/* ==========================================================
   Halcyon — Prime Hybrid Sleep System
   Palette: warm ivory · soft beige · muted sage · deep charcoal · cool blue
   ========================================================== */
:root {
  --ivory: #f5f1ea;
  --ivory-2: #ece5d9;
  --cream: #fbf9f5;
  --beige: #ddd0bd;
  --beige-2: #c9b89f;
  --sage: #9fae98;
  --sage-2: #c5d0bf;
  --sage-3: #e3e9df;
  --sage-deep: #5d6e5a;
  --charcoal: #24272a;
  --charcoal-2: #2f3337;
  --ink-soft: #5b5f5f;
  --blue: #9fbccb;
  --blue-2: #cfe0e8;
  --blue-deep: #5a8197;
  --warm: #e2a77c;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Figtree", system-ui, -apple-system, sans-serif;

  --radius: 28px;
  --ease: cubic-bezier(.22, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); color: var(--charcoal); background: var(--ivory);
  line-height: 1.6; overflow-x: clip; -webkit-font-smoothing: antialiased;
}
/* soft linen grain over the whole page */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .05; mix-blend-mode: multiply;
  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='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
canvas { display: block; }
.container { width: min(1240px, 100% - 32px); margin-inline: auto; }

/* ---------- Type ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .72rem; letter-spacing: .24em; text-transform: uppercase;
  color: var(--sage-deep); font-weight: 600; margin: 0 0 16px;
}
.eyebrow.light { color: var(--blue-2); }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue-deep); box-shadow: 0 0 0 4px rgba(90, 129, 151, .18); animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 9px rgba(90, 129, 151, 0); } }
.section-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.5rem, 5.4vw, 4.8rem); line-height: .98;
  letter-spacing: -.015em; margin: 0 0 20px;
}
.section-title em, .hero-title em { font-style: italic; color: var(--sage-deep); }
.section-title.light { color: var(--cream); }
.section-title.light em { color: var(--blue-2); }
.lead { font-size: 1.06rem; color: var(--ink-soft); max-width: 46ch; margin: 0 0 28px; font-weight: 400; }
.lead.light { color: rgba(251, 249, 245, .72); }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; white-space: nowrap; align-items: center; gap: 10px;
  padding: 17px 30px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 500; font-size: .95rem; letter-spacing: .01em; overflow: hidden;
  transition: transform .5s var(--ease), background .5s, box-shadow .5s, color .5s;
}
.btn:hover { transform: translateY(-2px); }
.btn .arr { transition: transform .5s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn-sm { padding: 11px 20px; font-size: .86rem; }
.btn-ink { background: var(--charcoal); color: var(--cream); box-shadow: 0 16px 36px -16px rgba(36, 39, 42, .7); }
.btn-ink::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .2), transparent 70%);
  transition: transform 1.1s var(--ease);
}
.btn-ink:hover::after { transform: translateX(120%); }
.btn-ink:hover { background: var(--sage-deep); }
.btn-ghost { border-color: rgba(36, 39, 42, .18); background: rgba(255, 255, 255, .4); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn-ghost:hover { background: rgba(255, 255, 255, .75); }
.btn-sage { background: var(--sage-2); color: var(--charcoal); }

/* ---------- Glass ---------- */
.glass {
  background: rgba(255, 255, 255, .45);
  border: 1px solid rgba(255, 255, 255, .75);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 30px 70px -36px rgba(36, 39, 42, .35), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.glass-dark {
  background: rgba(36, 39, 42, .4);
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(18px) saturate(130%); -webkit-backdrop-filter: blur(18px) saturate(130%);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 14px; left: 16px; right: 16px; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 9px 10px 9px 22px; border-radius: 999px;
  background: rgba(245, 241, 234, .45);
  border: 1px solid rgba(255, 255, 255, .6);
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  transition: box-shadow .5s, background .5s, border-color .5s;
  max-width: 1240px; margin-inline: auto;
  animation: navIn 1.2s var(--ease-out) both .3s;
}
.nav.scrolled { box-shadow: 0 14px 40px -22px rgba(36, 39, 42, .35); background: rgba(245, 241, 234, .82); }
.nav.on-dark { background: rgba(36, 39, 42, .55); border-color: rgba(255, 255, 255, .12); }
.nav.on-dark .logo, .nav.on-dark .nav-links a { color: var(--cream); }
.nav.on-dark .btn-ink { background: var(--cream); color: var(--charcoal); }
.logo {
  display: flex; align-items: center; gap: 9px; color: var(--charcoal);
  font-family: var(--sans); font-weight: 500; font-size: .95rem; letter-spacing: .32em; text-transform: uppercase;
  transition: color .4s;
}
.logo svg { width: 26px; height: 20px; color: var(--sage-deep); }
.logo-light { color: var(--cream); }
.logo-light svg { color: var(--sage-2); }
.nav-links { display: flex; gap: 34px; font-size: .88rem; font-weight: 500; }
.nav-links a { position: relative; color: var(--ink-soft); transition: color .3s; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transition: transform .4s var(--ease); }
.nav-links a:hover { color: var(--charcoal); }
.nav-links a:hover::after { transform: scaleX(1); }
@keyframes navIn { from { opacity: 0; transform: translateY(-20px); } }

/* ==========================================================
   Hero — mattress floating in a misty bedroom
   ========================================================== */
.hero { position: relative; height: 290vh; background: var(--ivory); }
.hero-sticky { position: sticky; top: 0; height: 100vh; min-height: 640px; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero-bg img {
  position: absolute; inset: -3%; width: 106%; height: 106%; object-fit: cover; object-position: 50% 60%;
  will-change: transform; animation: plateIn 2.8s var(--ease-out) both;
}
@keyframes plateIn { from { opacity: 0; transform: scale(1.12); filter: blur(12px); } }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(245, 241, 234, .82) 0%, rgba(245, 241, 234, .35) 34%, rgba(245, 241, 234, 0) 55%),
    linear-gradient(0deg, rgba(245, 241, 234, .55), rgba(245, 241, 234, 0) 30%);
}
.mist { position: absolute; left: -20%; right: -20%; height: 40%; pointer-events: none; filter: blur(30px); border-radius: 50%; mix-blend-mode: screen; }
.mist-1 { bottom: 8%; background: radial-gradient(closest-side, rgba(255, 255, 255, .75), transparent); animation: drift 26s ease-in-out infinite alternate; }
.mist-2 { bottom: -6%; height: 34%; background: radial-gradient(closest-side, rgba(207, 224, 232, .7), transparent); animation: drift 34s ease-in-out infinite alternate-reverse; }
.mist-3 { bottom: 26%; height: 22%; left: 10%; right: -40%; opacity: .6; background: radial-gradient(closest-side, rgba(255, 255, 255, .6), transparent); animation: drift 40s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-8%) scaleY(1); } to { transform: translateX(8%) scaleY(1.15); } }
#dustCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero-copy {
  position: absolute; left: max(16px, calc((100vw - 1240px) / 2)); top: 50%; transform: translateY(-46%);
  width: min(500px, 100% - 32px); z-index: 3; will-change: transform, opacity;
}
.hero-title { font-family: var(--serif); font-weight: 400; font-size: clamp(3.1rem, 5.6vw, 5.8rem); line-height: .94; letter-spacing: -.02em; margin: 0 0 22px; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .line > span { display: inline-block; animation: rise 1.4s var(--ease-out) both; }
.hero-title .line:nth-child(2) > span { animation-delay: .15s; }
@keyframes rise { from { transform: translateY(105%); } }
.hero-sub { font-size: 1.05rem; color: var(--ink-soft); max-width: 40ch; margin: 0 0 30px; animation: fadeUp 1.2s var(--ease-out) both .5s; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; animation: fadeUp 1.2s var(--ease-out) both .65s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } }

