/* ClinicBoost US — "The Night Shift" design system
   Deep-night palette, amber open-sign glow, Fraunces display + Plex Mono time. */

:root {
  color-scheme: dark; /* site is natively dark — stops auto-dark/dark-reader tools from inverting it */
  --ink: #070b14;
  --ink-2: #0c1220;
  --ink-3: #131b2e;
  --cream: #f3eee3;
  --muted: #8a93a8;
  --faint: #4a5468;
  --amber: #ffb03a;
  --amber-deep: #e08800;
  --mint: #3ee89f;
  --coral: #ff6257;
  --rose: #ff7eb6;
  --cyan: #5ee7f5;
  --violet: #a78bfa;
  --line: rgba(243, 238, 227, 0.09);
  --font-display: "Fraunces", serif;
  --font-body: "Instrument Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; background: #070b14; }
body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--amber); color: var(--ink); }
a { color: inherit; }
img, svg { max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* film grain */
body::after {
  content: "";
  position: fixed; inset: -100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 9998;
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0); } 25% { transform: translate(-2%,3%); }
  50% { transform: translate(3%,-2%); } 75% { transform: translate(-3%,-3%); }
  100% { transform: translate(2%,2%); }
}

/* cursor glow */
@media (pointer: coarse) { #cursor-glow { display: none; } }
#cursor-glow {
  position: fixed; width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,176,58,0.07) 0%, transparent 65%);
  pointer-events: none; z-index: 1;
  transform: translate(-50%,-50%);
  left: 50vw; top: 40vh;
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 4vw, 48px);
  transition: background 0.4s, backdrop-filter 0.4s;
}
.nav.scrolled { background: rgba(7,11,20,0.72); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav-logo {
  font-family: var(--font-display); font-weight: 600; font-size: 21px;
  text-decoration: none; letter-spacing: -0.01em;
}
.nav-logo em { font-style: italic; color: var(--amber); }
.nav-status {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em;
  color: var(--muted); text-transform: uppercase;
}
.nav-status .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--mint);
  box-shadow: 0 0 10px var(--mint);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--amber); color: var(--ink);
  font-weight: 600; font-size: 15px; text-decoration: none;
  padding: 13px 26px; border-radius: 999px; border: none;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s;
  box-shadow: 0 0 0 rgba(255,176,58,0);
  will-change: transform;
}
.btn:hover { box-shadow: 0 6px 32px rgba(255,176,58,0.35); }
.btn.ghost {
  background: transparent; color: var(--cream);
  border: 1px solid var(--line);
}
.btn.ghost:hover { border-color: var(--amber); color: var(--amber); box-shadow: none; }
.btn.big { font-size: 18px; padding: 18px 38px; }

