/* =====================================================================
   Light Sizer: "Lamplight Blueprint" design system
   Luminous · precise · warm. Dark is the hero mode; light is a daylight studio.
   See DESIGN.md for the concept and section plan.
   ===================================================================== */

/* ---------- 0. Fonts (self-hosted: Geist, Geist Mono, Instrument Serif; SIL Open Font License) ---------- */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300 700;
  font-display: optional;
  src: url(fonts/geist-normal-300-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300 700;
  font-display: optional;
  src: url(fonts/geist-normal-300-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/geist-mono-normal-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/geist-mono-normal-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/geist-mono-normal-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/geist-mono-normal-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: optional;
  src: url(fonts/instrument-serif-italic-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: optional;
  src: url(fonts/instrument-serif-italic-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url(fonts/instrument-serif-normal-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url(fonts/instrument-serif-normal-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- 1. Tokens ---------- */
:root {
  /* Light mode: daylight studio */
  --bg: #F6F7F9;
  --bg-2: #EEF0F4;
  --surface: #FFFFFF;
  --surface-2: #F2F4F7;
  --glass: rgba(255, 255, 255, .72);
  --line: rgba(13, 17, 23, .09);
  --line-strong: rgba(13, 17, 23, .18);
  --text: #0D1117;
  --text-2: #4A5462;
  --text-3: #5F6976;
  --amber: #A0560A;
  --ember: #E2531F;
  --cyan: #1A5FD0;
  --warn: #B4381F;
  --warn-bg: rgba(180, 56, 31, .08);
  --ok: #1F7446;
  --on-amber: #1A1206;
  --glow: rgba(255, 166, 60, .22);
  --glow-strong: rgba(255, 150, 40, .38);
  --grid-line: rgba(31, 111, 235, .07);
  --wood: #D9CBB8;
  --glass-fill: #DCE8EF;
  --noise-opacity: .035;
  --shadow-1: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 1px 2px rgba(13, 17, 23, .06);
  --shadow-2: 0 12px 32px -16px rgba(13, 17, 23, .18), 0 2px 6px -2px rgba(13, 17, 23, .06);
  --shadow-3: 0 40px 90px -40px rgba(13, 17, 23, .35), 0 12px 24px -12px rgba(13, 17, 23, .12);
  --ring-lit: 0 0 0 1px rgba(194, 104, 10, .45), 0 0 0 4px rgba(255, 166, 60, .18), 0 12px 40px -12px rgba(255, 140, 30, .45);
  --blob-1: rgba(255, 170, 70, .35);
  --blob-2: rgba(255, 110, 60, .22);
  --blob-3: rgba(90, 100, 230, .16);

  /* Shared gradients */
  --grad-filament: linear-gradient(100deg, #FFC86B 0%, #F29A2E 45%, #E2531F 100%);
  --grad-text: linear-gradient(100deg, #C2650C 0%, #D04A1A 100%);

  /* Type */
  --font-display: "Geist", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-body: "Geist", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --fs-display: clamp(2.9rem, 7vw, 6rem);
  --fs-h1: clamp(2.4rem, 5vw, 4.25rem);
  --fs-h2: clamp(1.9rem, 3.4vw, 3rem);
  --fs-h3: 1.3rem;
  --fs-lead: clamp(1.08rem, 1.5vw, 1.3rem);
  --fs-small: .875rem;
  --fs-micro: .72rem;

  /* Space, radius, motion */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;
  --section: clamp(88px, 12vw, 168px);
  --r-xs: 6px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --t-fast: 160ms; --t-base: 320ms; --t-slow: 700ms;
  --header-h: 72px;

  /* Aliases used by the calculators and drawings (kept for compatibility) */
  --ink: var(--text);
  --muted: var(--text-2);
  --rule: var(--line-strong);
  --grid: var(--line);
  --brass: var(--amber);
  --brass-soft: rgba(255, 166, 60, .16);
  --sheet: var(--surface);
  --paper: var(--surface-2);
  --focus: var(--cyan);
  --warn-soft: var(--warn-bg);
  --display: var(--font-display);
  --body: var(--font-body);
  --mono: var(--font-mono);
  color-scheme: light;
}

/* Dark mode: night studio. Tuned on its own, not inverted. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0C10; --bg-2: #0E1117; --surface: #12161E; --surface-2: #181D27;
    --glass: rgba(18, 22, 30, .66);
    --line: rgba(255, 255, 255, .08); --line-strong: rgba(255, 255, 255, .16);
    --text: #ECEFF4; --text-2: #A6AFBD; --text-3: #8590A0;
    --amber: #FFB547; --ember: #FF7A3D; --cyan: #7CC7FF; --warn: #FF8F7A; --warn-bg: rgba(255, 143, 122, .1); --ok: #6FD3A0;
    --glow: rgba(255, 181, 71, .16); --glow-strong: rgba(255, 170, 60, .32);
    --grid-line: rgba(124, 199, 255, .055);
    --wood: #3A3128; --glass-fill: #1C2A35; --noise-opacity: .05;
    --shadow-1: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 18px 40px -20px rgba(0, 0, 0, .7), 0 2px 6px -2px rgba(0, 0, 0, .4);
    --shadow-3: 0 50px 120px -40px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .05);
    --ring-lit: 0 0 0 1px rgba(255, 181, 71, .5), 0 0 0 4px rgba(255, 181, 71, .12), 0 16px 50px -12px rgba(255, 160, 50, .45);
    --blob-1: rgba(255, 170, 60, .22); --blob-2: rgba(255, 110, 60, .14); --blob-3: rgba(75, 79, 216, .22);
    --brass-soft: rgba(255, 181, 71, .14);
    --grad-text: linear-gradient(100deg, #FFD58A 0%, #FFB547 40%, #FF7A3D 100%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0C10; --bg-2: #0E1117; --surface: #12161E; --surface-2: #181D27;
  --glass: rgba(18, 22, 30, .66);
  --line: rgba(255, 255, 255, .08); --line-strong: rgba(255, 255, 255, .16);
  --text: #ECEFF4; --text-2: #A6AFBD; --text-3: #8590A0;
  --amber: #FFB547; --ember: #FF7A3D; --cyan: #7CC7FF; --warn: #FF8F7A; --warn-bg: rgba(255, 143, 122, .1); --ok: #6FD3A0;
  --glow: rgba(255, 181, 71, .16); --glow-strong: rgba(255, 170, 60, .32);
  --grid-line: rgba(124, 199, 255, .055);
  --wood: #3A3128; --glass-fill: #1C2A35; --noise-opacity: .05;
  --shadow-1: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 18px 40px -20px rgba(0, 0, 0, .7), 0 2px 6px -2px rgba(0, 0, 0, .4);
  --shadow-3: 0 50px 120px -40px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .05);
  --ring-lit: 0 0 0 1px rgba(255, 181, 71, .5), 0 0 0 4px rgba(255, 181, 71, .12), 0 16px 50px -12px rgba(255, 160, 50, .45);
  --blob-1: rgba(255, 170, 60, .22); --blob-2: rgba(255, 110, 60, .14); --blob-3: rgba(75, 79, 216, .22);
  --brass-soft: rgba(255, 181, 71, .14);
  --grad-text: linear-gradient(100deg, #FFD58A 0%, #FFB547 40%, #FF7A3D 100%);
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1rem/1.65 var(--font-body); font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
  transition: background-color var(--t-base) var(--ease-in-out), color var(--t-base) var(--ease-in-out);
}
/* Film grain over everything */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg, canvas { max-width: 100%; }
::selection { background: var(--amber); color: var(--on-amber); }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; color: var(--text); }
h1 { font-size: var(--fs-h1); font-weight: 600; letter-spacing: -.045em; line-height: 1.02; }
h2 { font-size: var(--fs-h2); font-weight: 600; letter-spacing: -.035em; line-height: 1.08; }
h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
b, strong { font-weight: 600; color: var(--text); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

/* Animated underline for links inside text */
.guide a, .lede a, .quick a, .callout a, .faq a, .embed-credit a, .site-footer p a, .principles a, .findings + .guide a {
  color: var(--text); background: linear-gradient(var(--amber), var(--amber)) 0 100% / 100% 1px no-repeat;
  transition: background-size var(--t-base) var(--ease-out), color var(--t-fast);
}
.guide a:hover, .lede a:hover, .quick a:hover, .callout a:hover, .faq a:hover {
  color: var(--amber); background-size: 100% 2px;
}

.container {
  width: 100%; max-width: 1240px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Text helpers */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; font: 500 var(--fs-micro)/1 var(--font-mono);
  letter-spacing: .14em; text-transform: uppercase; color: var(--text-2);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--grad-filament); box-shadow: 0 0 10px var(--amber); }
.hl {
  font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .06em;
}
.lede { color: var(--text-2); font-size: var(--fs-lead); line-height: 1.55; max-width: 60ch; }
.mono { font-family: var(--font-mono); }

/* ---------- 3. Buttons, chips, fields ---------- */
.btn, .btn-ghost {
  --mx: 0px; --my: 0px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 .95rem/1 var(--font-body); letter-spacing: -.01em; padding: 14px 22px; border-radius: var(--r-md);
  cursor: pointer; overflow: hidden; isolation: isolate; white-space: nowrap;
  transform: translate(var(--mx), var(--my));
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out), background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn { border: 0; color: var(--on-amber); background: var(--grad-filament); box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 10px 30px -10px var(--glow-strong); }
.btn::after { /* shine sweep */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0s;
}
.btn:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 16px 44px -10px var(--glow-strong); }
.btn:hover::after { transform: translateX(120%); transition: transform .9s var(--ease-out); }
.btn:active { transform: translate(var(--mx), var(--my)) scale(.97); }
.btn:disabled, .btn[aria-disabled="true"] { filter: grayscale(.8); opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-ghost { color: var(--text); background: var(--glass); border: 1px solid var(--line-strong); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn-ghost:hover { border-color: var(--amber); box-shadow: 0 0 0 4px var(--brass-soft); }
.btn-ghost:active { transform: translate(var(--mx), var(--my)) scale(.97); }
.btn .arrow { transition: transform var(--t-base) var(--ease-out); }
.btn:hover .arrow, .btn-ghost:hover .arrow { transform: translateX(4px); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font: 500 .72rem/1 var(--font-mono); letter-spacing: .02em;
  color: var(--text-2); padding: 6px 10px; border-radius: var(--r-xs); border: 1px solid var(--line); background: var(--surface-2);
}
.chip.lit { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); background: var(--brass-soft); }

/* ---------- 4. Header and mobile menu ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; padding-top: env(safe-area-inset-top, 0px);
  transition: background-color var(--t-base) var(--ease-out), border-color var(--t-base), backdrop-filter var(--t-base);
  border-bottom: 1px solid transparent;
}
.site-header .container { display: flex; align-items: center; gap: 20px; height: var(--header-h); transition: height var(--t-base) var(--ease-out); }
.site-header.is-scrolled { background: var(--glass); border-bottom-color: var(--line); backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%); }
.site-header.is-scrolled .container { height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 650 1.1rem/1 var(--font-display); letter-spacing: -.03em; color: var(--text); margin-right: auto; }
.brand svg { width: 26px; height: 26px; filter: drop-shadow(0 0 8px var(--glow-strong)); transition: transform var(--t-slow) var(--ease-out); }
.brand:hover svg { transform: rotate(-12deg); }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  position: relative; font-size: .9rem; font-weight: 500; color: var(--text-2); padding: 8px 12px; border-radius: var(--r-sm);
  transition: color var(--t-fast);
}
.site-nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 1.5px; border-radius: 2px; background: var(--grad-filament);
  transform: scaleX(0); transform-origin: right; transition: transform var(--t-base) var(--ease-out);
}
.site-nav a:hover { color: var(--text); }
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[href$="#calculators"] {
  margin-left: 8px; color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 8px 16px; background: var(--glass);
}
.site-nav a[href$="#calculators"]::after { display: none; }
.site-nav a[href$="#calculators"]:hover { border-color: var(--amber); box-shadow: 0 0 0 4px var(--brass-soft); }
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--glass); color: var(--text); cursor: pointer; transition: border-color var(--t-fast), transform var(--t-fast);
}
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn:active { transform: scale(.94); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .sun, .theme-toggle .moon { transition: transform var(--t-slow) var(--ease-out), opacity var(--t-base); transform-origin: center; }
:root[data-theme="dark"] .theme-toggle .sun, :root:not([data-theme]) .theme-toggle .sun { opacity: 0; transform: rotate(-90deg) scale(.5); }
:root[data-theme="light"] .theme-toggle .moon { opacity: 0; transform: rotate(90deg) scale(.5); }
@media (prefers-color-scheme: light) { :root:not([data-theme]) .theme-toggle .sun { opacity: 1; transform: none; } :root:not([data-theme]) .theme-toggle .moon { opacity: 0; transform: rotate(90deg) scale(.5); } }
.menu-toggle { display: none; }
.menu-toggle span { position: absolute; width: 18px; height: 1.5px; background: currentColor; border-radius: 2px; transition: transform var(--t-base) var(--ease-out); }
.menu-toggle span:first-child { transform: translateY(-4px); }
.menu-toggle span:last-child { transform: translateY(4px); }
.menu-toggle[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }
.mobile-menu {
  position: fixed; inset: 0; z-index: 45; padding: calc(var(--header-h) + 24px + env(safe-area-inset-top, 0px)) 24px 32px;
  background: var(--bg); display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
  clip-path: circle(0 at calc(100% - 44px) 36px); visibility: hidden;
  transition: clip-path .7s var(--ease-in-out), visibility 0s .7s;
}
.mobile-menu::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 40% at 90% 0%, var(--blob-1), transparent 70%), radial-gradient(50% 40% at 0% 100%, var(--blob-3), transparent 70%); }
.menu-open .mobile-menu { clip-path: circle(150% at calc(100% - 44px) 36px); visibility: visible; transition: clip-path .7s var(--ease-in-out), visibility 0s; }
.mobile-menu a {
  font: 600 clamp(1.7rem, 8vw, 2.4rem)/1.15 var(--font-display); letter-spacing: -.035em; color: var(--text); padding: 6px 0;
  opacity: 0; transform: translateY(18px); transition: opacity .5s var(--ease-out), transform .6s var(--ease-out);
  transition-delay: calc(.12s + var(--i, 0) * 50ms);
}
.mobile-menu a[aria-current="page"] { color: var(--amber); }
.menu-open .mobile-menu a { opacity: 1; transform: none; }
.mobile-menu .mm-label { font: 500 var(--fs-micro) var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-top: 20px; }
.menu-open { overflow: hidden; }
@media (max-width: 900px) {
  .site-nav { display: none; }
  .menu-toggle { display: inline-grid; position: relative; }
}
@media (min-width: 901px) { .mobile-menu { display: none; } }

/* ---------- 5. Page backgrounds: mesh, grid, lamp cursor ---------- */
.mesh { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.mesh i { position: absolute; width: 56vmax; height: 56vmax; border-radius: 50%; filter: blur(70px); opacity: .9; animation: drift 26s var(--ease-in-out) infinite alternate; }
.mesh i:nth-child(1) { background: var(--blob-1); top: -30vmax; right: -12vmax; }
.mesh i:nth-child(2) { background: var(--blob-2); top: -8vmax; right: 18vmax; width: 34vmax; height: 34vmax; animation-duration: 32s; animation-delay: -8s; }
.mesh i:nth-child(3) { background: var(--blob-3); top: -24vmax; left: -18vmax; animation-duration: 38s; animation-delay: -14s; }
@keyframes drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-4vmax, 3vmax, 0) scale(1.08); } 100% { transform: translate3d(3vmax, -2vmax, 0) scale(.95); } }
.blueprint {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px; -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
}
.lamp-cursor {
  position: fixed; left: 0; top: 0; z-index: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--glow) 0%, transparent 62%); opacity: 0; transition: opacity .6s, width .4s var(--ease-out), height .4s var(--ease-out), margin .4s var(--ease-out);
  will-change: transform;
}
.lamp-cursor.on { opacity: 1; }
.lamp-cursor.hot { width: 640px; height: 640px; margin: -320px 0 0 -320px; }

/* ---------- 6. Layout shell ---------- */
main { position: relative; z-index: 1; display: flex; flex-direction: column; gap: clamp(48px, 6vw, 80px); padding-block: 24px var(--section); }
.home main { gap: 0; padding-top: 0; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; font: 500 .78rem var(--font-mono); color: var(--text-3); }
.crumbs li + li::before { content: "/"; margin-right: 8px; opacity: .6; }
.crumbs a { color: var(--text-2); transition: color var(--t-fast); }
.crumbs a:hover { color: var(--amber); }

/* Page head on inner pages */
.page-head { position: relative; isolation: isolate; display: flex; flex-direction: column; gap: 18px; max-width: 900px; padding-block: clamp(24px, 5vw, 56px) 8px; }
.page-head::before { /* dusk glow behind the title */
  content: ""; position: absolute; z-index: -1; inset: -120px -40vw -60px -20vw; pointer-events: none;
  background: radial-gradient(40% 55% at 70% 20%, var(--blob-1), transparent 70%), radial-gradient(35% 50% at 15% 10%, var(--blob-3), transparent 70%);
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
}
.page-head::after {
  content: ""; position: absolute; z-index: -1; inset: -120px -40vw 0 -20vw; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 40% 30%, #000 20%, transparent 70%); mask-image: radial-gradient(ellipse 60% 70% at 40% 30%, #000 20%, transparent 70%);
}
.page-head h1 { max-width: 18ch; }
.article-meta { font: 500 .8rem var(--font-mono); color: var(--text-3); }
.quick {
  position: relative; max-width: 72ch; padding: 20px 22px 20px 58px; border-radius: var(--r-lg); color: var(--text-2);
  background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.quick::before { /* lit lamp icon */
  content: ""; position: absolute; left: 20px; top: 21px; width: 22px; height: 22px; background: var(--grad-filament);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M12 2v5M5 14a7 7 0 0 1 14 0z'/%3E%3Cpath d='M9 18a3 3 0 0 0 6 0'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M12 2v5M5 14a7 7 0 0 1 14 0z'/%3E%3Cpath d='M9 18a3 3 0 0 0 6 0'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 6px var(--amber));
}
.quick::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(120deg, color-mix(in srgb, var(--amber) 70%, transparent), transparent 40%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.quick b { color: var(--text); }

/* ---------- 7. Calculator UI ---------- */
.tool { display: flex; flex-direction: column; gap: 16px; }
.tool-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.example { font: 500 var(--fs-micro) var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.units { position: relative; display: inline-flex; padding: 4px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface-2); isolation: isolate; }
.units::before { content: ""; position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-2), 0 0 0 1px var(--line); transition: transform var(--t-base) var(--ease-out); }
.units:has(button[data-unit="cm"][aria-pressed="true"])::before { transform: translateX(100%); }
.units button { font: 500 .8rem var(--font-mono); border: 0; background: none; color: var(--text-3); padding: 8px 16px; min-width: 76px; cursor: pointer; border-radius: var(--r-pill); transition: color var(--t-fast); }
.units button[aria-pressed="true"] { color: var(--text); }
.layout { display: grid; grid-template-columns: minmax(260px, 330px) 1fr; gap: 20px; align-items: start; }
.layout > * { min-width: 0; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }
.inputs {
  position: sticky; top: calc(var(--header-h) + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-2);
}
@media (max-width: 860px) { .inputs { position: static; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .8rem; font-weight: 500; color: var(--text-2); }
.ctl {
  display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface-2);
  transition: border-color var(--t-fast), box-shadow var(--t-base) var(--ease-out), background-color var(--t-fast);
}
.ctl:hover { border-color: color-mix(in srgb, var(--amber) 45%, var(--line-strong)); }
.ctl:focus-within { border-color: var(--amber); box-shadow: 0 0 0 4px var(--brass-soft); background: var(--surface); }
.ctl:has(:disabled) { opacity: .5; }
.ctl input, .ctl select { font: 500 1rem var(--font-mono); border: 0; background: none; color: var(--text); padding: 11px 12px; width: 100%; min-width: 0; outline: none; }
.ctl select { font-family: var(--font-body); cursor: pointer; }
.ctl .u { font: .8rem var(--font-mono); color: var(--text-3); padding-right: 12px; }
.hint { font-size: .76rem; color: var(--text-3); line-height: 1.45; }
.out { display: flex; flex-direction: column; gap: 16px; }
.drawing, .fig {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-2); margin: 0;
}
.drawing::before, .fig::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .8;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 20px 20px;
}
.cap { position: relative; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); font: 500 .7rem var(--font-mono); color: var(--text-3); text-transform: uppercase; letter-spacing: .12em; }
.capR::before { content: "● "; color: var(--ok); }
.capR:empty::before { content: none; }
.views { position: relative; display: grid; grid-template-columns: 1.6fr 1fr; }
.views.single { grid-template-columns: 1fr; }
.views > .view + .view { border-left: 1px solid var(--line); }
@media (max-width: 620px) { .views { grid-template-columns: 1fr; } .views > .view + .view { border-left: 0; border-top: 1px solid var(--line); } }
.view svg { display: block; width: 100%; height: auto; }
.vlabel { font: 500 .68rem var(--font-mono); color: var(--text-3); text-transform: uppercase; letter-spacing: .12em; padding: 10px 14px 0; }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 12px; }
.spec {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow-1); transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base);
}
.spec:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.spec .k { font: 500 .68rem var(--font-mono); color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; }
.spec .v { font: 500 1.55rem/1.15 var(--font-mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--text); }
.spec .n { font-size: .82rem; color: var(--text-2); line-height: 1.45; }
.spec.key { border-color: color-mix(in srgb, var(--amber) 35%, var(--line)); box-shadow: var(--shadow-1), 0 16px 40px -24px var(--glow-strong); }
.spec.key::before { content: ""; position: absolute; left: 14px; right: 14px; top: -1px; height: 2px; border-radius: 2px; background: var(--grad-filament); box-shadow: 0 0 14px var(--amber); }
.spec.key .v { color: var(--amber); }
.notes { display: flex; flex-direction: column; gap: 10px; }
.note {
  position: relative; font-size: .92rem; padding: 14px 16px 14px 46px; border-radius: var(--r-md); color: var(--text-2);
  background: var(--surface); border: 1px solid var(--line);
}
.note::before { content: ""; position: absolute; left: 16px; top: 15px; width: 18px; height: 18px; border-radius: 50%; background: var(--brass-soft); box-shadow: inset 0 0 0 1.5px var(--amber); }
.note::after { content: "i"; position: absolute; left: 16px; top: 15px; width: 18px; text-align: center; font: 600 .7rem/18px var(--font-mono); color: var(--amber); }
.note.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--text); }
.note.warn::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--warn); }
.note.warn::after { content: "!"; color: var(--warn); }
.marks { font: .88rem var(--font-mono); display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; color: var(--text); }
.copyrow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.status { font-size: .86rem; color: var(--ok); }
.copy-fallback, .embed-box textarea {
  width: 100%; min-height: 130px; font: .8rem/1.55 var(--font-mono); padding: 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); resize: vertical;
}
noscript p { padding: 14px 16px; background: var(--warn-bg); border-radius: var(--r-md); }

