/* PC Sleep Center — one night, dusk to dawn, in a muted sky: slate and mauve-gray dusk, deep navy night */

:root {
  /* PulmoCrit brand */
  --navy: #1b2c51;
  --violet: #7057a5;

  /* sky stops, in page order */
  --dusk-1: #efebec;
  --dusk-2: #e5e0e5;
  --dusk-3: #d6d0dc;
  --dusk-4: #bcb6cd;
  --ridge-1: #a7a1c0;
  --ridge-2: #8d88af;
  --ridge-3: #75719d;
  --evening: #4f4d78;
  --evening-2: #45446e;
  --late: #393a63;
  --indigo: #2e3258;
  --midnight-0: #242c50;
  --midnight: #1b2c51;
  --predawn: #1d2a52;
  --day: #f6f8fd;
  --day-2: #e8eff9;
  --day-sky: #dbe6f5;

  /* ink */
  --ink: var(--navy);
  --ink-2: #44506f;
  --ink-night: #f6f2ff;
  --ink-night-2: #e4dcf8;
  --rule-night: rgba(255, 255, 255, 0.2);
  --rule-day: rgba(27, 44, 81, 0.16);

  /* after dark the accent is warm ivory (a reading lamp, not a sun); actions are white */
  --amber: #f1e8d8;
  --amber-hi: #faf5ec;
  --rem: #b3a8e2;
  --portrait-bg: linear-gradient(180deg, #eef0f4 0%, #d7dbe5 100%);

  --font-serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --font-display: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, "Cascadia Mono", monospace;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --gutter: clamp(16px, 4vw, 48px);
  --masthead-h: calc(var(--header-now, 86px) + var(--facet-h, 48px));  /* the header plus the center's row */
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-compact, 64px) + var(--facet-h, 48px) + 24px);
  scrollbar-color: var(--violet) var(--day);
  background: var(--day);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--day);
  overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  text-wrap: balance;
}
h1, h2 { font-family: var(--font-serif); font-weight: 400; font-optical-sizing: auto; }

h2 {
  font-size: clamp(2.1rem, 3.8vw, 3.3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 20ch;
}

h3 {
  font-weight: 600;
  font-size: 1.22rem;
  line-height: 1.22;
  letter-spacing: -0.01em;
}

p { text-wrap: pretty; }

a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 0.2em; }

::selection { background: #dcd5f3; color: var(--navy); }

:focus-visible {
  outline: 2px solid var(--focus, var(--navy));
  outline-offset: 3px;
  border-radius: 4px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: clip;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 200ms var(--ease-out);
}
.skip-link:focus { transform: none; }

.wrap {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left));
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-inline { width: 1.1em; height: 1.1em; vertical-align: -0.2em; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 48px;
  padding: 0.7em 1.3em;
  border: 0;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}
.btn:active { transform: scale(0.98); }

.btn-light { background: #fff; color: var(--navy); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-ghost {
  background: transparent;
  color: inherit;
  box-shadow: inset 0 0 0 1px currentColor;
}
.btn-lg { min-height: 54px; padding: 0.8em 1.55em; font-size: 1rem; }

