/* ==========================================================
   Adam Smajstrla — portfolio
   Quiet gallery: off-white, near-black, one grotesk, the work
   does the talking. Edit tokens here; every page shares this file.
   ========================================================== */

:root {
  --h1: clamp(46px, 7.8vw, 160px);  /* one size for every page's big heading */
  --bg: #F5F5F3;
  --ink: #17181A;
  --muted: #8C8C89;
  --line: #E3E3E0;
  --tile-bg: #E9E9E6;
  --head-bg: rgba(245, 245, 243, .92);
  --head-hi: rgba(255, 255, 255, .75);
  --head-shadow: rgba(23, 24, 26, .25);
  --next-ink-2: #4A4B50;
  --next-bg: linear-gradient(180deg, #C9D8E0 0%, #D6D6E4 38%, #EBD6DF 66%, #F5DCD2 86%, #F8E2CC 100%);
  --glow: rgba(110, 150, 225, .16);
  color-scheme: light;

  --font: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --pad: clamp(16px, 2.2vw, 28px);
  --header: 56px;
  --radius: 16px;     /* rounded corners on images everywhere except the project page strip */
  --tile-gap: 12px;
  --foot: 66px;   /* footer height; the first screen leaves room for it */
}

/* ---------- dark mode: chosen with the header toggle, or follows the system ---------- */
:root[data-theme="dark"] {
  --bg: #131416; --ink: #ECECE8; --muted: #8E8F93; --line: #2A2B2F; --tile-bg: #1E1F22;
  --head-bg: rgba(19, 20, 22, .92); --head-hi: rgba(255, 255, 255, .06); --head-shadow: rgba(0, 0, 0, .6);
  --next-ink-2: #C9C6CF;
  --next-bg: linear-gradient(180deg, #24303A 0%, #2D2D3D 38%, #3A2C36 66%, #43302C 86%, #453526 100%);
  --glow: rgba(70, 105, 200, .09);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131416; --ink: #ECECE8; --muted: #8E8F93; --line: #2A2B2F; --tile-bg: #1E1F22;
    --head-bg: rgba(19, 20, 22, .92); --head-hi: rgba(255, 255, 255, .06); --head-shadow: rgba(0, 0, 0, .6);
    --next-ink-2: #C9C6CF;
    --next-bg: linear-gradient(180deg, #24303A 0%, #2D2D3D 38%, #3A2C36 66%, #43302C 86%, #453526 100%);
    --glow: rgba(70, 105, 200, .09);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  transition: background-color .25s ease, color .25s ease;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }

/* soft blue glow behind everything */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(70vmax 60vmax at var(--mx, 70%) var(--my, 30%), var(--glow), transparent 70%),
    radial-gradient(60vmax 50vmax at calc(100% - var(--mx, 70%)) calc(100% - var(--my, 30%)), color-mix(in srgb, var(--glow) 45%, transparent), transparent 70%);
}
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  height: var(--header);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--pad);
  font-size: 15px;
  /* liquid glass: content scrolling underneath is blurred, brightened and bent */
  background: var(--head-bg);
  -webkit-backdrop-filter: blur(2px) saturate(.9);
  backdrop-filter: blur(2px) saturate(.9);
  backdrop-filter: url(#glass) blur(2px) saturate(.9);  /* ignored where SVG backdrops aren't supported */
  box-shadow:
    inset 0 1px 0 var(--head-hi),
    inset 0 -1px 0 var(--line),
    0 6px 18px -12px var(--head-shadow);
}
@media (prefers-reduced-transparency: reduce) {
  .top { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
.brand { justify-self: start; display: flex; align-items: center; padding: 4px 0; }
.brand .logo { height: 21.6px; width: auto; display: block; }   /* same height as the menu text */
.views { display: flex; gap: 14px; }
.views button { font: inherit; color: var(--muted); background: none; border: 0; padding: 4px 0; cursor: pointer; }
.views button[aria-pressed="true"] { color: var(--ink); }
.links { justify-self: end; display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.links a { color: var(--muted); }
.links a:hover, .links a[aria-current="page"] { color: var(--ink); }
.theme-toggle {
  grid-column: 3; justify-self: end; display: grid; place-items: center;
  width: 32px; height: 32px; margin-left: 32px; padding: 0; border: 0; border-radius: 50%;
  background: var(--tile-bg); color: var(--ink); cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.theme-toggle:hover { background: var(--ink); color: var(--bg); }
.theme-toggle svg { transition: transform .4s cubic-bezier(.2,.7,.2,1); }
.theme-toggle:hover svg { transform: rotate(-20deg); }
@media (prefers-reduced-motion: reduce) { .theme-toggle:hover svg { transform: none; } }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon, :root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}
.top-right { grid-column: 3; justify-self: end; display: flex; align-items: center; }
.close { justify-self: end; }
.close:hover { text-decoration: underline; text-underline-offset: 3px; }
.menu-btn { display: none; font: inherit; background: none; border: 0; padding: 4px 0; cursor: pointer; }

@media (max-width: 760px) {
  .top { grid-template-columns: 1fr auto; }
  .top > span:empty { display: none; }
  .views { grid-column: 1 / -1; grid-row: 2; justify-content: center; padding-bottom: 10px; }
  .top:has(.views) { height: auto; padding-top: 16px; }
  .menu-btn { display: block; }
  .top-right { grid-column: 2; grid-row: 1; }
  .links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px var(--pad) 18px; background: var(--bg);
    border-bottom: 1px solid var(--line); font-size: 18px;
  }
  .links.open { display: flex; }
  .links a { display: block; padding: 8px 0; }
}

/* ---------- index stage: huge word bottom-left, tiles bottom-right ---------- */
.stage {
  min-height: calc(100svh - var(--header) - var(--foot));
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: var(--pad);
  padding: 0 var(--pad) var(--pad);
}
.word {
  margin: 0;
  font-size: var(--h1);
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: .86;
  text-transform: lowercase;
  padding-bottom: 0.03em;
}
.word.long { font-size: var(--h1); }
.stage .lede { max-width: 34ch; margin: 0 0 clamp(24px, 4vw, 48px); color: var(--muted); }

.tiles {
  --cols: 4;
  --tile: clamp(96px, 11.5vw, 200px);
  display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; align-content: flex-start;
  gap: var(--tile-gap);
  width: calc(var(--tile) * var(--cols) + var(--tile-gap) * (var(--cols) - 1));
  list-style: none; margin: 0; padding: 0;
}
.tiles li { width: var(--tile); height: var(--tile); }
.tiles a { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; background: var(--tile-bg); border-radius: var(--radius); isolation: isolate; }
.tiles img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.tiles a:hover img, .tiles a:focus-visible img { transform: scale(1.06); }
.tiles .cap {
  position: absolute; inset: auto 0 0 0; padding: 8px;
  color: #fff; font-size: 11px; line-height: 1.25;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  opacity: 0; transition: opacity .15s ease;
}
.tiles .cap span { display: block; opacity: .75; }
.tiles a:hover .cap, .tiles a:focus-visible .cap { opacity: 1; }
.tiles .empty { display: grid; place-items: center; height: 100%; padding: 8px; font-size: 11px; color: var(--muted); text-align: center; }

@media (max-width: 760px) {
  .stage { grid-template-columns: 1fr; min-height: 0; padding-top: 32px; }
  .tiles { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); --tile-gap: 8px; }
  .tiles a { border-radius: 12px; }
  .tiles li { width: auto; height: auto; aspect-ratio: 1; }
  .tiles .cap { display: none; }
}

/* home: a 4-3-2 staircase of larger tiles, held well clear of the name */
.stage-home { column-gap: calc(3 * var(--pad) + 24px); }
.tiles-stair {
  --tile: clamp(90px, 10.4vw, 200px);
  display: grid; grid-template-columns: repeat(4, var(--tile)); grid-auto-rows: var(--tile);
}
.tiles-stair li:nth-child(1) { grid-area: 3 / 1; }
.tiles-stair li:nth-child(2) { grid-area: 3 / 2; }
.tiles-stair li:nth-child(3) { grid-area: 3 / 3; }
.tiles-stair li:nth-child(4) { grid-area: 3 / 4; }
.tiles-stair li:nth-child(5) { grid-area: 2 / 2; }
.tiles-stair li:nth-child(6) { grid-area: 2 / 3; }
.tiles-stair li:nth-child(7) { grid-area: 2 / 4; }
.tiles-stair li:nth-child(8) { grid-area: 1 / 3; }
.tiles-stair li:nth-child(9) { grid-area: 1 / 4; }
@media (max-width: 760px) {
  .tiles-stair { grid-template-columns: repeat(4, 1fr); grid-auto-rows: auto; }
}

/* ---------- list view ---------- */
.list { padding: 8px var(--pad) 40px; }
.row { display: block; margin-bottom: clamp(36px, 5vw, 64px); }
.strip { display: flex; gap: 2px; height: clamp(160px, 24vw, 360px); overflow: hidden; }
.strip img, .strip video { height: 100%; width: auto; max-width: none; flex: none; }
.strip .empty { display: grid; place-items: center; width: 100%; color: var(--muted); font-size: 13px; background: var(--tile-bg); }
.row h3 { margin: 12px 0 0; font-size: 15px; font-weight: 500; }
.row p { margin: 0; font-size: 12px; color: var(--muted); }
.row:hover h3 { text-decoration: underline; text-underline-offset: 3px; }

/* client pages: pieces grouped under headings */
.groups { padding: clamp(48px, 7vw, 96px) 0 0; }
.group h2 { margin: 0; padding: 24px var(--pad) 18px; font-size: 13px; font-weight: 500; border-top: 1px solid var(--line); margin-inline: var(--pad); padding-inline: 0; }
.group .masonry { padding-top: 0; }
figure.brick { margin: 0 0 clamp(24px, 3vw, 40px); }
.brick button.shot { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }

/* masonry ("List" in the header) */
.masonry { columns: 3 300px; column-gap: var(--pad); padding: 8px var(--pad) 56px; }
.brick { display: block; break-inside: avoid; margin-bottom: clamp(24px, 3vw, 40px); }
.brick .pic { display: block; overflow: hidden; border-radius: var(--radius); isolation: isolate; }
.brick img, .brick video { width: 100%; height: auto; background: var(--tile-bg); transition: transform .7s cubic-bezier(.2,.7,.2,1); }
a.brick:hover img, a.brick:hover video { transform: scale(1.04); }
.brick .empty { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: var(--radius); background: var(--tile-bg); color: var(--muted); font-size: 13px; }
.brick h3 { margin: 10px 0 0; font-size: 14px; font-weight: 500; }
.brick p { margin: 0; font-size: 12px; color: var(--muted); }
.brick:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) { .masonry { columns: 2; column-gap: 10px; } }

[data-view="grid"] .switchable { display: none; }
[data-view="list"] .tiles { display: none; }
[data-view="list"] .stage { min-height: 0; padding-top: 16vh; }

/* ---------- rail: tall boxes beside the big word (Brand, UX) ---------- */
.stage-rail {
  --box-h: min(calc(clamp(270px, 36vw, 510px) * 1.1), calc(100svh - var(--header) - var(--foot) - 2 * var(--pad) - 60px));
  --box-w: calc(var(--box-h) * .52);
  grid-template-columns: auto minmax(0, 1fr); column-gap: clamp(24px, 4vw, 64px);
}
/* the rail is always three boxes wide and right-aligned, so boxes start at the same spot on every page;
   when there are more, it bleeds off the right edge and scrolls */
.word-rail { font-size: var(--h1); line-height: .86; }
.word-rail.word-name { font-size: var(--h1); }
.rail-wrap { min-width: 0; justify-self: end; width: calc(3 * var(--box-w) + 2 * 12px); }
.rail-wrap.spills { width: calc(3 * var(--box-w) + 2 * 12px + var(--pad)); margin-right: calc(-1 * var(--pad)); }
.rail {
  --fade-l: 0px; --fade-r: 0px;
  list-style: none; margin: 0; padding: 0 0 10px;
  display: flex; gap: 12px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  /* soft fade on whichever side has more to scroll to */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
}
.rail.fade-r { --fade-r: 96px; }
/* when the rail runs off the edge, leave a gutter after the last box */
.rail-wrap.spills .rail { padding-right: var(--pad); scroll-padding-right: var(--pad); }
.rail > li { flex: none; scroll-snap-align: start; }
.box {
  position: relative; display: block; overflow: hidden; background: var(--tile-bg); border-radius: var(--radius); isolation: isolate;
  height: var(--box-h); width: var(--box-w);
}
.box img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.box:hover img, .box:focus-visible img { transform: scale(1.06); }
.box-empty { display: grid; place-items: center; height: 100%; padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }
.box-text {
  position: absolute; inset: auto 0 0 0; padding: 120px 16px 16px;
  /* eased fade so white text always reads, without a visible band */
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,.06) 25%, rgba(0,0,0,.22) 50%, rgba(0,0,0,.48) 75%, rgba(0,0,0,.66) 100%);
  color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.25);
}
.box-empty + .box-text { background: none; color: var(--ink); }
.box-text strong { display: block; font-size: 16px; font-weight: 500; line-height: 1.3; }
.box-text span { display: block; font-size: 12px; opacity: .85; margin-top: 2px; }
@media (max-width: 760px) {
  .stage-rail { grid-template-columns: 1fr; }
  .rail-wrap, .rail-wrap.spills { justify-self: stretch; width: auto; margin: 0 calc(-1 * var(--pad)); }
  .rail { padding: 0 var(--pad) 10px; scroll-padding: 0 var(--pad); }
  .rail.fade-r { --fade-r: 48px; }
  .box { width: 66vw; height: auto; aspect-ratio: 66 / 108; }
}