.hero-stage {
  position: absolute; z-index: 2; left: 65%; top: 54%;
  width: min(46vw, 820px); aspect-ratio: 1.55; transform: translate(-50%, -50%);
}
.hs-float { position: absolute; inset: 0; animation: floatIn 2.4s var(--ease-out) both .4s; }
@keyframes floatIn { from { opacity: 0; transform: translateY(60px) scale(.94); filter: blur(8px); } }
.hs-layers { position: absolute; inset: 0; }
.hs-layer { position: absolute; left: 0; width: 100%; height: auto; opacity: 0; will-change: transform, opacity; filter: drop-shadow(0 26px 22px rgba(70, 60, 45, .16)); }
.hs-whole { position: absolute; left: 0; width: 100%; top: 50%; transform: translateY(-50%); will-change: transform, opacity; filter: drop-shadow(0 30px 30px rgba(70, 60, 45, .2)); }
.hs-shadow {
  position: absolute; left: 12%; right: 12%; bottom: -4%; height: 14%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(70, 62, 52, .32), transparent); filter: blur(10px);
  will-change: transform, opacity;
}
.hs-tags { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; pointer-events: none; }
.hs-tags li {
  position: absolute; right: -6%; display: flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 8px 14px 8px 8px; border-radius: 999px; font-size: .8rem; font-weight: 500;
  background: rgba(255, 255, 255, .62); border: 1px solid rgba(255, 255, 255, .85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px -18px rgba(36, 39, 42, .4); opacity: 0;
}
.hs-tags li::before { content: ""; position: absolute; right: 100%; top: 50%; width: 9vw; max-width: 120px; height: 1px; background: linear-gradient(90deg, transparent, rgba(36, 39, 42, .35)); }
.hs-tags b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--charcoal); color: var(--cream); font-size: .66rem; font-weight: 600; }

