/* ==========================================================================
   BEDBINDER DELUXE — design system "Deluxe" (2026-07)
   Oura-inspired light premium look. Brand guide tokens (official 2026):
   gold #9A7D55 · cream #EAEBDD · ink #141313 · white #FFFFFF
   Headings: Philosopher Bold · Body: Karla
   Used by index.html and every page built from templates/oura-sections.html
   ========================================================================== */

:root {
  /* Brand palette */
  --gold: #9A7D55;
  --gold-soft: #B39A78;
  --gold-tint: #D8C9B0;
  --gold-deep: #7A6040;
  --cream: #EAEBDD;
  --cream-soft: #F4F3EC;
  --ink: #141313;
  --ink-soft: #3A3835;
  --ink-muted: #6B675F;
  --white: #FFFFFF;

  /* Semantic */
  --bg: var(--cream-soft);
  --text: var(--ink);
  --text-muted: var(--ink-muted);
  --accent: var(--gold);

  /* Type */
  --font-display: "Philosopher", Georgia, serif;
  --font-body: "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --size-hero: clamp(2.6rem, 6vw, 4.6rem);
  --size-h2: clamp(2rem, 4vw, 3.2rem);
  --size-h3: clamp(1.3rem, 2.2vw, 1.7rem);
  --size-body: 1.0625rem;
  --size-small: 0.875rem;

  /* Layout */
  --container: 1200px;
  --container-narrow: 760px;
  --space-section: clamp(4.5rem, 10vw, 8.5rem);
  --space-block: clamp(2rem, 4vw, 3.5rem);
  --radius: 20px;
  --radius-pill: 50px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Base ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  margin: 0 0 0.5em;
  color: var(--ink);
}
h1 { font-size: var(--size-hero); letter-spacing: -0.01em; }
h2 { font-size: var(--size-h2); letter-spacing: -0.005em; }
h3 { font-size: var(--size-h3); }
p { margin: 0 0 1em; max-width: 62ch; }
a { color: var(--gold-deep); }
.link-gold { color: var(--gold-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.link-gold:hover { color: var(--gold); }
.section--dark .link-gold { color: var(--gold-soft); }
.section--dark .link-gold:hover { color: var(--gold-tint); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }
.container--narrow { max-width: var(--container-narrow); }

/* Signature: the closing seam --------------------------------------------
   Two short rules with a gap that closes when revealed. Echoes the product:
   the gap between mattresses disappearing. Use .seam between section intro
   and content. */
.seam {
  display: flex; justify-content: center; align-items: center;
  gap: 28px; margin: 1.75rem auto 2.25rem; border: 0;
  transition: gap 900ms var(--ease);
}
.seam::before, .seam::after {
  content: ""; width: 44px; height: 2px; background: var(--gold);
  transition: width 900ms var(--ease);
}
.seam.is-visible { gap: 0; }
.seam.is-visible::before, .seam.is-visible::after { width: 58px; }

/* Buttons ------------------------------------------------------------------ */
.btn {
  display: inline-block; padding: 16px 34px;
  font-family: var(--font-body); font-weight: 700; font-size: 1.17rem;
  border-radius: var(--radius-pill); text-decoration: none;
  transition: background 200ms ease, transform 200ms ease;
  border: 2px solid transparent;
}
.btn--gold { background: var(--gold); color: var(--white); }
.btn--gold:hover { background: var(--gold-deep); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--white); }
.section--dark .btn--ghost { color: var(--cream); border-color: var(--cream); }
.section--dark .btn--ghost:hover { background: var(--cream); color: var(--ink); }

/* Nav ---------------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244, 243, 236, 0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: box-shadow 250ms ease;
}
.nav.is-scrolled { box-shadow: 0 1px 0 rgba(20, 19, 19, 0.08); }
.nav__inner {
  max-width: var(--container); margin: 0 auto;
  padding: 0.9rem clamp(1.25rem, 4vw, 2.5rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.nav__logo img { height: 34px; width: auto; }
.nav__links { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; font-weight: 700;
}
.nav__links a:hover { color: var(--gold-deep); }
.nav__toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: 8px;
}
.nav__toggle span {
  display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0;
  transition: transform 250ms ease, opacity 250ms ease;
}

/* Hero ---------------------------------------------------------------------- */
.hero { position: relative; background: var(--cream); overflow: hidden; }
.hero__media { position: relative; }
.hero__media video, .hero__media img { width: 100%; height: min(82vh, 780px); object-fit: cover; }
.hero__media--mobile { display: none; }
.hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,19,19,0.55) 0%, rgba(20,19,19,0.08) 45%, rgba(20,19,19,0) 70%);
}
.hero__content {
  position: absolute; left: 0; right: 0; bottom: clamp(2rem, 7vh, 5rem);
  text-align: center; padding: 0 1.25rem;
}
.hero__content h1 { color: var(--white); text-shadow: 0 1px 24px rgba(20,19,19,0.35); margin-bottom: 0.35em; }
.hero__content .hero-sub {
  color: var(--cream); font-size: clamp(1.05rem, 2vw, 1.3rem);
  margin: 0 auto 1.6em; max-width: 34em; text-shadow: 0 1px 16px rgba(20,19,19,0.45);
}

