/* =====================================================================
   Main site — a light, editorial, corporate-presentation take
   on the same portfolio content. Shares assets/ with the original build
   but nothing else with classic.html + style.css + script.js (the earlier dark build).
   ===================================================================== */

:root {
  --paper: #f7f6f2;
  --surface: #ffffff;
  --sunk: #eceae4;
  --ink: #101c2e;
  --ink-2: #3e4a5b;
  --muted: #5f6875;
  --line: #e1ded6;
  --line-strong: #cdc9bf;
  --accent: #1d3a6b;
  --accent-ink: #ffffff;
  --accent-soft: #e6ebf3;
  --navy: #13243f;

  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', monospace;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --hdr-h: 72px;
  --radius: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; scroll-behavior: smooth; scroll-padding-top: calc(var(--hdr-h) + 8px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  padding: 10px 16px; background: var(--ink); color: var(--paper); border-radius: 6px;
  transform: translateY(-200%); transition: transform .2s var(--ease);
}
.skip:focus { transform: none; }

.label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border-radius: 999px;
  font-size: 15px; font-weight: 500; line-height: 1;
  border: 1px solid transparent;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
  white-space: nowrap;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--navy); }
.btn--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }
.btn__sub { opacity: .7; font-weight: 400; }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 246, 242, .88);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease);
}
.hdr.is-scrolled { border-bottom-color: var(--line); }
.hdr__inner { height: var(--hdr-h); display: flex; align-items: center; gap: 32px; }

.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand__name { font-family: var(--serif); font-size: 24px; letter-spacing: -.01em; line-height: 1; }

.hdr__nav { display: flex; gap: 4px; }
.hdr__nav a {
  position: relative;
  padding: 8px 14px;
  font-size: 15px; color: var(--ink-2);
  border-radius: 999px;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.hdr__nav a:hover { color: var(--ink); background: var(--sunk); }
.hdr__nav a.is-active { color: var(--ink); }
.hdr__nav a.is-active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 2px; border-radius: 2px; background: var(--accent);
}
.hdr__cta { height: 40px; padding: 0 16px; font-size: 14px; }

.hdr__burger { display: none; width: 44px; height: 44px; position: relative; margin-right: -10px; }
.hdr__burger span {
  position: absolute; left: 12px; right: 12px; height: 1.5px; background: var(--ink);
  transition: transform .25s var(--ease);
}
.hdr__burger span:nth-child(1) { top: 18px; }
.hdr__burger span:nth-child(2) { top: 25px; }
.hdr__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.hdr__burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

.drawer {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0;
  flex-direction: column; gap: 4px;
  padding: 8px var(--gutter) 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 18px 30px -20px rgba(16, 28, 46, .35);
}
.drawer a:not(.btn) { padding: 14px 0; font-size: 20px; font-family: var(--serif); border-bottom: 1px solid var(--line); }
.drawer .btn { margin-top: 16px; justify-content: center; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: end;
  padding-top: clamp(56px, 10vw, 128px);
  padding-bottom: clamp(48px, 7vw, 88px);
}
.hero__name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(52px, 8.4vw, 116px);
  line-height: .98;
  letter-spacing: -.025em;
}
.hero__lede {
  margin-top: 28px;
  max-width: 24ch;
  font-size: clamp(21px, 2.3vw, 28px);
  line-height: 1.35;
  color: var(--ink-2);
  letter-spacing: -.01em;
}
.hero__lede strong { color: var(--ink); font-weight: 500; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; }

.hero__panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px 20px;
}
.caps { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.caps li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  font-size: 15px;
  border-top: 1px solid var(--line);
}
.caps li::before { content: ''; flex: none; width: 5px; height: 5px; background: var(--accent); border-radius: 1px; }

