/* ════════════════════════════════════════════════════════════════════
   MattressBuilder v2 — design system
   Concept: "the build sheet". Warm paper, ink, one ember accent.
   Technical-drawing details: numbered callouts, dimension lines,
   dashed rules, spec-sheet panels. Zero JS frameworks, zero images.
════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* paper + ink */
  --paper:       #F7F2E8;
  --paper-warm:  #F1EADB;
  --paper-deep:  #E9E0CC;
  --ink:         #26221B;
  --ink-soft:    #57503F;
  --ink-faint:   #6E6753; /* 4.7:1 on paper, keeps WCAG AA for small labels */
  --line:        rgba(38, 34, 27, 0.16);
  --line-soft:   rgba(38, 34, 27, 0.09);

  /* accents (from the Concept A logo palette) */
  --ember:       #C4622D;
  --ember-deep:  #A04A1C;
  --ember-soft:  #E8C3A8;
  --teal:        #3E6B66;
  --teal-deep:   #2E524E;
  --night:       #221D15;
  --night-soft:  #352E23;
  --cream:       #FBF8F1;

  /* material swatches (top / front / side face shading) */
  --m-cover-t: #F4EEDF; --m-cover-f: #E7DFC9; --m-cover-s: #D8CEB2;
  --m-wool-t:  #EBDDBE; --m-wool-f:  #DECBA3; --m-wool-s:  #C9B489;
  --m-talalay-t: #EBD08F; --m-talalay-f: #DDBE74; --m-talalay-s: #C6A65C;
  --m-dunlop-t:  #DDB369; --m-dunlop-f:  #CBA054; --m-dunlop-s:  #B08641;
  --m-gelfoam-t: #B9CFC5; --m-gelfoam-f: #A3BDB2; --m-gelfoam-s: #88A597;
  --m-transition-t: #E0D2AE; --m-transition-f: #D1C097; --m-transition-s: #B9A87E;
  --m-microcoil-t: #C9CEC4; --m-microcoil-f: #B4BAAF; --m-microcoil-s: #9AA196;
  --m-coils-t: #C3CBBD; --m-coils-f: #B0B8AA; --m-coils-s: #949D8F;
  --m-hdfoam-t: #C9B98F; --m-hdfoam-f: #B7A67B; --m-hdfoam-s: #9C8B62;
  --m-base-t: #A99A7C; --m-base-f: #96876A; --m-base-s: #7C6E54;
  --m-foundation-t: #997A57; --m-foundation-f: #86684A; --m-foundation-s: #6C5238;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-soft: 0 10px 34px rgba(38, 34, 27, 0.10);
  --shadow-pop: 0 18px 50px rgba(38, 34, 27, 0.16);

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', ui-monospace, 'Cascadia Mono', Menlo, monospace;

  --nav-h: 64px;
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 16.5px;
  overflow-x: hidden;
  /* faint paper grain */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.15 0 0 0 0 0.13 0 0 0 0 0.10 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg { max-width: 100%; display: block; }
a { color: var(--ember-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--ember-soft); }

:focus-visible { outline: 2.5px solid var(--ember); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 640px) { .wrap { padding: 0 18px; } }

/* ── Type ─────────────────────────────────────────────────────────── */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink);
}
h1 em, h2 em, .display em { font-style: italic; color: var(--ember-deep); font-weight: 600; }

.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-faint);
}
.kicker::before { content: ''; width: 26px; height: 1.5px; background: var(--ember); }

.section-title { font-size: clamp(30px, 4.4vw, 46px); margin: 14px 0 16px; }
.section-lede { color: var(--ink-soft); font-size: 18px; max-width: 620px; }

.mono { font-family: var(--font-mono); }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 16px; font-weight: 600; line-height: 1;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
  user-select: none; white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1.5px); }
