/* ============================================================
   Sleep Clarity Report — Orion Sleep Disruption Test
   Design system: "The Overnight Chart" — an editorial consumer-
   guide report. White ground, soft slate-blue report panels,
   navy structure, one emerald signal reserved for the calibrated
   test and the page's single action.
   ============================================================ */

@font-face {
  font-family: "Newsreader";
  src: url("../assets/fonts/newsreader-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../assets/fonts/newsreader-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../assets/fonts/newsreader-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../assets/fonts/newsreader-500italic.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../assets/fonts/ibm-plex-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../assets/fonts/ibm-plex-sans-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../assets/fonts/ibm-plex-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../assets/fonts/ibm-plex-sans-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Neutrals */
  --white: #ffffff;
  --panel: #f4f7fa;
  --panel-line: #e4eaf1;
  --ink: #1e293b;
  --ink-soft: #475569;
  --ink-faint: #5b6b82;

  /* Structural — navy */
  --navy: #0f4c81;
  --navy-deep: #0b3a63;
  --navy-soft: #e8eef5;
  --navy-line: rgba(15, 76, 129, 0.18);
  --navy-line-strong: rgba(15, 76, 129, 0.3);

  /* Signal — emerald (reserved: calibrated test + primary action) */
  --emerald: #0d9488;
  --emerald-deep: #0b7a70;
  --emerald-soft: #e3f5f3;
  --emerald-line: rgba(13, 148, 136, 0.35);

  /* Type */
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;

  /* Shape */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Spacing rhythm */
  --space-section: clamp(3.5rem, 7vw, 6rem);
  --pad-inline: clamp(1.25rem, 5vw, 3rem);

  --shadow-cta: 0 1px 0 rgba(15, 23, 42, 0.1), 0 14px 26px -14px rgba(15, 23, 42, 0.42);
  --shadow-cta-hover: 0 1px 0 rgba(15, 23, 42, 0.12), 0 20px 32px -14px rgba(15, 23, 42, 0.5);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--navy-deep); margin: 0; font-weight: 600; }
p { margin: 0 0 1.1em; }
a { color: inherit; }
ul, ol { padding: 0; margin: 0; list-style: none; }
button { font: inherit; }

::selection { background: var(--emerald-deep); color: var(--white); }

/* Scrollbar theming */
* { scrollbar-color: var(--navy-line-strong) var(--panel); scrollbar-width: thin; }
*::-webkit-scrollbar { height: 10px; width: 10px; }
*::-webkit-scrollbar-track { background: var(--panel); }
*::-webkit-scrollbar-thumb { background: var(--navy-line-strong); border-radius: 10px; }

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

.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;
}

/* ============================================================
   Disclosure bar
   ============================================================ */
.disclosure-bar {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.8125rem;
  line-height: 1.5;
  padding-inline: var(--pad-inline);
}
.disclosure-bar__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding-block: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: baseline;
}
.disclosure-bar__text strong { color: #bfe3dd; font-weight: 600; }
.disclosure-bar__text { margin: 0; }

/* ============================================================
   Masthead
   ============================================================ */
.masthead {
  border-bottom: 1px solid var(--navy-line);
  background: var(--white);
}
.masthead__top {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem var(--pad-inline) 1.1rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.masthead__wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  letter-spacing: -0.01em;
  color: var(--navy-deep);
}
.masthead__wordmark em {
  font-style: italic;
  color: var(--emerald-deep);
}
.masthead__nav {
  display: none;
  gap: 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.masthead__nav a {
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.masthead__nav a:hover { color: var(--navy-deep); border-color: var(--navy-line-strong); }
@media (min-width: 760px) {
  .masthead__nav { display: flex; }
}
.masthead__rubric {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--pad-inline) 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
}
.masthead__rubric .sep { color: var(--navy-line-strong); }
.masthead__rubric .issue { color: var(--ink-faint); font-weight: 500; letter-spacing: 0.04em; text-transform: none; }

/* ============================================================
   Layout rhythm
   ============================================================ */
.section {
  padding-block: var(--space-section);
}
.section--panel { background: var(--panel); }
.section__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: var(--pad-inline);
}
.section-heading {
  font-size: clamp(1.75rem, 3.6vw, 2.25rem);
  line-height: 1.15;
  max-width: 34ch;
}
.subsection-heading {
  font-size: clamp(1.3rem, 2.4vw, 1.5rem);
  margin-top: 2.25rem;
  margin-bottom: 1rem;
}
.prose {
  max-width: 68ch;
  color: var(--ink);
}
.prose p { color: var(--ink); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding-block: clamp(2.5rem, 6vw, 4rem) var(--space-section);
}
.hero__grid {
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: var(--pad-inline);
  display: grid;
  gap: clamp(2.5rem, 5vw, 3.5rem);
  align-items: start;
}
@media (min-width: 960px) {
  .hero__grid { grid-template-columns: 1.08fr 1fr; }
}
.hero-headline {
  font-size: clamp(2.1rem, 4.6vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--navy-deep);
  max-width: 18ch;
}
.hero-sub {
  margin-top: 1.25rem;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 54ch;
}

/* At-a-glance list (replaces icon-card grids) */
.glance {
  margin-top: 2rem;
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-md);
  background: var(--white);
  overflow: hidden;
}
.glance__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--navy-soft);
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid var(--navy-line);
}
.glance__row {
  display: flex;
  gap: 0.9rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--panel-line);
  align-items: flex-start;
}
.glance__row:last-child { border-bottom: none; }
.glance__mark {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 0.2rem;
  color: var(--emerald);
}
.glance__text strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
}
.glance__text span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  margin-top: 0.15rem;
}