/* ---------- 8. Article content ---------- */
.guide { display: flex; flex-direction: column; gap: 18px; max-width: 72ch; color: var(--text-2); font-size: 1.04rem; }
.guide > p:first-child { font-size: var(--fs-lead); color: var(--text); line-height: 1.55; }
.guide h2 { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); position: relative; }
.guide h2::before { content: ""; position: absolute; top: -1px; left: 0; width: 56px; height: 1px; background: var(--grad-filament); box-shadow: 0 0 12px var(--amber); }
.guide h3 { margin-top: 10px; }
.guide ul, .guide ol { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.guide ul > li { position: relative; padding-left: 22px; }
.guide ul > li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.guide ol { counter-reset: step; }
.guide ol > li { counter-increment: step; position: relative; padding-left: 38px; }
.guide ol > li::before { content: counter(step); position: absolute; left: 0; top: .1em; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; font: 600 .72rem var(--font-mono); color: var(--amber); background: var(--brass-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 35%, transparent); }
.guide .example-calc {
  font: .92rem/1.6 var(--font-mono); color: var(--text); padding: 18px 20px; border-radius: var(--r-md); border: 1px dashed color-mix(in srgb, var(--cyan) 45%, transparent);
  background-color: var(--surface); background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 16px 16px;
}
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font: 500 .68rem var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); background: var(--surface-2); }
td { font-variant-numeric: tabular-nums; color: var(--text); transition: background-color var(--t-fast); }
td:last-child:not(:first-child) { white-space: normal; min-width: 16ch; }
tr:hover td { background: var(--brass-soft); }
tr:last-child td { border-bottom: 0; }
caption { caption-side: bottom; text-align: left; padding: 10px 16px; font-size: .8rem; color: var(--text-3); }
.callout {
  position: relative; border-radius: var(--r-lg); padding: 22px 24px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2);
  background: linear-gradient(135deg, var(--brass-soft), transparent 60%), var(--surface); border: 1px solid color-mix(in srgb, var(--amber) 30%, var(--line));
}
.callout h3 { font-size: 1.05rem; }
.toc { border-radius: var(--r-lg); padding: 18px 22px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); }
.toc b { font: 500 var(--fs-micro) var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.toc ol { counter-reset: none; gap: 4px; }
.toc ol > li { padding-left: 0; counter-increment: none; }
.toc ol > li::before { content: none; }
.toc a { background: none; color: var(--text-2); display: inline-flex; gap: 8px; }
.toc a::before { content: "→"; color: var(--amber); transition: transform var(--t-base) var(--ease-out); }
.toc a:hover { color: var(--text); }
.toc a:hover::before { transform: translateX(3px); }
.fig figcaption { position: relative; padding: 12px 16px; border-top: 1px solid var(--line); font-size: .84rem; color: var(--text-3); }
.room-spec { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.room-spec div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.room-spec span { font: 500 .66rem var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); }
.room-spec b { font: 500 1rem var(--font-mono); }
.legend { position: relative; list-style: none; margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .84rem; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }

/* Article side rail: fills the empty right side on wide screens with useful navigation */
.rail {
  position: fixed; z-index: 5; top: calc(var(--header-h) + 36px); right: max(20px, calc((100vw - 1240px) / 2 + 20px)); width: 260px;
  display: flex; flex-direction: column; gap: 12px; opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity var(--t-base) var(--ease-out), transform var(--t-slow) var(--ease-out);
}
.rail.is-visible { opacity: 1; transform: none; pointer-events: auto; }
@media (max-width: 1179px) { .rail { display: none; } }
/* With the rail on the right, wide tables can use the space up to it instead of scrolling sideways */
@media (min-width: 1180px) {
  .guide > .table-wrap { width: calc(min(1240px, 100vw) - 340px); max-width: none; }
  .guide > .table-wrap td { white-space: normal; }
}
.rail-box, .rail-cta { border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow-2); }
.rail-box { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - var(--header-h) - 200px); overflow-y: auto; }
.rail-label { font: 500 var(--fs-micro) var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.rail-progress { height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.rail-progress i { display: block; height: 100%; background: var(--grad-filament); box-shadow: 0 0 10px var(--amber); transform-origin: left; transform: scaleX(0); transition: transform .2s linear; }
.rail nav { display: flex; flex-direction: column; }
.rail nav a { position: relative; font-size: .84rem; line-height: 1.35; color: var(--text-3); padding: 7px 0 7px 14px; border-left: 1px solid var(--line); transition: color var(--t-fast), border-color var(--t-base); }
.rail nav a:hover { color: var(--text); }
.rail nav a.is-active { color: var(--text); border-left-color: var(--amber); }
.rail nav a.is-active::before { content: ""; position: absolute; left: -3px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.rail-cta { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px; transition: border-color var(--t-base), box-shadow var(--t-base); }
.rail-cta .t { font-weight: 600; font-size: .92rem; color: var(--text); }
.rail-cta:hover { border-color: var(--amber); box-shadow: var(--ring-lit); }

/* FAQ accordion */
.faq { display: flex; flex-direction: column; gap: 10px; max-width: 72ch; }
.faq h2 { margin-bottom: 8px; }
.faq details { border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: border-color var(--t-base), box-shadow var(--t-base); }
.faq details[open] { border-color: color-mix(in srgb, var(--amber) 35%, var(--line)); box-shadow: 0 14px 40px -26px var(--glow-strong); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; font-weight: 500; color: var(--text); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 20px; height: 20px; border-radius: 6px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong);
  background-image: linear-gradient(var(--text-2), var(--text-2)), linear-gradient(var(--text-2), var(--text-2)); background-size: 10px 1.5px, 1.5px 10px; background-position: center; background-repeat: no-repeat; transition: transform var(--t-base) var(--ease-out); }
.faq details[open] summary::after { transform: rotate(135deg); }
.faq details p { padding: 0 20px 18px; color: var(--text-2); }

/* Cards (related, home lists) */
.related { display: flex; flex-direction: column; gap: 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.card, .bento-card, .plan-card, .guide-card {
  --mx: 50%; --my: 50%; --rx: 0deg; --ry: 0deg;
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 20px;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); color: var(--text); box-shadow: var(--shadow-1);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out), border-color var(--t-base);
}
.card::before, .bento-card::before, .plan-card::before, .guide-card::before { /* cursor spotlight */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity var(--t-base);
  background: radial-gradient(420px circle at var(--mx) var(--my), var(--glow), transparent 45%);
}
.card::after, .bento-card::after, .plan-card::after, .guide-card::after { /* glowing border follows the cursor */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity var(--t-base);
  background: radial-gradient(260px circle at var(--mx) var(--my), var(--amber), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.card:hover, .bento-card:hover, .plan-card:hover, .guide-card:hover { box-shadow: var(--shadow-3); border-color: var(--line-strong); }
.card:hover::before, .bento-card:hover::before, .plan-card:hover::before, .guide-card:hover::before,
.card:hover::after, .bento-card:hover::after, .plan-card:hover::after, .guide-card:hover::after { opacity: 1; }
.card:focus-visible, .bento-card:focus-visible, .plan-card:focus-visible, .guide-card:focus-visible { box-shadow: var(--ring-lit); outline: none; }
.card .t, .bento-card .t, .plan-card .t, .guide-card .t { font: 600 1.08rem/1.25 var(--font-display); letter-spacing: -.02em; }
.card .d, .bento-card .d, .plan-card .d, .guide-card .d { font-size: .9rem; color: var(--text-2); line-height: 1.5; }
.card .gets { margin-top: auto; padding-top: 6px; font: 500 .72rem var(--font-mono); color: var(--amber); }
.card .t::after, .guide-card .t::after { content: " →"; color: var(--amber); opacity: 0; display: inline-block; transform: translateX(-6px); transition: opacity var(--t-base), transform var(--t-base) var(--ease-out); }
.card:hover .t::after, .guide-card:hover .t::after { opacity: 1; transform: none; }
.shine::marker { content: none; }

/* Embed box */
.embed-box { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); padding: 14px 18px; max-width: 72ch; transition: border-color var(--t-base); }
.embed-box:hover { border-color: var(--amber); }
.embed-box summary { cursor: pointer; font-weight: 500; color: var(--text); list-style: none; display: flex; align-items: center; gap: 10px; }
.embed-box summary::-webkit-details-marker { display: none; }
.embed-box summary::before { content: "</>"; font: 600 .72rem var(--font-mono); color: var(--amber); padding: 4px 7px; border-radius: 6px; background: var(--brass-soft); }
.embed-box[open] { display: flex; flex-direction: column; gap: 12px; }
.embed-box p { color: var(--text-2); font-size: .92rem; }
body.embedded { background: var(--surface); }
body.embedded::after { display: none; }
body.embedded main { padding-block: 14px; gap: 14px; }
.embed-credit { font-size: .85rem; color: var(--text-3); }

/* ---------- 9. Study page and color visuals ---------- */
.findings { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.finding { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.finding::before { content: ""; position: absolute; inset: auto -30% -60% auto; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, var(--glow), transparent 70%); }
.finding b { font: 600 2.2rem/1 var(--font-display); letter-spacing: -.04em; color: var(--amber); }
.finding span { font-size: .9rem; color: var(--text-2); }
.iv { position: relative; padding: 18px 18px 8px; display: flex; flex-direction: column; }
.iv-row { position: relative; display: grid; grid-template-columns: minmax(96px, 170px) 1fr 70px; align-items: center; gap: 10px; min-height: 36px; border-radius: 8px; padding: 0 6px; }
.iv-row[data-i]:hover, .iv-row[data-i]:focus-visible { background: var(--surface-2); }
.iv-label { font-size: .86rem; line-height: 1.25; color: var(--text); }
.iv-val { font: .8rem var(--font-mono); color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.iv-track { position: relative; height: 36px; }
.iv-track::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--line); }
.iv-track.has-band::before { content: ""; position: absolute; top: 0; bottom: 0; left: var(--b0); width: calc(var(--b1) - var(--b0)); background: var(--brass-soft); }
.iv-bar { position: absolute; top: 50%; height: 10px; margin-top: -5px; border-radius: 5px; background: var(--grad-filament); box-shadow: 0 0 0 2px var(--surface), 0 0 14px -2px var(--amber); z-index: 1; }
.iv-head .iv-track, .iv-axis .iv-track { height: 24px; }
.iv-head .iv-track::after, .iv-axis .iv-track::after { display: none; }
.iv-bandlabel { position: absolute; bottom: 3px; text-align: center; font: 500 .7rem var(--font-mono); color: var(--amber); white-space: nowrap; }
.iv-tick { position: absolute; top: 3px; transform: translateX(-50%); font: .7rem var(--font-mono); color: var(--text-3); }
.iv-tip { position: absolute; left: 50%; transform: translateX(-50%); z-index: 3; max-width: min(320px, 90%); background: var(--text); color: var(--bg); border-radius: 10px; padding: 10px 14px; font-size: .84rem; display: flex; flex-direction: column; gap: 2px; pointer-events: none; box-shadow: var(--shadow-3); }
.iv-tip b { color: var(--bg); }
@media (max-width: 520px) { .iv-row { grid-template-columns: 90px 1fr 60px; gap: 6px; } .iv-label { font-size: .76rem; } }
.kelvin { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 22px 18px 10px; }
.kelvin-bar { height: 40px; border-radius: 10px; box-shadow: 0 10px 40px -12px rgba(255, 150, 60, .55);
  background: linear-gradient(90deg, #ff7e00 0%, #ff9227 8.5%, #ffa757 19.1%, #ffb16e 25.5%, #ffc18d 36.2%, #ffcea6 46.8%, #ffe4ce 68.1%, #fffefa 100%); }
.kelvin-marks { position: relative; height: 56px; font: .72rem var(--font-mono); color: var(--text-2); }
.kelvin-marks span { position: absolute; transform: translateX(-50%); text-align: center; white-space: nowrap; line-height: 1.3; }
.kelvin-marks span::before { content: ""; display: block; width: 1px; height: 8px; margin: 0 auto 2px; background: var(--text-3); }
.kelvin-marks span.low { top: 24px; }
.kelvin-marks span.low::before { height: 30px; margin-top: -24px; }
.kelvin-marks span.first { transform: none; }
.kelvin-marks span.first::before { margin-left: 0; }
.kelvin-marks span.last { left: auto !important; right: 0; transform: none; }
.kelvin-marks span.last::before { margin-right: 0; }
.swatches { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; padding: 16px; }
.swatch { border-radius: var(--r-md); min-height: 130px; padding: 14px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; color: #1e2830; border: 1px solid rgba(0, 0, 0, .06); box-shadow: 0 18px 40px -20px rgba(255, 150, 60, .6); transition: transform var(--t-base) var(--ease-out); }
.swatch:hover { transform: translateY(-4px); }
.swatch b { font: 600 1.4rem var(--font-display); letter-spacing: -.03em; color: #1e2830; }
.swatch span { font-size: .8rem; }

/* ---------- 10. Footer ---------- */
.site-footer { position: relative; z-index: 1; margin-top: 0; border-top: 1px solid var(--line); background: var(--bg-2); color: var(--text-3); font-size: .86rem; overflow: hidden; }
.site-footer::before { content: ""; position: absolute; left: 10%; right: 10%; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--amber), transparent); box-shadow: 0 0 24px 2px var(--glow-strong); }
.site-footer .container { position: relative; display: flex; flex-direction: column; gap: 18px; padding-block: 64px 40px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 28px; padding-bottom: 20px; }
.footer-cols nav { display: flex; flex-direction: column; gap: 9px; }
.footer-cols b { font: 500 var(--fs-micro) var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.footer-cols a { color: var(--text-2); width: fit-content; background: linear-gradient(var(--amber), var(--amber)) 0 100% / 0 1px no-repeat; transition: background-size var(--t-base) var(--ease-out), color var(--t-fast); }
.footer-cols a:hover { color: var(--text); background-size: 100% 1px; }
.site-footer a[aria-current="page"] { color: var(--amber); }
.wordmark {
  font: 650 clamp(4rem, 17vw, 15rem)/.85 var(--font-display); letter-spacing: -.06em; white-space: nowrap; user-select: none; margin: 8px 0 28px;
  color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--amber) 55%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--amber) 18%, transparent), transparent 75%); -webkit-background-clip: text; background-clip: text;
}

/* ---------- 11. Home ---------- */
.section { position: relative; padding-block: var(--section); }
.section-head { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 24px 64px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head > div { display: flex; flex-direction: column; gap: 16px; }
.section-head p { color: var(--text-2); max-width: 46ch; justify-self: end; }
@media (max-width: 860px) { .section-head { grid-template-columns: 1fr; } .section-head p { justify-self: start; } }

/* Hero */
.hero { position: relative; isolation: isolate; min-height: min(100svh, 920px); display: grid; align-items: center; padding-block: calc(var(--header-h) + 24px) 64px; margin-top: calc(var(--header-h) * -1); }
.hero-canvas { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.hero-grid { display: grid; grid-template-columns: 1.25fr .95fr; gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 26px; }
.hero h1 { font-size: var(--fs-display); letter-spacing: -.05em; line-height: .98; max-width: 13ch; }
.hero h1 .hl { font-size: 1.04em; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; width: fit-content; padding: 6px 14px 6px 6px; border-radius: var(--r-pill);
  font: 500 .78rem var(--font-mono); color: var(--text-2); background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.pill b { font-weight: 600; color: var(--on-amber); background: var(--grad-filament); padding: 3px 9px; border-radius: var(--r-pill); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { font: .78rem var(--font-mono); color: var(--text-3); display: flex; gap: 18px; flex-wrap: wrap; }
.hero-note span::before { content: "✓ "; color: var(--ok); }
.sizer {
  position: relative; border-radius: var(--r-xl); padding: 22px; background: var(--glass); border: 1px solid var(--line-strong);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; gap: 16px;
}
.sizer::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; background: linear-gradient(160deg, color-mix(in srgb, var(--amber) 80%, transparent), transparent 35%, transparent 70%, color-mix(in srgb, var(--cyan) 50%, transparent)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.sizer-top { display: flex; justify-content: space-between; align-items: center; font: 500 .7rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.sizer-top .live { color: var(--ok); display: inline-flex; align-items: center; gap: 6px; }
.sizer-top .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 8px transparent; } }
.sizer-stage { position: relative; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.sizer-stage::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 16px 16px; }
.sizer-stage svg { position: relative; display: block; width: 100%; height: auto; }
.sizer-stage .s-light { transition: all .5s var(--ease-out); }
.sizer-read { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sizer-read div { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.sizer-read span { display: block; font: 500 .64rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.sizer-read b { font: 500 1.35rem var(--font-mono); letter-spacing: -.03em; color: var(--amber); }
.range { display: flex; flex-direction: column; gap: 8px; }
.range label { display: flex; justify-content: space-between; font-size: .82rem; color: var(--text-2); }
.range label output { font-family: var(--font-mono); color: var(--text); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; background: transparent; cursor: pointer; --p: 50%; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--amber) var(--p), var(--line-strong) var(--p)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--amber) var(--p), var(--line-strong) var(--p)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--surface); border: 2px solid var(--amber); box-shadow: 0 0 0 5px var(--brass-soft), 0 4px 10px rgba(0, 0, 0, .3); transition: transform var(--t-fast); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--amber); box-shadow: 0 0 0 5px var(--brass-soft); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px color-mix(in srgb, var(--cyan) 40%, transparent); }
@media (max-width: 960px) {
  .hero { min-height: auto; padding-top: calc(var(--header-h) + 40px); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero h1 { max-width: 14ch; }
}

/* Counters */
.stats { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); }
.stat { padding: 34px 24px; display: flex; flex-direction: column; gap: 6px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { font: 600 clamp(2.4rem, 5vw, 3.6rem)/1 var(--font-display); letter-spacing: -.05em; color: var(--text); font-variant-numeric: tabular-nums; }
.stat span { font: 500 .72rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; } .stat:nth-child(3) { border-left: 0; } .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* Bento of calculators */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(170px, auto); gap: 14px; }
.bento-card { padding: 24px; gap: 10px; }
.bento-card .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--amber); background: var(--brass-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 30%, transparent); margin-bottom: 6px; }
.bento-card .icon svg { width: 24px; height: 24px; }
.bento-card .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.bento-card .go { position: absolute; top: 22px; right: 22px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--text-2); transition: all var(--t-base) var(--ease-out); }
.bento-card:hover .go { background: var(--amber); color: var(--on-amber); border-color: var(--amber); transform: rotate(-45deg); }
.b-hero { grid-column: span 3; grid-row: span 2; }
.b-wide { grid-column: span 3; }
.b-tall { grid-column: span 2; grid-row: span 2; }
.b-sm { grid-column: span 2; }
.b-full { grid-column: span 6; flex-direction: row; align-items: center; gap: 22px; }
.b-full .body { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.b-full .chips { margin: 0; padding: 0; }
.bento { grid-auto-flow: dense; }
@media (max-width: 1000px) { .b-full { grid-column: span 2; } }
@media (max-width: 560px) { .b-full { grid-column: auto; flex-direction: column; align-items: flex-start; } }
.b-hero .t { font-size: 1.6rem; letter-spacing: -.035em; }
.bento-art { position: relative; margin: 6px -6px 6px; border-radius: var(--r-md); overflow: hidden; flex: 1; min-height: 160px; background: var(--surface-2); border: 1px solid var(--line); }
.bento-art::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 14px 14px; }
.bento-art svg { position: relative; width: 100%; height: 100%; display: block; }
.ba-cord { stroke: var(--text-3); stroke-width: 1.2; }
.ba-wood { fill: var(--wood); stroke: var(--line-strong); }
.ba-fix { fill: var(--amber); }
.ba-glow { fill: var(--glow-strong); filter: blur(10px); }
.ba-dim { stroke: var(--cyan); stroke-width: 1; fill: none; stroke-dasharray: 3 3; }
.ba-dimtxt { fill: var(--cyan); font: 500 11px var(--font-mono); }
.b-hero .ba-light { transition: transform .7s var(--ease-out); transform-origin: 50% 0; transform-box: fill-box; }
.b-hero:hover .ba-light { transform: translateY(8px); }
.dots-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 18px; position: relative; }
.dots-grid i { aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, var(--amber) 0 12%, var(--glow-strong) 13%, transparent 65%); animation: pulse 3s var(--ease-in-out) infinite; animation-delay: calc(var(--d) * 120ms); }
@keyframes pulse { 0%, 100% { opacity: .45; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
.fan-blades { transform-origin: 50% 50%; transform-box: fill-box; transition: transform 1.6s var(--ease-out); }
.bento-card:hover .fan-blades { transform: rotate(360deg); }
@media (max-width: 1000px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .b-hero { grid-column: span 2; grid-row: auto; }
  .b-wide { grid-column: span 2; }
  .b-tall, .b-sm { grid-column: span 1; grid-row: auto; }
}
@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; }
  .b-hero, .b-wide, .b-tall, .b-sm { grid-column: auto; }
  .bento-card { padding: 20px; }
}