.btn:active { transform: translateY(0.5px); }
.btn.primary { background: var(--ember-deep); color: var(--cream); box-shadow: 0 8px 22px rgba(160, 74, 28, 0.34); }
.btn.primary:hover { background: #8C3F15; box-shadow: 0 12px 28px rgba(140, 63, 21, 0.42); }
.btn.ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.paper { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-soft); }
.btn.small { padding: 9px 18px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn .arr { transition: transform 0.16s ease; }
.btn:hover .arr { transform: translateX(3px); }

/* ── Nav ──────────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(247, 242, 232, 0.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner { display: flex; align-items: center; gap: 30px; width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 28px; }
.nav-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--ink); letter-spacing: -0.01em; }
.nav-logo:hover { text-decoration: none; }
.nav-logo svg { width: 30px; height: 30px; }
.nav-links { display: flex; gap: 26px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--ink-soft); font-weight: 500; font-size: 15.5px; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a.active { color: var(--ember-deep); font-weight: 600; }
.nav-cta { margin-left: 6px; }
.nav-burger { display: none; margin-left: auto; background: none; border: none; width: 42px; height: 42px; border-radius: 10px; align-items: center; justify-content: center; }
.nav-burger svg { width: 24px; height: 24px; stroke: var(--ink); }
.nav-mobile {
  display: none; position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 59;
  background: var(--paper); border-bottom: 1px solid var(--line);
  padding: 10px 22px 22px; box-shadow: var(--shadow-pop);
}
.nav-mobile a { display: block; padding: 13px 6px; font-size: 18px; font-weight: 500; color: var(--ink); border-bottom: 1px dashed var(--line-soft); }
.nav-mobile a:hover { text-decoration: none; color: var(--ember-deep); }
.nav-mobile .btn { margin-top: 16px; }
.nav-mobile.open { display: block; animation: navDrop 0.22s ease; }
@keyframes navDrop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
}

main { padding-top: var(--nav-h); }

/* ── Reveal on scroll ─────────────────────────────────────────────── */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
[data-reveal].revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; } }

/* ── Isometric stack ──────────────────────────────────────────────
   A CSS 3D scene: .iso-viewport contains .iso-scene (rotated plane).
   Each .iso-layer is a cuboid of 3 visible faces. JS sets:
     --w (width px), --d (depth px), --h (height px), --z (elevation px)
*/
.iso-viewport {
  position: relative;
  perspective: 2400px;
  perspective-origin: 50% 40%;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.iso-viewport.grabbing { cursor: grabbing; }
.iso-scene {
  position: absolute; left: 50%; top: 58%;
  width: 0; height: 0;
  transform-style: preserve-3d;
  /* rotX tips the floor plane away; rotZ turns the footprint */
  transform: rotateX(63deg) rotateZ(-40deg);
}
.iso-layer {
  position: absolute;
  width: var(--w); height: var(--d);
  left: calc(var(--w) / -2); top: calc(var(--d) / -2);
  transform-style: preserve-3d;
  transform: translateZ(var(--z));
}
.iso-layer .face { position: absolute; }
.iso-layer .face.top {
  width: var(--w); height: var(--d);
  transform: translateZ(var(--h));
  border-radius: 4px;
}
.iso-layer .face.front {
  /* the edge at y = D; top edge raised to the layer's top */
  width: var(--w); height: var(--h);
  top: 100%; left: 0;
  transform-origin: top left;
  transform: translateZ(var(--h)) rotateX(-90deg);
}
.iso-layer .face.side {
  /* the edge at x = W; top edge raised to the layer's top */
  width: var(--d); height: var(--h);
  left: 100%; top: 0;
  transform-origin: top left;
  transform: translateZ(var(--h)) rotateZ(90deg) rotateX(-90deg);
}
.iso-layer.pickable { cursor: grab; }
.iso-layer.dragging { cursor: grabbing; }
.iso-layer .face { transition: filter 0.2s ease, opacity 0.2s ease; }
.iso-layer.hovered .face, .iso-layer.selected .face { filter: brightness(1.06) saturate(1.06); }
.iso-layer.dragging .face { filter: brightness(1.1) saturate(1.1); }
.iso-layer.dropzone-hint .face { filter: brightness(0.96); }

/* soft contact shadow under the whole stack */
.iso-shadow {
  position: absolute;
  width: var(--w); height: var(--d);
  left: calc(var(--w) / -2); top: calc(var(--d) / -2);
  transform: translateZ(-14px) scale(1.12);
  background: radial-gradient(ellipse at 50% 50%, rgba(38,34,27,0.30), rgba(38,34,27,0.0) 68%);
  border-radius: 40%;
  pointer-events: none;
}

/* ── Material faces ───────────────────────────────────────────────
   Each material gets colored faces + a texture on top/front/side. */
.mat-cover .top { background-color: var(--m-cover-t); background-image:
  repeating-linear-gradient(45deg, rgba(255,255,255,0.5) 0 1.5px, transparent 1.5px 26px),
  repeating-linear-gradient(-45deg, rgba(255,255,255,0.5) 0 1.5px, transparent 1.5px 26px),
  radial-gradient(circle at 13px 13px, rgba(38,34,27,0.10) 1.6px, transparent 2.4px);
  background-size: auto, auto, 26px 26px; }
.mat-cover .front { background-color: var(--m-cover-f); background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.35) 0 2px, transparent 2px 22px); }
.mat-cover .side { background-color: var(--m-cover-s); }