@media (hover: hover) {
  .btn-light:hover { background: #e9e7f2; }
  .btn-navy:hover { background: #24396a; }
  .btn-ghost:hover { background: rgba(27, 44, 81, 0.05); }
}

/* ---------- shared ridges ---------- */

.ridges { position: relative; }
.ridges svg { display: block; width: 100%; height: clamp(150px, 22vw, 320px); }

/* ---------- 7:00 PM · hero ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding-top: clamp(24px, 5vh, 64px);
  background: linear-gradient(180deg, var(--dusk-1) 0%, var(--dusk-2) 28%, var(--dusk-3) 56%, var(--dusk-4) 86%);
  overflow: clip;
  isolation: isolate;
}

.hero-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-sun {
  position: absolute;
  left: 77%;
  top: 0;
  width: clamp(180px, 22vw, 340px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 252, 246, 0.95) 0%, rgba(255, 249, 240, 0.6) 22%, rgba(255, 246, 236, 0.22) 44%, rgba(255, 244, 234, 0) 68%);
  transform: translate3d(-50%, calc(-52% + var(--sun-y, 0px)), 0);
  will-change: transform;
}
.hero-dim {
  position: absolute;
  inset: 0;
  background: #4a4870;
  opacity: var(--dim, 0);
}

.hero-inner { position: relative; z-index: 2; margin-bottom: calc(-1 * clamp(28px, 4.5vw, 72px)); }

.hero h1 {
  font-size: clamp(2.7rem, 5.2vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  max-width: 13ch;
}

.hero-sub {
  margin-top: clamp(18px, 3vh, 28px);
  max-width: 62ch;
  font-size: clamp(1.125rem, 1.5vw, 1.3rem);
  color: #2b3156;
}

.doors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 820px;
  margin-top: clamp(22px, 4vh, 36px);
}

.door {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 20px 24px 22px;
  border-radius: 10px;
  text-decoration: none;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, box-shadow 200ms ease;
}
.door:active { transform: scale(0.98); }
.door-who { font-size: 0.95rem; font-weight: 600; opacity: 0.9; }
.door-what {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.door-note { font-size: 0.98rem; }

.door-patient {
  background: var(--navy);
  color: #fff;
  --focus: var(--navy);
}
.door-physician {
  color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--navy);
}
@media (hover: hover) {
  .door-patient:hover { background: #24396a; }
  .door-physician:hover { background: rgba(27, 44, 81, 0.07); }
}

.ridges-dusk { margin-top: auto; }
.ridges-dusk svg { height: clamp(120px, 15vw, 230px); }
.ridges-dusk .r1 { fill: var(--ridge-1); opacity: 0.7; }
.ridges-dusk .r2 { fill: var(--ridge-2); opacity: 0.85; }
.ridges-dusk .r3 { fill: var(--ridge-3); }
.ridges-dusk .r4 { fill: var(--evening); }
.ridge-ground { background: var(--evening); margin-top: -1px; }
.ridges-dusk svg, .ridge-ground { position: relative; z-index: 1; }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  padding-block: 4px 28px;
  color: var(--ink-night);
  font-weight: 600;
  font-size: 1rem;
}
.facts li { display: inline-flex; align-items: center; gap: 10px; }
.ridge-ground { --focus: #fff; }
.facts a { display: inline-block; padding-block: 10px; margin-block: -10px; color: var(--ink-night); text-decoration-color: rgba(255, 255, 255, 0.5); text-decoration-thickness: 1px; }
.facts li::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--amber);
}

@media (max-width: 720px) {
  .doors { grid-template-columns: 1fr; }
  /* phones: leave sky between the doors and the ridges for the sun to set into */
  .hero-sun { left: 76%; width: 128px; }
  .hero-inner { margin-bottom: 64px; }
}

/* ---------- bands ---------- */

.band {
  position: relative;
  padding-block: clamp(84px, 11vw, 160px);
  isolation: isolate;
}

.band-grid { display: grid; grid-template-columns: minmax(0, 1fr); }

.when {
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.when span {
  display: inline-block;
  padding: 0.3em 0.7em;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px currentColor;
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  white-space: nowrap;
}

@media (min-width: 960px) {
  .band-grid {
    grid-template-columns: 8.5rem minmax(0, 1fr);
    column-gap: clamp(24px, 4vw, 64px);
  }
  .when { position: sticky; top: calc(var(--masthead-h) + 32px); align-self: start; padding-top: 0.55em; }
}
@media (max-width: 959px) {
  .when { position: absolute; top: 28px; right: max(var(--gutter), env(safe-area-inset-right)); }
}

.band-body > * + * { margin-top: clamp(18px, 2.4vw, 28px); }
.band-body > h2 + .lede { margin-top: 20px; }

.lede { font-size: clamp(1.15rem, 1.6vw, 1.35rem); max-width: 58ch; }

.fine { font-size: 0.95rem; }

/* dark bands share ink */
.band-conditions,
.band-children,
.band-studies,
.band-night,
.dawn {
  color: var(--ink-night);
  --focus: #fff;
}
.band-conditions .lede,
.band-children p,
.band-studies .lede,
.band-night .lede { color: var(--ink-night-2); }

/* checklist ticks, drawn */
.ticks { display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 34px; }
.ticks li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.32em;
  width: 15px;
  height: 8px;
  border-left: 1.5px solid var(--tick, var(--amber));
  border-bottom: 1.5px solid var(--tick, var(--amber));
  transform: rotate(-45deg);
}

/* ---------- 8:00 PM · conditions ---------- */

.band-conditions {
  padding-top: clamp(72px, 8vw, 120px);
  background: linear-gradient(180deg, var(--evening) 0%, var(--evening-2) 100%);
}

.symptoms { margin-top: clamp(36px, 5vw, 56px) !important; border-bottom: 1px solid var(--rule-night); }
.symptoms li {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 12px clamp(24px, 4vw, 56px);
  padding-block: clamp(22px, 2.6vw, 30px);
  border-top: 1px solid var(--rule-night);
}
.symptom {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #fff;
}
.dx { color: var(--ink-night-2); }
.dx strong {
  display: block;
  margin-bottom: 2px;
  font-family: var(--font-display);
  font-weight: 600;
  color: #fff;
}
.band-cta { font-size: 1.15rem; }
.band-cta a { display: inline-block; padding-block: 10px; font-weight: 600; color: #fff; }

@media (max-width: 720px) {
  .symptoms li { grid-template-columns: 1fr; }
}

/* ---------- 8:30 PM · children ---------- */

.band-children {
  background: linear-gradient(180deg, var(--evening-2) 0%, var(--late) 100%);
  overflow: clip;
}

.nightlight {
  position: absolute;
  z-index: -1;
  right: -26vw;
  top: -22%;
  width: min(1200px, 95vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(241, 232, 216, 0.2) 0%, rgba(241, 232, 216, 0.09) 24%, rgba(241, 232, 216, 0.03) 44%, rgba(241, 232, 216, 0) 64%);
  pointer-events: none;
}

.children-title {
  font-size: clamp(2.5rem, 5.2vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 17ch;
}
.children-title em { font-style: italic; }

.children-claim {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.3rem, 2.1vw, 1.7rem);
  line-height: 1.34;
  letter-spacing: -0.01em;
  max-width: 36ch;
  color: #fff !important;
}
.children-claim em { font-style: italic; }

.children-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  margin-top: clamp(36px, 5vw, 56px) !important;
}
.children-cols > div:first-child { display: grid; align-content: start; gap: 24px; justify-items: start; }
.children-cols > div:first-child p:first-child { font-size: 1.2rem; max-width: 46ch; }
.children-cols .fine { margin-top: -10px; }

.signs { padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.4); }
.signs h3 { margin-bottom: 18px; color: #fff; }
.signs li { font-size: 1.15rem; color: #fff; }

@media (max-width: 860px) {
  .children-cols { grid-template-columns: 1fr; }
}

/* ---------- 9:30 PM · studies ---------- */

.band-studies {
  background: linear-gradient(180deg, var(--late) 0%, var(--indigo) 55%, var(--midnight-0) 100%);
}

.tabs { margin-top: clamp(32px, 4vw, 48px) !important; }

.tablist {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.tablist [role="tab"] {
  position: relative;
  z-index: 1;
  min-height: 46px;
  padding: 0 clamp(16px, 2.4vw, 28px);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  cursor: pointer;
  transition: color 200ms ease;
}
.tablist [role="tab"][aria-selected="true"] { color: var(--navy); }
.tab-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: var(--thumb-w, 50%);
  border-radius: 6px;
  background: #fff;
  transform: translateX(var(--thumb-x, 6px));
  transition: transform 300ms var(--ease-out), width 300ms var(--ease-out);
}

.tabpanel { margin-top: clamp(28px, 3.5vw, 44px); border-radius: 12px; }
.tabpanel[hidden] { display: none; }
.tabpanel:not([hidden]) { animation: panel-in 320ms var(--ease-out); }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); filter: blur(3px); }
}