.cta-block { margin-top: 2rem; }
.cta-block--center { text-align: center; margin-top: 2.5rem; }
.cta-microcopy {
  margin: 0.7rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-faint);
}
.cta-block--center .cta-microcopy { margin-inline: auto; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border-radius: var(--radius-md);
  padding: 1rem 1.6rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn--primary {
  background: var(--navy);
  color: var(--white);
  box-shadow: var(--shadow-cta);
}
.btn--primary:hover {
  background: var(--navy-deep);
  box-shadow: var(--shadow-cta-hover);
  transform: translateY(-1px);
}
.btn--large { padding: 1.15rem 2rem; font-size: 1.0625rem; }
.btn--secondary {
  background: var(--emerald-deep);
  color: var(--white);
}
.btn--secondary:hover { background: #095f58; }
.btn__arrow {
  width: 1.05em;
  height: 1.05em;
  transition: transform 0.15s ease;
}
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ============================================================
   Signature figure — Overnight Thermal Trace
   ============================================================ */
.trace-figure {
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
  background: var(--white);
  padding: 1.25rem 1.25rem 1rem;
}
.trace-figure__eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--emerald-deep);
  margin-bottom: 0.35rem;
}
.trace-figure svg { width: 100%; height: auto; display: block; }
.trace-figure figcaption {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--navy-line);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.trace-figure figcaption strong { color: var(--ink); font-family: var(--font-display); font-style: italic; font-weight: 500; }

.trace-sleepband { fill: var(--navy-soft); }
.trace-gridline { stroke: var(--navy-line); stroke-width: 1; }
.trace-axislabel { fill: var(--ink-faint); font-family: var(--font-body); font-size: 12px; font-weight: 500; }
.trace-line { fill: none; stroke: var(--emerald); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.trace-callout-line { stroke: var(--emerald); stroke-width: 1.25; stroke-dasharray: 3 3; }
.trace-callout-text { fill: var(--navy-deep); font-family: var(--font-body); font-size: 11.5px; font-weight: 600; }
.trace-dot {
  fill: var(--emerald);
}
.trace-ring {
  fill: none;
  stroke: var(--emerald);
  stroke-width: 1.5;
  transform-origin: center;
  animation: trace-pulse 2.6s ease-out infinite;
}
.trace-ring--d2 { animation-delay: 0.6s; }
.trace-ring--d3 { animation-delay: 1.2s; }
@keyframes trace-pulse {
  0% { opacity: 0.75; transform: scale(0.6); }
  80%, 100% { opacity: 0; transform: scale(2.1); }
}

/* mini legend */
.trace-legend {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.trace-legend__item { display: flex; align-items: center; gap: 0.4rem; }
.trace-legend__swatch { width: 14px; height: 3px; border-radius: 2px; flex: none; }
.trace-legend__swatch--line { background: var(--emerald); }
.trace-legend__swatch--band { background: var(--navy-soft); border: 1px solid var(--navy-line); height: 10px; }

/* ============================================================
   Mechanism / comparison
   ============================================================ */
.mech-figure {
  margin-top: 2rem;
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
}
.mech-figure img { width: 100%; }
.mech-figure figcaption {
  padding: 0.9rem 1.25rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--navy-line);
  background: var(--white);
}

.table-wrap {
  margin-top: 1.5rem;
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  background: var(--white);
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-size: 0.9375rem;
}
.compare-table caption { caption-side: top; text-align: left; }
.compare-table th, .compare-table td {
  padding: 0.95rem 1.15rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--panel-line);
}
.compare-table thead th {
  background: var(--navy-deep);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  border-bottom: none;
}
.compare-table thead th:first-child { background: var(--navy); }
.compare-table tbody th {
  font-weight: 600;
  color: var(--ink);
  background: var(--panel);
  white-space: nowrap;
}
.compare-table tbody tr:last-child td,
.compare-table tbody tr:last-child th { border-bottom: none; }
.compare-table__lead {
  background: var(--emerald-soft);
  font-weight: 500;
  color: var(--ink);
  position: relative;
}
.compare-table thead th.compare-table__lead-head {
  background: var(--emerald-deep);
}
.compare-table__badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--emerald-deep);
  background: var(--white);
  border: 1px solid var(--emerald-line);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  margin-bottom: 0.4rem;
}

