/* Myo Ko Zin — editorial portfolio. Shared by the homepage and case study pages. */

:root {
  --paper: #f4efe6;
  --paper-2: #ebe4d8;
  --ink: #121110;
  --muted: #6b645b;
  --rule: #cfc6b8;
  --accent: #c4360c;        /* text-safe accent (4.7:1 on paper) */
  --accent-fill: #ff4a17;   /* decorative fills only */
  --on-accent: #121110;

  --display: "Instrument Serif", "Times New Roman", Georgia, serif;
  --sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --max: 1360px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121110; --paper-2: #1c1a18; --ink: #f2ece2; --muted: #a39b90;
    --rule: #34302b; --accent: #ff5a2a; --accent-fill: #ff5a2a; --on-accent: #121110;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121110; --paper-2: #1c1a18; --ink: #f2ece2; --muted: #a39b90;
  --rule: #34302b; --accent: #ff5a2a; --accent-fill: #ff5a2a; --on-accent: #121110;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
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 { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--accent-fill); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 14px; text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }
@media (min-width: 900px) { .wrap { padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: max(40px, env(safe-area-inset-right, 0px)); } }

.kicker { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* ---------- masthead ---------- */
.masthead { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); padding-top: env(safe-area-inset-top, 0px); }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.masthead .mark { font-family: var(--display); font-size: 24px; text-decoration: none; letter-spacing: -.01em; }
.masthead .mark span { color: var(--accent); }
.masthead nav ul { display: flex; gap: clamp(14px, 2.4vw, 32px); list-style: none; margin: 0; padding: 0; }
.masthead nav a { text-decoration: none; font-size: 14px; font-weight: 500; color: var(--muted); }
.masthead nav a:hover { color: var(--ink); }
.masthead .right { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); }
.theme-toggle { appearance: none; border: 1px solid var(--rule); background: transparent; color: var(--ink); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg { width: 16px; height: 16px; }
@media (max-width: 560px) { .masthead nav li.opt { display: none; } }

/* ---------- hero ---------- */
.hero { padding-top: clamp(40px, 8vw, 110px); padding-bottom: clamp(36px, 6vw, 80px); }
.hero .issue { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--ink); }
.hero h1 {
  font-family: var(--display); font-weight: 400; margin: clamp(18px, 3vw, 36px) 0 0;
  font-size: clamp(76px, 17.5vw, 268px); line-height: .84; letter-spacing: -.035em;
}
.hero-top { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: end; }
.hero-top h1 { grid-column: 1 / span 9; grid-row: 1; position: relative; z-index: 1; }
/* Photo: left edge on the intro column, bottom of the frame on the baseline of "Zin." */
.hero-photo {
  grid-column: 8 / -1; grid-row: 1; justify-self: start; align-self: end;
  width: 100%; max-width: 260px;
  margin: 0 0 calc(clamp(76px, 17.5vw, 268px) * .143);
  padding: 8px; border: 1px solid var(--ink); background: var(--paper);
  box-shadow: 10px 10px 0 var(--accent-fill);
}
.hero-photo .hp-clip { display: block; overflow: hidden; background: var(--paper-2); }
.hero-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
@media (max-width: 820px) {
  .hero-top h1 { grid-column: 1 / -1; }
  .hero-photo { grid-column: 7 / -1; grid-row: 2; justify-self: end; max-width: 160px; margin: 22px 7px 0 0; padding: 5px; box-shadow: 6px 6px 0 var(--accent-fill); }
}
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero h1 .line > span { display: inline-block; }
.hero h1 .line:nth-child(2) { padding-left: clamp(0px, 14vw, 220px); }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .sub { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; margin-top: clamp(28px, 4vw, 56px); align-items: end; }
.hero .tagline { grid-column: 1 / span 6; font-family: var(--display); font-size: clamp(34px, 4.6vw, 64px); line-height: 1; margin: 0; letter-spacing: -.02em; }
.hero .tagline em { color: var(--accent); }
.hero .intro { grid-column: 8 / span 5; margin: 0; font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); max-width: 46ch; }
.hero .intro strong { color: var(--ink); font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 8px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-fill); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (max-width: 820px) {
  .hero .tagline, .hero .intro { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .hero h1 { font-size: 27vw; }
  .hero h1 .line:nth-child(2) { padding-left: 18vw; }
}

/* numbers strip */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-top: clamp(56px, 7vw, 110px); }
.figures div { padding: 22px 20px 22px 0; }
.figures div + div { border-left: 1px solid var(--rule); padding-left: 20px; }
.figures b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(40px, 5vw, 68px); line-height: 1; letter-spacing: -.02em; font-variant-numeric: lining-nums; }
.figures span { display: block; margin-top: 8px; font-size: 14px; color: var(--muted); max-width: 26ch; line-height: 1.45; }
@media (max-width: 820px) {
  .figures { grid-template-columns: 1fr 1fr; }
  .figures div:nth-child(3) { border-left: 0; padding-left: 0; }
  .figures div:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

/* ---------- section heads ---------- */
.section { padding-top: clamp(64px, 9vw, 140px); }
.section-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: end; padding-bottom: 20px; border-bottom: 1px solid var(--ink); margin-bottom: clamp(36px, 5vw, 64px); }
.section-head h2 { grid-column: 1 / span 9; font-family: var(--display); font-weight: 400; margin: 0; font-size: clamp(56px, 10vw, 156px); line-height: .88; letter-spacing: -.035em; }
.section-head h2 em { color: var(--accent); }
.section-head .kicker { grid-column: 10 / span 3; justify-self: end; text-align: right; padding-bottom: .6em; }
@media (max-width: 700px) { .section-head .kicker { grid-column: 1 / -1; justify-self: start; text-align: left; } .section-head h2 { grid-column: 1 / -1; } }