/* Proof strip ---------------------------------------------------------------- */
.strip { background: var(--white); border-bottom: 1px solid rgba(20,19,19,0.06); }
.strip__inner {
  max-width: var(--container); margin: 0 auto;
  padding: 1.4rem clamp(1.25rem, 4vw, 2.5rem);
  display: flex; justify-content: center; gap: clamp(1.5rem, 6vw, 4.5rem);
  flex-wrap: wrap; text-align: center;
}
.strip__item { font-size: 0.95rem; color: var(--ink-soft); }
.strip__item strong { display: block; font-family: var(--font-display); font-size: 1.35rem; color: var(--ink); }
.strip__item .stars { color: var(--gold); letter-spacing: 2px; }

/* Sections ---------------------------------------------------------------- */
.section { padding: var(--space-section) 0; background: var(--white); }
.section--cream { background: var(--cream-soft); }
.section--dark { background: var(--ink); color: var(--cream); }
.section--dark h2, .section--dark h3 { color: var(--cream); }
.section--dark p { color: rgba(234, 235, 221, 0.82); }
.section__intro { text-align: center; max-width: 720px; margin: 0 auto var(--space-block); }
.section__intro .label {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 1rem;
}
.section--dark .section__intro .label { color: var(--gold-soft); }
.section__intro p { margin-left: auto; margin-right: auto; }

/* The gap visual (dark problem section) ------------------------------------ */
.gapviz { max-width: 680px; margin: 0 auto var(--space-block); }
.gapviz__beds { display: flex; justify-content: center; gap: 48px; transition: gap 1200ms var(--ease); }
.gapviz.is-visible .gapviz__beds { gap: 0; }
.gapviz__bed {
  width: min(38vw, 240px); height: 72px; border-radius: 10px;
  background: var(--cream); position: relative;
}
.gapviz__bed::after {
  content: ""; position: absolute; inset: 10px 12px auto;
  height: 10px; border-radius: 5px; background: rgba(20,19,19,0.12);
}
.gapviz__caption { text-align: center; margin-top: 1.25rem; font-size: var(--size-small); color: rgba(234,235,221,0.6); }

/* Problem photos (dark section) --------------------------------------------- */
.problem-photos {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(1.25rem, 3vw, 2rem); max-width: 980px; margin: 0 auto;
}
.problem-photo { margin: 0; }
.problem-photo img { width: 100%; height: auto; border-radius: var(--radius); }
.problem-photo figcaption {
  text-align: center; margin-top: 0.9rem;
  font-size: var(--size-small); color: rgba(234, 235, 221, 0.6);
}

/* Story blocks -------------------------------------------------------------- */
.story {
  display: flex; align-items: center; gap: clamp(2rem, 5vw, 4.5rem);
  margin-bottom: var(--space-section);
}
.story:last-child { margin-bottom: 0; }
.story--flip { flex-direction: row-reverse; }
.story__media { flex: 1; }
.story__media img, .story__media video { width: 100%; height: auto; border-radius: var(--radius); }
.story__text { flex: 1; text-align: center; }
.story__text .label {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 0.9rem;
}
.story__text p { margin-left: auto; margin-right: auto; }

/* Steps ---------------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 3vw, 2.5rem); }
.step {
  background: var(--white); border-radius: var(--radius); padding: 2rem 1.75rem;
  text-align: center; box-shadow: 0 2px 16px rgba(20,19,19,0.05);
}
.section--cream .step { background: var(--white); }
.step__num {
  font-family: var(--font-display); font-size: 1.1rem; color: var(--gold);
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 2px solid var(--gold-tint); border-radius: 50%;
  margin-bottom: 1.1rem;
}
.step img { border-radius: 12px; margin-bottom: 1.1rem; }

/* Video feature -------------------------------------------------------------- */
.video-feature { position: relative; max-width: 900px; margin: 0 auto; }
.video-feature video { width: 100%; border-radius: var(--radius); }
.video-feature__play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(20,19,19,0.25); border: 0; cursor: pointer; border-radius: var(--radius);
  transition: background 200ms ease;
}
.video-feature__play:hover { background: rgba(20,19,19,0.4); }
.video-feature__play span {
  width: 84px; height: 84px; border-radius: 50%; background: var(--gold);
  display: flex; align-items: center; justify-content: center;
}
.video-feature__play span::after {
  content: ""; margin-left: 6px;
  border-left: 22px solid var(--white); border-top: 14px solid transparent; border-bottom: 14px solid transparent;
}
.video-feature.is-playing .video-feature__play { display: none; }

