/* Ian Brady Wave. Generated from the approved prototype. */
html.ibw, body.ibw-body { margin: 0 !important; }
html.ibw { margin-top: 0 !important; }               /* WordPress adds room for the admin bar; the wave page hides it */
#wpadminbar { display: none !important; }
.ibw-body img { max-width: 100%; }
.ibw-body [hidden] { display: none !important; }
.ibw-body h1, .ibw-body h2, .ibw-body h3, .ibw-body p, .ibw-body ul, .ibw-body dl { letter-spacing: normal; }
.ibw-empty { position: fixed; inset: 0; display: grid; place-items: center; font: 16px/1.5 'Helvetica Neue', Arial, sans-serif; color: var(--muted); z-index: 20; margin: 0; padding: 24px; text-align: center; }
.post-body { display: grid; gap: 26px; min-width: 0; }
.post-body img, .post-body iframe, .post-body video { max-width: 100%; height: auto; }
.page-hero iframe, .page-hero video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #000; }
.page-videos { display: grid; gap: 28px; }
.ibw-video { margin: 0; position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: #000; }
.ibw-video iframe, .post-body .ibw-video iframe, .ibw-video video, .post-body .ibw-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.post-body .ibw-video { margin: 6px 0; }
.page-hero.is-zoomable { cursor: zoom-in; }
html.touch-nav, html.touch-nav body { overflow: hidden; height: 100%; overscroll-behavior: none; }
html.touch-nav { scroll-snap-type: none; }
html.touch-nav #track { display: none; }
html.touch-nav #sea, html.touch-nav #overlay { touch-action: none; }
.ibw-gallery { display: grid; gap: 14px; min-width: 0; }
.ibw-gallery figure { margin: 0; display: grid; gap: 8px; min-width: 0; }
.ibw-gallery figcaption { font-size: 14px; line-height: 1.45; color: var(--muted); max-width: 70ch; }
.g-open { display: block; width: 100%; padding: 0; cursor: zoom-in; background: var(--rule); overflow: hidden; }
.g-open img { display: block; width: 100%; height: auto; }
.ibw-gallery.is-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px; align-items: start; }
.ibw-gallery.is-grid .g-open { aspect-ratio: 4 / 3; }
.ibw-gallery.is-grid .g-open img { height: 100%; object-fit: cover; transition: transform .35s ease; }
.ibw-gallery.is-grid .g-open:hover img { transform: scale(1.03); }
.ibw-gallery.is-stack { gap: 30px; }
.car-track { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.car-track::-webkit-scrollbar { display: none; }
.car-slide { scroll-snap-align: start; scroll-snap-stop: always; }
.car-slide .g-open { aspect-ratio: 16 / 10; }
.car-slide .g-open img { height: 100%; object-fit: contain; }
.car-bar { display: flex; align-items: center; justify-content: center; gap: 14px; font-family: var(--label); font-weight: 600; font-size: 15px; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.car-btn { width: 36px; height: 36px; border: 1px solid var(--rule); background: var(--panel); display: grid; place-items: center; color: var(--ink); }
.car-btn:hover:not(:disabled) { border-color: var(--ink); }
.car-btn:disabled { opacity: .35; cursor: default; }
.car-btn svg, .ibw-lightbox svg { width: 18px; height: 18px; }
.car-btn path, .ibw-lightbox path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ibw-lightbox { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: rgba(8, 10, 12, .95); color: #e6ecf1; }
.lb-stage { display: grid; place-items: center; min-height: 0; padding: calc(64px + env(safe-area-inset-top, 0px)) 76px 12px; }
.lb-img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-foot { display: flex; justify-content: center; align-items: baseline; gap: 18px; padding: 4px 16px calc(20px + env(safe-area-inset-bottom, 0px)); min-height: 24px; }
.lb-count { font-family: var(--label); font-weight: 600; font-size: 14px; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.lb-cap { margin: 0; font-size: 15px; color: #c8d0d7; max-width: 70ch; }
.lb-close, .lb-prev, .lb-next { position: absolute; width: 46px; height: 46px; display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .25); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, .12); }
.lb-close { top: calc(12px + env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); }
.lb-prev { left: max(12px, env(safe-area-inset-left, 0px)); top: 50%; transform: translateY(-50%); }
.lb-next { right: max(12px, env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); }
@media (max-width: 720px) {
  .lb-stage { padding: calc(64px + env(safe-area-inset-top, 0px)) 8px 8px; }
  .lb-prev, .lb-next { top: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); transform: none; }
  .lb-foot { padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); flex-direction: column; align-items: center; gap: 4px; text-align: center; }
  .car-slide .g-open { aspect-ratio: 4 / 3; }
}

/* Layout: a full-bleed wireframe sea, its grid turned at an angle; scrolling travels across it. Each project sits on a
   grid intersection and docks a card opposite its point. Opening a project dives into the sea and raises its subpage. */
:root {
  --bg: #fbfcfd;
  --ink: #11161b;
  --muted: #56616b;
  --rule: rgba(17, 22, 27, .14);
  --panel: rgba(251, 252, 253, .9);
  --veil: rgba(251, 252, 253, .93);
  --accent: #007bb6;          /* the link blue from the resumes */
  --mesh: 17, 22, 27;         /* wave line color, read by the WebGL scene */
  --mesh-alpha: .36;
  --display: 'Montserrat', 'Gotham', 'Helvetica Neue', Arial, sans-serif;        /* stands in for Gotham */
  --label: 'Barlow Semi Condensed', 'DIN Alternate', 'Arial Narrow', sans-serif;  /* stands in for DIN Alternate */
  --body: 'Helvetica Neue', Helvetica, Arial, sans-serif;                        /* Helvetica Light, as on the resumes */
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f13; --ink: #e6ecf1; --muted: #98a4ae; --rule: rgba(230, 236, 241, .16);
    --panel: rgba(11, 15, 19, .86); --veil: rgba(11, 15, 19, .93); --accent: #52b4e6;
    --mesh: 214, 226, 236; --mesh-alpha: .28; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f13; --ink: #e6ecf1; --muted: #98a4ae; --rule: rgba(230, 236, 241, .16);
  --panel: rgba(11, 15, 19, .86); --veil: rgba(11, 15, 19, .93); --accent: #52b4e6;
  --mesh: 214, 226, 236; --mesh-alpha: .28; color-scheme: dark;
}
html { scroll-snap-type: y proximity; }
html.page-open { overflow: hidden; scroll-snap-type: none; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--body); font-weight: 300;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0; -webkit-font-smoothing: antialiased; transition: background-color .5s ease;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

#sea { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
#track { position: relative; z-index: 1; }
.stop { height: var(--step, 85vh); scroll-snap-align: start; }
.stop:last-child { height: 100vh; }

/* ---------- header ---------- */
.top {
  position: fixed; z-index: 9; top: env(safe-area-inset-top, 0px); left: 0; right: 0;
  padding: 20px var(--gutter-r) 0 var(--gutter-l);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; pointer-events: none;
}
.top > * { pointer-events: auto; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.brand { color: var(--ink); display: grid; gap: 3px; justify-items: start; text-align: left; }
.brand .name { font-family: var(--display); font-size: 26px; font-weight: 300; letter-spacing: .02em; line-height: 1; }
.brand .name b { font-weight: 700; }
.brand .sub { font-family: var(--label); font-weight: 500; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; line-height: 1.1; }
.controls { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.filters { display: flex; border: 1px solid var(--rule); background: var(--panel); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.filters button {
  white-space: nowrap; font-family: var(--label); font-weight: 600; font-size: 14px; letter-spacing: .06em; text-transform: uppercase;
  padding: 9px 14px; display: flex; gap: 8px; align-items: baseline; color: var(--muted); transition: background-color .3s, color .3s;
}
.filters button + button { border-left: 1px solid var(--rule); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.filters .count { font-variant-numeric: tabular-nums; opacity: .7; font-weight: 500; }
.toplinks { display: flex; align-items: center; gap: 16px; font-family: var(--label); font-weight: 600; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
.toplinks > button { color: var(--ink); padding: 9px 0; }
.toplinks > button:hover { color: var(--accent); }
.theme-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--rule); background: var(--panel); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .moon, :root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}
.theme-btn svg * { stroke: var(--ink); fill: none; stroke-width: 1.5; }

/* ---------- nodes & leader ---------- */
#overlay { position: fixed; inset: 0; z-index: 2; pointer-events: none; transition: opacity .4s; }
html.page-open #overlay, html.page-open .card, html.page-open .rail { opacity: 0; pointer-events: none; }
#leader { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#leader line { stroke: var(--ink); stroke-width: 1; }
#leader circle { fill: var(--ink); }
.node {
  position: absolute; left: 0; top: 0; pointer-events: auto; padding: 10px; margin: -10px;
  display: flex; align-items: center; gap: 6px; will-change: transform, opacity;
}
html.page-open .node { pointer-events: none; }
.node .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px var(--bg); transition: transform .25s; }
.node .num { font-family: var(--label); font-weight: 600; font-size: 12px; letter-spacing: .06em; color: var(--ink); font-variant-numeric: tabular-nums; text-shadow: 0 0 4px var(--bg), 0 0 8px var(--bg); }
.node .tip {
  font-family: var(--label); font-weight: 500; font-size: 14px; letter-spacing: .02em; color: var(--ink); white-space: nowrap;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; padding: 1px 6px; line-height: 1.25;
  background: var(--panel); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); transition: color .2s, background-color .5s;
}
.node:hover .tip, .node:focus-visible .tip { color: var(--accent); }
.node.is-active .dot { background: var(--accent); transform: scale(1.7); box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--accent); }
.node.is-active .num { color: var(--accent); margin-left: 5px; }
.node.is-active .tip { color: var(--accent); font-weight: 600; }
.node.flip { flex-direction: row-reverse; }
.node.flip.is-active .num { margin-left: 0; margin-right: 5px; }
html.measuring .node .num, html.measuring .node .tip { display: block !important; }

/* ---------- project card ---------- */
.card {
  position: fixed; z-index: 4; left: max(28px, env(safe-area-inset-left, 0px)); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: min(400px, 34vw);
  background: var(--panel); border: 1px solid var(--rule); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: opacity .2s ease, transform .25s ease, background-color .5s;
}
.card.is-leaving { opacity: 0; transform: translateY(8px); }
.card-media { margin: 0; aspect-ratio: 16 / 9; max-width: 100%; background: var(--rule); position: relative; overflow: hidden; display: block; width: 100%; padding: 0; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.card-media:hover img { transform: scale(1.03); }
.ph {
  position: absolute; left: 10px; bottom: 8px; font-family: var(--label); font-weight: 500; font-size: 12px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--panel); padding: 2px 6px;
}
.card-body { padding: 18px 20px 20px; display: grid; gap: 8px; }
.card-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-family: var(--label); font-weight: 600; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.card-meta .rank { font-variant-numeric: tabular-nums; color: var(--muted); }
.card-meta .disc { color: var(--accent); text-align: right; }
.card-client { font-family: var(--label); font-weight: 500; font-size: 15px; letter-spacing: .04em; color: var(--muted); margin: 0; }
.card-title { font-family: var(--display); font-weight: 700; font-size: 25px; line-height: 1.12; letter-spacing: -.005em; margin: 0; text-wrap: balance; }
.card-kind { font-size: 14px; font-style: italic; color: var(--muted); margin: 0; }
.card-desc { font-size: 15px; line-height: 1.5; margin: 2px 0 4px; }
.card-open { font-family: var(--label); font-weight: 600; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; justify-self: start; color: var(--accent); padding: 0; }
.card-open:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- progress rail ---------- */
.rail {
  position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; transition: opacity .3s;
  padding: 0 var(--gutter-r) calc(18px + env(safe-area-inset-bottom, 0px)) var(--gutter-l);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px; pointer-events: none;
}
.rail > * { pointer-events: auto; }
.hint { font-family: var(--label); font-weight: 500; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: grid; gap: 3px; }
.hint-2 { opacity: .72; }
.ticks { display: flex; gap: 5px; align-items: flex-end; height: 22px; }
.ticks button { width: 9px; height: 22px; display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.ticks button::after { content: ""; width: 1px; height: 9px; background: var(--ink); opacity: .45; transition: height .2s, opacity .2s; }
.ticks button:hover::after { opacity: 1; height: 14px; }
.ticks button[aria-current="true"]::after { height: 20px; width: 2px; background: var(--accent); opacity: 1; }
.stepper { justify-self: end; display: flex; align-items: center; gap: 12px; font-family: var(--label); font-weight: 600; font-size: 15px; letter-spacing: .08em; }
.stepper .counter { font-variant-numeric: tabular-nums; min-width: 4.6em; text-align: center; }
.stepper button { width: 34px; height: 34px; border: 1px solid var(--rule); background: var(--panel); display: grid; place-items: center; }
.stepper svg { width: 16px; height: 16px; }
.stepper path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.stepper button:hover { border-color: var(--ink); }
.stepper button:disabled { opacity: .35; cursor: default; }

/* ---------- minimal view: click the wave and only the projects stay ---------- */
.top, .rail, #leader { transition: opacity .45s ease, visibility 0s linear 0s; }
html.minimal:not(.page-open) .top, html.minimal .card, html.minimal .rail, html.minimal #leader {
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .45s ease, visibility 0s linear .45s;
}

/* ---------- index ---------- */
.index {
  position: fixed; inset: 0; z-index: 8; background: var(--bg); overflow-y: auto;
  padding: calc(92px + env(safe-area-inset-top, 0px)) var(--gutter-r) calc(40px + env(safe-area-inset-bottom, 0px)) var(--gutter-l);
}
.index-head { max-width: 1180px; margin: 0 auto 22px; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.index-head h2 { font-family: var(--display); font-weight: 300; font-size: 30px; margin: 0; }
.index-head h2 b { font-weight: 700; }
.index-head p { margin: 0; color: var(--muted); font-size: 15px; }
.index-grid { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 28px 22px; }
.tile { text-align: left; display: grid; gap: 8px; align-content: start; }
.tile .thumb { aspect-ratio: 16 / 9; max-width: 100%; width: 100%; background: var(--rule); overflow: hidden; }
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.tile:hover .thumb img { transform: scale(1.03); }
.t-meta { display: flex; justify-content: space-between; gap: 10px; font-family: var(--label); font-weight: 600; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.t-meta .disc { color: var(--accent); text-align: right; }
.t-title { font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1.2; }
.t-client { font-family: var(--label); font-weight: 500; font-size: 14px; color: var(--muted); }

/* ---------- subpages ---------- */
.ibw-page {
  --head: calc(88px + env(safe-area-inset-top, 0px));
  position: fixed; inset: 0; z-index: 7; overflow-y: auto; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(to bottom, transparent calc(var(--head) - 16px), #000 calc(var(--head) + 12px));
  mask-image: linear-gradient(to bottom, transparent calc(var(--head) - 16px), #000 calc(var(--head) + 12px));
  background: linear-gradient(to bottom, transparent 0, var(--veil) 46vh);
  opacity: 0; transform: translateY(26px); transition: opacity .45s ease, transform .55s cubic-bezier(.2, .7, .2, 1);
}
.ibw-page.is-open { opacity: 1; transform: none; }
.ibw-page::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--veil); opacity: 0; transition: opacity .45s ease; }
.ibw-page.is-scrolled::before { opacity: 1; }
.page-inner {
  max-width: 1040px; margin: 0 auto;
  padding: calc(104px + env(safe-area-inset-top, 0px)) var(--gutter-r) calc(64px + env(safe-area-inset-bottom, 0px)) var(--gutter-l);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px;
}
.page-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.back { color: var(--ink); display: block; padding: 10px 14px 10px 0; margin: -10px 0; }
.back svg { display: block; width: 76px; height: 28px; overflow: visible; transition: transform .25s ease; }
.back path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.back:hover { color: var(--accent); }
.back:hover svg { transform: translateX(-6px); }
.crumb { font-family: var(--label); font-weight: 600; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-variant-numeric: tabular-nums; }
.crumb .disc { color: var(--accent); }
.page-head { display: grid; gap: 10px; max-width: 760px; }
.eyebrow { font-family: var(--label); font-weight: 500; font-size: 17px; letter-spacing: .05em; color: var(--muted); margin: 0; }
.page-head h1 { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 5.4vw, 58px); line-height: 1.04; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
.lede { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; margin: 6px 0 0; max-width: 62ch; }
.page-hero { margin: 0; aspect-ratio: 16 / 9; max-width: 100%; background: var(--rule); position: relative; overflow: hidden; }
.page-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr); gap: 32px 56px; align-items: start; }
.facts { margin: 0; display: grid; gap: 18px; border-top: 1px solid var(--ink); padding-top: 14px; }
.facts div { display: grid; gap: 3px; align-content: start; }
.facts dt { font-family: var(--label); font-weight: 600; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-size: 15px; line-height: 1.45; }
.facts dd.disc { color: var(--accent); font-family: var(--label); font-weight: 600; letter-spacing: .04em; }
.prose { display: grid; gap: 26px; min-width: 0; }
.prose section { display: grid; gap: 10px; border-top: 1px solid var(--rule); padding-top: 14px; }
.prose h2 { font-family: var(--label); font-weight: 600; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; margin: 0; }
.prose p { margin: 0; font-size: 17px; line-height: 1.6; max-width: 64ch; }
.prose ul { margin: 0; padding-left: 1.1em; display: grid; gap: 8px; font-size: 17px; line-height: 1.5; max-width: 64ch; }
.prose .pending { font-size: 15px; color: var(--muted); font-style: italic; }
.jump { font-family: var(--label); font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); padding: 0; white-space: nowrap; }
.jump:hover { text-decoration: underline; text-underline-offset: 3px; }
.page-links .jump { font-size: inherit; letter-spacing: inherit; }
.resume-tools { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 12px 0; }
.seg { display: flex; border: 1px solid var(--rule); background: var(--panel); }
.seg button { font-family: var(--label); font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; padding: 8px 12px; color: var(--muted); white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.downloads { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; font-family: var(--label); font-weight: 600; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
.downloads .lbl { color: var(--muted); font-size: 12px; letter-spacing: .12em; }
.res-note { margin: -18px 0 0; font-size: 15px; color: var(--muted); }
.facts dd.stack { display: grid; gap: 1px; }
.facts dd.stack + dd.stack { margin-top: 8px; }
.facts dd.stack b { font-weight: 600; }
.roles { display: grid; gap: 24px; }
.role { display: grid; gap: 3px; transition: opacity .3s; }
.role-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; }
.role h3 { font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.25; margin: 0; }
.role .when { font-family: var(--label); font-weight: 500; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.role-title { margin: 0; font-size: 15px; font-style: italic; color: var(--muted); }
.prose .role ul { margin-top: 6px; font-size: 16px; }
.role.is-quiet { opacity: .5; }
.page-links { display: flex; flex-wrap: wrap; gap: 12px 28px; font-family: var(--label); font-weight: 600; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; }
.contact { display: grid; gap: 12px; }
.contact-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.contact-row .v { font-size: 19px; user-select: all; }
.copy { font-family: var(--label); font-weight: 600; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--rule); padding: 4px 9px; color: var(--muted); }
.copy:hover { color: var(--ink); border-color: var(--ink); }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.timeline li { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 4px 18px; font-size: 16px; line-height: 1.45; }
.timeline .when { font-family: var(--label); font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline b { font-weight: 600; }
.page-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; border-top: 1px solid var(--ink); padding-top: 18px; }
.page-nav button { text-align: left; display: grid; gap: 6px; align-content: start; }
.page-nav .next { text-align: right; justify-items: end; }
.page-nav .dir { font-family: var(--label); font-weight: 600; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.page-nav .t-title { font-size: 19px; }
.page-nav button:hover .t-title { color: var(--accent); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nogl .card { top: auto; bottom: 90px; transform: none; }

@media (min-width: 721px) and (max-height: 780px) { .card-media { aspect-ratio: 21 / 9; } .card-kind { display: none; } }

/* ---------- phone ---------- */
@media (max-width: 720px) {
  .top { flex-direction: column; gap: 12px; padding-top: 14px; }
  .brand .name { font-size: 22px; }
  .node .tip { font-size: 13px; max-width: 56vw; }
  .top::before { content: ""; position: absolute; inset: 0 0 -28px; z-index: -1; pointer-events: none; background: linear-gradient(var(--bg) 62%, transparent); }
  .controls { width: 100%; justify-content: space-between; gap: 10px; flex-wrap: nowrap; }
  .filters { min-width: 0; }
  .filters button { padding: 8px 10px; font-size: 13px; gap: 5px; }
  .filters .long, .seg .long { display: none; }
  .toplinks { gap: 10px; font-size: 13px; }
  .toplinks .about .long { display: none; }
  .theme-btn { width: 32px; height: 32px; position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: var(--gutter-r); }
  .ibw-page { --head: calc(110px + env(safe-area-inset-top, 0px)); }
  html { scroll-snap-type: y mandatory; }
  .stop { scroll-snap-stop: always; }
  .card {
    left: var(--gutter-l); right: var(--gutter-r); width: auto;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px));
    display: grid; grid-template-columns: 112px minmax(0, 1fr);
  }
  .card-media { aspect-ratio: auto; height: 100%; min-height: 76px; }
  .card-body { padding: 10px 12px; gap: 2px; align-content: center; }
  .card-meta { font-size: 11px; justify-content: flex-start; }
  .card-meta .rank { display: none; }
  .card-meta .disc { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card-client { font-size: 13px; }
  .card-title { font-size: 17px; line-height: 1.15; }
  .card-kind, .card-desc, .card .ph { display: none; }
  .card-open { font-size: 0; letter-spacing: 0; }
  .card-open::after { content: ""; position: absolute; inset: 0; }
  .hint { font-size: 11px; letter-spacing: .08em; }
  .back svg { width: 64px; height: 24px; }
  .rail { grid-template-columns: 1fr auto; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .ticks { display: none; }
  .index { padding-top: calc(130px + env(safe-area-inset-top, 0px)); }
  .index-grid { grid-template-columns: 1fr 1fr; gap: 20px 14px; }
  .tile .t-title { font-size: 15px; }
  .page-inner { padding-top: calc(134px + env(safe-area-inset-top, 0px)); gap: 26px; }
  .page-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 18px; }
  .contact-row .v { overflow-wrap: anywhere; }
  .prose p, .prose ul { font-size: 16px; }
  .timeline li { grid-template-columns: minmax(0, 1fr); }
  .page-nav .t-title { font-size: 16px; }
}
@media (max-width: 380px) { .filters button { padding: 8px 8px; letter-spacing: .03em; } }
@media (prefers-reduced-motion: reduce) {
  .card, .node .dot, .tile .thumb img, .ticks button::after, .ibw-page, body, .card-media img { transition: none; }
}

/* ---------- later additions: these come last so they win over the prototype's rules ---------- */
button { padding: 0; -webkit-appearance: none; appearance: none; border-radius: 0; }   /* iPhone Safari pads buttons by default */
.theme-btn, .toplinks > .theme-btn, .stepper button, .home-btn, .car-btn { box-sizing: border-box; padding: 0; line-height: 0; }   /* the header links' 9px padding pushed the sun/moon down */
.theme-btn svg, .stepper svg, .home-btn svg { display: block; margin: auto; }
.rail-end { justify-self: end; display: flex; align-items: center; gap: 12px; }
.home-btn { width: 34px; height: 34px; border: 1px solid var(--rule); background: var(--panel); display: grid; place-items: center; color: var(--ink); }
.home-btn svg { width: 17px; height: 17px; }
.home-btn path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.home-btn:hover:not(:disabled) { border-color: var(--ink); }
.home-btn:disabled { opacity: .35; cursor: default; }
.ticks { position: relative; }
.tick-tip { position: absolute; bottom: calc(100% + 10px); left: 0; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font-family: var(--label); font-weight: 500; font-size: 13px; letter-spacing: .03em; color: var(--ink);
  background: var(--panel); border: 1px solid var(--rule); padding: 3px 8px; opacity: 0; transition: opacity .15s; }
.tick-tip .n { font-weight: 600; margin-right: 6px; font-variant-numeric: tabular-nums; color: var(--accent); }
.tick-tip.is-on { opacity: 1; }
@media (hover: none), (pointer: coarse) { .tick-tip { display: none; } }
@media (max-width: 720px) {
  .rail { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .rail-end { display: contents; }
  .rail .hint { grid-column: 1; font-size: 10px; letter-spacing: .07em; white-space: nowrap; }
  .home-btn { grid-column: 2; justify-self: center; }
  .rail .stepper { grid-column: 3; justify-self: end; gap: 8px; }
  .stepper .counter { min-width: 3.6em; }
}
/* phones: no double-tap zoom anywhere (set on every element, since each scrolling box starts afresh);
   pinching still works, so a zoomed page can always be pinched back out */
* { touch-action: manipulation; }
html.touch-nav #sea, html.touch-nav #overlay { touch-action: pinch-zoom; }
.ibw-gallery figcaption, .lb-cap { white-space: pre-line; }

/* titled pictures and videos: the title, a line, then the picture, evenly spaced */
.ibw-gallery .g-title, .page-videos .g-title {
  --line: var(--rule); --line: color-mix(in srgb, var(--ink) 26%, transparent);
  margin: 0; justify-self: stretch; text-align: center; color: var(--ink);
  font-family: var(--display); font-weight: 700; font-size: clamp(18px, 1.9vw, 22px); line-height: 1.25; letter-spacing: -.005em;
  text-wrap: balance; white-space: pre-line; padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.ibw-gallery.is-grid .g-title { font-size: 16px; padding-bottom: 12px; }
.ibw-gallery figure, .page-videos figure { gap: 22px; }
.page-videos figure { margin: 0; display: grid; min-width: 0; }
.ibw-gallery, .page-videos { margin-top: 22px; }
.ibw-gallery.is-stack, .page-videos { gap: 56px; }
.car-slide { align-content: end; }                 /* pictures line up even when titles run to two lines */
.ibw-gallery.is-grid { align-items: end; }
.lb-cap { font-family: var(--display); font-weight: 700; font-size: 16px; color: #fff; }
@media (max-width: 720px) {
  .ibw-gallery, .page-videos { margin-top: 10px; }
  .ibw-gallery.is-stack, .page-videos { gap: 36px; }
  .ibw-gallery figure, .page-videos figure { gap: 16px; }
  .ibw-gallery .g-title, .page-videos .g-title { padding-bottom: 14px; }
}

/* carousel: the frame takes the shape of its tallest picture, and nothing grey shows around a picture */
.ibw-gallery.is-carousel .car-slide .g-open { aspect-ratio: var(--car-ar, 16 / 10); max-height: 78vh; background: transparent; }

/* tall title pictures and tall videos get a frame of their own shape, centered, up to most of the screen's height */
.page-hero.is-tall, .ibw-video.is-tall { aspect-ratio: var(--rw); width: min(100%, calc(min(78vh, 920px) * var(--rw))); justify-self: center; margin-left: auto; margin-right: auto; }
.page-hero.is-tall { background: transparent; }

/* thumbnails (the card, List View, gallery grid): a picture taller than its box is shown whole, full height */
.fits-tall { background: transparent !important; }
.fits-tall img { object-fit: contain !important; }
.post-body .ibw-video.is-tall { margin-left: auto; margin-right: auto; }

/* a dark page and a light player made browsers paint a white box around videos that don't fill their frame */
.ibw-video iframe, .page-hero iframe, .post-body iframe { color-scheme: light; }

/* the full-screen viewer: every picture in the same calmer frame instead of filling the screen */
.lb-img { width: min(960px, 78vw, 100%); height: min(600px, 66vh, 100%); max-width: none; max-height: none; object-fit: contain; }
.ibw-lightbox { background: rgba(8, 10, 12, .97); }
@media (max-width: 720px) { .lb-img { width: 100%; height: min(100%, 70vh); } }

.ibw-noscript { position: relative; z-index: 10; max-width: 760px; margin: 120px auto 40px; padding: 0 16px; background: var(--bg); }