.mat-wool .top, .mat-wool .front, .mat-wool .side { background-image:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.16' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.98 0 0 0 0 0.9 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23w)'/%3E%3C/svg%3E"); }
.mat-wool .top { background-color: var(--m-wool-t); }
.mat-wool .front { background-color: var(--m-wool-f); }
.mat-wool .side { background-color: var(--m-wool-s); }

.mat-talalay .top { background-color: var(--m-talalay-t); background-image: radial-gradient(circle at 10px 10px, rgba(38,34,27,0.13) 2.6px, transparent 3.6px); background-size: 30px 30px; }
.mat-talalay .front { background-color: var(--m-talalay-f); background-image: radial-gradient(circle at 8px 8px, rgba(38,34,27,0.10) 2px, transparent 3px); background-size: 24px 24px; }
.mat-talalay .side { background-color: var(--m-talalay-s); }

.mat-dunlop .top { background-color: var(--m-dunlop-t); background-image: radial-gradient(circle at 9px 9px, rgba(38,34,27,0.15) 2px, transparent 3px); background-size: 22px 22px; }
.mat-dunlop .front { background-color: var(--m-dunlop-f); background-image: radial-gradient(circle at 8px 8px, rgba(38,34,27,0.12) 1.8px, transparent 2.6px); background-size: 20px 20px; }
.mat-dunlop .side { background-color: var(--m-dunlop-s); }

.mat-gelfoam .top { background-color: var(--m-gelfoam-t); background-image:
  radial-gradient(ellipse 60px 24px at 24% 30%, rgba(255,255,255,0.35), transparent 70%),
  radial-gradient(ellipse 80px 30px at 74% 68%, rgba(255,255,255,0.25), transparent 70%); }
.mat-gelfoam .front { background-color: var(--m-gelfoam-f); background-image: linear-gradient(180deg, rgba(255,255,255,0.22), transparent 55%); }
.mat-gelfoam .side { background-color: var(--m-gelfoam-s); }

.mat-transition .top { background-color: var(--m-transition-t); }
.mat-transition .front { background-color: var(--m-transition-f); background-image: repeating-linear-gradient(0deg, rgba(38,34,27,0.06) 0 2px, transparent 2px 9px); }
.mat-transition .side { background-color: var(--m-transition-s); }

.mat-microcoil .top { background-color: var(--m-microcoil-t); background-image: radial-gradient(circle at 8px 8px, rgba(38,34,27,0.2) 2.6px, transparent 3.6px); background-size: 16px 16px; }
.mat-microcoil .front { background-color: var(--m-microcoil-f); background-image:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='28' viewBox='0 0 16 28'%3E%3Cpath d='M3 4 Q8 7 13 4 M3 10 Q8 13 13 10 M3 16 Q8 19 13 16 M3 22 Q8 25 13 22' stroke='%23636B5E' stroke-width='1.6' fill='none' opacity='0.75'/%3E%3C/svg%3E");
  background-size: 16px 28px; background-repeat: repeat; }
.mat-microcoil .side { background-color: var(--m-microcoil-s); background-image: inherit; }

.mat-coils .top { background-color: var(--m-coils-t); background-image: radial-gradient(circle at 14px 14px, rgba(38,34,27,0.18) 5px, rgba(38,34,27,0.05) 6.4px, transparent 8px); background-size: 30px 30px; }
.mat-coils .front, .mat-coils .side { background-color: var(--m-coils-f); background-image:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='120' viewBox='0 0 34 120'%3E%3Crect x='1.5' y='2' width='31' height='116' rx='13' fill='%23AEB6A8' stroke='%23808A7B' stroke-width='1.4'/%3E%3Cpath d='M7 16 Q17 24 27 16 M7 34 Q17 42 27 34 M7 52 Q17 60 27 52 M7 70 Q17 78 27 70 M7 88 Q17 96 27 88 M7 104 Q17 112 27 104' stroke='%236E7868' stroke-width='2' fill='none' opacity='0.8'/%3E%3C/svg%3E");
  background-size: 34px 100%; background-repeat: repeat-x; }
.mat-coils .side { background-color: var(--m-coils-s); }

.mat-hdfoam .top { background-color: var(--m-hdfoam-t); }
.mat-hdfoam .front { background-color: var(--m-hdfoam-f); background-image: repeating-linear-gradient(0deg, rgba(38,34,27,0.07) 0 1.5px, transparent 1.5px 6px); }
.mat-hdfoam .side { background-color: var(--m-hdfoam-s); background-image: repeating-linear-gradient(0deg, rgba(38,34,27,0.07) 0 1.5px, transparent 1.5px 6px); }

.mat-base .top { background-color: var(--m-base-t); }
.mat-base .front { background-color: var(--m-base-f); }
.mat-base .side { background-color: var(--m-base-s); }

.mat-foundation .top { background-color: var(--m-foundation-t); background-image:
  repeating-linear-gradient(0deg, transparent 0 44px, rgba(30,22,12,0.35) 44px 47px),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='44'%3E%3Cpath d='M0 10 Q50 6 100 11 T200 9 M0 24 Q60 28 120 23 T200 26 M0 37 Q40 34 90 38 T200 36' stroke='%23745535' stroke-width='1.2' fill='none' opacity='0.5'/%3E%3C/svg%3E"); }
.mat-foundation .front { background-color: var(--m-foundation-f); }
.mat-foundation .side { background-color: var(--m-foundation-s); }

/* ── Callouts + dimension line (screen-space overlay) ─────────────── */
.iso-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.iso-callout {
  position: absolute; display: flex; align-items: center; gap: 0;
  transform: translateY(-50%);
  transition: opacity 0.25s ease;
  pointer-events: auto; cursor: pointer;
}
.iso-callout .lead { height: 1.5px; background-image: linear-gradient(90deg, var(--ink-faint) 55%, transparent 0); background-size: 7px 1.5px; width: 40px; opacity: 0.8; }
.iso-callout .tag {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 4px 12px 4px 4px;
  box-shadow: 0 4px 14px rgba(38,34,27,0.10);
  white-space: nowrap;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.iso-callout:hover .tag, .iso-callout.active .tag { border-color: var(--ember); transform: translateX(2px); }
.iso-callout .n {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.iso-callout.active .n { background: var(--ember); }
.iso-callout .lbl { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.iso-callout .in { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }

.iso-dim {
  position: absolute; pointer-events: none;
  border-left: 1.5px solid var(--ink-faint);
  opacity: 0.85;
}
.iso-dim::before, .iso-dim::after {
  content: ''; position: absolute; left: -6.5px; width: 12px; height: 1.5px; background: var(--ink-faint);
}
.iso-dim::before { top: 0; } .iso-dim::after { bottom: 0; }
.iso-dim .val {
  position: absolute; left: -12px; top: 50%;
  transform: translate(-100%, -50%);
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  background: var(--paper); padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line-soft);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .iso-callout .lbl, .iso-callout .in { display: none; }
  .iso-callout .tag { padding: 3px; }
  .iso-callout .lead { width: 18px; }
  .iso-dim .val { left: 10px; transform: translate(0, -50%); }
}

/* ── Cards / panels ───────────────────────────────────────────────── */
.card {
  background: var(--cream);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.sheet {
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  position: relative;
}
.sheet-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 14px 18px 10px;
  border-bottom: 1.5px dashed var(--line);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint);
}

/* ── Meters + dial ────────────────────────────────────────────────── */
.meter { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 10px; font-size: 13.5px; }
.meter .lbl { color: var(--ink-soft); font-weight: 500; }
.meter .bar { height: 7px; border-radius: 99px; background: var(--paper-deep); overflow: hidden; }
.meter .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--teal), var(--teal-deep)); width: 0%; transition: width 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.meter.ember .fill { background: linear-gradient(90deg, var(--ember), var(--ember-deep)); }
.meter .val { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); text-align: right; }