.stage-short { min-height: 0; padding-top: clamp(80px, 14vh, 160px); }
.lede a { text-decoration: underline; text-underline-offset: 3px; }
.lede a:hover { color: var(--ink); }

/* ---------- home extras ---------- */
.label { font-size: 13px; font-weight: 500; margin: 0 0 16px; padding: 0 var(--pad); }
.home-list { padding-top: clamp(56px, 9vw, 120px); }
.home-list .list { padding-top: 0; }
.more { padding: 24px 0 80px; }
.more ul { list-style: none; margin: 0; padding: 0 var(--pad); }
.more li a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 14px 0; border-top: 1px solid var(--line);
  font-size: clamp(32px, 5vw, 72px); font-weight: 600; letter-spacing: -0.055em; line-height: 1.05;
  text-transform: lowercase;
}
.more li:last-child a { border-bottom: 1px solid var(--line); }
.more li a span { font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--muted); text-transform: none; }
.more li a:hover { color: var(--muted); }

/* ---------- project page ---------- */
/* the slot holds the strip's full height in the page; the strip itself is pinned
   under the header and shrinks from 62% to 34% of the screen as you scroll (see script) */
.gallery-slot { height: min(62svh, 50vw); }
.gallery-frame { position: fixed; top: var(--header); left: 0; right: 0; z-index: 20; background: var(--bg); height: min(62svh, 50vw); }
.gallery {
  display: flex; gap: 2px; height: 100%;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: thin;
}
.gallery > * { flex: none; height: 100%; scroll-snap-align: start; }
.gallery button.shot { padding: 0; border: 0; background: var(--tile-bg); cursor: zoom-in; max-width: calc(100vw - clamp(200px, 26vw, 440px)); overflow: hidden; }
.gallery button.shot img, .gallery button.shot video { height: 100%; width: auto; max-width: 100%; object-fit: cover; }
.gallery .empty { width: 62vw; display: grid; place-items: center; background: var(--tile-bg); color: var(--muted); font-size: 13px; }
.next-panel {
  position: relative; flex: 1 0 clamp(220px, 28vw, 460px) !important; overflow: hidden; color: var(--ink);
  /* the same sunset as the About portrait, softened */
  background: var(--next-bg);
}
.next-panel div { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; padding: 16px; gap: 2px; }
.next-panel strong { font-weight: 500; font-size: 15px; }
.next-panel span { font-size: 12px; color: var(--next-ink-2); }
.next-panel .arrow { width: 28px; height: 28px; margin-top: 14px; transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.next-panel:hover .arrow, .next-panel:focus-visible .arrow { transform: translateX(6px); }

.info { display: grid; grid-template-columns: 1fr 1fr; gap: var(--pad); padding: 18px var(--pad) 0; }
.info .left { font-size: 12px; }
.info .left div { margin-bottom: 10px; }
.info h1 { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; }
.info .type { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.info .desc { max-width: 52ch; font-size: 14px; }
.prompt { color: var(--muted); font-style: italic; }

.facts { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; column-gap: 40px; row-gap: 12px; margin: 24px 0 0; font-size: 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 2px 0 0; }

.story { padding: clamp(56px, 8vw, 110px) var(--pad) 0; }
.story section { display: grid; grid-template-columns: 1fr 1fr; gap: var(--pad); padding: 24px 0 44px; border-top: 1px solid var(--line); }
.story h2 { margin: 0; font-size: 13px; font-weight: 500; }
.story .body { max-width: 56ch; font-size: 15px; }
.story .body ul { margin: 0 0 1em; padding-left: 1.1em; }
.story .body li { margin-bottom: .45em; }
.story .body li::marker { color: var(--muted); }

.pager {
  display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: var(--pad);
  padding: clamp(64px, 10vw, 140px) var(--pad) var(--pad); font-size: 12px;
}
.pager a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.pager strong { display: block; font-weight: 500; }
.pager span { color: var(--muted); }
.pager .next { text-align: right; }

@media (max-width: 760px) {
  /* phones: the image strip pins under the header while the details scroll beneath it */
  .gallery-slot { display: contents; }
  .gallery-frame { position: sticky; top: var(--header); height: 62vw; min-height: 240px; }
  .info, .story section { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager .mid { display: none; }
}

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: none; grid-template-rows: var(--header) 1fr; }
.lightbox.open { display: grid; }
.lightbox .bar { display: flex; justify-content: space-between; align-items: center; padding: 0 var(--pad); font-size: 13px; }
.lightbox .bar button { font: inherit; background: none; border: 0; cursor: pointer; padding: 4px 0; }
.lightbox .frame {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(24px, 3vw, 48px);
  padding: 0 var(--pad) var(--pad); min-height: 0;
}
.lightbox.has-note .frame { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); }
.lightbox .pic { display: grid; place-items: center; min-height: 0; min-width: 0; }
.lightbox .pic img, .lightbox .pic video {
  /* always fit the whole image on screen, edges included */
  width: auto; height: auto; max-width: 100%;
  max-height: calc(100svh - var(--header) - var(--pad));
  object-fit: contain; transform: none;
}
.lightbox .note-panel { display: none; align-self: center; font-size: 15px; line-height: 1.6; overflow-y: auto; max-height: 100%; }
.lightbox.has-note .note-panel { display: block; }
.note-panel strong { display: block; font-size: 18px; font-weight: 500; margin-bottom: 10px; }
.note-panel p { margin: 0 0 .9em; color: var(--ink); }
.note-panel ul { margin: 0 0 1em; padding-left: 1.1em; }
.note-panel li { margin-bottom: .45em; }
.note-panel li::marker { color: var(--muted); }
@media (max-width: 760px) {
  /* phones: image on top, write-up below, the whole view scrolls */
  .lightbox { overflow-y: auto; }
  .lightbox.has-note .frame { grid-template-columns: 1fr; align-content: start; }
  .lightbox.has-note .pic img, .lightbox.has-note .pic video { max-height: 60svh; }
  .lightbox .note-panel { align-self: start; max-height: none; overflow: visible; }
}

/* ---------- about ---------- */

.about-portrait { width: clamp(270px, 36vw, 510px); aspect-ratio: 4 / 5; background: var(--tile-bg); overflow: hidden; border-radius: var(--radius); }
.about-portrait img { width: 100%; height: 100%; object-fit: cover; }
.about-portrait .empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 12px; }
.xp { list-style: none; margin: 0; padding: 0; max-width: 640px; }
.xp li { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 84px; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; text-align: left; }
.xp li span:nth-child(3) { text-align: right; }
.more-xp summary { list-style: none; cursor: pointer; padding: 12px 0 0; font-size: 13px; color: var(--muted); }
.more-xp summary::-webkit-details-marker { display: none; }
.more-xp summary:hover { color: var(--ink); }
.more-xp .when-open, .more-xp[open] .when-closed { display: none; }
.more-xp[open] .when-open { display: inline; }
.more-xp[open] summary { padding-bottom: 12px; }
.more-xp[open] .xp li:first-child { border-top: 0; }
.note-sm { margin: 10px 0 0; max-width: 640px; font-size: 12px; color: var(--muted); }
@media (max-width: 760px) { .xp li { grid-template-columns: 1fr auto; } .xp li span:nth-child(2) { grid-column: 1; grid-row: 2; } .xp li span:nth-child(3) { grid-column: 2; grid-row: 1; } }
.xp li:last-child { border-bottom: 1px solid var(--line); }
.xp li:first-child { border-top: 0; padding-top: 0; }
.xp.hl li { grid-template-columns: 1fr; }
.xp li span:not(:first-child) { color: var(--muted); }