/* ============================================================
   Process list (How it works)
   ============================================================ */
.process {
  margin-top: 2rem;
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
  background: var(--white);
  overflow: hidden;
}
.process__row {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 1rem;
  padding: 1.5rem 1.35rem;
  border-bottom: 1px solid var(--panel-line);
}
.process__row:last-child { border-bottom: none; }
.process__num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--emerald-deep);
  line-height: 1;
}
.process__row h4 {
  font-size: 1.1875rem;
  margin-bottom: 0.35rem;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
}
.process__row p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

.review-figure {
  margin-top: 2rem;
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
}
.review-figure img { width: 100%; }
.review-figure figcaption {
  padding: 0.85rem 1.25rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  border-top: 1px dashed var(--navy-line);
}

/* Callout: HSA/FSA */
.callout {
  margin-top: 2.5rem;
  border: 1px solid var(--emerald-line);
  border-radius: var(--radius-lg);
  background: var(--emerald-soft);
  display: grid;
  gap: 1.5rem;
  padding: 1.75rem;
}
@media (min-width: 720px) {
  .callout { grid-template-columns: 1fr 220px; align-items: center; }
}
.callout__title {
  font-size: 1.2rem;
  color: var(--navy-deep);
  margin-bottom: 0.5rem;
}
.callout__body p { color: var(--ink); margin-bottom: 0.6rem; }
.callout__body p:last-child { margin-bottom: 0; font-size: 0.85rem; color: var(--ink-soft); }
.callout__art {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--emerald-line);
}

/* ============================================================
   FAQ
   ============================================================ */
.faq {
  margin-top: 2rem;
  border-top: 1px solid var(--navy-line);
}
.faq-row {
  border-bottom: 1px solid var(--navy-line);
}
.faq-row__summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0.25rem;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--navy-deep);
}
.faq-row__summary::-webkit-details-marker { display: none; }
.faq-row__glyph {
  flex: none;
  width: 22px;
  height: 22px;
}
.faq-row__glyph rect { fill: var(--emerald); }
.faq-row__glyph .v { transition: transform 0.2s ease, opacity 0.2s ease; transform-origin: center; }
.faq-row[open] .faq-row__glyph .v { transform: rotate(90deg); opacity: 0; }
.faq-row__content {
  padding: 0 0.25rem 1.4rem;
  color: var(--ink-soft);
  max-width: 68ch;
  font-size: 0.9625rem;
}
.faq-row__content p { margin: 0; }

/* ============================================================
   Closing
   ============================================================ */
.closing {
  background: var(--navy-deep);
  color: var(--white);
}
.closing .section__inner {
  display: grid;
  gap: clamp(2rem, 5vw, 3rem);
  align-items: center;
}
@media (min-width: 900px) {
  .closing .section__inner { grid-template-columns: 1fr 0.9fr; }
}
.closing__photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  order: -1;
}
@media (min-width: 900px) {
  .closing__photo { order: 2; }
}
.closing__photo img { width: 100%; }
.closing-heading {
  color: var(--white);
  font-size: clamp(1.75rem, 3.6vw, 2.25rem);
  max-width: 18ch;
}
.closing-text {
  margin-top: 1.1rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.0625rem;
  max-width: 50ch;
}
.closing .btn--primary {
  margin-top: 1.75rem;
  background: var(--emerald-deep);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25), 0 16px 30px -14px rgba(0, 0, 0, 0.55);
}
.closing .btn--primary:hover {
  background: #095f58;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 20px 34px -14px rgba(0, 0, 0, 0.65);
}
.closing .cta-microcopy { color: rgba(255, 255, 255, 0.6); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--panel-line);
}
.site-footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem var(--pad-inline) 3rem;
}
.site-footer__disclaimer {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ink-faint);
  max-width: 78ch;
  margin-bottom: 1.25rem;
}
.site-footer__meta {
  font-size: 0.8125rem;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.8125rem;
}
.site-footer__links a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer__links a:hover { color: var(--navy-deep); }

/* ============================================================
   Scroll reveal
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