.study-split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
}
.study-split h3 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.5rem, 2.3vw, 1.95rem); line-height: 1.15; letter-spacing: -0.015em; color: #fff; max-width: 24ch; }

/* the lab is a room first: a night-light glow behind it */
.study-lab { position: relative; }
.study-lab::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -14%;
  top: -40%;
  width: min(640px, 70%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(241, 232, 216, 0.12) 0%, rgba(241, 232, 216, 0.05) 30%, rgba(241, 232, 216, 0) 60%);
  pointer-events: none;
}
.study-split > div:first-child > p { margin-top: 12px; color: var(--ink-night-2); max-width: 52ch; }

.study-types { margin-top: 28px; border-bottom: 1px solid var(--rule-night); }
.study-types > div {
  display: grid;
  grid-template-columns: minmax(10rem, 0.8fr) minmax(0, 1.4fr);
  gap: 6px 24px;
  padding-block: 16px;
  border-top: 1px solid var(--rule-night);
}
.study-types dt { font-family: var(--font-display); font-weight: 600; color: #fff; }
.study-types dd { color: var(--ink-night-2); }

.channels {
  align-self: start;
  padding: 24px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
}
.channels-title { font-family: var(--font-display); font-weight: 600; color: #fff; margin-bottom: 8px; }
.channels li {
  display: grid;
  grid-template-columns: 4.6em minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding-block: 10px;
  color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='20' viewBox='0 0 120 20'%3E%3Cpath d='M0 10 C 6 2, 9 2, 15 10 S 24 18, 30 10 S 36 4, 42 10 S 50 16, 56 10 S 62 0, 68 10 S 78 19, 84 10 S 92 6, 98 10 S 106 14, 112 10 S 118 8, 120 10' fill='none' stroke='%23ffffff' stroke-opacity='0.22' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 120px 20px;
  background-position: var(--trace-x, 0) 100%;
  padding-bottom: 22px;
}
.channels li:nth-child(2n) { --trace-x: -37px; }
.channels li:nth-child(3n) { --trace-x: -71px; }
.channels li span {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-night-2);
}

@media (max-width: 900px) {
  .study-split { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .tablist { display: grid; width: 100%; }
  .tablist [role="tab"] { padding: 0 10px; font-size: 0.95rem; }
  .study-types > div { grid-template-columns: 1fr; }
}

/* ---------- decks moved through by scrolling (owner, 2026-11-18) ----------
   sleep.js adds .is-deck to a track. Held (.is-stacked.is-pinned): the cards or panels share one place and the stage
   holds still under the header and the center's row; the track is the stage plus one stretch of scrolling per card,
   and --p is the progress (0–1). Followed (.is-spy, when the stage would not fit): cards and panels sit one after
   another and the tabs stick under the center's row, marking the one being read. */

.deck-track.is-pinned .deck-stage { position: sticky; top: calc(var(--masthead-h) + 20px); }

/* sleep problems: an index of six beside a deck of flash cards */
.cond-head > * + * { margin-top: 20px; }
.cond-track.is-deck .cond-stage {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.cond-index { position: relative; display: grid; margin-top: 30px !important; padding-left: 22px; }
.cond-index::before,
.cond-index::after { content: ""; position: absolute; left: 3px; top: 12px; width: 1px; }
.cond-index::before { bottom: 12px; background: var(--rule-night); }
.cond-index::after { height: calc((100% - 24px) * var(--p, 0)); background: #fff; }
.cond-index [role="tab"] {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-height: 36px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--ink-night-2);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: color 200ms ease;
}
.cond-index [role="tab"] span { font-family: var(--font-mono); font-size: 0.76rem; opacity: 0.75; }
.cond-index [role="tab"]::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--evening);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  transition: background 200ms ease, box-shadow 200ms ease;
}
.cond-index [aria-selected="true"] { color: #fff; }
.cond-index [aria-selected="true"]::before { background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.14); }
@media (hover: hover) { .cond-index [role="tab"]:hover { color: #fff; } }

.cond-track.is-deck .symptoms { display: grid; margin-top: 0 !important; border-bottom: 0; }
.cond-track.is-deck .symptoms li {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(26px, 3.2vw, 44px);
  border-top: 0;
  border-radius: 16px;
  background: linear-gradient(165deg, #5e5c8a 0%, #4b4a77 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 30px 60px -36px rgba(10, 10, 35, 0.75);
}
.cond-track.is-stacked .symptoms li {
  grid-area: 1 / 1;
  min-height: clamp(280px, 36vh, 380px);
  transform-origin: 50% 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-40px) scale(0.87);
  transition: transform 560ms var(--ease-out), opacity 420ms ease, visibility 420ms;
}
.cond-track.is-stacked .symptoms li[data-d="0"] { z-index: 3; opacity: 1; visibility: visible; transform: none; }
.cond-track.is-stacked .symptoms li[data-d="1"] { z-index: 2; opacity: 0.55; visibility: visible; transform: translateY(-16px) scale(0.955); }
.cond-track.is-stacked .symptoms li[data-d="2"] { z-index: 1; opacity: 0.25; visibility: visible; transform: translateY(-30px) scale(0.91); }
.cond-track.is-stacked .symptoms li[data-d^="-"] { z-index: 4; transform: translateY(40px) rotate(-1.5deg); }   /* dealt: slides away */
/* followed: the six cards in a column, the heading and index travelling beside them */
.cond-track.is-spy .symptoms { gap: 14px; }
.cond-track.is-spy .cond-stage { align-items: start; }
.cond-track.is-spy .cond-head { position: sticky; top: calc(var(--masthead-h) + 20px); }
.card-n { display: none; font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.04em; color: var(--ink-night-2); }
.cond-track.is-deck .card-n { display: block; }
.cond-track.is-deck .symptom { font-size: clamp(1.45rem, 2.3vw, 2.05rem); line-height: 1.22; max-width: 24ch; }
.cond-track.is-deck .dx { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--rule-night); }

@media (max-width: 959px) {
  .cond-track.is-deck .cond-stage { grid-template-columns: 1fr; gap: 22px; }
  .cond-track.is-deck .cond-head { display: contents; }
  .cond-track.is-deck .cond-head > * + * { margin-top: 0; }
  .cond-index {
    display: flex;
    gap: 6px;
    margin-top: 0 !important;
    margin-inline: calc(-1 * var(--gutter));
    padding: 2px var(--gutter) 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .cond-index::-webkit-scrollbar { display: none; }
  .cond-index::before, .cond-index::after, .cond-index [role="tab"]::before { display: none; }
  .cond-index [role="tab"] {
    flex: none;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
    font-size: 0.9rem;
    white-space: nowrap;
  }
  .cond-index [aria-selected="true"] { background: #fff; color: var(--navy); }
  .cond-track.is-stacked .symptoms li { min-height: 240px; }
  .cond-track.is-spy .cond-index {
    position: sticky;
    top: var(--masthead-h);
    z-index: 4;
    padding-block: 10px;
    background: color-mix(in srgb, var(--evening-2) 94%, transparent);
    backdrop-filter: blur(8px);
  }
}

/* sleep studies: the two tabs hold still while scrolling switches between them */
.studies-track { margin-top: clamp(32px, 4vw, 48px) !important; }
.studies-track .tabs { margin-top: 0 !important; }
.studies-track.is-deck .tabpanel { animation: none; }
.studies-track.is-stacked .tabpanels { display: grid; }
.studies-track.is-stacked .tabpanel { grid-area: 1 / 1; transition: opacity 360ms ease, transform 420ms var(--ease-out), visibility 360ms; }
.studies-track.is-stacked .tabpanel[inert] { opacity: 0; visibility: hidden; transform: translateY(10px); }
/* followed: the two panels one after the other, the tabs riding along under the center's row */
.studies-track.is-spy .tablist {
  position: sticky;
  top: calc(var(--masthead-h) + 10px);
  z-index: 4;
  background: color-mix(in srgb, var(--indigo) 92%, transparent);
  backdrop-filter: blur(8px);
}
.studies-track.is-spy .tabpanel + .tabpanel { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--rule-night); }
.studies-track.is-pinned .tablist::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: -12px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #fff calc(var(--p, 0) * 100%), rgba(255, 255, 255, 0.18) 0);
}
/* compact enough to hold still on a laptop screen: the study types in two columns, tighter channel rows */
@media (min-width: 901px) {
  .studies-track .tabpanel { margin-top: 26px; }
  .studies-track .study-split { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
  .studies-track .study-split h3 { max-width: none; font-size: clamp(1.35rem, 1.9vw, 1.65rem); }
  .studies-track .study-split > div:first-child > p { max-width: 60ch; }
  .studies-track .study-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; margin-top: 22px; border-bottom: 0; }
  .studies-track .study-types > div { display: block; padding-block: 10px 12px; }
  .studies-track .study-types dd { margin-top: 3px; font-size: 0.95rem; line-height: 1.45; }
  .studies-track .channels li { padding-block: 6px 16px; }
}

/* ---------- children: what we offer ---------- */

.peds {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px clamp(24px, 3vw, 48px);
  margin-top: clamp(36px, 5vw, 56px) !important;
}
.peds li { display: grid; gap: 10px; align-content: start; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.4); }
.peds h3 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.3rem, 1.9vw, 1.6rem); line-height: 1.2; letter-spacing: -0.01em; color: #fff; }
.peds p { color: var(--ink-night-2); }
@media (max-width: 860px) { .peds { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .cond-track.is-stacked .symptoms li, .studies-track.is-stacked .tabpanel { transition: none; }
}

/* ---------- 10:00 PM · night ---------- */

.band-night {
  background: linear-gradient(180deg, var(--midnight-0) 0%, var(--midnight) 30%, var(--midnight) 72%, var(--predawn) 100%);
  overflow: clip;
}

.stars {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* keep stars out of the reading column so they never read as punctuation */
  -webkit-mask-image: linear-gradient(90deg, #000 0 17%, transparent 21% 92%, #000 95%), linear-gradient(180deg, #000 0 7%, transparent 11%);
  mask-image: linear-gradient(90deg, #000 0 17%, transparent 21% 92%, #000 95%), linear-gradient(180deg, #000 0 7%, transparent 11%);
}
@media (max-width: 959px) {
  .stars {
    -webkit-mask-image: linear-gradient(180deg, #000 0 4%, transparent 7%);
    mask-image: linear-gradient(180deg, #000 0 4%, transparent 7%);
  }
}
.stars svg { width: 100%; height: 100%; display: block; }
.stars circle { fill: #fff; }
.stars .tw { animation: twinkle var(--d, 5s) ease-in-out var(--delay, 0s) infinite alternate; }
.stars[data-paused="true"] .tw { animation-play-state: paused; }
@keyframes twinkle { to { opacity: 0.15; } }

.night-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  margin-top: clamp(36px, 5vw, 64px) !important;
}

.hypno {
  position: sticky;
  top: calc(var(--masthead-h) + 32px);
  align-self: start;
}
.hypno-svg { width: 100%; height: auto; display: block; overflow: visible; }
.hypno-svg .band-row { fill: rgba(255, 255, 255, 0.035); }
.hypno-svg .band-row.deep { fill: rgba(112, 87, 165, 0.22); }
.hypno-svg .stage-label { fill: rgba(255, 255, 255, 0.8); font-family: var(--font-mono); font-size: 16px; }
.hypno-svg .hour-label { fill: rgba(255, 255, 255, 0.72); font-family: var(--font-mono); font-size: 15px; text-anchor: middle; }
.hypno-svg .hour-line { stroke: rgba(255, 255, 255, 0.08); stroke-width: 1; }
.hypno-svg .ghost { fill: none; stroke: rgba(255, 255, 255, 0.13); stroke-width: 2; stroke-linejoin: round; }
.hypno-svg .trace { fill: none; stroke: #d6c8ff; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.hypno-svg .rem { fill: var(--rem); opacity: 0; transition: opacity 300ms ease; }
.hypno-svg .rem.on { opacity: 0.95; }
.hypno-svg .dot { fill: #fff; }

.hypno figcaption { display: grid; gap: 6px; margin-top: 18px; }
.readout { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.readout-time {
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 1.5rem;
  color: #fff;
}
.readout-stage { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--ink-night-2); }
.hypno-note { font-size: 0.98rem; color: var(--ink-night-2); max-width: 52ch; }

.steps { display: grid; gap: 0; counter-reset: step; }
.steps li {
  position: relative;
  padding: 0 0 clamp(36px, 7vh, 72px) 36px;
}
.steps li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0.55em;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
  background: var(--midnight);
  transition: background-color 240ms ease, box-shadow 240ms ease;
}
.steps li::after {
  content: "";
  position: absolute;
  left: 10.25px;
  top: calc(0.55em + 16px);
  bottom: 4px;
  width: 1.5px;
  background: rgba(255, 255, 255, 0.2);
}
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }
.steps li.is-now::before { background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.14); }
.steps h3 { color: #fff; }
.steps p { margin-top: 8px; color: var(--ink-night-2); }

.prep {
  margin-top: clamp(56px, 8vw, 96px) !important;
  padding-top: 28px;
  border-top: 1px solid var(--rule-night);
}
.prep h3 { color: #fff; margin-bottom: 20px; }
.ticks-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 40px; color: var(--ink-night-2); }

@media (max-width: 959px) {
  .night-layout { grid-template-columns: 1fr; }
  .hypno { position: relative; top: auto; }
}
@media (max-width: 720px) {
  .ticks-cols { grid-template-columns: 1fr; }
  /* the chart scales down on phones; keep its labels readable */
  .hypno-svg .stage-label { font-size: 23px; }
  .hypno-svg .hour-label { font-size: 21px; }
  .hypno-svg .hour-label.minor { display: none; }
}

/* ---------- 5:00 AM · dawn ---------- */

.dawn {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 112svh;
  padding-top: clamp(84px, 11vw, 150px);
  background: linear-gradient(180deg, var(--predawn) 0%, #2d3459 22%, #4c4f78 42%, #8a87a6 62%, #bdb6c7 78%, #dcd6dc 90%, #efebec 100%);
  overflow: clip;
  isolation: isolate;
}
.dawn-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.dawn-sun {
  position: absolute;
  left: 24%;
  bottom: clamp(60px, 9vw, 140px);
  width: clamp(200px, 24vw, 360px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 252, 246, 0.9) 0%, rgba(255, 249, 240, 0.55) 22%, rgba(255, 246, 236, 0.2) 44%, rgba(255, 244, 234, 0) 68%);
  transform: translate3d(-50%, var(--sun-y, 0px), 0);
  will-change: transform;
}
.dawn h2 { font-size: clamp(2.4rem, 5vw, 4.25rem); max-width: 14ch; }
.dawn .lede { color: var(--ink-night-2); }

.ridges-mist { margin-top: auto; }
.ridges-mist svg { height: clamp(140px, 20vw, 280px); }
.ridges-mist .m1 { fill: #e3dee6; opacity: 0.5; }
.ridges-mist .m2 { fill: #ebe8ee; opacity: 0.72; }
.ridges-mist .m3 { fill: #eef0f9; opacity: 0.92; }
.ridges-mist .m4 { fill: var(--day); }

/* ---------- daylight bands ---------- */

.band-results,
.band-team,
.band-physicians,
.band-visit {
  color: var(--ink);
  --focus: var(--navy);
  --tick: var(--violet);
}
.band-results .lede,
.band-team .lede,
.band-physicians .lede,
.band-visit .lede { color: var(--ink-2); }

.band-results { background: var(--day); padding-top: clamp(48px, 6vw, 96px); }
.band-team { background: linear-gradient(180deg, var(--day) 0%, var(--day-2) 100%); }
.band-physicians { background: linear-gradient(180deg, var(--day-2) 0%, var(--day-sky) 22%, var(--day-sky) 78%, var(--day-2) 100%); }
.band-visit { background: linear-gradient(180deg, var(--day-2) 0%, var(--day) 40%); }

.band-results .when span,
.band-team .when span,
.band-physicians .when span,
.band-visit .when span { color: var(--violet); }

/* 7:00 AM · after the night */
.after {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px clamp(20px, 3vw, 40px);
  margin-top: clamp(40px, 5vw, 64px) !important;
  padding-top: 40px;
}
.after::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(27, 44, 81, 0.3);
}
.after li { position: relative; }
.after li::before {
  content: "";
  position: absolute;
  top: -40px;
  left: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--day);
  box-shadow: inset 0 0 0 1.5px var(--violet);
  transform: translateY(3px);
}
.after li:first-child::before { background: var(--violet); box-shadow: none; }
.after-when {
  margin-top: 2px;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--violet);
}
.after p:last-child { margin-top: 8px; color: var(--ink-2); }

@media (max-width: 1000px) {
  .after { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .after::before { display: none; }
  .after li { padding-top: 32px; border-top: 1px solid rgba(112, 87, 165, 0.35); }
  .after li::before { top: -11px; }
}
@media (max-width: 600px) {
  .after { grid-template-columns: 1fr; padding-top: 12px; }
}

/* 8:00 AM · team */
.lead-doc {
  display: grid;
  grid-template-columns: minmax(200px, 340px) minmax(0, 1fr);
  align-items: end;
  gap: clamp(24px, 4vw, 56px);
  margin-top: clamp(36px, 5vw, 56px) !important;
}
.lead-doc img,
.docs img {
  width: 100%;
  object-fit: cover;
  object-position: 50% 15%;
  background: var(--portrait-bg);
}
.lead-doc img { aspect-ratio: 6 / 7; border-radius: 8px; }
.lead-doc h3 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.8rem, 3vw, 2.5rem); letter-spacing: -0.02em; }
.doc-role {
  margin-top: 6px;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--violet);
}
.lead-doc p:last-child { margin-top: 14px; max-width: 50ch; color: var(--ink-2); font-size: 1.15rem; }

.team-bridge {
  margin-top: clamp(48px, 7vw, 88px) !important;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.3rem, 2.1vw, 1.7rem);
  line-height: 1.34;
  letter-spacing: -0.01em;
  max-width: 42ch;
}

.docs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px clamp(20px, 3vw, 40px);
  padding-top: 28px;
  border-top: 1px solid var(--rule-day);
}
.docs li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 16px; align-items: start; }
.docs img { aspect-ratio: 1; border-radius: 50%; }
.docs h3 { font-size: 1.1rem; }
.docs p { margin-top: 4px; font-size: 1rem; color: var(--ink-2); }