.hero-proof { position: absolute; left: max(16px, calc((100vw - 1240px) / 2)); bottom: 34px; display: flex; gap: 34px; z-index: 3; animation: fadeUp 1.2s var(--ease-out) both .9s; }
.hero-proof div { display: flex; align-items: center; gap: 10px; }
.hero-proof b { font-family: var(--serif); font-size: 2rem; font-weight: 400; line-height: 1; }
.hero-proof span { font-size: .78rem; color: var(--ink-soft); max-width: 12ch; line-height: 1.3; }
.hero-caption {
  position: absolute; left: 50%; bottom: 7vh; transform: translateX(-50%); margin: 0; z-index: 3; opacity: 0;
  font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.6rem); white-space: nowrap; pointer-events: none;
}
.hero-caption em { color: var(--sage-deep); }
.scroll-cue { position: absolute; right: max(16px, calc((100vw - 1240px) / 2)); bottom: 34px; display: flex; align-items: center; gap: 12px; z-index: 3; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); }
.scroll-cue em { font-style: normal; }
.scroll-cue span { width: 22px; height: 36px; border-radius: 12px; border: 1px solid rgba(36, 39, 42, .3); position: relative; }
.scroll-cue span::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--charcoal); animation: cue 2.2s var(--ease) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- Marquee ---------- */
.marquee { background: var(--charcoal); color: var(--ivory); overflow: hidden; padding: 20px 0; }
.marquee-track { display: flex; gap: 34px; width: max-content; animation: marquee 46s linear infinite; font-family: var(--serif); font-size: 1.5rem; white-space: nowrap; align-items: center; }
.marquee-track i { font-style: normal; color: var(--blue); font-size: .9rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Shared section head ---------- */
section { position: relative; }
.split-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; margin-bottom: 56px; flex-wrap: wrap; }
.split-head .lead { margin-bottom: 8px; }
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* ==========================================================
   Layer explorer
   ========================================================== */
.layers { padding: 140px 0 120px; background: linear-gradient(180deg, var(--ivory), var(--ivory-2)); }
.lx { display: grid; grid-template-columns: 280px 1fr 320px; gap: 36px; align-items: center; }
.lx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lx-list button {
  width: 100%; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; text-align: left;
  padding: 14px 16px; border-radius: 18px; border: 1px solid transparent; background: transparent;
  transition: background .5s var(--ease), border-color .5s, transform .5s var(--ease);
}
.lx-list button:hover { background: rgba(255, 255, 255, .5); }
.lx-list button[aria-selected="true"] { background: rgba(255, 255, 255, .8); border-color: rgba(255, 255, 255, .9); box-shadow: 0 16px 40px -26px rgba(36, 39, 42, .5); transform: translateX(6px); }
.lx-list .n { font-size: .7rem; font-weight: 600; letter-spacing: .1em; color: var(--ink-soft); }
.lx-list .t { font-weight: 500; font-size: .95rem; line-height: 1.25; }
.lx-list .t small { display: block; font-weight: 400; color: var(--ink-soft); font-size: .78rem; }
.lx-list .sw { width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }

.lx-stage { position: relative; aspect-ratio: 1 / .95; }
.lx-glow { position: absolute; inset: 10% 5%; border-radius: 50%; background: radial-gradient(closest-side, rgba(207, 224, 232, .9), rgba(207, 224, 232, 0)); filter: blur(20px); animation: glowPulse 7s ease-in-out infinite; }
@keyframes glowPulse { 50% { transform: scale(1.08); opacity: .7; } }
.lx-stack { position: absolute; inset: 0; }
.lx-layer {
  position: absolute; left: 4%; width: 92%; cursor: pointer; border: 0; padding: 0; background: none;
  transition: transform 1s var(--ease-out), opacity .8s var(--ease), filter .8s var(--ease);
  filter: drop-shadow(0 22px 18px rgba(70, 60, 45, .16));
}
.lx-layer img { width: 100%; height: auto; pointer-events: none; }
.lx-layer.dim { opacity: .5; filter: saturate(.6) drop-shadow(0 18px 14px rgba(70, 60, 45, .1)); }
.lx-layer.sel { filter: drop-shadow(0 40px 34px rgba(70, 60, 45, .28)) brightness(1.04); }
.lx-layer:focus-visible { outline: 2px solid var(--blue-deep); outline-offset: 4px; border-radius: 12px; }
.lx-depth { position: absolute; right: -6px; top: 12%; bottom: 12%; width: 4px; border-radius: 4px; background: rgba(36, 39, 42, .1); }
.lx-depth i { position: absolute; left: 0; right: 0; top: 0; height: 0; border-radius: 4px; background: var(--sage-deep); transition: height 1s var(--ease-out); }
.lx-depth span { position: absolute; right: 12px; top: 0; font-size: .72rem; font-weight: 600; white-space: nowrap; color: var(--sage-deep); transition: top 1s var(--ease-out); transform: translateY(-50%); }

.lx-card { border-radius: var(--radius); padding: 30px 28px; }
.lx-num { font-size: .72rem; font-weight: 600; letter-spacing: .2em; color: var(--sage-deep); margin: 0 0 10px; }
.lx-card h3 { font-family: var(--serif); font-weight: 400; font-size: 2rem; line-height: 1.05; margin: 0 0 12px; }
.lx-card p { color: var(--ink-soft); margin: 0 0 20px; font-size: .96rem; }
.lx-specs { margin: 0; display: grid; gap: 0; }
.lx-specs div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid rgba(36, 39, 42, .1); font-size: .88rem; }
.lx-specs dt { color: var(--ink-soft); }
.lx-specs dd { margin: 0; font-weight: 600; text-align: right; }
.lx-card.swap > * { animation: cardSwap .7s var(--ease-out) both; }
.lx-card.swap > *:nth-child(2) { animation-delay: .04s; }
.lx-card.swap > *:nth-child(3) { animation-delay: .08s; }
.lx-card.swap > *:nth-child(4) { animation-delay: .12s; }
@keyframes cardSwap { from { opacity: 0; transform: translateY(12px); } }

/* ==========================================================
   Firmness
   ========================================================== */