/* Pinned story */
.story-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.story-visual { position: sticky; top: calc(var(--header-h) + 40px); }
.story-frame { position: relative; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-3); overflow: hidden; }
.story-frame::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 20px 20px; }
.story-frame svg { position: relative; display: block; width: 100%; height: auto; }
.story-frame .st { opacity: 0; transition: opacity .6s var(--ease-out), transform .8s var(--ease-out); }
.story-frame .st-move { transform: translateY(-14px); }
.story[data-step="1"] .st-1, .story[data-step="2"] .st-1, .story[data-step="2"] .st-2, .story[data-step="3"] .st-1, .story[data-step="3"] .st-2, .story[data-step="3"] .st-3 { opacity: 1; transform: none; }
.story-frame .mark-pulse { transform-origin: center; transform-box: fill-box; animation: markpulse 1.6s var(--ease-out) infinite; }
@keyframes markpulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
.story-progress { display: flex; gap: 6px; margin-top: 16px; }
.story-progress i { flex: 1; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; position: relative; }
.story-progress i::after { content: ""; position: absolute; inset: 0; background: var(--grad-filament); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease-out); }
.story[data-step="1"] .story-progress i:nth-child(1)::after, .story[data-step="2"] .story-progress i:nth-child(-n+2)::after, .story[data-step="3"] .story-progress i::after { transform: scaleX(1); }
.steps { display: flex; flex-direction: column; }
.step { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding-block: 24px; opacity: .35; transition: opacity .5s var(--ease-out); }
.step.is-active { opacity: 1; }
.step .num { font: 500 .78rem var(--font-mono); color: var(--amber); letter-spacing: .1em; }
.step h3 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); letter-spacing: -.035em; }
.step p { color: var(--text-2); max-width: 44ch; }
@media (max-width: 900px) {
  .story-grid { grid-template-columns: 1fr; }
  .story-visual { position: relative; top: 0; }
  .step { min-height: auto; opacity: 1; padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); margin-top: 12px; }
}

