/* Original twelve-column layout, featured mosaic, archive and footer. */
.page {
  max-width: 1800px; margin: 0 auto;
  padding-left: max(var(--m), env(safe-area-inset-left, 0px));
  padding-right: max(var(--m), env(safe-area-inset-right, 0px));
  padding-block: var(--top) 96px;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g);
  align-items: start;
}

/* ---------- Left column ---------- */
.side {
  grid-column: 1 / 4; position: sticky; top: calc(var(--top) + env(safe-area-inset-top, 0px));
  display: flex; flex-direction: column; gap: 64px; min-width: 0;
}
.bio { display: flex; flex-direction: column; gap: 24px; font-size: 16px; line-height: 24px; }
/* Short laptop screens: the sticky column scrolls on its own so Featured/Archive stay reachable */
.side { max-height: calc(100dvh - 2 * var(--top)); overflow-y: auto; scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
/* Short laptop screens (e.g. 1280×800): tighten so the column fits without scrolling */
@media (min-width: 901px) and (max-height: 900px) {
  .side { gap: 32px; }
  .bio { font-size: 14px; line-height: 20px; gap: 12px; }
  .index { gap: 20px; }
}
.bio a { text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: 2px; }
.bio a:hover { text-decoration-color: var(--fg); }
.index { display: flex; flex-direction: column; gap: 32px; font-size: 16px; line-height: 24px; }
.index h2 { font: inherit; margin: 0 0 8px; color: var(--muted); }
.index ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.index a, .index button { transition: color .2s ease; }
.index a:hover, .index a.on { text-decoration: underline; text-underline-offset: 3px; }
.index a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }
.filters button {
  font: inherit; color: var(--fg); background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
  display: flex; gap: 8px;
}
.filters button:hover, .filters button[aria-pressed="true"] { color: var(--muted); }
.filters button[aria-pressed="true"] span:first-child { text-decoration: underline; text-underline-offset: 3px; }
.filters ul { flex-direction: row; flex-wrap: wrap; gap: 2px 20px; }
.filters .n { color: inherit; font-variant-numeric: tabular-nums; }
.filters { max-height: 0; overflow: hidden; opacity: 0; transition: opacity .3s ease, max-height .3s ease; }
.side.in-archive .filters, .side.show-filters .filters { max-height: 400px; opacity: 1; }
.archive-filters { max-height: none; opacity: 1; overflow: visible; margin-bottom: 20px; font-size: 16px; line-height: 24px; }
.archive-filters ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }

/* ---------- Work column ---------- */
/* Dotted divider at the right edge of column 4, full page height */
.rule {
  grid-column: 4; grid-row: 1; justify-self: end; align-self: stretch; width: 1px;
  margin-block: calc(-1 * var(--top)) -96px;
  background: repeating-linear-gradient(to bottom, var(--muted) 0 6px, transparent 6px 11px);
}
.side { grid-row: 1; }
.work { grid-row: 1; }
.work { grid-column: 5 / 13; min-width: 0; container-type: inline-size; }
/* Two columns with one 12px gap everywhere. At 1440 wide each column is 424px and the tiles
   keep their proportions: WorldTime 424x599, Her Money 424x476, Stag Mode 424x302,
   Oyibo Juju 424x424. Heights scale with column width (--w); the gap stays fixed. */
.featured {
  --fg-gap: 12px;
  --w: calc((100cqw - var(--fg-gap)) / 2);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--fg-gap); row-gap: 0;
  grid-template-rows: calc(var(--w) * 472 / 420) var(--fg-gap) calc(var(--w) * 121 / 420 - var(--fg-gap)) var(--fg-gap) calc(var(--w) * 299 / 420);
}
.tile { position: relative; overflow: hidden; background: var(--tile); display: block; }
.tile > img { width: 100%; height: 100%; object-fit: cover; transition: opacity .35s ease, transform .6s ease; }
.project .lead-panel.is-phone { background: var(--wt-green); }
.t-wt   { grid-column: 1; grid-row: 1 / 4; background: var(--wt-green); display: grid; place-items: center; }