/* ---------- hero (scroll-scrubbed night) ---------- */
.hero { height: 520vh; position: relative; }
.hero-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  overflow: hidden;
  display: flex; flex-direction: column;
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, #16203a 0%, transparent 60%),
    var(--ink);
}
#stars { position: absolute; inset: 0; z-index: 0; }
.horizon {
  position: absolute; left: 0; right: 0; bottom: 0; height: 40vh; z-index: 0;
  background: linear-gradient(to top, rgba(255,140,40,0.22), transparent);
  opacity: 0; transition: opacity 0.3s linear;
}
.dawn {
  position: absolute; inset: 0; z-index: 1; opacity: 0; pointer-events: none;
  background: linear-gradient(to top,
    rgba(255,132,54,0.55) 0%,
    rgba(255,178,96,0.28) 34%,
    rgba(190,140,150,0.14) 58%,
    rgba(110,135,190,0.12) 78%,
    transparent 95%);
  will-change: opacity;
}
.sunrise-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1; opacity: 0; pointer-events: none;
  will-change: opacity;
}
.sun {
  position: absolute; left: 50%; bottom: 2vh; z-index: 1;
  width: clamp(220px, 30vw, 420px); height: clamp(220px, 30vw, 420px);
  border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(circle,
    #ffe4b0 0%, #ffc25e 22%, rgba(255,176,58,0.45) 48%, rgba(255,140,40,0.18) 65%, transparent 72%);
  filter: blur(1px);
  transform: translateX(-50%) translateY(42vh);
  will-change: transform, opacity;
}

.hero-clock {
  position: absolute; top: 12vh; left: 0; right: 0; z-index: 2;
  text-align: center; pointer-events: none;
  transform-origin: 50% 0; will-change: transform, opacity;
}
.hero-clock .time {
  font-family: var(--font-mono); font-weight: 500;
  font-size: clamp(56px, 11vw, 128px); letter-spacing: 0.02em;
  color: var(--cream);
  text-shadow: 0 0 60px rgba(255,176,58,0.25);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.hero-clock .time .ampm { font-size: 0.32em; color: var(--amber); margin-left: 0.2em; }
.hero-clock .phase-label {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--faint); margin-top: 14px;
}

.hero-intro {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 24px; padding-top: 16vh;
  will-change: transform, opacity;
}
.hero-intro h1 {
  font-family: var(--font-display); font-weight: 470;
  font-size: clamp(40px, 6.4vw, 88px); line-height: 1.04;
  letter-spacing: -0.02em; max-width: 13em;
  font-variation-settings: "SOFT" 60, "WONK" 1;
}
.hero-intro h1 em { font-style: italic; color: var(--amber); }
.hero-intro .sub {
  margin-top: 26px; font-size: clamp(16px, 1.6vw, 20px);
  color: var(--muted); max-width: 34em;
}
.hero-intro .cta-row { margin-top: 36px; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.scroll-hint {
  position: absolute; bottom: 4vh; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--faint);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.scroll-hint::after {
  content: ""; width: 1px; height: 44px;
  background: linear-gradient(var(--amber), transparent);
  animation: drip 1.8s ease-in-out infinite;
}
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* split night view */
.night-split {
  position: absolute; inset: 0; z-index: 2;
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 24vh clamp(16px, 5vw, 80px) 10vh;
  gap: clamp(16px, 4vw, 64px);
  opacity: 0; pointer-events: none;
  will-change: opacity;
}
.night-col { display: flex; flex-direction: column; min-height: 0; }
.night-col .col-head {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.24em;
  text-transform: uppercase; padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline;
}
.night-col.them .col-head { color: var(--coral); }
.night-col.you .col-head { color: var(--mint); }
.col-tally { font-size: 15px; font-variant-numeric: tabular-nums; }
.night-feed { display: flex; flex-direction: column; gap: 10px; overflow: hidden; justify-content: flex-end; flex: 1; }

.nmsg { max-width: 92%; display: none; }
.nmsg.on { display: block; animation: msgIn 0.5s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.nmsg .stamp { font-family: var(--font-mono); font-size: 10px; color: var(--faint); margin-bottom: 4px; letter-spacing: 0.06em; }
.nmsg .bubble {
  background: var(--ink-3); border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px;
  padding: 10px 14px; font-size: 14px; line-height: 1.45;
}
.nmsg .fate {
  margin-top: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  opacity: 0; transition: opacity 0.4s 0.15s;
}
.nmsg.fated .fate { opacity: 1; }
.nmsg .fate.missed { color: var(--coral); }
.nmsg .fate.booked { color: var(--mint); }
.nmsg .reply {
  margin-top: 8px; margin-left: 12%;
  background: rgba(62,232,159,0.1); border: 1px solid rgba(62,232,159,0.25);
  border-radius: 16px 4px 16px 16px;
  padding: 10px 14px; font-size: 14px; line-height: 1.45;
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.4s 0.1s, transform 0.4s 0.1s;
}
.nmsg.fated .reply { opacity: 1; transform: none; }

/* sunrise verdict */
.sunrise {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 24px;
  opacity: 0; pointer-events: none;
  will-change: opacity, transform;
  transform: translateY(40px);
}
.sunrise { text-shadow: 0 2px 28px rgba(7,11,20,0.75); }
.sunrise h2 {
  font-family: var(--font-display); font-weight: 470;
  font-size: clamp(32px, 4.6vw, 64px); line-height: 1.08; letter-spacing: -0.02em;
  max-width: 15em;
}
.sunrise h2 em { font-style: italic; color: var(--amber); }
.verdict {
  display: flex; gap: clamp(28px, 7vw, 110px); margin-top: 48px; flex-wrap: wrap; justify-content: center;
  background: rgba(7, 11, 20, 0.48);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid rgba(243, 238, 227, 0.14); border-radius: 28px;
  padding: clamp(30px, 4.5vw, 56px) clamp(34px, 6vw, 84px);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.45);
}
.verdict .v { font-family: var(--font-mono); }
.verdict .v .num { font-size: clamp(52px, 7.5vw, 108px); font-variant-numeric: tabular-nums; line-height: 1; }
.verdict .v.lost .num { color: var(--coral); text-shadow: 0 0 38px rgba(255, 98, 87, 0.45); }
.verdict .v.won .num { color: var(--mint); text-shadow: 0 0 38px rgba(62, 232, 159, 0.45); }
.verdict .v .lbl { font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-top: 14px; }

/* ---------- ticker ---------- */
.ticker {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden; padding: 16px 0; background: var(--ink-2);
  position: relative; z-index: 5;
}
.ticker-track {
  display: flex; gap: 48px; width: max-content;
  animation: tick 36s linear infinite;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em;
  color: var(--muted); white-space: nowrap;
}
.ticker-track b { color: var(--coral); font-weight: 500; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- vertical scenes ---------- */
.verticals { position: relative; z-index: 5; background: var(--ink); }
.vscene {
  min-height: 100vh;
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  align-items: center; gap: clamp(24px, 5vw, 80px);
  padding: 14vh clamp(20px, 6vw, 100px);
  position: relative;
  border-bottom: 1px solid var(--line);
}
.vscene:nth-child(even) .v-copy { order: 2; }
.vscene:nth-child(even) .v-visual { order: 1; }
.v-index {
  position: absolute; top: 8vh; right: clamp(20px, 6vw, 100px);
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.3em;
  color: var(--faint);
}
.v-copy .v-kicker {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--accent, var(--amber)); margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px;
}
.v-copy .v-kicker::before { content: ""; width: 34px; height: 1px; background: var(--accent, var(--amber)); }
.v-copy h2 {
  font-family: var(--font-display); font-weight: 470;
  font-size: clamp(34px, 4.4vw, 62px); line-height: 1.05; letter-spacing: -0.02em;
}
.v-copy h2 em { font-style: italic; color: var(--accent, var(--amber)); }
.v-copy .v-pain { margin-top: 22px; color: var(--muted); font-size: clamp(16px, 1.5vw, 19px); max-width: 30em; }
.v-stat {
  margin-top: 28px; padding: 18px 22px;
  border-left: 2px solid var(--accent, var(--amber));
  background: linear-gradient(90deg, rgba(255,255,255,0.03), transparent);
}
.v-stat .n { font-family: var(--font-mono); font-size: clamp(28px, 3vw, 40px); color: var(--accent, var(--amber)); font-variant-numeric: tabular-nums; }
.v-stat .t { font-size: 14px; color: var(--muted); margin-top: 4px; }
.v-link {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 34px;
  font-weight: 600; font-size: 17px; text-decoration: none;
  color: var(--cream); position: relative;
}
.v-link .arr { transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1); color: var(--accent, var(--amber)); }
.v-link:hover .arr { transform: translateX(8px); }
.v-link::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 100%;
  background: var(--accent, var(--amber));
  transform: scaleX(0); transform-origin: left; transition: transform 0.35s ease;
}
.v-link:hover::after { transform: scaleX(1); }