/* Before / after */
.compare-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.compare { position: relative; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-3); background: var(--surface); --pos: 50%; touch-action: pan-y; user-select: none; }
.compare svg { display: block; width: 100%; height: auto; }
.compare .after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--grad-filament); box-shadow: 0 0 18px var(--amber); pointer-events: none; }
.compare .handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; color: var(--on-amber); background: var(--grad-filament); box-shadow: 0 0 0 6px var(--brass-soft), var(--shadow-2); }
.compare input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare-label { position: absolute; top: 14px; font: 500 .72rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; padding: 6px 10px; border-radius: var(--r-xs); background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(8px); }
.compare-label.l { left: 14px; color: var(--warn); }
.compare-label.r { right: 14px; color: var(--ok); }
.cmp-wood { fill: var(--wood); stroke: var(--line-strong); }
.cmp-fix { fill: var(--amber); }
.cmp-glow { fill: var(--glow-strong); filter: blur(14px); }
.cmp-line { stroke: var(--line-strong); stroke-width: 2; }
.cmp-cord { stroke: var(--text-3); stroke-width: 1.5; }
.cmp-dim { stroke: var(--cyan); stroke-width: 1.2; stroke-dasharray: 4 3; }
.cmp-txt { fill: var(--text); font: 500 15px var(--font-mono); }
.cmp-sub { fill: var(--text-3); font: 12px var(--font-mono); }
@media (max-width: 900px) { .compare-grid { grid-template-columns: 1fr; } }