/* ---------- footer ---------- */
.foot {
  min-height: var(--foot); align-items: center;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 0 var(--pad); font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--line);
}
.foot nav { display: flex; gap: 18px; }
.foot a:hover { color: var(--ink); }

/* one load moment: the big word settles, tiles fill in */
@media (prefers-reduced-motion: no-preference) {
  .word { animation: settle .8s cubic-bezier(.2,.7,.2,1) both; }
  .tiles li { animation: appear .5s ease both; animation-delay: calc(var(--i, 0) * 22ms + .15s); }
  @keyframes settle { from { opacity: 0; transform: translateY(.1em); } }
  @keyframes appear { from { opacity: 0; } }
}

@media (prefers-reduced-motion: reduce) {
  .tiles img, .box img, .brick img, .brick video { transition: none; transform: none !important; }
}

/* clickable images round further on hover */
.tiles a, .box, .brick .pic { transition: border-radius .35s cubic-bezier(.2,.7,.2,1); }
.tiles a:hover, .tiles a:focus-visible,
.box:hover, .box:focus-visible,
a.brick:hover .pic, a.brick:focus-visible .pic { border-radius: 32px; }

/* links to a client's live site */
a.ext { text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
a.ext:hover { text-decoration-color: currentColor; }
a.ext::after { content: " \2197"; font-size: .9em; }

/* ---------- product design case studies: images left, write-up right ---------- */
.cs { padding: var(--pad) var(--pad) 0; }
.cs-row {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px); align-items: start;
  padding-bottom: clamp(40px, 6vw, 88px);
}
.cs-media .shot { display: block; width: 100%; padding: 0; border: 0; background: var(--tile-bg); cursor: zoom-in; border-radius: var(--radius); overflow: hidden; }
.cs-media img, .cs-media video { width: 100%; height: auto; display: block; }
.cs-media { display: flex; justify-content: center; }
.cs-media .shot:not(.long) { width: auto; max-width: 100%; }
.cs-media .shot:not(.long) img, .cs-media .shot:not(.long) video {
  width: auto; max-width: 100%; max-height: calc(100svh - var(--header) - 2 * var(--pad)); object-fit: contain;
}
/* the short side stays in view while the long side scrolls past */
.cs-intro .cs-media { position: sticky; top: calc(var(--header) + var(--pad)); }
.cs-row:not(.cs-intro) .cs-text { position: sticky; top: calc(var(--header) + var(--pad)); }
.cs-text { max-width: 52ch; }
.cs-text h1 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; }
.cs-text .type { font-size: 13px; color: var(--muted); margin: 4px 0 20px; }
.cs-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; font-size: 13px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.cs-text .desc p { font-size: 16px; }
.cs-text .story { padding: 12px 0 0; }
.cs-text .story section { display: block; padding: 18px 0 6px; }
.cs-text .story section:first-child { border-top: 1px solid var(--line); }
.cs-text .story h2, .cs-text > h2 { margin: 0 0 8px; font-size: 15px; font-weight: 500; }
.cs-text .body { font-size: 15px; }
.cs-text .body ul { margin: 0 0 1em; padding-left: 1.1em; }
.cs-text .body li { margin-bottom: .45em; }
.cs-text .body li::marker { color: var(--muted); }
.cs .pager { padding-left: 0; padding-right: 0; }
@media (max-width: 760px) {
  .cs-row { grid-template-columns: 1fr; gap: 16px; }
  .cs-intro .cs-media, .cs-row:not(.cs-intro) .cs-text { position: static; }
  .cs-media .shot:not(.long) img, .cs-media .shot:not(.long) video { max-height: none; }
  .cs-meta { grid-template-columns: 1fr 1fr; }
}