@media (max-width: 900px) {
  .docs { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .lead-doc { grid-template-columns: 1fr; }
  .lead-doc img { max-width: 320px; }
}

/* 9:00 AM · physicians */
.refer {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
  gap: clamp(36px, 5vw, 72px);
  margin-top: clamp(36px, 5vw, 56px) !important;
}

.fax { display: grid; justify-items: start; gap: 10px; }
.fax-label { font-family: var(--font-display); font-weight: 600; color: var(--violet); }
.fax-number {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2rem, 3.4vw, 3rem);
  white-space: nowrap;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.fax-number { user-select: all; }
.copy[data-copied="true"] { background: var(--navy); color: #fff; box-shadow: none; }

.contact-list { margin-top: 28px; border-bottom: 1px solid var(--rule-day); }
.contact-list > div {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 16px;
  padding-block: 12px;
  border-top: 1px solid var(--rule-day);
}
.contact-list dt { font-weight: 700; }
.contact-list dd { color: var(--ink-2); }
.contact-list a { display: inline-block; padding-block: 8px; margin-block: -8px; color: var(--ink); font-weight: 600; }

.refer-contact h3 { margin: 32px 0 16px; }

.order h3 { margin-bottom: 16px; }
.order-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.02rem;
}
.order-table thead th {
  text-align: left;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--violet);
  padding: 0 0 10px;
}
.order-table tbody th,
.order-table td {
  padding: 14px 0;
  border-top: 1px solid rgba(27, 44, 81, 0.18);
  text-align: left;
  vertical-align: top;
}
.order-table tbody th {
  width: 36%;
  padding-right: 20px;
  font-family: var(--font-display);
  font-weight: 600;
}
.order-table td { color: var(--ink-2); }
.order-table tbody tr:last-child > * { border-bottom: 1px solid rgba(27, 44, 81, 0.18); }
.order-note { margin-top: 18px; color: var(--ink-2); max-width: 60ch; }