/* Phone: the clip sits in the frame's screen opening (measured from the frame PNG), frame on top */
.phone { position: relative; height: 86%; aspect-ratio: 1646 / 3354; max-width: 100%; }
.phone .phone-screen {
  position: absolute; left: 4.617%; top: 1.968%; width: 90.64%; height: 96.42%;
  object-fit: cover; border-radius: 15.4% / 7.1%; background: #317B1F;
}
/* These clips are decorative: never let tapping the phone open native video controls. */
.phone video.phone-screen { pointer-events: none; }
.phone .phone-frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.t-stag { grid-column: 1; grid-row: 5; }
.t-hmhp { grid-column: 2; grid-row: 1; }
.t-oyibo{ grid-column: 2; grid-row: 3 / 6; }
.t-hmhp > img.lead { object-position: 70% 50%; }
.t-stag > img.lead { object-position: 50% 32%; }
/* Stag Mode monogram laid over the shirt photo */
.tile .mono, .project .lead-panel .mono, .item .frame .mono {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: auto; height: 40%; object-fit: contain; pointer-events: none;
}
.item .frame .mono { height: 26%; }
.tile .tag {
  position: absolute; left: 10px; bottom: 9px; padding: 3px 7px; border-radius: 2px;
  background: rgba(0,0,0,.6); color: var(--fg); font-size: 11px; line-height: 14px;
  opacity: 0; transform: translateY(4px); transition: opacity .25s ease, transform .25s ease;
}
.tile:hover .tag, .tile:focus-visible .tag, .tile.on .tag { opacity: 1; transform: none; }

/* ---------- Archive ---------- */
/* ---------- Footer loop: the hands stay, the object between them swaps ---------- */
.foot { margin-top: 480px; }
.foot-row { display: flex; justify-content: space-between; gap: 24px; margin-top: 24px; padding-top: 12px; font-size: 16px; line-height: 24px;
  background: repeating-linear-gradient(to right, var(--muted) 0 6px, transparent 6px 11px) left top / 100% 1px no-repeat; }
.offering { position: relative; container-type: inline-size; height: 20.6cqw; aspect-ratio: auto; background: var(--bg); overflow: hidden; }
.offering { height: auto; aspect-ratio: 1000 / 206; }
.offering img { position: absolute; display: block; pointer-events: none; }
.offering .hand-l { left: 0; bottom: 0; width: 43%; }
.offering .hand-r { right: 0; bottom: 0; width: 41%; }
.offering .gift { left: 51%; top: 50%; height: calc(var(--h) * 0.381cqw); width: auto; transform: translate(-50%, -50%); visibility: hidden; }
.offering .gift.on { visibility: visible; }
.archive { margin-top: 480px; scroll-margin-top: var(--top); }
.archive-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 12px; margin-bottom: 20px; font-size: 16px; line-height: 24px;
  background: repeating-linear-gradient(to right, var(--muted) 0 6px, transparent 6px 11px) left bottom / 100% 1px no-repeat; }
.archive-head h2 { font: inherit; margin: 0; }
.archive-head span { color: var(--muted); font-variant-numeric: tabular-nums; }
.wall { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 12px; }
.item { display: flex; flex-direction: column; gap: 7px; transition: opacity .3s ease; background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.item.dim { opacity: .14; }
.item .frame { aspect-ratio: 4 / 5; background: var(--tile); overflow: hidden; position: relative; }
.item .frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.item:hover .frame img:not(.mono) { transform: scale(1.02); }
.item .frame.contain { background: var(--panel); }
.item .frame.contain img { object-fit: contain; height: 88%; margin-top: 6%; }
.item .ph { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 10px; color: var(--dim); font-size: 11px; }
.item .cap { font-size: 11px; line-height: 13px; color: var(--muted); }
.item .cap b { font-weight: 400; color: var(--fg); }
.item .badge { color: var(--fg); }

/* The source used a white background for these two contained archive previews. */
.item .frame.is-white { background: #fff; }
.item .frame img.is-contain { object-fit: contain; }

/* Hover / focus relationships also work if JavaScript is disabled. */
body:has(.t-wt:is(:hover, :focus-visible)) .index [data-id="worldtime"],
body:has(.index [data-id="worldtime"]:is(:hover, :focus-visible)) .t-wt .tag,
body:has(.t-hmhp:is(:hover, :focus-visible)) .index [data-id="hmhp"],
body:has(.index [data-id="hmhp"]:is(:hover, :focus-visible)) .t-hmhp .tag,
body:has(.t-oyibo:is(:hover, :focus-visible)) .index [data-id="oyibo"],
body:has(.index [data-id="oyibo"]:is(:hover, :focus-visible)) .t-oyibo .tag {
  text-decoration: underline;
  text-underline-offset: 3px;
}
body:has(.index [data-id="worldtime"]:is(:hover, :focus-visible)) .t-wt .tag,
body:has(.index [data-id="hmhp"]:is(:hover, :focus-visible)) .t-hmhp .tag,
body:has(.index [data-id="oyibo"]:is(:hover, :focus-visible)) .t-oyibo .tag {
  opacity: 1;
  transform: none;
}

/* The original height factors are art direction: do not normalise them. */
.offering .gift--01 { --h: 45; }
.offering .gift--02 { --h: 54; }
.offering .gift--03 { --h: 39; }
.offering .gift--04 { --h: 27; }
.offering .gift--05 { --h: 47; }
.offering .gift--06 { --h: 54; }
.offering .gift--07 { --h: 39; }
.offering .gift--08 { --h: 47; }