.firmness { padding: 120px 0; background: var(--ivory-2); }
.firm-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 64px; align-items: center; }
.firm-control { margin: 8px 0 30px; }
.firm-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.firm-name { font-family: var(--serif); font-size: 2.2rem; line-height: 1; }
.firm-val { color: var(--ink-soft); font-size: .9rem; }
.firm-val b { font-size: 1.3rem; color: var(--charcoal); font-weight: 600; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; cursor: pointer; margin: 0;
  --p: 60%;
}
input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--blue-2), var(--sage), var(--charcoal-2)); }
input[type="range"]::-moz-range-track { height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--blue-2), var(--sage), var(--charcoal-2)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -11px; border-radius: 50%; background: var(--cream); border: 1px solid rgba(36, 39, 42, .15); box-shadow: 0 8px 20px -6px rgba(36, 39, 42, .45), inset 0 0 0 6px var(--cream), inset 0 0 0 9px var(--sage-deep); transition: transform .3s var(--ease); }
input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--cream); border: 1px solid rgba(36, 39, 42, .15); box-shadow: 0 8px 20px -6px rgba(36, 39, 42, .45), inset 0 0 0 6px var(--cream), inset 0 0 0 9px var(--sage-deep); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]:focus-visible { outline: 2px solid var(--blue-deep); outline-offset: 6px; border-radius: 8px; }
.firm-scale { display: flex; justify-content: space-between; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-top: 6px; }
.firm-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.firm-presets button, .cool-toggle button, .pos-tabs button {
  padding: 10px 18px; border-radius: 999px; border: 1px solid rgba(36, 39, 42, .14); background: rgba(255, 255, 255, .4);
  font-size: .86rem; font-weight: 500; transition: background .4s, color .4s, border-color .4s;
}
.firm-presets button:hover, .pos-tabs button:hover { background: rgba(255, 255, 255, .85); }
.firm-presets button.active, .pos-tabs button.active { background: var(--charcoal); color: var(--cream); border-color: var(--charcoal); }
.firm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; border-top: 1px solid rgba(36, 39, 42, .12); }
.firm-stats div { padding: 18px 14px 0 0; }
.firm-stats dt { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.firm-stats dd { margin: 0; font-family: var(--serif); font-size: 1.6rem; line-height: 1.1; }
#firmBest { font-size: 1.15rem; }
.firm-viz { position: relative; border-radius: var(--radius); padding: 18px; aspect-ratio: 1.3; }
.firm-viz canvas { width: 100%; height: 100%; }
.firm-legend { position: absolute; left: 28px; bottom: 22px; display: flex; align-items: center; gap: 10px; font-size: .7rem; color: var(--ink-soft); }
.firm-legend i { width: 90px; height: 6px; border-radius: 6px; background: linear-gradient(90deg, #cfe0e8, #9fae98, #e9c79a, #d98d6c); }

/* ==========================================================
   Cooling
   ========================================================== */
.cooling { padding: 130px 0; background: radial-gradient(120% 90% at 20% 30%, #2f3a40, var(--charcoal) 60%); color: var(--cream); overflow: hidden; }
.cool-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 64px; align-items: center; }
.cool-viz { position: relative; aspect-ratio: 1.25; border-radius: var(--radius); overflow: hidden; background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, 0)); border: 1px solid rgba(255, 255, 255, .08); }
.cool-viz canvas { width: 100%; height: 100%; }
.cool-temp { position: absolute; top: 18px; right: 18px; border-radius: 18px; padding: 12px 16px; display: grid; gap: 4px; min-width: 150px; }
.cool-temp span { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: rgba(251, 249, 245, .6); }
.cool-temp b { font-family: var(--serif); font-weight: 400; font-size: 2rem; line-height: 1; }
.cool-bar { display: block; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.cool-bar i { display: block; height: 100%; width: 40%; border-radius: 4px; background: linear-gradient(90deg, var(--blue), var(--warm)); transition: width .6s var(--ease); }
.cool-toggle { display: inline-flex; padding: 5px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); margin-bottom: 36px; }
.cool-toggle button { border: 0; background: transparent; color: rgba(251, 249, 245, .7); }
.cool-toggle button.active { background: var(--blue-2); color: var(--charcoal); }
.cool-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.cool-points li { display: flex; align-items: baseline; gap: 18px; padding: 16px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.cool-points b { font-family: var(--serif); font-weight: 400; font-size: 2.2rem; color: var(--blue-2); min-width: 80px; line-height: 1; }
.cool-points span { color: rgba(251, 249, 245, .72); }

/* ==========================================================
   Sleep positions
   ========================================================== */
.positions { padding: 130px 0; background: var(--ivory); }
.pos-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.pos-tabs button { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; }
.pos-tabs svg { width: 34px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pos-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: center; }
.pos-viz { position: relative; border-radius: var(--radius); aspect-ratio: 1.75; padding: 14px; background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(236, 229, 217, .5)); }
.pos-viz canvas { width: 100%; height: 100%; }
.pos-align { position: absolute; left: 24px; top: 20px; display: grid; }
.pos-align span { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }
.pos-align b { font-family: var(--serif); font-weight: 400; font-size: 2.4rem; line-height: 1.05; color: var(--sage-deep); }
.pos-info h3 { font-family: var(--serif); font-weight: 400; font-size: 2.4rem; margin: 0 0 10px; line-height: 1; }
.pos-info p { color: var(--ink-soft); margin: 0 0 26px; }
.zones { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 120px; }
.zone { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.zone i { width: 100%; border-radius: 10px 10px 4px 4px; height: calc(var(--v) * 100%); background: linear-gradient(180deg, var(--zc, var(--sage)), rgba(159, 174, 152, .35)); transition: height 1s var(--ease-out), background .8s; }
.zone span { font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
.zones-cap { font-size: .72rem !important; letter-spacing: .14em; text-transform: uppercase; margin: 14px 0 0 !important; }

/* ==========================================================
   Texture
   ========================================================== */
.texture { padding: 120px 0; background: var(--ivory-2); }
.tex-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: center; }
.tex-pad { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; cursor: crosshair; box-shadow: 0 40px 80px -50px rgba(36, 39, 42, .6); }
.tex-pad img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 2.4s var(--ease-out); will-change: transform; }
.tex-pad:hover img { transform: scale(1.14); }
.tex-press {
  position: absolute; left: 0; top: 0; width: 280px; height: 280px; margin: -140px 0 0 -140px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(36, 30, 20, .24), rgba(36, 30, 20, .08) 40%, transparent 68%);
  mix-blend-mode: multiply; opacity: 0; transition: opacity .5s, transform .4s var(--ease);
}
.tex-pad:hover .tex-press { opacity: 1; }
.tex-pad.down .tex-press { transform: scale(.8); background: radial-gradient(circle, rgba(36, 30, 20, .34), rgba(36, 30, 20, .1) 40%, transparent 68%); }
.tex-hint { position: absolute; left: 18px; bottom: 18px; padding: 8px 14px; border-radius: 999px; font-size: .76rem; font-weight: 500; background: rgba(255, 255, 255, .6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.materials { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 14px; }
.materials li { display: grid; grid-template-columns: 150px 1fr 44px; align-items: center; gap: 16px; font-size: .92rem; }
.materials i { height: 6px; border-radius: 6px; background: rgba(36, 39, 42, .08); position: relative; overflow: hidden; }
.materials i::after { content: ""; position: absolute; inset: 0; width: calc(var(--v) * 100%); background: var(--sage-deep); border-radius: 6px; transform-origin: left; transform: scaleX(0); transition: transform 1.6s var(--ease-out) .2s; }
.materials.in i::after { transform: scaleX(1); }
.materials em { font-style: normal; font-weight: 600; text-align: right; }
.certs { font-size: .78rem; letter-spacing: .08em; color: var(--ink-soft); }

/* ==========================================================
   Lightness banner
   ========================================================== */
.lightness { height: 92vh; min-height: 560px; overflow: hidden; display: grid; place-items: start center; color: var(--cream); }
.lightness img { position: absolute; inset: -8% 0; width: 100%; height: 116%; object-fit: cover; will-change: transform; }
.lightness::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(40, 60, 66, .42), rgba(40, 60, 66, 0) 45%); }
.lightness-copy { position: relative; z-index: 1; text-align: center; padding-top: 13vh; }
.lightness-copy .section-title { font-size: clamp(3rem, 7vw, 6rem); }
.light-icons { list-style: none; margin: 26px 0 0; padding: 0; display: flex; gap: 48px; justify-content: center; flex-wrap: wrap; font-size: .82rem; }
.light-icons li { display: grid; justify-items: center; gap: 10px; }
.light-icons svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linejoin: round; stroke-linecap: round; }