@media (max-width: 960px) {
  .refer { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .order-table thead { display: none; }
  .order-table tr { display: block; padding-block: 14px; border-top: 1px solid rgba(27, 44, 81, 0.18); }
  .order-table tbody th,
  .order-table td { display: block; width: auto; padding: 0; border: 0; }
  .order-table td { margin-top: 4px; }
  .order-table tbody tr:last-child > * { border: 0; }
  .order-table tbody tr:last-child { border-bottom: 1px solid rgba(27, 44, 81, 0.18); }
}

/* 10:00 AM · visit */
.visit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: 36px clamp(24px, 4vw, 56px);
  margin-top: clamp(36px, 5vw, 56px) !important;
}
.visit-label {
  font-size: 1.05rem;
  color: var(--violet);
  margin-bottom: 14px;
}
address { font-style: normal; font-size: 1.2rem; line-height: 1.45; }
.lab-address .btn { margin-top: 22px; }
.offices ul { display: grid; gap: 14px; }
.offices li { display: grid; gap: 2px; }
.offices span { color: var(--ink-2); }
.reach-list { display: grid; gap: 12px; }
.reach-list li { display: flex; align-items: center; gap: 12px; }
.reach-list .icon { color: var(--violet); }
.reach-list a { font-weight: 600; display: inline-block; padding-block: 10px; }
.reach-list { gap: 0; }
.reach .fine { margin-top: 14px; color: var(--ink-2); }