/* chat vignette card */
.v-visual { position: relative; }
.v-visual::before {
  content: ""; position: absolute; inset: -12%;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent, var(--amber)) 9%, transparent), transparent 70%);
  pointer-events: none;
}
.chat-card {
  color: var(--cream); /* phone stays in night mode even inside daylight sections */
  position: relative;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 20px;
  padding: 22px; max-width: 420px; margin: 0 auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  transform: rotate(var(--tilt, -1.4deg));
}
.chat-card .cc-head {
  display: flex; align-items: center; gap: 10px; padding-bottom: 14px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.08em;
}
.chat-card .cc-head .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.chat-card .cc-time { margin-left: auto; color: var(--faint); }
.cc-msgs { display: flex; flex-direction: column; gap: 10px; min-height: 220px; }
.cc-msg { max-width: 85%; opacity: 0; transform: translateY(14px); transition: opacity 0.4s, transform 0.4s cubic-bezier(0.22,1,0.36,1); }
.cc-msg.show { opacity: 1; transform: none; }
.cc-msg .b { padding: 10px 14px; border-radius: 4px 14px 14px 14px; background: var(--ink-3); border: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.cc-msg.bot { align-self: flex-end; }
.cc-msg.bot .b {
  border-radius: 14px 4px 14px 14px;
  background: color-mix(in srgb, var(--accent, var(--amber)) 12%, var(--ink-3));
  border-color: color-mix(in srgb, var(--accent, var(--amber)) 30%, transparent);
}
.cc-msg .who { font-family: var(--font-mono); font-size: 10px; color: var(--faint); margin-bottom: 4px; letter-spacing: 0.08em; }
.cc-typing { display: inline-flex; gap: 4px; padding: 12px 16px; }
.cc-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.cc-typing i:nth-child(2) { animation-delay: 0.15s; } .cc-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%,100% { opacity: 0.25; } 50% { opacity: 1; } }
.cc-result {
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em;
  color: var(--mint); opacity: 0; transition: opacity 0.5s;
  display: flex; align-items: center; gap: 8px;
}
.cc-result.show { opacity: 1; }