/* Comparison table ------------------------------------------------------------ */
.compare-table { width: 100%; max-width: 820px; margin: 0 auto; border-collapse: collapse; }
.compare-table th, .compare-table td {
  padding: 1rem 1.25rem; text-align: left; border-bottom: 1px solid rgba(20,19,19,0.08);
}
.compare-table thead th { font-family: var(--font-display); font-size: 1.15rem; border-bottom: 2px solid var(--gold-tint); }
.compare-table thead th:nth-child(2) { color: var(--gold-deep); }
.compare-table td:not(:first-child) { text-align: center; }
.compare-table tbody th { font-weight: 400; }
.compare-table .yes { color: var(--gold-deep); font-weight: 700; }
.compare-table .no { color: var(--ink-muted); }

/* Reviews ---------------------------------------------------------------------- */
.reviews { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 3vw, 2rem); }
.review {
  background: var(--white); border-radius: var(--radius); padding: 2rem 1.75rem;
  box-shadow: 0 2px 16px rgba(20,19,19,0.05);
}
.review .stars { color: var(--gold); letter-spacing: 3px; margin-bottom: 0.8rem; }
.review blockquote { margin: 0 0 1.1rem; font-size: 1.02rem; }
.review figcaption { font-size: var(--size-small); color: var(--ink-muted); font-weight: 700; }

/* Specs table ------------------------------------------------------------------- */
.specs-table { width: 100%; max-width: 720px; margin: 0 auto; border-collapse: collapse; }
.specs-table th, .specs-table td { padding: 0.9rem 1.1rem; border-bottom: 1px solid rgba(20,19,19,0.08); text-align: left; }
.specs-table th { width: 40%; font-weight: 700; color: var(--ink-soft); }

/* FAQ ------------------------------------------------------------------------------ */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  border-bottom: 1px solid rgba(20,19,19,0.1); padding: 0.35rem 0;
}
.faq summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; padding: 0.9rem 0;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold); font-size: 1.5rem; font-family: var(--font-body); transition: transform 200ms ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-soft); padding-bottom: 1rem; }

/* Final CTA ---------------------------------------------------------------------- */
.cta-final { text-align: center; }
.cta-final__media { max-width: 900px; margin: 0 auto var(--space-block); }
.cta-final__media img { width: 100%; height: auto; border-radius: var(--radius); }
.cta-final h2 { max-width: 16em; margin-left: auto; margin-right: auto; }
.cta-final p { margin-left: auto; margin-right: auto; }
.cta-final .btn { margin-top: 1.25rem; }
.cta-final__note { font-size: var(--size-small); color: rgba(234,235,221,0.55); margin-top: 1.25rem; }

/* Footer ------------------------------------------------------------------------------ */
.footer { background: var(--ink); color: rgba(234,235,221,0.7); padding: 3.5rem 0 2.5rem; }
.footer a { color: var(--cream); text-decoration: none; }
.footer a:hover { color: var(--gold-soft); }
.footer__inner {
  max-width: var(--container); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  display: flex; flex-wrap: wrap; gap: 2.5rem; justify-content: space-between; align-items: flex-start;
}
.footer__brand img { height: 30px; width: auto; margin-bottom: 1rem; }
.footer__links { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer__links ul { list-style: none; margin: 0; padding: 0; }
.footer__links li { margin-bottom: 0.5rem; }
.footer__links .footer__title { color: var(--cream); font-family: var(--font-display); font-weight: 700; font-size: 1rem; margin-bottom: 0.9rem; }
.footer__legal {
  max-width: var(--container); margin: 2.5rem auto 0; padding: 1.5rem clamp(1.25rem, 4vw, 2.5rem) 0;
  border-top: 1px solid rgba(234,235,221,0.12); font-size: var(--size-small);
}

/* Utilities ---------------------------------------------------------------------- */
.mt-block { margin-top: var(--space-block); }
.mb-0 { margin-bottom: 0; }
.stars-gold { color: var(--gold); letter-spacing: 2px; }

/* Reveal on scroll ---------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* Responsive ------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .problem-photos { grid-template-columns: 1fr; }
  .story, .story--flip { flex-direction: column; }
  .story__media { order: 1; width: 100%; }
  .story__text { order: 2; }
  .steps, .reviews { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--cream-soft);
    box-shadow: 0 12px 24px rgba(20,19,19,0.12);
    max-height: 0; overflow: hidden; transition: max-height 300ms ease;
  }
  .nav__links.is-open { max-height: 400px; }
  .nav__links li { border-top: 1px solid rgba(20,19,19,0.06); }
  .nav__links a { display: block; padding: 1rem clamp(1.25rem, 4vw, 2.5rem); }
  .nav__toggle { display: block; }
  .nav__cta { display: none; }
  .hero__media--desktop { display: none; }
  .hero__media--mobile { display: block; }
  .hero__media video, .hero__media img { height: 70vh; }
  .gapviz__bed { height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .seam, .gapviz__beds { transition: none; }
  .reveal { opacity: 1; transform: none; }
}
@media print {
  .nav, .hero__media video, .video-feature__play { display: none; }
}