.emergency {
  margin-top: clamp(40px, 5vw, 56px) !important;
  font-weight: 700;
}

.parent {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 28px;
  border-top: 1px solid var(--rule-day);
  max-width: 760px;
}
.parent img {
  width: 76px;
  height: auto;
  padding: 8px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(27, 44, 81, 0.12);
}
.parent p { color: var(--ink-2); }
.parent a { color: var(--ink); font-weight: 600; }

@media (max-width: 960px) {
  .visit { grid-template-columns: 1fr 1fr; }
  .lab-address { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .visit { grid-template-columns: 1fr; }
}

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stars .tw { animation: none; }
  .tabpanel:not([hidden]) { animation: panel-fade 200ms ease; }
  .tab-thumb { transition-duration: 0ms; }
  @keyframes panel-fade { from { opacity: 0; } }
}


/* ---------- inside the PulmoCrit family ---------- */

/* the center bar carries the night clock and the night's progress */
.facet-bar-sleep .glyph { background: color-mix(in srgb, var(--c-sleep) 40%, white); }
.facet-bar-sleep .clock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 8px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 7.6em;
  color: #fff;
}
.clock-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.clock[data-phase="night"] .clock-icon { fill: currentColor; stroke-width: 0; }
.night-progress { position: absolute; inset: auto 0 0; height: 2px; }
.night-progress span { display: block; height: 100%; background: rgba(255, 255, 255, 0.85); transform-origin: 0 50%; transform: scaleX(var(--night, 0)); }
@media (max-width: 1180px) { .facet-bar-sleep .clock { display: none; } }