/* ==========================================================
   Proof
   ========================================================== */
.proof { padding: 130px 0; background: var(--ivory); }
.proof-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 72px; align-items: center; }
.sleeper { position: relative; margin: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; }
.sleeper img { width: 100%; height: 100%; object-fit: cover; }
.sleeper figcaption { position: absolute; left: 18px; right: 18px; bottom: 18px; border-radius: 22px; padding: 20px 22px; }
.quote { font-family: var(--serif); font-size: 1.4rem; line-height: 1.25; margin: 0 0 8px; }
.quote-by { margin: 0; font-size: .82rem; color: var(--ink-soft); }
.stats { display: grid; gap: 0; margin-top: 10px; }
.stat { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 4px 20px; padding: 18px 0; border-top: 1px solid rgba(36, 39, 42, .1); position: relative; }
.stat-num { font-family: var(--serif); font-size: 3.4rem; line-height: 1; }
.stat-unit { font-family: var(--serif); font-size: 1.8rem; color: var(--sage-deep); }
.stat p { margin: 0; color: var(--ink-soft); }
.stat-bar { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: rgba(36, 39, 42, .07); position: relative; overflow: hidden; }
.stat-bar::after { content: ""; position: absolute; inset: 0; width: calc(var(--v) * 100%); background: linear-gradient(90deg, var(--blue), var(--sage-deep)); transform: scaleX(0); transform-origin: left; transition: transform 2s var(--ease-out); }
.stats.in .stat-bar::after { transform: scaleX(1); }
.fineprint { font-size: .74rem; color: var(--ink-soft); margin-top: 18px; }