/* ── Forms ────────────────────────────────────────────────────────── */
.input {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--cream); color: var(--ink);
  font-family: inherit; font-size: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px rgba(196, 98, 45, 0.15); }
.input::placeholder { color: var(--ink-faint); }

/* ── Modal ────────────────────────────────────────────────────────── */
.modal-scrim {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(34, 29, 21, 0.5);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-scrim.open { display: flex; animation: fadeIn 0.2s ease; }
.modal {
  width: 100%; max-width: 470px;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 30px 30px 26px;
  position: relative;
  animation: popIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  max-height: 90vh; overflow: auto;
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
.modal h3 { font-size: 26px; margin-bottom: 8px; }
.modal .sub { color: var(--ink-soft); font-size: 15px; margin-bottom: 18px; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: var(--paper-deep); color: var(--ink-soft);
  font-size: 17px; line-height: 1;
}
.modal-close:hover { background: var(--ink); color: var(--paper); }
.modal .fine { font-size: 12.5px; color: var(--ink-faint); margin-top: 12px; line-height: 1.5; }
.modal .build-echo {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-soft);
  background: var(--paper-warm); border: 1px dashed var(--line);
  border-radius: 10px; padding: 10px 13px; margin-bottom: 16px;
}

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 20px);
  z-index: 95; background: var(--ink); color: var(--paper);
  border-radius: 999px; padding: 13px 24px;
  font-size: 15px; font-weight: 500;
  box-shadow: var(--shadow-pop);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: min(92vw, 540px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── FAQ ──────────────────────────────────────────────────────────── */
.faq-item { border-bottom: 1.5px solid var(--line-soft); }
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 4px; font-weight: 600; font-size: 17.5px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .ind {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--line); color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: transform 0.25s ease, background 0.2s ease;
}
.faq-item[open] summary .ind { transform: rotate(45deg); background: var(--ink); color: var(--paper); border-color: var(--ink); }
.faq-item .faq-body { padding: 0 4px 22px; color: var(--ink-soft); max-width: 700px; }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer { background: var(--night); color: #CFC6B4; margin-top: 90px; }
.footer a { color: #E8DFC9; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 60px 0 40px; }
.footer h4 { color: var(--paper); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 16px; font-weight: 600; }
.footer li { list-style: none; margin-bottom: 10px; font-size: 15px; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 21px; font-weight: 700; color: var(--paper); margin-bottom: 14px; }
.footer-brand svg { width: 30px; height: 30px; }
.footer .mission { font-size: 15px; line-height: 1.65; max-width: 340px; color: #B5AC99; }
.footer-legal { border-top: 1px solid rgba(247, 242, 232, 0.14); padding: 22px 0 30px; font-size: 13px; color: #8F876F; display: flex; flex-wrap: wrap; gap: 8px 26px; justify-content: space-between; }
.footer-legal .disc { max-width: 640px; line-height: 1.55; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr; gap: 30px; padding: 44px 0 26px; } }

/* ── Email band ───────────────────────────────────────────────────── */
.email-band {
  background: var(--night); color: var(--paper);
  border-radius: var(--radius-lg);
  padding: clamp(30px, 5vw, 54px);
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 34px; align-items: center;
  position: relative; overflow: hidden;
}
.email-band::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(196, 98, 45, 0.35), transparent 65%);
  pointer-events: none;
}
.email-band h3 { color: var(--paper); font-size: clamp(24px, 3vw, 34px); margin-bottom: 10px; }
.email-band p { color: #C9C0AC; font-size: 15.5px; }
.email-band form { display: flex; gap: 10px; position: relative; z-index: 1; }
.email-band .input { background: rgba(251, 248, 241, 0.08); border-color: rgba(251, 248, 241, 0.25); color: var(--paper); }
.email-band .input::placeholder { color: #A79E8A; }
.email-band .input:focus { border-color: var(--ember); }
@media (max-width: 780px) {
  .email-band { grid-template-columns: 1fr; gap: 20px; }
  .email-band form { flex-direction: column; }
}

/* ── Score pills / chips ──────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  background: var(--cream);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }

/* ── Utility ──────────────────────────────────────────────────────── */
.tac { text-align: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 980px) { .grid4 { grid-template-columns: repeat(2, 1fr); } .grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Shared page vocabulary ───────────────────────────────────────────
   These started life duplicated inside three page <style> blocks. The plan
   page needed the same warnings, chips and disclosures, and a fourth copy is
   how a warning ends up looking like a bare letter "i" on one page and a
   proper badge on another. One definition, every page. */
section.block { padding: 90px 0 0; }
@media (max-width: 640px) { section.block { padding: 64px 0 0; } }

.disclosure { font-size: 13px; color: var(--ink-faint); max-width: 760px; margin-top: 18px; line-height: 1.55; }
.disclosure + .disclosure { margin-top: 8px; }

.warns { margin-top: 14px; display: grid; gap: 8px; }
.warn {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: 12px; padding: 11px 14px; font-size: 13.5px; line-height: 1.45;
  background: var(--cream); border: 1.5px solid var(--line-soft); color: var(--ink-soft);
}
.warn .ic {
  flex: none; width: 18px; height: 18px; border-radius: 50%; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: var(--cream); background: var(--ink-faint);
}
.warn.block { border-color: rgba(196, 98, 45, 0.5); background: rgba(196, 98, 45, 0.07); }
.warn.block .ic { background: var(--ember); }
.warn.warn-lv .ic { background: #B08A2E; }

.gaps { display: grid; gap: 10px; margin-top: 14px; }

.chip-sale, .chip-flat {
  font-size: 10.5px; font-family: var(--font-mono); letter-spacing: 0.1em;
  text-transform: uppercase; border-radius: 99px; padding: 3px 9px; font-weight: 700;
}
.chip-sale { background: rgba(196, 98, 45, 0.14); color: var(--ember-deep); }
.chip-flat { background: var(--paper-deep); color: var(--ink-soft); }