/* arrows above the project rows, shown only when the row scrolls */
.rail-nav { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px; visibility: hidden; }
.rail-wrap.scrolls .rail-nav { visibility: visible; }
.rail-wrap.spills .rail-nav { padding-right: var(--pad); }
.rail-btn {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--tile-bg); color: var(--ink); cursor: pointer;
  transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}
.rail-btn svg { width: 16px; height: 16px; }
.rail-btn.prev svg { transform: rotate(180deg); }
.rail-btn:hover:not(:disabled) { background: var(--ink); color: var(--bg); }
.rail-btn:disabled { opacity: .35; cursor: default; }

/* project page heading: big title, the one-line summary, a rule, then the facts */
.cs-text h1, .info-stack h1 { font-size: clamp(34px, 3.4vw, 48px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; margin: 0; }
.lead p { margin: 14px 0 0; font-size: 18px; line-height: 1.45; color: var(--ink); }
.cs-text .cs-meta { border-bottom: 0; margin: 24px 0 8px; padding: 20px 0 0; }
.info-stack { display: block; max-width: 760px; padding-top: clamp(24px, 3vw, 40px); }
.info-stack .lead p { max-width: 56ch; }
.info-stack .cs-meta { grid-template-columns: repeat(4, auto); justify-content: start; column-gap: 48px; border-bottom: 0; margin: 24px 0 0; padding: 20px 0 0; }
@media (max-width: 760px) { .info-stack .cs-meta { grid-template-columns: 1fr 1fr; } }

/* light/dark phone comparison: screens scroll together inside phone frames, tab bars stay put */
.phones-shot { background: none !important; border-radius: 0 !important; overflow: visible !important; width: 100% !important; }
.phones { --ph-h: min(74svh, 700px); display: flex; justify-content: center; gap: clamp(20px, 5%, 56px); padding: 8px 0 24px; }
.phone { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.phone .screen-wrap { width: calc(var(--ph-h) * 780 / 1690); container-type: inline-size; }
.phone figcaption { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.phone { gap: 0 !important; }
.screen {
  --u: calc(100cqw / 780);
  position: relative; width: 100%; aspect-ratio: 780 / 1690; overflow: hidden;
  border-radius: calc(96 * var(--u));
  box-shadow: 0 0 0 calc(22 * var(--u)) #0b0b0d, 0 0 0 calc(25 * var(--u)) #45464d, 0 30px 60px -20px rgba(0,0,0,.45);
  background: #0b0b0d;
}
.screen .scroll {
  width: 100% !important; max-width: none !important; max-height: none !important; height: auto !important;
  display: block; animation: phone-scroll 20s infinite;
}
.screen .tabs { position: absolute; max-width: none !important; max-height: none !important; height: auto !important; }
.screen .td { left: calc(34 * var(--u)); bottom: calc(68 * var(--u)); width: calc(712 * var(--u)) !important; }
.screen .tl { left: calc(-14 * var(--u)); bottom: calc(4 * var(--u)); width: calc(808 * var(--u)) !important; }
.screen .status-bg { position: absolute; top: 0; left: 0; right: 0; height: calc(124 * var(--u)); opacity: 0; animation: status-bg 20s infinite; }
.tl ~ .status-bg { background: rgb(250 252 255 / .96); }
.td ~ .status-bg { background: rgb(13 22 48 / .96); }
.screen .st-scrolled { opacity: 0; animation: status-bg 20s infinite; }
/* the bar fills in once the hero scrolls under it, like a real app; dark-on-light text swaps in */
@keyframes status-bg { 0%, 9% { opacity: 0; } 13%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .screen .status-bg, .screen .st-scrolled { animation: none; } }
.screen .status { position: absolute; top: 0; left: 0; width: 100% !important; max-width: none !important; max-height: none !important; height: auto !important; }
.screen .island { position: absolute; top: calc(24 * var(--u)); left: 50%; width: calc(250 * var(--u)); height: calc(72 * var(--u)); transform: translateX(-50%); border-radius: 999px; background: #000; }
.screen .home-ind { position: absolute; bottom: calc(18 * var(--u)); left: 50%; width: calc(268 * var(--u)); height: calc(10 * var(--u)); transform: translateX(-50%); border-radius: 99px; background: #000; }
@keyframes phone-scroll {
  0%, 8%   { transform: translateY(0); animation-timing-function: ease-in-out; }
  46%, 58% { transform: translateY(calc(-1310 * var(--u))); animation-timing-function: ease-in-out; }
  96%, 100% { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .screen .scroll { animation: none; } }
.lightbox .pic .phones { --ph-h: calc(100svh - var(--header) - 2 * var(--pad) - 40px); }
@media (max-width: 760px) { .phones { --ph-h: 88vw; gap: 18px; } }

/* graphic design work pages: title and summary left, facts right in a 2x2 grid */
.info-stack {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0 clamp(32px, 5vw, 80px);
  align-items: start; max-width: none;
}
.info-stack h1 { grid-column: 1; }
.info-stack .lead { grid-column: 1; }
.info-stack .cs-meta {
  grid-column: 2; grid-row: 1 / span 2; align-self: start;
  grid-template-columns: 1fr 1fr; column-gap: 32px; margin: 8px 0 0; padding: 0; border-top: 0;
}
@media (max-width: 760px) {
  .info-stack { grid-template-columns: 1fr; }
  .info-stack .cs-meta { grid-column: 1; grid-row: auto; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
}

/* home on phones: name pinned under the header, tiles + footer pushed to the bottom */
@media (max-width: 760px) {
  .stage.stage-home {
    min-height: calc(100svh - var(--header) - var(--foot));
    display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; gap: 40px;
  }
}

/* footer on phones: a little more air above the text and off the bottom edge */
@media (max-width: 760px) {
  :root { --foot: 76px; }
  .foot { padding-top: 22px; padding-bottom: calc(30px + env(safe-area-inset-bottom)); align-items: flex-start; }
}

/* About: more room between the heading and the portrait, a touch more leading */
.stage-about { column-gap: calc(2 * var(--pad) + 32px); }
.stage-about .word { line-height: .86; }
@media (max-width: 760px) {
  .stage-about { row-gap: 40px; }
}

/* arrows over the project image strip */
.gallery { position: relative; z-index: 1; }
.g-btn {
  position: absolute; top: 50%; z-index: 3; transform: translateY(-50%);
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%;
  border: 1px solid rgb(255 255 255 / .18); background: rgb(14 15 20 / .55); color: #fff; cursor: pointer;
  -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 4px 18px rgb(0 0 0 / .25); -webkit-transform: translate3d(0, -50%, 0);
  transition: opacity .2s ease, background-color .2s ease, color .2s ease;
}
.g-btn.prev { left: var(--pad); }
.g-btn.next { right: var(--pad); }
.g-btn svg { width: 18px; height: 18px; }
.g-btn.prev svg { transform: rotate(180deg); }
@media (hover: hover) { .g-btn:hover:not(:disabled) { background: #fff; color: #111; } }
.g-btn:disabled { opacity: 0; pointer-events: none; }
@media (max-width: 760px) {
  .g-btn { width: 36px; height: 36px; }
  .g-btn svg { width: 16px; height: 16px; }
  .g-btn.prev { left: 10px; } .g-btn.next { right: 10px; }
}

@media (max-width: 760px) { :root { --h1: 76px; } }

/* Disney pages: star trail off the cursor, drawn over the page but under the header and lightbox (see script) */
.sparks { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 25; pointer-events: none; }

/* ---------- work page headings: eyebrow, bold title, larger lead, four fact cards ---------- */
:root { --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace; }
.eyebrow {
  margin: 0 0 18px; font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.cs-text h1, .info-stack h1 {
  font-size: clamp(40px, 4.4vw, 68px); font-weight: 700; letter-spacing: -0.035em; line-height: 1;
}
.cs-head .lead p {
  margin: 22px 0 0; font-size: clamp(18px, 1.45vw, 21px); line-height: 1.5;
  color: color-mix(in srgb, var(--ink) 80%, var(--bg));
}
.cs-meta.stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  border: 0; padding: 0; margin: 32px 0 8px; font-size: inherit;
}
.stat {
  display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
  min-height: 104px; padding: 18px 18px 16px;
  border: 1px solid var(--line); border-radius: 14px;
  background: color-mix(in srgb, var(--tile-bg) 70%, transparent);
}
.stat .v { font-size: 18px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; color: var(--ink); }
.stat .k {
  font-family: var(--mono); font-size: 11px; font-weight: 500; line-height: 1.35;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
/* product design: the intro column lays the cards four across when it has the room */
.cs-text { container-type: inline-size; max-width: 60ch; }
@container (min-width: 600px) { .cs-text .cs-meta.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* design pages: copy left, the 2x2 cards right */
.info-stack { padding-top: clamp(36px, 4vw, 56px); }
.info-stack .cs-head { grid-column: 1; }
.info-stack .cs-meta.stats { grid-column: 2; grid-row: 1; align-self: start; margin: 34px 0 0; }
@media (max-width: 760px) {
  .info-stack .cs-meta.stats { grid-column: 1; grid-row: auto; margin-top: 28px; padding-top: 0; border-top: 0; }
  .stat { min-height: 92px; padding: 16px 14px 14px; }
  .stat .v { font-size: 16px; }
}

/* section labels in the case study copy pick up the same mono eyebrow */
.work-story h2, .cs-text .work-story h2 {
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 12px;
}
.work-story .body { font-size: 16px; }
.work-story .body p:first-child { font-size: 18px; line-height: 1.5; color: var(--ink); }
.cs-row:not(.cs-intro) .cs-text h2 { font-size: clamp(22px, 1.9vw, 28px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 12px; }
@media (max-width: 760px) { .work-story section { row-gap: 4px; } }

/* big-number result cards inside a case study section */
.work-story .body, .cs-text .body { container-type: inline-size; }
.stat-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 24px 0 8px; }
.stat-big { min-height: 132px; padding: 20px 18px 16px; }
.stat-big .v { font-size: clamp(34px, 3vw, 48px); font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
@container (min-width: 680px) { .stat-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .stat-big { min-height: 112px; } .stat-big .v { font-size: 34px; } }

/* links inside the About and case study copy */
.story .body a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; transition: color .2s ease, text-decoration-color .2s ease; }
.story .body a:hover { color: var(--accent, var(--ink)); text-decoration-color: currentColor; }
.cs-media .shot.bare { background: none; border-radius: 0; }

/* arrows inside the full-screen image view */
.lightbox .pic-wrap { position: relative; display: grid; min-height: 0; min-width: 0; }
.lightbox .lb-btn.prev { left: 12px; }
.lightbox .lb-btn.next { right: 12px; }
.lightbox.single .lb-btn { display: none; }
@media (max-width: 760px) {
  .lightbox .pic-wrap { position: sticky; top: 0; }
  .lightbox .lb-btn.prev { left: 6px; } .lightbox .lb-btn.next { right: 6px; }
}

/* home squares: image only, no caption on hover */
.tiles-stair .cap { display: none; }
