/* ============================================================
   Slingshot Brand Guidelines — styles
   Built in the Slingshot system: Space Grotesk / Inter / JetBrains Mono,
   Carbon / Warm Stone / Signal Amber.
   ============================================================ */

:root {
  /* color */
  --carbon: #1C1C1E;
  --warm-stone: #F5F0EB;
  --white: #FFFFFF;
  --deep-gray: #3A3A3C;
  --amber: #D97706;
  --amber-dark-mode: #F59E0B;
  --dark-bg: #121214;
  --surface-1: #1C1C1E;
  --surface-2: #2C2C2E;
  --surface-3: #3A3A3C;

  /* hairlines */
  --rule-on-light: rgba(58, 58, 60, 0.12);
  --rule-on-dark: rgba(245, 240, 235, 0.10);

  /* type */
  --font-display: 'Space Grotesk', 'Avenir Next', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-normal: 200ms;
  --dur-reveal: 500ms;
  --stagger: 80ms;

  /* spacing (4px base) */
  --space-1: 4px;  --space-2: 8px;   --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px;  --space-7: 48px; --space-8: 64px;
  --space-9: 96px; --space-10: 128px; --space-11: 160px;

  --pad: 20px;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--carbon);
  background: var(--warm-stone);
}
img, video { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--font-display); text-wrap: balance; margin: 0 0 var(--space-5); }
h1 { font-size: clamp(2.25rem, 7.5vw, 3.063rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
h2 { font-size: clamp(1.953rem, 4vw, 2.441rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
h3 { font-size: clamp(1.563rem, 3vw, 1.953rem); font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
h4 { font-size: 1.563rem; font-weight: 600; line-height: 1.25; }
p { margin: 0 0 var(--space-4); }
ul, ol { margin: 0 0 var(--space-4); padding-left: 1.25em; }
em, i, cite, blockquote { font-style: normal; } /* no italics anywhere in the system */
code {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
  font-size: 0.875em;
  background: rgba(58, 58, 60, 0.07);
  padding: 1px 5px;
  border-radius: 2px;
}
a { color: var(--carbon); text-decoration-color: var(--amber); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.s-dark :focus-visible, .s-carbon :focus-visible, .dark-panel :focus-visible,
.carbon-band :focus-visible, .site-footer :focus-visible { outline-color: var(--amber-dark-mode); }

.measure { max-width: 68ch; }
.lede { font-size: 1.125rem; font-weight: 300; line-height: 1.6; max-width: 68ch; }

/* mono annotation voice */
.anno {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
  font-weight: 400;
  font-size: 0.688rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
}
.amber-on-light { color: var(--amber); }
.amber-on-dark { color: var(--amber-dark-mode); }
.muted { color: var(--deep-gray); }
.muted-dark { color: rgba(245, 240, 235, 0.55); }

/* skip link */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 300;
  background: var(--carbon); color: var(--warm-stone);
  font-family: var(--font-mono); font-size: 0.813rem; text-transform: uppercase;
  letter-spacing: 0.06em; text-decoration: none;
  padding: 12px 16px; border-radius: 2px;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- container + exposed structure ---------- */
.container {
  width: 100%;
  max-width: calc(1200px + 2 * var(--pad));
  margin-inline: auto;
  padding-inline: var(--pad);
  position: relative;
}
@media (min-width: 768px)  { :root { --pad: 40px; } }
@media (min-width: 1280px) { :root { --pad: 64px; } }

/* section rhythm */
section { --pt: 64px; --pb: 72px; padding: var(--pt) 0 var(--pb); position: relative; }
@media (min-width: 768px)  { section { --pt: 96px;  --pb: 104px; } }
@media (min-width: 1280px) { section { --pt: 128px; --pb: 144px; } }
.hero { padding: 0; }

/* surfaces */
.s-stone  { background: var(--warm-stone); color: var(--carbon); }
.s-white  { background: var(--white); color: var(--carbon); }
.s-carbon { background: var(--carbon); color: var(--warm-stone); }
.s-dark   { background: var(--dark-bg); color: var(--warm-stone); }

/* horizontal section rules */
section + section, .site-footer { border-top: 1px solid var(--rule-on-light); }
.s-carbon, .s-dark { border-top-color: var(--rule-on-dark) !important; }

/* exposed vertical hairlines + registration ticks (>=1024 only) */
@media (min-width: 1024px) {
  section > .container::before, section > .container::after,
  .dark-panel > .container::before, .dark-panel > .container::after,
  .carbon-band > .container::before, .carbon-band > .container::after {
    content: ''; position: absolute; top: calc(-1 * var(--pt, 0px)); bottom: calc(-1 * var(--pb, 0px));
    width: 1px; background: var(--rule-on-light); pointer-events: none;
  }
  section > .container::before { left: 0; }
  section > .container::after { right: 0; }
  .dark-panel > .container::before, .carbon-band > .container::before { left: 0; top: 0; bottom: 0; }
  .dark-panel > .container::after, .carbon-band > .container::after { right: 0; top: 0; bottom: 0; }
  .s-carbon > .container::before, .s-carbon > .container::after,
  .s-dark > .container::before, .s-dark > .container::after,
  .dark-panel > .container::before, .dark-panel > .container::after,
  .carbon-band > .container::before, .carbon-band > .container::after {
    background: var(--rule-on-dark);
  }
}
@media (min-width: 1360px) {
  .ticks i {
    position: absolute; width: 9px; height: 9px;
    top: calc(-1 * var(--pt) - 4px); pointer-events: none;
  }
  .ticks i:first-child { left: -4px; }
  .ticks i:last-child { right: -4px; }
  .ticks i::before, .ticks i::after { content: ''; position: absolute; background: rgba(58, 58, 60, 0.25); }
  .ticks i::before { left: 0; right: 0; top: 4px; height: 1px; }
  .ticks i::after { top: 0; bottom: 0; left: 4px; width: 1px; }
  .s-carbon .ticks i::before, .s-carbon .ticks i::after,
  .s-dark .ticks i::before, .s-dark .ticks i::after { background: rgba(245, 240, 235, 0.2); }
}
@media (max-width: 1359px) { .ticks { display: none; } }
.hero > .container::before, .hero > .container::after { display: none; }

/* meta row */
.meta-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--space-4); margin-bottom: var(--space-7);
}
.meta-row .anno:last-child { text-align: right; }
/* AA on Warm Stone: amber-as-text passes only >=1.25rem/600 (spec §3), so
   stone-section meta labels render Carbon with a 2px amber rule as the accent.
   Meta rows on White and dark surfaces keep their amber type. */
.s-stone .meta-row .amber-on-light {
  color: var(--carbon);
  border-bottom: 2px solid var(--amber);
  padding-bottom: 3px;
}
@media (max-width: 560px) { .meta-row .anno:last-child { display: none; } }

/* sub-block spacing */
.sub-block { margin-top: var(--space-9); }
@media (max-width: 767px) { .sub-block { margin-top: var(--space-8); } }

/* offset editorial head (sections 01 / 06) */
@media (min-width: 1280px) {
  .offset-head { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); align-items: start; }
  .offset-head h2 { margin-bottom: 0; }
}

/* ---------- sticky nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 240, 235, 0.92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(28, 28, 30, 0.08);
}
.nav-inner {
  max-width: calc(1200px + 2 * var(--pad));
  margin-inline: auto; padding-inline: var(--pad);
  height: 60px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-5);
}
.nav-brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; flex-shrink: 0; padding: 10px 0; }
.nav-brand img { height: 22px; width: auto; align-self: center; }
.nav-word { font-family: var(--font-display); font-weight: 600; font-size: 0.85rem; color: var(--carbon); }
.nav-suffix {
  font-family: var(--font-mono); font-variant-ligatures: none; font-weight: 400; font-size: 0.688rem;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--deep-gray);
}
.nav-links {
  display: flex; align-items: center; gap: var(--space-2);
  list-style: none; margin: 0; padding: 0;
}
.nav-links a {
  display: inline-block; padding: 14px 9px; white-space: nowrap;
  font-family: var(--font-mono); font-variant-ligatures: none; font-weight: 500; font-size: 0.688rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--deep-gray); text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast) var(--ease-out);
}
.nav-links a:hover { color: var(--amber); }
.nav-links a[aria-current="true"] { color: var(--amber); border-bottom-color: var(--amber); }
@media (max-width: 1279px) {
  .nav-inner { height: 52px; }
  .nav-inner nav { min-width: 0; flex: 1; }
  .nav-links {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; white-space: nowrap; justify-content: flex-start;
  }
  .nav-links::-webkit-scrollbar { display: none; }
}
@media (max-width: 480px) { .nav-suffix { display: none; } }
.progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--amber); transform: scaleX(0); transform-origin: left;
}

/* ---------- hero ---------- */
.hero {
  min-height: 100svh;
  background: radial-gradient(120% 90% at 70% 20%, #1C1C1E 0%, #121214 60%);
  display: flex; align-items: stretch;
}
.hero-inner { display: flex; align-items: center; min-height: 100svh; }
.hero-content { width: 100%; padding: 140px 0 120px; }
.hero-lockup { width: min(100%, 760px); height: auto; display: block; margin-bottom: var(--space-8); }
.hero-eyebrow { margin-bottom: var(--space-4); }
.hero h1 { color: var(--warm-stone); margin-bottom: var(--space-5); }
.hero .lede { color: rgba(245, 240, 235, 0.85); max-width: 55ch; }
.corner {
  position: absolute; z-index: 2;
  font-family: var(--font-mono); font-variant-ligatures: none; font-weight: 400; font-size: 0.688rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(245, 240, 235, 0.55); text-decoration: none;
}
.corner-tl { top: 84px; left: var(--pad); }
.corner-tr { top: 84px; right: var(--pad); text-align: right; }
.corner-bl { bottom: 28px; left: var(--pad); padding: 14px 0; }
.corner-br { bottom: 40px; right: var(--pad); text-align: right; }
a.scroll-cue { transition: color var(--dur-fast) var(--ease-out); }
a.scroll-cue:hover { color: var(--amber-dark-mode); }
@media (max-width: 767px) { .corner-tr, .corner-br { display: none; } .hero-content { padding: 120px 0 100px; } }

/* ---------- section 01: story ---------- */
.story-grid { margin-top: var(--space-7); }
@media (min-width: 1024px) {
  .story-grid { display: grid; grid-template-columns: 7fr 5fr; gap: var(--space-8); align-items: start; }
}
blockquote {
  margin: 0 0 var(--space-6);
  border-left: 2px solid var(--amber);
  padding-left: var(--space-5);
}
blockquote p { margin-bottom: var(--space-3); }
blockquote cite { display: block; color: var(--deep-gray); }

/* figure tiles */
.fig-tile { margin: var(--space-6) 0 0; }
.fig-img { border: 1px solid var(--rule-on-light); border-radius: 2px; overflow: hidden; }
.fig-img img { display: block; width: 100%; height: auto; }
.white-tile { background: var(--white); }
.fig-caption {
  display: flex; justify-content: space-between; gap: var(--space-4);
  padding-top: var(--space-3);
}
.fig-caption-solo { margin-top: var(--space-4); }

/* ---------- section 02: the mark ---------- */
.anatomy-grid { display: grid; gap: var(--space-7); }
@media (min-width: 1024px) { .anatomy-grid { grid-template-columns: 5fr 6fr; align-items: center; } }
.anatomy-grid .fig-tile { margin-top: 0; }
.anatomy-grid .fig-img img { padding: var(--space-6); }
.anatomy-list { list-style: none; padding: 0; margin: 0; counter-reset: anat; }
.anatomy-list li {
  counter-increment: anat;
  padding: var(--space-4) 0 var(--space-4) var(--space-7);
  border-bottom: 1px solid var(--rule-on-light);
  position: relative; max-width: 62ch;
}
.anatomy-list li::before {
  content: '0' counter(anat);
  position: absolute; left: 0; top: calc(var(--space-4) + 3px);
  font-family: var(--font-mono); font-variant-ligatures: none;
  font-size: 0.688rem; letter-spacing: 0.08em; color: var(--deep-gray);
}
.note { font-size: 0.813rem; color: var(--deep-gray); margin-top: var(--space-5); }

.variant-h { margin-top: var(--space-8); }

/* variant cards */
.card-grid { display: grid; gap: var(--space-5); margin-top: var(--space-5); }
.card-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.card-grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
@media (min-width: 1024px) {
  .card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}
.v-card { border: 1px solid var(--rule-on-light); border-radius: 2px; background: var(--white); display: flex; flex-direction: column; }
.v-display {
  display: grid; place-items: center; padding: var(--space-7);
  border-bottom: 1px solid var(--rule-on-light); border-radius: 2px 2px 0 0;
}
.v-display img { max-width: 70%; max-height: 60%; width: auto; height: auto; }
.ratio-wide { aspect-ratio: 4 / 3; }
.ratio-square { aspect-ratio: 1 / 1; }
.bg-white { background: var(--white); }
.bg-stone { background: var(--warm-stone); }
.bg-carbon { background: var(--carbon); }
.bg-carbon-match { background: #1C1C1E; } /* matches the baked ground of logo-mark-knockout.png */
.bg-deepgray { background: var(--deep-gray); }
.v-meta {
  display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4);
  padding: var(--space-4); min-height: 44px; flex: 1;
}
.v-name {
  display: block; font-family: var(--font-mono); font-variant-ligatures: none;
  font-weight: 500; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--carbon);
}
.v-ground {
  display: block; margin-top: var(--space-1);
  font-family: var(--font-body); font-size: 0.75rem; line-height: 1.45; color: var(--deep-gray);
}
.dl {
  font-family: var(--font-mono); font-variant-ligatures: none; font-weight: 500; font-size: 0.75rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--amber); text-decoration: none;
  padding: 12px 4px; margin: -12px 0; white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out);
}
.dl:hover { text-decoration: underline; }

/* full-bleed carbon band */
.carbon-band { background: var(--carbon); margin: var(--space-9) 0; padding: var(--space-9) 0; }
.band-lockup { display: block; width: min(100%, 720px); height: auto; margin: 0 auto; }
.band-note { display: block; text-align: center; margin-top: var(--space-6); color: rgba(245, 240, 235, 0.55); }

.reduced-copy p { font-size: 0.938rem; }
.decision-list { margin-top: var(--space-8); border: 1px solid var(--rule-on-light); border-radius: 2px; padding: var(--space-6); background: var(--white); max-width: 720px; }
.decision-title { display: block; margin-bottom: var(--space-4); }
.decision-list ol { margin: 0; padding-left: 1.4em; }
.decision-list li { padding: var(--space-2) 0; }

/* ---------- section 03: usage ---------- */
.plain-list { list-style: none; padding: 0; }
.plain-list li { padding: var(--space-3) 0; border-bottom: 1px solid var(--rule-on-light); }

/* clearspace figure — measured from main-id-positive.png:
   artwork inset 5.62% x / 22.14% y; X (x-height) = 9.99% of image width = 27.08% of image height */
.cs-figure { margin-top: var(--space-6); }
.cs-tile {
  background: var(--white); border: 1px solid var(--rule-on-light); border-radius: 2px;
  padding: var(--space-9) var(--space-8); display: grid; place-items: center;
}
@media (max-width: 767px) { .cs-tile { padding: var(--space-7) var(--space-5); } }
.cs-stage { position: relative; width: min(420px, 100%); }
.cs-stage img { position: relative; z-index: 2; width: 100%; height: auto; display: block; }
.cs-zone {
  position: absolute; z-index: 0;
  left: -4.37%; right: -4.37%; top: -4.94%; bottom: -4.94%;
  border: 1px dashed rgba(58, 58, 60, 0.4);
  background: repeating-linear-gradient(45deg, rgba(58, 58, 60, 0.06) 0 1px, transparent 1px 8px);
}
.cs-mask { position: absolute; z-index: 1; left: 5.62%; top: 22.14%; width: 88.76%; height: 55.72%; background: var(--white); }
.cs-dim { position: absolute; z-index: 3; background: var(--deep-gray); }
.cs-dim em {
  position: absolute; font-family: var(--font-mono); font-variant-ligatures: none;
  font-size: 0.688rem; letter-spacing: 0.08em; color: var(--deep-gray); text-transform: uppercase;
}
.cs-dim-top { left: 26%; top: -4.94%; width: 1px; height: 27.08%; }
.cs-dim-top::before, .cs-dim-top::after { content: ''; position: absolute; left: -3px; width: 7px; height: 1px; background: var(--deep-gray); }
.cs-dim-top::before { top: 0; } .cs-dim-top::after { bottom: 0; }
.cs-dim-top em { left: 8px; top: 50%; transform: translateY(-50%); }
.cs-dim-left { top: 49%; left: -4.37%; height: 1px; width: 9.99%; }
.cs-dim-left::before, .cs-dim-left::after { content: ''; position: absolute; top: -3px; height: 7px; width: 1px; background: var(--deep-gray); }
.cs-dim-left::before { left: 0; } .cs-dim-left::after { right: 0; }
.cs-dim-left em { left: 50%; top: -20px; transform: translateX(-50%); }
@media (max-width: 767px) { .cs-dim em { font-size: 0.625rem; } }

/* minimum-size figure */
.minsize-tile {
  background: var(--white); border: 1px solid var(--rule-on-light); border-radius: 2px;
  padding: var(--space-7); display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: flex-end;
}
.specimen { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.specimen img.fixed-size { max-width: none; flex: none; }
.dim-bracket { display: block; height: 1px; background: var(--deep-gray); position: relative; margin-top: var(--space-1); }
.dim-bracket::before, .dim-bracket::after { content: ''; position: absolute; top: -3px; height: 7px; width: 1px; background: var(--deep-gray); }
.dim-bracket::before { left: 0; } .dim-bracket::after { right: 0; }

/* backgrounds demo */
.bg-demo-grid { display: grid; gap: var(--space-5); margin-top: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.bg-demo { margin: 0; }
.bg-demo .v-display { border: 1px solid var(--rule-on-light); border-radius: 2px; }
.bg-demo figcaption { padding-top: var(--space-3); display: block; }
/* Dark quiet-field ground (Cosmic 140 disc interior), settled with an overlay
   so the mark sits in deep shadow — demonstrating the photography rule above */
.photo-tile {
  background:
    linear-gradient(rgba(18, 18, 20, 0.72), rgba(18, 18, 20, 0.72)),
    url('../assets/visual-language/ref-circular-mapping.jpg') center 45% / 150% no-repeat;
}
.photo-tile img.photo-mark { max-width: 30%; }

/* misuse grid */
.misuse-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin-bottom: var(--space-8); }
@media (max-width: 1023px) { .misuse-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 419px) { .misuse-grid { gap: var(--space-2); } }
.m-tile { margin: 0; }
.m-display {
  aspect-ratio: 1 / 1; display: grid; place-items: center; padding: var(--space-4);
  border: 1px solid var(--rule-on-light); border-radius: 2px; overflow: hidden;
}
.m-display img { max-width: 85%; height: auto; }
.mis-rotate { transform: rotate(24deg); }
.mis-stretch { transform: scaleX(1.4); }
.mis-recolor { filter: hue-rotate(160deg) saturate(1.4); }
.mis-shadow { filter: drop-shadow(4px 6px 5px rgba(28, 28, 30, 0.45)); }
.busy-ground { background: url('../assets/visual-language/ref-early-ancestor.jpg') center / cover no-repeat; }
.m-tile figcaption { display: flex; gap: var(--space-2); align-items: flex-start; padding: var(--space-3) 2px; }
.m-tile .anno { color: var(--deep-gray); }
.verdict { width: 16px; height: 16px; flex: none; margin-top: 1px; }

.never-list ol { columns: 2; column-gap: var(--space-8); padding-left: 1.3em; margin: 0; }
@media (max-width: 767px) { .never-list ol { columns: 1; } }
.never-list li { padding: var(--space-2) 0; break-inside: avoid; max-width: 55ch; }

/* ---------- section 04: color ---------- */
.token-table-wrap { margin: var(--space-7) 0 var(--space-8); }
.token-table { width: 100%; max-width: 720px; border-collapse: collapse; }
.token-table th {
  text-align: left; font-family: var(--font-mono); font-variant-ligatures: none; font-weight: 500;
  font-size: 0.688rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--deep-gray);
  padding: var(--space-2) var(--space-4) var(--space-2) 0; border-bottom: 1px solid var(--deep-gray);
}
.token-table td { padding: var(--space-3) var(--space-4) var(--space-3) 0; border-bottom: 1px solid var(--rule-on-light); font-size: 0.875rem; }
.token-table td:first-child { font-family: var(--font-display); font-weight: 600; font-size: 0.938rem; }
.token-table code { background: none; padding: 0; font-variant-numeric: tabular-nums; }

.swatch-bento { display: grid; grid-template-columns: 3fr 3fr 2fr 2fr 2fr; gap: var(--space-5); }
@media (max-width: 1023px) { .swatch-bento { grid-template-columns: 1fr 1fr; } }
@media (max-width: 559px) { .swatch-bento { grid-template-columns: 1fr; } }
.sw-card { display: flex; flex-direction: column; }
.sw-block { min-height: 160px; position: relative; border-radius: 2px 2px 0 0; }
@media (max-width: 767px) { .sw-block { min-height: 120px; } }
.sw-name { position: absolute; left: var(--space-4); bottom: var(--space-3); font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
.on-dark { color: var(--warm-stone); }
.on-light { color: var(--carbon); }
.sw-carbon { background: var(--carbon); }
.sw-stone { background: var(--warm-stone); }
.sw-amber { background: var(--amber); }
.sw-deepgray { background: var(--deep-gray); }
.sw-white { background: var(--white); }
.bordered { border: 1px solid var(--rule-on-light); }
.sw-data {
  background: var(--white); border: 1px solid var(--rule-on-light); border-top: none;
  border-radius: 0 0 2px 2px; padding: var(--space-4); flex: 1;
  display: flex; flex-direction: column; gap: 6px;
}
.mono-row { font-family: var(--font-mono); font-variant-ligatures: none; font-size: 0.813rem; font-variant-numeric: tabular-nums; }
.role-row { font-size: 0.813rem; color: var(--deep-gray); }
.chip {
  align-self: flex-start; font-family: var(--font-mono); font-variant-ligatures: none;
  font-size: 0.688rem; letter-spacing: 0.06em; padding: 3px 8px; border-radius: 2px; margin-top: 2px;
}
.chip-carbon { background: var(--carbon); color: var(--warm-stone); }
.chip-gray { background: var(--deep-gray); color: var(--white); }
.chip-amber { background: var(--white); color: var(--amber); border: 1px solid var(--rule-on-light); }
.sw-caption { font-size: 0.813rem; color: var(--deep-gray); margin: var(--space-2) 0 0; }

.ratio-figure { margin: var(--space-9) 0 0; }
.ratio-bar { display: flex; height: 48px; border: 1px solid rgba(58, 58, 60, 0.25); border-radius: 2px; overflow: hidden; }
.seg { display: block; }
.seg + .seg { border-left: 1px solid rgba(58, 58, 60, 0.35); }
.seg-stone { background: var(--warm-stone); }
.seg-carbon { background: var(--carbon); }
.seg-white { background: var(--white); }
.seg-amber { background: var(--amber); }
.ratio-labels { display: flex; margin-top: var(--space-2); }
.ratio-labels .anno { min-width: 0; }
.ratio-labels .anno::before { content: ''; display: block; width: 1px; height: 6px; background: var(--deep-gray); margin-bottom: 4px; }
@media (max-width: 639px) {
  .ratio-labels { flex-wrap: wrap; gap: var(--space-3) var(--space-5); }
  .ratio-labels .anno { flex: none !important; }
  .ratio-labels .anno::before { display: none; }
}

/* dark-mode panel */
.dark-panel { background: var(--dark-bg); color: var(--warm-stone); margin-top: var(--space-9); padding: var(--space-9) 0; }
.dark-panel code { background: rgba(245, 240, 235, 0.08); color: var(--warm-stone); }
.ladder { margin: var(--space-7) 0; max-width: 720px; }
.ladder-step { height: 72px; display: flex; align-items: center; padding-left: var(--space-4); border-radius: 2px; }
.ladder-step .anno { color: rgba(245, 240, 235, 0.8); }
.step-1 { background: var(--surface-1); }
.step-2 { background: var(--surface-2); margin-left: var(--space-7); }
.step-3 { background: var(--surface-3); margin-left: var(--space-9); }
@media (max-width: 559px) { .step-2 { margin-left: var(--space-5); } .step-3 { margin-left: var(--space-7); } }
.amber-pair { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.pair-chip { width: 48px; height: 48px; border-radius: 2px; flex: none; }
.pair-arrow { color: rgba(245, 240, 235, 0.55); }
.pair-note { color: rgba(245, 240, 235, 0.8); }

.contrast-list { list-style: none; padding: 0; max-width: 68ch; }
.contrast-list li { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--rule-on-light); }
.contrast-list .chip { margin: 0; flex: none; }

/* ---------- section 05: typography ---------- */
.specimen-block { border-top: 1px solid var(--rule-on-light); padding-top: var(--space-5); margin-top: var(--space-8); }
.spec-meta { margin-bottom: var(--space-6); }
.spec-meta .anno:first-child { color: var(--carbon); }
.spec-giant { font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: 1.05; margin-bottom: var(--space-6); letter-spacing: -0.02em; }
.font-display { font-family: var(--font-display); font-weight: 700; }
.font-body { font-family: var(--font-body); font-weight: 400; }
.font-mono { font-family: var(--font-mono); font-variant-ligatures: none; font-weight: 400; }
.spec-giant.font-mono { letter-spacing: 0; font-size: clamp(1.75rem, 4.5vw, 3.25rem); }
.spec-sample { margin-bottom: var(--space-4); }
.spec-xl { font-size: 1.563rem; font-weight: 600; line-height: 1.25; max-width: 30ch; }
.spec-data { display: flex; flex-direction: column; gap: var(--space-1); font-size: 0.875rem; margin-bottom: var(--space-4); font-variant-numeric: tabular-nums; }
.spec-role { font-size: 0.813rem; color: var(--deep-gray); max-width: 68ch; margin: 0; }

.ramp-layout { display: grid; gap: var(--space-8); }
@media (min-width: 1280px) { .ramp-layout { grid-template-columns: 7fr 5fr; align-items: start; } }
.ramp-table { border-top: 1px solid var(--deep-gray); }
.ramp-row {
  display: grid; grid-template-columns: 1.1fr 1fr 0.7fr 1.6fr; gap: var(--space-4);
  padding: var(--space-3) 0; border-bottom: 1px solid var(--rule-on-light);
  font-family: var(--font-mono); font-variant-ligatures: none; font-size: 0.813rem;
  font-variant-numeric: tabular-nums;
}
.ramp-head { font-weight: 500; font-size: 0.688rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--deep-gray); }
.ramp-row span:last-child { font-family: var(--font-body); color: var(--deep-gray); }
.ramp-head span:last-child { font-family: var(--font-mono); color: var(--deep-gray); }
@media (max-width: 767px) {
  .ramp-head { display: none; }
  .ramp-row { grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-4); padding: var(--space-4) 0; }
  .ramp-row span::before {
    content: attr(data-l); display: block;
    font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.08em; color: var(--deep-gray);
    margin-bottom: 2px;
  }
  .ramp-row span:empty { display: none; }
}
.ramp-render { display: none; }
@media (min-width: 1280px) {
  .ramp-render { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }
  .rr { display: block; line-height: 1.15; }
  .rr-display { font-family: var(--font-display); font-weight: 700; font-size: 3.063rem; letter-spacing: -0.02em; }
  .rr-3xl { font-family: var(--font-display); font-weight: 700; font-size: 2.441rem; letter-spacing: -0.02em; }
  .rr-2xl { font-family: var(--font-display); font-weight: 700; font-size: 1.953rem; letter-spacing: -0.01em; }
  .rr-xl { font-family: var(--font-display); font-weight: 600; font-size: 1.563rem; }
  .rr-lg { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
  .rr-base { font-size: 1rem; }
  .rr-sm { font-size: 0.813rem; }
  .rr-xs { font-size: 0.688rem; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }
  .rr-code { font-family: var(--font-mono); font-variant-ligatures: none; font-size: 0.875rem; }
}

.rules-grid { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4) var(--space-8); max-width: 980px; }
@media (max-width: 767px) { .rules-grid { grid-template-columns: 1fr; } }
.rules-grid li { display: flex; gap: var(--space-3); font-size: 0.875rem; align-items: flex-start; }
.tick-icon { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* ---------- section 06: visual language ---------- */
.s-carbon .lede { color: rgba(245, 240, 235, 0.85); }
.s-carbon code { background: rgba(245, 240, 235, 0.08); color: var(--warm-stone); }
.principles {
  list-style: none; padding: 0; counter-reset: pr;
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6) var(--space-8);
  margin: var(--space-8) 0 0;
}
@media (max-width: 767px) { .principles { grid-template-columns: 1fr; } }
.principles li {
  counter-increment: pr; position: relative;
  padding: var(--space-4) 0 var(--space-4) var(--space-7);
  border-top: 1px solid var(--rule-on-dark);
  color: rgba(245, 240, 235, 0.8); max-width: 58ch;
}
.principles li::before {
  content: '0' counter(pr);
  position: absolute; left: 0; top: calc(var(--space-4) + 3px);
  font-family: var(--font-mono); font-variant-ligatures: none;
  font-size: 0.688rem; letter-spacing: 0.08em; color: rgba(245, 240, 235, 0.5);
}
.principles strong { color: var(--warm-stone); }
.vl-copy { margin-top: var(--space-9); }
.vl-copy p { color: rgba(245, 240, 235, 0.8); }
.avoid-title { display: block; margin: var(--space-6) 0 var(--space-3); }
.avoid-list { list-style: none; padding: 0; }
.avoid-list li { padding: var(--space-2) 0; border-bottom: 1px solid var(--rule-on-dark); color: rgba(245, 240, 235, 0.8); max-width: 40ch; }