/* ---------- work index ---------- */
.index { padding-bottom: clamp(72px, 10vw, 128px); }
.index__head { padding-bottom: 16px; border-bottom: 1px solid var(--ink); }
.index__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(32px, 5vw, 72px); }
.index__group {
  padding: 20px 0 8px;
  font-family: var(--serif); font-weight: 400; font-size: 24px;
}
.index__group a:hover { color: var(--accent); }
.index__group span { color: var(--muted); font-size: .7em; }
.index__list a {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  transition: color .2s var(--ease);
}
.index__num { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.index__title { font-weight: 500; }
.index__meta { font-size: 14px; color: var(--muted); text-align: right; }
.index__list a:hover { color: var(--accent); }
.index__list a:hover .index__meta { color: var(--accent); }

/* ---------- sections ---------- */
.sect { padding-block: clamp(72px, 10vw, 128px); border-top: 1px solid var(--line); }
.sect--alt { background: var(--surface); }
.sect__head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
  gap: 16px clamp(28px, 4.5vw, 64px);
  align-items: end;
  padding-bottom: clamp(32px, 4vw, 48px);
}
.sect__num { grid-column: 1 / -1; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.sect__num::after { content: ''; display: inline-block; vertical-align: middle; width: 32px; height: 1px; margin-left: 12px; background: var(--line-strong); }
.sect__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(40px, 5.6vw, 72px);
  line-height: 1; letter-spacing: -.02em;
}
.sect__title-sub { font-size: .42em; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.sect__desc { color: var(--ink-2); max-width: 44ch; padding-bottom: 6px; }

/* ---------- case studies ---------- */
.case {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
  gap: clamp(28px, 4.5vw, 64px);
  padding-block: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--line);
}
.case__text { display: flex; flex-direction: column; align-self: start; }
.case__index { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.case__index b { color: var(--ink); font-weight: 500; }
.case__title {
  margin-top: 12px;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 1.08; letter-spacing: -.015em;
}
.case__meta {
  align-self: flex-start;
  margin-top: 16px;
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px; font-weight: 500; line-height: 1.4;
}
.case__copy { margin-top: 20px; color: var(--ink-2); max-width: 46ch; }

/* viewer */
.viewer { min-width: 0; }
.viewer__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--sunk);
  border: 1px solid var(--line);
  user-select: none; -webkit-user-select: none;
  touch-action: pan-y;
}
.viewer__slide {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity .45s var(--ease), visibility 0s linear .45s;
}
.viewer__slide.is-active { opacity: 1; visibility: visible; transition: opacity .45s var(--ease), visibility 0s; }
.viewer__slide img, .viewer__slide video { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.viewer__open {
  position: absolute; inset: 0; z-index: 1;
  cursor: zoom-in;
}
.viewer__open:focus-visible { outline-offset: -3px; border-radius: var(--radius); }
.viewer__chip {
  position: absolute; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border-radius: 999px;
  background: rgba(16, 28, 46, .72);
  color: #fff;
  font-family: var(--mono); font-size: 12px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  pointer-events: none;
}
.viewer__expand { right: 12px; top: 12px; opacity: 0; transition: opacity .2s var(--ease); }
.viewer__frame:hover .viewer__expand,
.viewer__open:focus-visible ~ .viewer__expand { opacity: 1; }
.viewer__arrow {
  position: absolute; z-index: 2; top: 50%;
  width: 40px; height: 40px; margin-top: -20px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(16, 28, 46, .14);
  opacity: 0;
  transition: opacity .2s var(--ease), background-color .2s var(--ease);
}
.viewer__arrow--prev { left: 12px; }
.viewer__arrow--next { right: 12px; }
.viewer__frame:hover .viewer__arrow, .viewer__arrow:focus-visible { opacity: 1; }
.viewer__arrow:hover { background: #fff; }
.viewer__arrow:disabled { opacity: 0 !important; pointer-events: none; }

.viewer__thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.viewer__thumbs--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: var(--sunk);
  /* active ring is an inset shadow on ::after, so selecting never shifts layout */
}
.thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .62; transition: opacity .2s var(--ease); -webkit-user-drag: none; }
.thumb::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .2s var(--ease);
}
.thumb:hover img { opacity: .9; }
.thumb[aria-current="true"] img { opacity: 1; }
.thumb[aria-current="true"]::after { box-shadow: inset 0 0 0 2px var(--accent); }
.thumb__play {
  position: absolute; left: 8px; bottom: 8px;
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(16, 28, 46, .75); color: #fff;
}

