:root {
  --bg: #ffffff;
  --card: #f6f6f6;
  --ink: #141414;
  --muted: #767676;
  --body: #3a3a38;
  --line: #e8e8e8;
  --chip: #ebebeb;
  --accent: #141414;
  --radius: 20px;
--measure: 680px; /* one reading width for every text block */
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Inter Tight", -apple-system, system-ui, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px);
}
.mono { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.back { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--card); font-size: 13px; transition: background .2s, color .2s; }
.back:hover { background: var(--ink); color: #fff; }
.bar-title { font-size: 13px; color: var(--muted); opacity: 0; transition: opacity .3s; }
.bar-title.show { opacity: 1; }
.bar .next { margin-left: auto; font-size: 13px; color: var(--muted); }
.bar .next:hover { color: var(--ink); }
.progress { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); width: 0; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* Hero */
.hero { background: var(--card); border-radius: 24px; padding: clamp(28px, 5vw, 56px); margin-top: 8px; }
.eyebrow { display: flex; gap: 6px; flex-wrap: wrap; }
.eyebrow span { background: var(--chip); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; color: #4a4a47; }
.hero h1 { font-size: clamp(38px, 6vw, 76px); font-weight: 500; letter-spacing: -.045em; line-height: 1; margin-top: 22px; }
.hero .lede { font-size: clamp(17px, 1.6vw, 21px); color: var(--body); max-width: 46ch; margin-top: 18px; line-height: 1.45; letter-spacing: -.01em; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.facts small { display: block; font-size: 12.5px; color: var(--muted); }
.facts b { font-weight: 500; font-size: 15px; }
.cover { margin-top: 10px; border-radius: 24px; overflow: hidden; background: var(--card); }

/* TL;DR */
.tldr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.tldr div { background: var(--card); border-radius: var(--radius); padding: 22px; }
.tldr small { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.tldr small::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.tldr p { font-size: 15px; color: var(--body); margin-top: 10px; line-height: 1.5; }
.tldr p strong { color: var(--ink); font-weight: 500; }

/* Body layout */
.layout { display: grid; grid-template-columns: 220px 1fr; gap: 56px; margin-top: 72px; }
.toc { position: sticky; top: 80px; align-self: start; }
.toc small { font-size: 12.5px; color: var(--muted); display: block; margin-bottom: 12px; }
.toc ol { list-style: none; display: grid; gap: 2px; }
.toc a { display: flex; gap: 10px; padding: 7px 12px; border-radius: 10px; font-size: 14px; color: var(--muted); transition: background .2s, color .2s; }
.toc a em { font-style: normal; font-variant-numeric: tabular-nums; opacity: .6; }
.toc a:hover { color: var(--ink); }
.toc a.on { background: var(--card); color: var(--ink); }
.toc a.on em { color: var(--accent); opacity: 1; }

section { scroll-margin-top: 80px; padding-bottom: 72px; }
.sec-num { font-size: 13px; color: var(--muted); font-weight: 500; }
section h2 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 500; letter-spacing: -.035em; line-height: 1.08; margin-top: 8px; max-width: var(--measure); }
section h3 { font-size: 19px; font-weight: 500; letter-spacing: -.015em; margin-top: 36px; }
section p { color: var(--body); margin-top: 14px; }
/* Rule: running text is capped to a reading width; every other block (cards, stats, media) spans the full column */
.prose, .impact > p { max-width: var(--measure); }

figure { margin-top: 28px; }
figure .media { border-radius: 16px; overflow: hidden; background: var(--card); }
figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 28px; }
.stat { background: var(--card); border-radius: 16px; padding: 20px; }
.stat b { display: block; font-size: 34px; font-weight: 500; letter-spacing: -.035em; line-height: 1; }
.stat span { display: block; font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.4; }

.callout { background: var(--card); border-radius: 16px; padding: 22px 24px; margin-top: 28px; border-left: 3px solid var(--accent); }
.callout p { margin-top: 0; color: var(--ink); }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
.compare div { background: var(--card); border-radius: 16px; padding: 20px; }
.compare small { font-size: 12.5px; color: var(--muted); }
.compare b { display: block; font-weight: 500; margin: 4px 0 6px; }
.compare p { font-size: 14px; margin: 0; }
.compare .no { opacity: .7; }
.compare .no b { text-decoration: line-through; text-decoration-color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.chips span { background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.chips span.new { background: var(--ink); color: #fff; }

/* Impact (dark) */
.impact { background: var(--ink); color: #fff; border-radius: 24px; padding: clamp(28px, 4vw, 44px); position: relative; overflow: hidden; }
.impact > * { position: relative; }
.impact .sec-num { color: rgba(255,255,255,.55); }
.impact h2 { color: #fff; }
.impact p { color: rgba(255,255,255,.72); }
.impact .stats { grid-template-columns: repeat(4, 1fr); }
.impact .stat { background: rgba(255,255,255,.07); }
.impact .stat span { color: rgba(255,255,255,.6); }
.impact figcaption { color: rgba(255,255,255,.5); }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; margin-top: 30px; max-width: 520px; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; font-size: 12px; color: rgba(255,255,255,.6); }
.bars i { display: block; width: 100%; border-radius: 6px 6px 2px 2px; background: rgba(255,255,255,.22); }
.bars div.peak i { background: #fff; }
.bars b { font-weight: 500; color: #fff; font-size: 12.5px; }

/* Next project */
.next-card { display: grid; grid-template-columns: 1fr 1.2fr; background: var(--card); border-radius: 24px; overflow: hidden; margin-top: clamp(72px, 10vw, 140px); transition: transform .3s; }
.next-card:hover { transform: translateY(-3px); }
.next-card .txt { padding: 32px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; }
.next-card small { font-size: 13px; color: var(--muted); }
.next-card h3 { font-size: clamp(28px, 3vw, 40px); font-weight: 500; letter-spacing: -.035em; line-height: 1.05; margin-top: 8px; }
.next-card .go { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; }
.next-card .go i { font-style: normal; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; transition: background .2s; }
.next-card:hover .go i { background: #3a3a38; }
.next-card .media { background: #ececec; padding: 28px 0 0 28px; display: flex; min-height: 280px; }
.next-card video { width: 100%; height: 100%; object-fit: cover; object-position: left top; border-radius: 12px 0 0 0; box-shadow: 0 6px 30px rgba(0,0,0,.08); }

footer { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 28px 0 40px; font-size: 13px; color: var(--muted); }
footer nav { display: flex; gap: 18px; }
footer a:hover { color: var(--ink); }

.draft-tag { position: fixed; right: 16px; bottom: 16px; z-index: 60; background: #fff3c4; color: #5c4a00; font-size: 12px; padding: 7px 12px; border-radius: 999px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 0; margin-top: 48px; }
  .toc { display: none; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .tldr { grid-template-columns: 1fr; }
  .impact .stats { grid-template-columns: repeat(2, 1fr); }
  .next-card { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .stats, .compare { grid-template-columns: 1fr; }
  .bar .next { display: none; }
  .bar-title { display: none; }
}

.stats.four { grid-template-columns: repeat(4, 1fr); }
.stat p { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.4; }
.impact .stat p { color: rgba(255,255,255,.6); }
.phase { display: inline-block; font-size: 12px; background: var(--card); border-radius: 999px; padding: 4px 10px; margin-top: 36px; color: var(--muted); }
.phase + h3 { margin-top: 10px; }
.phase.todo { border: 1px dashed #c9c7c1; background: transparent; }
@media (max-width: 900px) { .stats.four { grid-template-columns: repeat(2, 1fr); } }

.eyebrow span { background: #fff; }

/* "Grey is only for images".
   Loaded after case.css: text blocks lose their containers and become plain,
   separated by hairlines. Media keeps the #f6f6f6 box; Impact stays black. */

/* Top bar: one button style, everything else is a plain link */
.back { background: none; padding: 8px 4px; }
.back:hover { background: none; color: var(--muted); }

/* Hero: no box */
.hero { background: none; border-radius: 0; padding: clamp(32px, 6vw, 72px) 0 0; margin-top: 0; }
.eyebrow { gap: 0; }
.eyebrow span { background: none !important; padding: 0; font-size: 13px; color: var(--muted); }
.eyebrow span + span::before { content: "·"; margin: 0 8px; }
.facts { margin-top: 36px; }
.cover { margin-top: 36px; }

/* TL;DR: plain columns */
.tldr { gap: 32px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.tldr div { background: none; border-radius: 0; padding: 0; }
.tldr small::before { display: none; }

/* Stats: plain numbers on a hairline */
.stats { gap: 32px; }
.stat { background: none; border-radius: 0; padding: 18px 0 0; border-top: 1px solid var(--ink); }
.impact .stat { background: none; border-top-color: rgba(255,255,255,.35); }

/* Compare: plain two columns */
.compare { gap: 32px; }
.compare div { background: none; border-radius: 0; padding: 18px 0 0; border-top: 1px solid var(--ink); }
.compare .no { border-top-color: var(--line); }

/* Callout: pull quote, no box */
.callout { background: none; border-radius: 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--ink); }
.callout p { font-size: 19px; line-height: 1.45; letter-spacing: -.01em; }

/* Chips: outlined, not filled */
.chips span { background: none !important; border: 1px solid var(--line); }
.chips span.new { background: var(--ink) !important; border-color: var(--ink); }

/* Phases: plain labels */
.phase { background: none; padding: 0; border: 0 !important; }

/* Side index: active item without a pill */
.toc a { padding: 6px 0; }
.toc a.on { background: none; }

/* Next project: plain text + grey media box only */
.next-card { background: none; border-radius: 0; border-top: 1px solid var(--line); padding-top: 28px; gap: 32px; overflow: visible; }
.next-card:hover { transform: none; }
.next-card .txt { padding: 0; }
.next-card .media { border-radius: 16px; overflow: hidden; background: var(--card); }
.next-card .go i { width: auto; height: auto; background: none; color: var(--ink); font-size: 18px; }
.next-card:hover .go i { background: none; }
.next-card:hover h3 { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

/* Content from the live portfolio */
.facts { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
figure .media img { width: 100%; height: auto; }
figure.small .media { display: inline-block; background: none; border-radius: 0; }
figure.small .media img { width: auto; max-width: 100%; }
.stat b { font-size: 26px; letter-spacing: -.025em; line-height: 1.15; }
.stat span { margin-top: 8px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

/* Carousel (slideshows from the live site): swipe, arrows or keyboard */
.carousel { margin-top: 28px; }
.carousel .track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; outline: none; }
.carousel .track::-webkit-scrollbar { display: none; }
.carousel .slide { flex: 0 0 100%; margin: 0; scroll-snap-align: start; }
.carousel .ctrl { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: -24px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.carousel .ctrl button { font: inherit; font-size: 16px; color: var(--ink); background: none; border: 0; padding: 2px 4px; cursor: pointer; }
.carousel .ctrl button:disabled { color: #c8c8c8; cursor: default; }
.carousel .slide figcaption { padding-right: 110px; }
/* Wide content (carousels, fixed-size images) must never stretch the text column */
.layout > article { min-width: 0; }
figure.small .media { max-width: 100%; }