.masonry { columns: 3; column-gap: var(--space-4); margin-top: var(--space-9); }
@media (max-width: 1023px) { .masonry { columns: 2; } }
@media (max-width: 559px) { .masonry { columns: 1; } }
.g-tile { break-inside: avoid; margin: 0 0 var(--space-4); }
.g-tile img {
  width: 100%; display: block; border: 1px solid var(--rule-on-dark); border-radius: 2px;
  transition: transform var(--dur-normal) var(--ease-out), border-color var(--dur-normal) var(--ease-out);
}
.motion-ok .g-tile:hover img { transform: scale(1.015); border-color: rgba(245, 240, 235, 0.3); }
.g-tile figcaption { display: flex; flex-direction: column; gap: 4px; padding: var(--space-3) 2px var(--space-4); }
.g-cap { font-size: 0.813rem; line-height: 1.5; color: rgba(245, 240, 235, 0.72); }
.g-cap strong { color: var(--warm-stone); }

/* ---------- section 07: applications ---------- */
.app-grid { display: grid; gap: var(--space-6) var(--space-5); margin-top: var(--space-7); }
@media (min-width: 1024px) {
  .app-grid { grid-template-columns: repeat(12, 1fr); }
  .span-7 { grid-column: span 7; }
  .span-5 { grid-column: span 5; }
  .span-12 { grid-column: 1 / -1; }
  .offset-6 { grid-column: 6 / -1; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .app-grid { grid-template-columns: 1fr 1fr; }
  .span-12 { grid-column: 1 / -1; }
}
.app-tile { margin: 0; }
.app-img { border: 1px solid var(--rule-on-light); border-radius: 2px; overflow: hidden; transition: border-color var(--dur-normal) var(--ease-out); }
.app-tile:hover .app-img { border-color: rgba(58, 58, 60, 0.4); }
.app-img img { display: block; width: 100%; height: auto; }
.app-tile figcaption { display: flex; flex-direction: column; gap: 6px; padding-top: var(--space-3); }
.app-cap { font-size: 0.813rem; line-height: 1.55; color: var(--deep-gray); max-width: 68ch; }
.app-cap strong { color: var(--carbon); }

/* ---------- section 08: assets ---------- */
.s-dark h2, .s-dark h3 { color: var(--warm-stone); }
.s-dark .lede { color: rgba(245, 240, 235, 0.85); }
.s-dark code { background: rgba(245, 240, 235, 0.08); color: var(--warm-stone); }
.assets-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-6); flex-wrap: wrap; }
.assets-head .lede { margin-bottom: 0; }
.btn-primary {
  display: inline-block; flex: none;
  background: var(--amber-dark-mode); color: var(--carbon);
  font-family: var(--font-display); font-weight: 600; font-size: 0.875rem;
  padding: 14px 24px; border-radius: 2px; text-decoration: none;
  transition: background-color var(--dur-normal) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn-primary:hover { background: var(--amber); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(0.99); }
.dl-group { margin-top: var(--space-8); margin-bottom: var(--space-4); font-size: 1.25rem; }
.manifest { list-style: none; padding: 0; margin: 0; }
.manifest li {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto;
  gap: var(--space-4); align-items: center;
  padding: var(--space-3) var(--space-2); min-height: 56px;
  border-bottom: 1px solid var(--rule-on-dark);
  transition: background-color var(--dur-normal) var(--ease-out);
}
.manifest li:hover { background: var(--carbon); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.thumb { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 2px; flex: none; overflow: hidden; }
.thumb img { max-width: 40px; max-height: 36px; width: auto; height: auto; }
.thumb-stone { background: var(--warm-stone); }
.thumb-carbon { background: var(--surface-1); border: 1px solid var(--rule-on-dark); }
.m-name { min-width: 0; }
.m-name code { background: none; padding: 0; font-size: 0.813rem; color: var(--warm-stone); overflow-wrap: anywhere; }
.m-desc { display: block; font-size: 0.813rem; color: rgba(245, 240, 235, 0.64); }
.m-ground { color: rgba(245, 240, 235, 0.55); white-space: nowrap; }
.m-action {
  font-family: var(--font-mono); font-variant-ligatures: none; font-weight: 500; font-size: 0.813rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--amber-dark-mode); text-decoration: none;
  padding: 12px 8px; white-space: nowrap;
}
.m-action:hover { text-decoration: underline; }
@media (max-width: 639px) {
  .manifest li { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .m-ground { grid-column: 2; grid-row: 2; white-space: normal; }
  .manifest li { grid-auto-rows: auto; }
}
.closing-note { margin-top: var(--space-8); font-size: 0.875rem; color: rgba(245, 240, 235, 0.64); max-width: 68ch; }
.master-note { display: block; }

/* ---------- footer ---------- */
.site-footer { background: var(--dark-bg); border-top: 1px solid var(--rule-on-dark); padding: var(--space-9) 0 var(--space-8); }
.footer-inner { display: flex; align-items: center; gap: var(--space-6); flex-wrap: wrap; }
.footer-mark { height: 28px; width: auto; flex: none; }
.footer-meta { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 240px; }
.back-top { color: var(--amber-dark-mode); text-decoration: none; padding: 14px 8px; flex: none; }
.back-top:hover { text-decoration: underline; }

/* ---------- motion (opt-in via .motion-ok; visible by default for no-JS / reduced motion) ---------- */
.motion-ok .rv {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out);
  transition-delay: calc(min(var(--i, 0), 5) * var(--stagger));
}
.motion-ok .rv.is-visible { opacity: 1; transform: translateY(0); }
.motion-ok .hero .corner { animation: cornerFade 0.4s var(--ease-out) both; }
.motion-ok .hero .corner-tl { animation-delay: 0s; }
.motion-ok .hero .corner-tr { animation-delay: 0.1s; }
.motion-ok .hero .corner-bl { animation-delay: 0.2s; }
.motion-ok .hero .corner-br { animation-delay: 0.3s; }
@keyframes cornerFade { from { opacity: 0; } to { opacity: 1; } }

/* misuse transforms must survive the reveal transform */
.m-display img { transition: none; }

/* print sanity */
@media print {
  .nav, .progress, .skip-link { display: none; }
}