/* Horizontal showcase */
.showcase { position: relative; overflow: hidden; }
.showcase-track { display: flex; gap: 18px; padding-inline: max(20px, calc((100vw - 1240px) / 2 + 20px)); will-change: transform; }
.plan-card { flex: none; width: min(420px, 82vw); min-height: 440px; padding: 24px; }
.plan-card .plan-art { position: relative; flex: 1; min-height: 220px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin-bottom: 8px; }
.plan-card .plan-art::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 14px 14px; }
.plan-card .plan-art svg { position: relative; width: 100%; height: 100%; display: block; }
.plan-card .idx { font: 500 .74rem var(--font-mono); color: var(--text-3); }
.pa-wall { fill: none; stroke: var(--line-strong); stroke-width: 2; }
.pa-furn { fill: var(--wood); opacity: .75; }
.pa-light { fill: var(--amber); }
.pa-glow { fill: var(--glow-strong); }
.showcase-hint { font: 500 .74rem var(--font-mono); color: var(--text-3); letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 900px), (prefers-reduced-motion: reduce) {
  .showcase-track { overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; scrollbar-width: none; }
  .showcase-track::-webkit-scrollbar { display: none; }
  .plan-card { scroll-snap-align: center; }
}

/* Study spotlight */
.spotlight { position: relative; isolation: isolate; overflow: hidden; border-radius: var(--r-xl); padding: clamp(32px, 6vw, 72px); background: #0B0E14; color: #ECEFF4; border: 1px solid rgba(255, 255, 255, .08); box-shadow: var(--shadow-3); }
.spotlight .mesh i:nth-child(1) { background: rgba(255, 170, 60, .3); }
.spotlight .mesh i:nth-child(2) { background: rgba(255, 110, 60, .2); }
.spotlight .mesh i:nth-child(3) { background: rgba(75, 79, 216, .3); }
.spotlight h2, .spotlight b { color: #fff; }
.spotlight .eyebrow { color: rgba(236, 239, 244, .7); }
.spotlight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: end; }
.quote { font: 400 clamp(1.6rem, 3vw, 2.5rem)/1.2 var(--font-serif); font-style: italic; letter-spacing: -.01em; color: #fff; }
.quote em { font-style: italic; background: linear-gradient(100deg, #FFD58A, #FF7A3D); -webkit-background-clip: text; background-clip: text; color: transparent; }
.spot-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(255, 255, 255, .1); border-radius: var(--r-lg); overflow: hidden; margin-top: 36px; }
.spot-stats div { background: rgba(11, 14, 20, .82); padding: 22px; display: flex; flex-direction: column; gap: 8px; backdrop-filter: blur(8px); }
.spot-stats b { font: 600 clamp(2rem, 4vw, 3rem)/1 var(--font-display); letter-spacing: -.05em; background: linear-gradient(100deg, #FFD58A, #FF7A3D); -webkit-background-clip: text; background-clip: text; color: transparent; }
.spot-stats span { color: rgba(236, 239, 244, .72); font-size: .9rem; }
.spotlight .btn-ghost { color: #fff; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .2); }
@media (max-width: 860px) { .spotlight-grid { grid-template-columns: 1fr; } }

/* Guide switcher */
.tabs { position: relative; display: inline-flex; gap: 4px; padding: 5px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 28px; max-width: 100%; overflow-x: auto; }
.tabs button { position: relative; z-index: 1; font: 500 .88rem var(--font-body); color: var(--text-2); background: none; border: 0; padding: 10px 18px; border-radius: var(--r-pill); cursor: pointer; white-space: nowrap; transition: color var(--t-base); }
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs .ind { position: absolute; z-index: 0; top: 5px; bottom: 5px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-2), 0 0 0 1px var(--line); transition: left var(--t-base) var(--ease-out), width var(--t-base) var(--ease-out); }
.tab-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.tab-panel.is-entering > * { animation: rise .6s var(--ease-out) both; }
.tab-panel.is-entering > *:nth-child(2) { animation-delay: 60ms; }
.tab-panel.is-entering > *:nth-child(3) { animation-delay: 120ms; }
.tab-panel.is-entering > *:nth-child(4) { animation-delay: 180ms; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.guide-card { min-height: 190px; }
.guide-card .kicker { font: 500 .7rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--amber); }
.guide-card .d { max-height: 0; opacity: 0; overflow: hidden; transition: max-height .5s var(--ease-out), opacity .4s; }
.guide-card:hover .d, .guide-card:focus-visible .d { max-height: 120px; opacity: 1; }
@media (hover: none) { .guide-card .d { max-height: none; opacity: 1; } }
.guide-card .read { margin-top: auto; font: 500 .78rem var(--font-mono); color: var(--text-3); }

/* Principles */
.principles-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.statement { font: 400 clamp(2rem, 4.2vw, 3.6rem)/1.08 var(--font-serif); letter-spacing: -.02em; color: var(--text); }
.statement em { font-style: italic; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.principles { display: flex; flex-direction: column; gap: 0; }
.principles > div { display: grid; grid-template-columns: 44px 1fr; gap: 6px 18px; padding-block: 24px; border-top: 1px solid var(--line); }
.principles > div:last-child { border-bottom: 1px solid var(--line); }
.principles .p-icon { grid-row: span 2; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--amber); background: var(--brass-soft); }
.principles .p-icon svg { width: 22px; height: 22px; }
.principles h3 { font-size: 1.12rem; }
.principles p { color: var(--text-2); }
@media (max-width: 860px) { .principles-grid { grid-template-columns: 1fr; } }

/* ---------- 12. Reveal states (only when JS is running) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); }
.js.reveal-all [data-reveal], .js.reduced [data-reveal] { opacity: 1 !important; transform: none !important; }
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.split .wi { display: inline-block; will-change: transform; }

/* Above-the-fold entrance: pure CSS from the first paint (no waiting for scripts, no flicker).
   Elements stay opaque; they settle into place and come into focus. */
@keyframes settle { from { transform: translateY(16px); filter: blur(6px); } to { transform: none; filter: none; } }
.hero-copy > *:not(h1), .sizer, .page-head > *:not(h1), main > .tool:first-of-type { animation: settle 1s var(--ease-out) both; }
.hero-copy > :nth-child(1), .page-head > :nth-child(1) { animation-delay: 0ms; }
.hero-copy > :nth-child(3), .page-head > :nth-child(3) { animation-delay: 380ms; }
.hero-copy > :nth-child(4), .page-head > :nth-child(4) { animation-delay: 470ms; }
.hero-copy > :nth-child(5), .page-head > :nth-child(5) { animation-delay: 560ms; }
.page-head > :nth-child(6) { animation-delay: 650ms; }
.sizer { animation-delay: 300ms; }
main > .tool:first-of-type { animation-delay: 500ms; }

/* Page transition */
.page-veil { position: fixed; inset: 0; z-index: 90; pointer-events: none; background: var(--bg); opacity: 0; transition: opacity .35s var(--ease-in-out); }
.is-leaving .page-veil { opacity: 1; }
/* Headline reveal: words are wrapped in the HTML and animate with CSS from the first paint,
   so the headline never waits for scripts (good for Largest Contentful Paint). Words stay opaque. */
.split-css .wi { animation: wordIn .95s var(--ease-out) both; }
@keyframes wordIn { from { transform: translateY(.5em); filter: blur(10px); } to { transform: none; filter: none; } }
.split-css .w:nth-child(2) .wi { animation-delay: 115ms; }
.split-css .w:nth-child(3) .wi { animation-delay: 170ms; }
.split-css .w:nth-child(4) .wi { animation-delay: 225ms; }
.split-css .w:nth-child(5) .wi { animation-delay: 280ms; }
.split-css .w:nth-child(6) .wi { animation-delay: 335ms; }
.split-css .w:nth-child(7) .wi { animation-delay: 390ms; }
.split-css .w:nth-child(8) .wi { animation-delay: 445ms; }
.split-css .w:nth-child(9) .wi { animation-delay: 500ms; }
.split-css .w:nth-child(10) .wi { animation-delay: 555ms; }
.split-css .w:nth-child(11) .wi { animation-delay: 610ms; }
.split-css .w:nth-child(12) .wi { animation-delay: 665ms; }
.split-css .w:nth-child(13) .wi { animation-delay: 720ms; }
.split-css .w:nth-child(14) .wi { animation-delay: 775ms; }
.split-css .w:nth-child(15) .wi { animation-delay: 830ms; }
.split-css .w:nth-child(16) .wi { animation-delay: 885ms; }
.split-css .w:nth-child(17) .wi { animation-delay: 940ms; }
.split-css .w:nth-child(18) .wi { animation-delay: 995ms; }

/* ---------- 13. Drawing primitives (calculator SVGs) ---------- */
.g-grid { stroke: transparent; stroke-width: 1; }
.g-struct { stroke: var(--text-2); stroke-width: 2; fill: none; }
.g-wall { stroke: var(--text-2); stroke-width: 1.4; fill: none; }
.g-wood { fill: var(--wood); stroke: var(--line-strong); stroke-width: 1.2; }
.g-glass { fill: var(--glass-fill); stroke: var(--line-strong); stroke-width: 1.2; }
.g-fix { fill: var(--amber); stroke: color-mix(in srgb, var(--amber) 60%, #000); stroke-width: 1; }
.g-bulb { fill: color-mix(in srgb, var(--amber) 30%, var(--surface)); stroke: var(--amber); stroke-width: 1.2; }
.g-cord { stroke: var(--text-3); stroke-width: 1.2; }
.g-glow { fill: var(--glow-strong); }
.g-dim { stroke: var(--cyan); stroke-width: 1; fill: none; opacity: .85; }
.g-dimtxt { fill: var(--text); font: 500 12px var(--font-mono); }
.g-sub { fill: var(--text-3); font: 11px var(--font-mono); }
.g-range { fill: none; stroke: var(--amber); stroke-width: 1.2; stroke-dasharray: 4 4; }
.g-clear { stroke: var(--warn); stroke-width: 1; stroke-dasharray: 6 4; }
.g-cleartxt { fill: var(--warn); font: 11px var(--font-mono); }

/* ---------- 14. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .lamp-cursor, .hero-canvas { display: none; }
  .card, .bento-card, .plan-card, .guide-card { transform: none !important; }
}