/* 7:00 PM again: dusk returns, and its ridges settle into the navy footer */
.sleep-close {
  position: relative;
  color: var(--navy);
  --focus: var(--navy);
  background: linear-gradient(180deg, var(--day) 0%, var(--dusk-1) 22%, var(--dusk-2) 50%, var(--dusk-3) 78%, var(--dusk-4) 100%);
  padding-top: clamp(96px, 12vw, 180px);
}
.sleep-close-inner { display: grid; justify-items: start; gap: 28px; padding-bottom: clamp(24px, 4vw, 48px); }
.sleep-close-line {
  font-size: clamp(2.2rem, 4.4vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -0.022em;
  max-width: 15ch;
}
.sleep-close-nav { display: flex; flex-wrap: wrap; gap: 0 24px; font-family: var(--font-display); font-weight: 500; }
.sleep-close-nav a { display: inline-block; padding-block: 10px; text-decoration: none; }
@media (hover: hover) { .sleep-close-nav a:hover { text-decoration: underline; } }
.ridges-close svg { height: clamp(90px, 12vw, 180px); }
.ridges-close .r1 { fill: var(--ridge-1); opacity: 0.8; }
.ridges-close .r2 { fill: var(--ridge-3); }
.ridges-close .r3 { fill: var(--navy); }

.ridges-close { margin-bottom: -1px; }
body[data-facet="sleep"] .site-footer { position: relative; margin-top: -2px; }
.docs .doc-ph { aspect-ratio: 1; border-radius: 50%; font-size: 1.4rem; background: var(--portrait-bg); }