/* ---------- projects ---------- */
.projects { display: grid; gap: clamp(72px, 10vw, 150px); }
.project { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 22px; text-decoration: none; color: inherit; }
.project .media { position: relative; overflow: hidden; background: var(--paper-2); }
.project .media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.project:hover .media img, .project:focus-visible .media img { transform: scale(1.045); }
.project .num { font-family: var(--display); font-size: clamp(88px, 12vw, 190px); line-height: .78; letter-spacing: -.04em; color: var(--ink); }
.project .num sup { font-family: var(--sans); font-size: 12px; letter-spacing: .14em; vertical-align: top; margin-left: 6px; color: var(--muted); font-weight: 600; }
.project h3 { font-family: var(--display); font-weight: 400; margin: 0 0 14px; font-size: clamp(36px, 4.4vw, 64px); line-height: .98; letter-spacing: -.02em; }
.project h3 .u {
  background-image: linear-gradient(var(--accent-fill), var(--accent-fill));
  background-size: 0% 3px; background-repeat: no-repeat; background-position: 0 92%;
  transition: background-size .6s var(--ease); padding-bottom: 2px;
}
.project:hover h3 .u, .project:focus-visible h3 .u { background-size: 100% 3px; }
.project .dek { margin: 0 0 18px; color: var(--muted); max-width: 52ch; font-size: clamp(16px, 1.3vw, 18px); }
.project .meta { display: grid; gap: 10px; align-content: start; font-size: 14px; border-top: 1px solid var(--rule); padding-top: 14px; }
.project .meta dt { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.project .meta dd { margin: 2px 0 0; }
.project .cta { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: var(--accent); }
.project .cta svg { width: 18px; height: 18px; transition: transform .4s var(--ease); }
.project:hover .cta svg { transform: translateX(6px); }

/* layout A: full-bleed image, text row under */
.project.a .media { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.project.a .num { grid-column: 1 / span 3; }
.project.a .body { grid-column: 4 / span 6; }
.project.a .meta { grid-column: 10 / span 3; }
/* layout B: tall image left, big number + text right */
.project.b .media { grid-column: 1 / span 5; grid-row: 1 / span 3; aspect-ratio: 788 / 760; }
.project.b .num { grid-column: 7 / span 6; align-self: start; }
.project.b .body { grid-column: 7 / span 6; }
.project.b .meta { grid-column: 7 / span 6; align-self: end; }
/* layout C: text left, wide image right */
.project.c .num { grid-column: 1 / span 4; grid-row: 1; }
.project.c .body { grid-column: 1 / span 4; grid-row: 2; }
.project.c .meta { grid-column: 1 / span 4; grid-row: 3; align-self: end; }
.project.c .media { grid-column: 5 / -1; grid-row: 1 / span 3; aspect-ratio: 16 / 9; align-self: start; }

@media (max-width: 900px) {
  .project.a .num, .project.b .num, .project.c .num { grid-column: 1 / span 4; grid-row: auto; }
  .project.a .body, .project.b .body, .project.c .body { grid-column: 1 / -1; grid-row: auto; }
  .project.a .meta, .project.b .meta, .project.c .meta { grid-column: 1 / -1; grid-row: auto; }
  .project.b .media, .project.c .media { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 16 / 10; }
  .project.b .media img { object-position: 50% 40%; }
  .project .num { order: -1; }
  .project .media { order: 0; }
  .project .body { order: 1; }
  .project .meta { order: 2; }
  .project.b .num, .project.c .num { order: -1; }
}

/* text-only covers for work without images */
.more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ink); }
.more .project { display: flex; flex-direction: column; gap: 18px; padding: 28px 24px 32px; border-right: 1px solid var(--rule); }
.more .project:first-child { padding-left: 0; }
.more .project:last-child { border-right: 0; padding-right: 0; }
.cover { position: relative; aspect-ratio: 4 / 5; background: var(--paper-2); overflow: hidden; display: grid; place-items: center; }
.cover .word { font-family: var(--display); font-size: clamp(64px, 8vw, 128px); line-height: .85; letter-spacing: -.04em; text-align: center; transition: transform 1.1s var(--ease); }
.cover .word em { color: var(--accent); }
.project:hover .cover .word { transform: scale(1.06); }
.cover .corner { position: absolute; left: 16px; bottom: 14px; right: 16px; display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cover.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 78% 50%; transition: transform 1.1s var(--ease); }
.project:hover .cover.photo img { transform: scale(1.045); }
.cover.ink { background: var(--ink); color: var(--paper); }
.cover.ink .corner { color: color-mix(in srgb, var(--paper) 65%, transparent); }
.cover.accent { background: var(--accent-fill); color: #121110; }
.cover.accent .word em { color: #fff8ef; }
.cover.accent .corner { color: rgba(18, 17, 16, .7); }
.more .num-sm { font-family: var(--display); font-size: clamp(56px, 6vw, 88px); line-height: .8; letter-spacing: -.03em; }
.more h3 { font-size: clamp(28px, 2.6vw, 38px); margin: 0 0 8px; }
.more .dek { font-size: 15.5px; margin: 0 0 12px; }
@media (max-width: 900px) {
  .more { grid-template-columns: 1fr; }
  .more .project { padding: 28px 0 36px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .more .project:last-child { border-bottom: 0; }
  .cover { aspect-ratio: 16 / 10; }
}

/* ---------- toolkit ---------- */
.toolkit { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.toolkit div { padding: 4px 24px 8px; border-left: 1px solid var(--rule); }
.toolkit div:first-child { border-left: 0; padding-left: 0; }
.toolkit h3 { font-family: var(--display); font-weight: 400; font-size: clamp(26px, 2.4vw, 34px); line-height: 1; margin: 0 0 14px; }
.toolkit p { margin: 0; color: var(--muted); font-size: 15.5px; }
@media (max-width: 900px) {
  .toolkit { grid-template-columns: 1fr 1fr; row-gap: 36px; }
  .toolkit div:nth-child(3) { border-left: 0; padding-left: 0; }
}
@media (max-width: 520px) {
  .toolkit { grid-template-columns: 1fr; }
  .toolkit div { border-left: 0; padding-left: 0; padding-right: 0; border-top: 1px solid var(--rule); padding-top: 20px; }
  .toolkit div:first-child { border-top: 0; padding-top: 4px; }
}

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto 1fr; gap: 24px; }
.about .copy { align-self: start; }
.about .lead { grid-column: 1 / span 7; font-family: var(--display); font-size: clamp(30px, 3.4vw, 48px); line-height: 1.08; letter-spacing: -.015em; margin: 0; }
.about .lead em { color: var(--accent); }
.about .copy { grid-column: 1 / span 7; color: var(--muted); }
.about .copy p { max-width: 60ch; margin: 0 0 14px; }
.about-side { grid-column: 9 / span 4; grid-row: 1 / span 2; display: grid; gap: 28px; align-content: start; }
.facts { margin: 0; border-top: 1px solid var(--ink); align-self: start; }
.facts div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
@media (max-width: 900px) {
  .about .lead, .about .copy, .about-side { grid-column: 1 / -1; grid-row: auto; }
}

/* ---------- contact ---------- */
.contact { padding-top: clamp(64px, 9vw, 140px); padding-bottom: clamp(48px, 6vw, 80px); }
.contact .big { display: block; font-family: var(--display); font-size: clamp(56px, 11vw, 176px); line-height: .88; letter-spacing: -.035em; margin: 18px 0 clamp(28px, 4vw, 48px); text-decoration: none; }
.contact .big em { color: var(--accent); }
.contact .rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.contact .rows a, .contact .rows button {
  appearance: none; background: none; border: 0; border-right: 1px solid var(--rule); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 20px 20px 20px 0; text-decoration: none; font-size: 17px; font-weight: 500; min-width: 0;
}
.contact .rows > * + * { padding-left: 20px !important; }
.contact .rows > *:last-child { border-right: 0; }
.contact .rows .v { overflow-wrap: anywhere; }
.contact .rows small { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.contact .rows a:hover .v, .contact .rows button:hover .v { text-decoration: underline; text-decoration-color: var(--accent-fill); text-underline-offset: 5px; text-decoration-thickness: 2px; }
@media (max-width: 820px) {
  .contact .rows { grid-template-columns: 1fr; }
  .contact .rows > * { border-right: 0 !important; border-bottom: 1px solid var(--rule) !important; padding-left: 0 !important; }
}

footer.colophon { border-top: 1px solid var(--rule); padding-top: 22px; padding-bottom: max(28px, env(safe-area-inset-bottom, 0px)); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

/* ---------- motion ---------- */
/* Only hide things when JS is running, so content is always visible without it. */
.js .hero h1 .line > span { transform: translateY(105%); }
.js .hero .issue, .js .hero .sub, .js .figures { opacity: 0; transform: translateY(14px); }
.js.loaded .hero h1 .line > span { transform: none; transition: transform 1.1s var(--ease); }
.js.loaded .hero h1 .line:nth-child(2) > span { transition-delay: .12s; }
.js .hero-photo img { clip-path: inset(100% 0 0 0); transform: scale(1.08); }
.js.loaded .hero-photo img { clip-path: inset(0 0 0 0); transform: none; transition: clip-path 1.2s var(--ease) .25s, transform 1.6s var(--ease) .25s; }
.js.loaded .hero .issue { opacity: 1; transform: none; transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js.loaded .hero .sub { opacity: 1; transform: none; transition: opacity .9s var(--ease) .45s, transform .9s var(--ease) .45s; }
.js.loaded .figures { opacity: 1; transform: none; transition: opacity .9s var(--ease) .65s, transform .9s var(--ease) .65s; }

.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; transition-delay: 0s !important; }
  .js .hero h1 .line > span, .js .hero .issue, .js .hero .sub, .js .figures, .js .reveal, .js .hero-photo img { opacity: 1 !important; transform: none !important; clip-path: none !important; }
}

/* =========================================================
   Case study pages
   ========================================================= */
.case-hero { padding-top: clamp(28px, 5vw, 64px); }
.case-hero .back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--muted); }
.case-hero .back:hover { color: var(--ink); }
.case-hero .issue { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: clamp(24px, 4vw, 48px); padding-bottom: 16px; border-bottom: 1px solid var(--ink); }
.case-hero h1 { font-family: var(--display); font-weight: 400; margin: clamp(16px, 3vw, 32px) 0 0; font-size: clamp(64px, 13vw, 210px); line-height: .86; letter-spacing: -.035em; text-wrap: balance; }
.case-hero h1.long { font-size: clamp(52px, 8.4vw, 136px); line-height: .9; }
.case-hero h1 em { color: var(--accent); }
.case-hero .dek { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; margin-top: clamp(22px, 3vw, 40px); }
.case-hero .dek p { grid-column: 1 / span 8; margin: 0; font-family: var(--display); font-size: clamp(24px, 2.8vw, 40px); line-height: 1.12; letter-spacing: -.01em; }
.case-hero .dek p em { color: var(--accent); }
.case-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: clamp(32px, 4vw, 56px) 0 0; border-top: 1px solid var(--rule); }
.case-facts div { padding: 16px 20px 18px 0; }
.case-facts div + div { border-left: 1px solid var(--rule); padding-left: 20px; }
.case-facts dt { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.case-facts dd { margin: 6px 0 0; font-size: 15.5px; line-height: 1.45; }
@media (max-width: 820px) {
  .case-hero .dek p { grid-column: 1 / -1; }
  .case-facts { grid-template-columns: 1fr 1fr; }
  .case-facts div:nth-child(3) { border-left: 0; padding-left: 0; }
  .case-facts div:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

.case-cover { margin-top: clamp(28px, 4vw, 48px); }
.case-cover .frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: var(--paper-2); }
.case-cover .frame img { width: 100%; height: 100%; object-fit: cover; }
.case-cover .cover { aspect-ratio: 16 / 7; }
.case-cover .cover .word { font-size: clamp(72px, 13vw, 200px); }
@media (max-width: 700px) { .case-cover .cover { aspect-ratio: 4 / 3; } }

/* chapters: label column + prose column */
.chapter { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; padding-top: clamp(56px, 8vw, 120px); }
.chapter > header { grid-column: 1 / span 4; }
.chapter > header .n { display: block; font-size: 12px; font-weight: 600; letter-spacing: .14em; color: var(--accent); margin-bottom: 10px; }
.chapter > header h2 { font-family: var(--display); font-weight: 400; margin: 0; font-size: clamp(40px, 5vw, 76px); line-height: .92; letter-spacing: -.025em; position: sticky; top: 84px; }
.chapter > .body { grid-column: 6 / -1; border-top: 1px solid var(--ink); padding-top: 22px; min-width: 0; }
.chapter > .body > :first-child { margin-top: 0; }
.prose p, .prose li { font-size: clamp(17px, 1.35vw, 19px); line-height: 1.65; }
.prose p { margin: 0 0 18px; max-width: 64ch; }
.prose ul, .prose ol { margin: 0 0 22px; padding-left: 1.2em; max-width: 64ch; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 600; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose h3 { font-family: var(--display); font-weight: 400; font-size: clamp(26px, 2.4vw, 34px); line-height: 1.05; margin: 34px 0 12px; }
.prose .note { font-size: 15px; color: var(--muted); border-left: 2px solid var(--accent-fill); padding-left: 14px; }
@media (max-width: 900px) {
  .chapter > header, .chapter > .body { grid-column: 1 / -1; }
  .chapter > header { margin-bottom: 18px; }
  .chapter > header h2 { position: static; }
}

.pull { font-family: var(--display); font-size: clamp(28px, 3.2vw, 46px); line-height: 1.08; letter-spacing: -.015em; margin: 30px 0; padding: 0; max-width: 24ch; }
.pull em { color: var(--accent); }

/* numbered process steps */
.prose .steps { list-style: none; padding: 0; margin: 0 0 22px; counter-reset: s; max-width: none; }
.prose .steps > li { counter-increment: s; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.prose .steps > li:first-child { padding-top: 4px; }
.prose .steps > li::before { content: counter(s, decimal-leading-zero); font-family: var(--display); font-size: 34px; line-height: 1; color: var(--accent); }
.steps b { display: block; font-weight: 600; margin-bottom: 4px; }
.prose .steps p { margin: 0; color: var(--muted); }

/* big stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 8px 0 28px; border-top: 1px solid var(--rule); }
.stats div { padding: 18px 18px 18px 0; border-bottom: 1px solid var(--rule); }
.stats b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(44px, 5vw, 72px); line-height: 1; letter-spacing: -.02em; }
.stats span { display: block; margin-top: 8px; font-size: 14.5px; color: var(--muted); line-height: 1.45; max-width: 28ch; }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 0 24px; }
.data { border-collapse: collapse; width: 100%; font-size: 15.5px; font-variant-numeric: tabular-nums; }
.data th, .data td { text-align: left; padding: 11px 14px 11px 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.data th { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--ink); }
.data tbody th { font-size: 15.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink); border-bottom-color: var(--rule); }
.data td.best { color: var(--accent); font-weight: 600; }

/* figures */
.fig { margin: 30px 0; }
.zoom { display: block; width: 100%; padding: 0; border: 1px solid var(--rule); background: var(--paper-2); cursor: zoom-in; overflow: hidden; }
.zoom img { width: 100%; transition: transform 1s var(--ease); }
.zoom:hover img { transform: scale(1.025); }
.fig figcaption { display: flex; gap: 12px; margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.fig figcaption b { color: var(--accent); font-weight: 600; white-space: nowrap; }

/* deck gallery */
.deck { padding-top: clamp(56px, 8vw, 120px); }
.deck-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--ink); margin-bottom: 22px; }
.deck-head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(36px, 4.4vw, 64px); line-height: .95; margin: 0; letter-spacing: -.02em; }
.deck-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.deck-grid .zoom { aspect-ratio: 16 / 9; }
.deck-grid .zoom img { height: 100%; object-fit: cover; object-position: top; }
@media (max-width: 900px) { .deck-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.downloads { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 0; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border: 1px solid var(--ink); border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14.5px; transition: background .25s, color .25s, border-color .25s; }
.pill:hover { background: var(--ink); color: var(--paper); }
.pill.solid { background: var(--ink); color: var(--paper); }
.pill.solid:hover { background: var(--accent-fill); border-color: var(--accent-fill); color: #121110; }

/* next project */
.next { display: block; margin-top: clamp(72px, 10vw, 150px); padding: clamp(28px, 4vw, 48px) 0 clamp(36px, 5vw, 64px); border-top: 1px solid var(--ink); text-decoration: none; }
.next .kicker { display: block; margin-bottom: 14px; }
.next b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(52px, 10vw, 160px); line-height: .88; letter-spacing: -.035em; }
.next b .u { background-image: linear-gradient(var(--accent-fill), var(--accent-fill)); background-size: 0% 4px; background-repeat: no-repeat; background-position: 0 92%; transition: background-size .6s var(--ease); }
.next:hover b .u, .next:focus-visible b .u { background-size: 100% 4px; }
.next .arrow { color: var(--accent); }

/* image viewer */
dialog.viewer { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; background: transparent; color: #f2ece2; }
dialog.viewer::backdrop { background: rgba(10, 9, 8, .94); }
.viewer .vf { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.viewer .vt { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.viewer .vt span { opacity: .8; }
.viewer .vs { display: grid; place-items: center; min-height: 0; }
.viewer .vs img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; }
.viewer .vn { display: flex; justify-content: center; gap: 10px; }
.viewer button { font: inherit; font-weight: 600; font-size: 14px; color: #f2ece2; background: transparent; border: 1px solid rgba(242, 236, 226, .35); border-radius: 999px; padding: 9px 18px; cursor: pointer; }
.viewer button:hover { background: rgba(242, 236, 226, .12); }