/* ---------- closing ---------- */
.closing {
  position: relative; z-index: 5;
  min-height: 92vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 16vh 24px 8vh; overflow: hidden;
  background: radial-gradient(ellipse 80% 60% at 50% 110%, rgba(255,140,40,0.16), transparent 60%), var(--ink);
}
.closing .big-time {
  font-family: var(--font-mono); font-size: 14px; letter-spacing: 0.3em;
  color: var(--amber); text-transform: uppercase; margin-bottom: 26px;
}
.closing h2 {
  font-family: var(--font-display); font-weight: 470;
  font-size: clamp(40px, 6.5vw, 92px); line-height: 1.02; letter-spacing: -0.02em;
  max-width: 11em;
}
.closing h2 em { font-style: italic; color: var(--amber); }
.closing .sub { margin-top: 24px; color: var(--muted); max-width: 32em; font-size: 18px; }
.closing .cta-row { margin-top: 40px; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

/* ---------- footer ---------- */
.footer {
  position: relative; z-index: 5;
  border-top: 1px solid var(--line);
  padding: 44px clamp(20px, 5vw, 60px);
  display: flex; flex-wrap: wrap; gap: 28px; align-items: center; justify-content: space-between;
  font-size: 14px; color: var(--muted); background: var(--ink-2);
}
.footer nav { display: flex; gap: 24px; flex-wrap: wrap; }
.footer a { text-decoration: none; transition: color 0.2s; }
.footer a:hover { color: var(--amber); }

/* ---------- split-text reveal ---------- */
.split-reveal .w { display: inline-block; overflow: hidden; vertical-align: bottom; }
.split-reveal .w > span { display: inline-block; transform: translateY(110%); transition: transform 0.7s cubic-bezier(0.22,1,0.36,1); }
.split-reveal.in .w > span { transform: none; }

/* generic scroll reveal */
.rv { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22,1,0.36,1); }
.rv.in { opacity: 1; transform: none; }

/* ---------- daylight: post-sunrise sections live in the morning ---------- */
.day {
  --d-text: #16203a;
  --d-muted: #5a6478;
  --d-line: rgba(22, 32, 58, 0.12);
  background: #fbf5e8;
  color: var(--d-text);
}
.hero + .day::before {
  /* dawn bridge: the sunrise bleeds into the morning (homepage only) */
  content: ""; display: block; height: 18vh;
  background: linear-gradient(to bottom, rgba(255,150,70,0.22), rgba(255,196,120,0.1) 55%, transparent);
}
.day .ticker { background: #f4ecda; border-color: var(--d-line); }
.day .ticker-track { color: var(--d-muted); }
.day .ticker-track b { color: #d63c31; }
.day .verticals { background: transparent; }
.day .vscene { border-color: var(--d-line); }
.day .v-index { color: rgba(22,32,58,0.35); }
.day .v-pain, .day .v-stat .t { color: var(--d-muted); }
.day .v-link { color: var(--d-text); }
.day .v-stat { background: linear-gradient(90deg, rgba(22,32,58,0.05), transparent); }
/* darken each scene's accent so it holds contrast on cream */
.day .v-kicker,
.day .v-kicker::before,
.day .v-stat .n,
.day .v-copy h2 em,
.day .v-link .arr { color: color-mix(in srgb, var(--accent, var(--amber)) 62%, var(--d-text)); }
.day .v-kicker::before { background: color-mix(in srgb, var(--accent, var(--amber)) 62%, var(--d-text)); }
.day .v-link::after { background: color-mix(in srgb, var(--accent, var(--amber)) 62%, var(--d-text)); }
.day .closing {
  background: radial-gradient(ellipse 80% 60% at 50% 110%, rgba(255,176,58,0.3), transparent 60%), #fbf5e8;
}
.day .closing h2 em { color: var(--amber-deep); }
.day .closing .sub { color: var(--d-muted); }
.day .big-time { color: var(--amber-deep); }
.day .btn.ghost { color: var(--d-text); border-color: rgba(22,32,58,0.3); }
.day .btn.ghost:hover { color: var(--amber-deep); border-color: var(--amber-deep); }
.day .footer { background: #f4ecda; color: var(--d-muted); border-color: var(--d-line); }
.day .footer a:hover { color: var(--amber-deep); }
.day ::selection { background: var(--amber-deep); color: #fbf5e8; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { height: 420vh; }
  .night-split { grid-template-columns: 1fr; padding-top: 24vh; gap: 12px; }
  .night-col.them { display: none; }
  .nav-status { display: none; }
  .cta-x { display: none; }
  .hero-clock { top: 14vh; }
  .hero-clock .time { font-size: clamp(40px, 12vw, 56px); }
  .vscene { grid-template-columns: 1fr; min-height: auto; padding-top: 12vh; padding-bottom: 12vh; }
  .vscene:nth-child(even) .v-copy { order: 1; }
  .vscene:nth-child(even) .v-visual { order: 2; }
  .chat-card { --tilt: 0deg; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  body::after { display: none; }
  .rv, .nmsg, .cc-msg, .cc-result, .split-reveal .w > span { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
}