/* ---------- links ---------- */
.links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.lcard {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 196px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.lcard:hover { border-color: var(--accent); box-shadow: 0 10px 30px -18px rgba(29, 58, 107, .45); }
.lcard__icon {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
}
.lcard__title { margin-top: auto; padding-top: 28px; font-weight: 600; font-size: 18px; }
.lcard__desc { font-size: 15px; color: var(--muted); }
.lcard__arrow {
  position: absolute; top: 24px; right: 24px;
  color: var(--muted);
  transition: transform .2s var(--ease), color .2s var(--ease);
}
.lcard:hover .lcard__arrow { transform: translate(3px, -3px); color: var(--accent); }

/* ---------- contact ---------- */
.contact { background: var(--navy); color: #eef1f6; padding-top: clamp(72px, 10vw, 128px); }
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px clamp(32px, 6vw, 96px);
  align-items: end;
}
.contact__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(44px, 6.4vw, 88px);
  line-height: 1; letter-spacing: -.02em;
  color: #fff;
}
.crow {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, .16);
}
.crow:last-child { border-bottom: 1px solid rgba(255, 255, 255, .16); }
.crow__label { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: rgba(238, 241, 246, .6); }
.crow__value { font-size: clamp(16px, 1.8vw, 21px); overflow-wrap: break-word; color: #fff; }
.crow__value:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.crow__copy {
  display: grid;
  height: 34px; padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .28);
  font-size: 13px;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
/* both labels share one grid cell so the button keeps the wider label's width — no shift on "Copied" */
.crow__copy > span { grid-area: 1 / 1; display: grid; place-items: center; transition: opacity .2s var(--ease); }
.crow__copy-done { opacity: 0; }
.crow__copy:hover { border-color: #fff; }
.crow__copy.is-copied { background: #fff; color: var(--navy); border-color: #fff; }
.crow__copy.is-copied .crow__copy-idle { opacity: 0; }
.crow__copy.is-copied .crow__copy-done { opacity: 1; }
.contact :focus-visible { outline-color: #fff; }
.contact__bottom {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: clamp(64px, 9vw, 112px);
  padding-block: 28px calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, .16);
  font-size: 14px; color: rgba(238, 241, 246, .6);
}
.contact__bottom a:hover { color: #fff; }

/* ---------- lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 200;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #0b111d;
  color: #fff;
}
.lb[hidden] { display: none; }
.lb__bar { display: flex; align-items: center; gap: 16px; padding: 12px 12px 12px var(--gutter); }
.lb__title { font-weight: 500; }
.lb__count { font-family: var(--mono); font-size: 13px; color: rgba(255, 255, 255, .6); margin-right: auto; }
.lb__btn {
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  color: #fff;
  transition: background-color .2s var(--ease);
}
.lb__btn:hover { background: rgba(255, 255, 255, .12); }
.lb__btn[hidden] { display: none; }
.lb__btn:disabled { opacity: .25; cursor: default; background: none; }
.lb__stage { display: grid; place-items: center; padding: 0 clamp(16px, 7vw, 96px) clamp(16px, 4vw, 48px); min-height: 0; }
.lb__stage img, .lb__stage video { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 6px; -webkit-user-drag: none; }
.lb__nav { position: absolute; top: 50%; margin-top: -24px; }
.lb__nav--prev { left: 12px; }
.lb__nav--next { right: 12px; }
.lb :focus-visible { outline-color: #fff; }

/* ---------- reveal (JS-gated so content is never hidden without it) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js [data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .viewer__slide { transition: none; }
}

/* ---------- touch: no hover, so keep viewer controls visible ---------- */
@media (hover: none) {
  .viewer__arrow { opacity: 1; width: 36px; height: 36px; margin-top: -18px; }
  .viewer__expand { opacity: 1; }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hdr__nav a { padding-inline: 10px; }
  .hdr__nav a.is-active::after { left: 10px; right: 10px; }
}

@media (max-width: 900px) {
  .hdr__nav, .hdr__cta { display: none; }
  .hdr__burger { display: block; }
  .drawer.is-open { display: flex; }

  .hero { grid-template-columns: 1fr; align-items: start; }
  .index__cols { grid-template-columns: 1fr; }
  .sect__head { grid-template-columns: 1fr; gap: 12px; }
  .case { grid-template-columns: 1fr; gap: 24px; }
  .case__copy { max-width: none; }
  .contact__grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .caps { grid-template-columns: 1fr; }
  .hero__panel { padding: 20px; }
  .index__list a { grid-template-columns: 32px minmax(0, 1fr); }
  .index__meta { grid-column: 2; text-align: left; margin-top: -10px; }
  .links { grid-template-columns: 1fr; }
  .lcard { min-height: 0; }
  .lcard__title { padding-top: 20px; }
  .viewer__thumbs { gap: 8px; margin-top: 8px; }
  .crow { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .crow__label { grid-column: 1 / -1; }
  .lb__nav { top: auto; bottom: 16px; margin-top: 0; }
  .lb__stage { padding-bottom: 80px; }
}