/* ==========================================================
   Find Your Mattress
   ========================================================== */
.find { padding-bottom: 130px; background: var(--ivory-2); }
.find-banner { position: relative; height: 62vh; min-height: 440px; overflow: hidden; display: flex; align-items: center; }
.find-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.find-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(236, 229, 217, .75), rgba(236, 229, 217, .1) 60%), linear-gradient(0deg, var(--ivory-2), transparent 30%); }
.find-head { position: relative; z-index: 1; }
.quiz { position: relative; z-index: 2; margin-top: -120px; border-radius: 34px; padding: 44px clamp(22px, 5vw, 64px) 30px; min-height: 420px; display: flex; flex-direction: column; }
.quiz-progress { height: 3px; border-radius: 3px; background: rgba(36, 39, 42, .08); overflow: hidden; margin-bottom: 34px; }
.quiz-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--sage-deep)); transition: width .8s var(--ease-out); }
.quiz-body { flex: 1; }
.q-step { animation: qIn .7s var(--ease-out) both; }
@keyframes qIn { from { opacity: 0; transform: translateX(24px); } }
.q-step h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.8rem, 3.2vw, 2.6rem); margin: 0 0 8px; line-height: 1.05; }
.q-step > p { color: var(--ink-soft); margin: 0 0 26px; }
.q-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.q-opt {
  text-align: left; padding: 20px; border-radius: 20px; border: 1px solid rgba(36, 39, 42, .1); background: rgba(255, 255, 255, .55);
  transition: transform .5s var(--ease), background .4s, border-color .4s, box-shadow .5s;
}
.q-opt:hover { transform: translateY(-3px); background: rgba(255, 255, 255, .95); box-shadow: 0 18px 40px -26px rgba(36, 39, 42, .45); }
.q-opt.picked { border-color: var(--sage-deep); background: var(--sage-3); }
.q-opt b { display: block; font-weight: 600; margin-bottom: 4px; }
.q-opt span { font-size: .86rem; color: var(--ink-soft); }
.q-opt .ico { font-size: 1.4rem; display: block; margin-bottom: 10px; color: var(--sage-deep); }
.quiz-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; }
.quiz-count { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
#quizBack[disabled] { opacity: 0; pointer-events: none; }

.q-result { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; animation: qIn .8s var(--ease-out) both; }
.q-result .r-art { position: relative; aspect-ratio: 1.45; display: grid; place-items: center; }
.q-result .r-art::before { content: ""; position: absolute; inset: 10%; border-radius: 50%; background: radial-gradient(closest-side, rgba(207, 224, 232, .9), transparent); filter: blur(16px); }
.q-result .r-art img { position: relative; width: 100%; animation: bob 6s ease-in-out infinite; filter: drop-shadow(0 30px 24px rgba(70, 60, 45, .22)); }
@keyframes bob { 50% { transform: translateY(-10px); } }
.q-result .match { font-size: .72rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--sage-deep); margin: 0 0 8px; }
.q-result h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 4vw, 3.4rem); margin: 0 0 10px; line-height: 1; }
.q-result p { color: var(--ink-soft); margin: 0 0 18px; }
.r-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.r-tags span { padding: 7px 13px; border-radius: 999px; background: rgba(255, 255, 255, .7); font-size: .8rem; font-weight: 500; border: 1px solid rgba(36, 39, 42, .08); }
.r-firm { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; font-size: .8rem; color: var(--ink-soft); }
.r-firm .track { flex: 1; height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--blue-2), var(--sage), var(--charcoal-2)); position: relative; }
.r-firm .track i { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--cream); box-shadow: 0 4px 12px -2px rgba(36, 39, 42, .5), inset 0 0 0 4px var(--sage-deep); left: 0; transition: left 1.4s var(--ease-out); }
.r-price { display: flex; align-items: baseline; gap: 12px; margin-bottom: 22px; }
.r-price b { font-family: var(--serif); font-weight: 400; font-size: 2.4rem; }
.r-price span { font-size: .84rem; color: var(--ink-soft); }
.r-ctas { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Footer ---------- */
.footer { background: var(--charcoal); color: rgba(251, 249, 245, .72); padding: 80px 0 30px; }
.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; padding-bottom: 50px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.footer-grid p { max-width: 40ch; font-size: .92rem; }
.news label { display: block; font-family: var(--serif); font-size: 1.6rem; color: var(--cream); margin-bottom: 14px; }
.news-row { display: flex; gap: 8px; padding: 6px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); }
.news input { flex: 1; min-width: 0; background: transparent; border: 0; padding: 0 16px; color: var(--cream); font: inherit; }
.news input:focus { outline: none; }
.copy { font-size: .78rem; padding-top: 24px; }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1080px) {
  .lx { grid-template-columns: 1fr 1fr; }
  .lx-list { grid-column: 1 / -1; grid-template-columns: repeat(5, 1fr); }
  .lx-list button { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 4px; }
  .lx-list button[aria-selected="true"] { transform: translateY(-3px); }
  .lx-list .t small { display: none; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav { padding-left: 18px; }
  .nav .btn-sm { padding: 10px 16px; font-size: .8rem; }
  .logo { letter-spacing: .24em; font-size: .85rem; }
  .hero { height: 260vh; }
  .hero-bg::after { background: linear-gradient(180deg, rgba(245, 241, 234, .9) 0%, rgba(245, 241, 234, .4) 40%, rgba(245, 241, 234, 0) 60%), linear-gradient(0deg, rgba(245, 241, 234, .6), transparent 30%); }
  .hero-copy { top: 96px; transform: none; }
  .hero-title { font-size: clamp(2.7rem, 12vw, 3.6rem); }
  .hero-sub { font-size: .95rem; margin-bottom: 20px; }
  .hero-stage { left: 50%; top: 70%; width: 92vw; }
  .hs-tags li { right: auto; left: 52%; font-size: .7rem; padding: 5px 10px 5px 5px; }
  .hs-tags li::before { display: none; }
  .hs-tags b { width: 20px; height: 20px; font-size: .58rem; }
  .hero-proof, .scroll-cue { display: none; }
  .hero-caption { white-space: normal; text-align: center; width: 90%; bottom: 5vh; }
  .lx { grid-template-columns: 1fr; }
  .lx-list { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .lx-list button { padding: 10px 4px; }
  .lx-list .t { font-size: .7rem; }
  .lx-depth { display: none; }
  .firm-grid, .cool-grid, .pos-grid, .tex-grid, .proof-grid { grid-template-columns: 1fr; gap: 40px; }
  .firm-stats { grid-template-columns: 1fr 1fr; }
  .firm-stats div:last-child { grid-column: 1 / -1; }
  .cool-copy { order: -1; }
  .pos-viz { aspect-ratio: 1.3; }
  .materials li { grid-template-columns: 120px 1fr 40px; }
  .stat { grid-template-columns: 110px 1fr; }
  .stat-num { font-size: 2.6rem; }
  .q-result { grid-template-columns: 1fr; }
  .layers, .firmness, .cooling, .positions, .texture, .proof { padding: 90px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
