/* ============================================================
   Sleep Check (/sleep-check/), draft Nov 30 2026
   A night sky with one gold line from 10 pm to 6 am. The moon
   moves one step per answer; at the result it reaches 6 am and
   the sky warms to dawn. Everything else stays quiet.
   ============================================================ */

.sc {
  --sc-p: 0;
  /* iPhone: quick taps on the answers counted as a double-tap and zoomed the page in (Jordan's screenshot, Nov 30).
     manipulation keeps scrolling and pinch-zoom but drops double-tap zoom for everything inside. */
  touch-action: manipulation;
  position: relative;
  overflow: hidden;
  min-height: calc(100svh - 72px);
  background: linear-gradient(180deg, var(--night) 0%, var(--deep) 100%);
  color: #cfe0da;
}
.sc-stars { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sc-dawn {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(130% 62% at 50% 106%, rgba(233, 190, 98, 0.5), rgba(233, 190, 98, 0.1) 46%, transparent 72%),
    linear-gradient(to top, rgba(219, 161, 55, 0.12), transparent 55%);
  opacity: var(--sc-p);
  transition: opacity 0.9s ease;
}
.sc-inner { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; padding: 34px 24px 44px; } /* 24px sides = the header logo's edge */

/* ---------- heading ---------- */
.sc-head .eyebrow { margin-bottom: 10px; }
.sc-title {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.85rem, 7vw, 2.9rem); line-height: 1.08; letter-spacing: -0.01em; max-width: 16em;
  color: var(--white);
}
.sc-lead { margin: 12px 0 0; font-size: 1.04rem; line-height: 1.6; color: #cfe0da; max-width: 34em; }
.sc.is-started .sc-lead { display: none; }
.sc.is-started .sc-title { font-size: clamp(1.15rem, 4.4vw, 1.5rem); line-height: 1.2; }

/* ---------- the night arc (the one signature) ---------- */
.sc-arc { position: relative; margin: 4px 0 2px; padding-bottom: 20px; }
.sc-arc svg { display: block; width: 100%; height: auto; overflow: visible; }
.sc-arc-track { fill: none; stroke: rgba(246, 215, 138, 0.22); stroke-width: 1.2; }
.sc-arc-done {
  fill: none; stroke: var(--dawn); stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.sc-moon { fill: var(--glow); transition: cx 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), cy 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.sc-moon-halo { fill: rgba(246, 215, 138, 0.16); transition: cx 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), cy 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), r 0.6s ease; }
.sc.is-dawn .sc-moon-halo { r: 18; fill: rgba(246, 215, 138, 0.26); }
.sc-arc-from, .sc-arc-to {
  position: absolute; bottom: 0; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: #9fb0aa;
}
.sc-arc-from { left: 0; }
.sc-arc-to { right: 0; }
.sc.is-dawn .sc-arc-to { color: var(--glow); }

/* ---------- question card ---------- */
.sc-card {
  margin-top: 14px; padding: 18px 16px 20px;
  background: rgba(13, 34, 33, 0.9);
  border: 1px solid rgba(233, 190, 98, 0.26); border-radius: 20px;
  box-shadow: 0 24px 60px rgba(4, 14, 13, 0.35);
}
.sc-card[hidden] { display: none; }
.sc-card-top { display: flex; align-items: center; justify-content: space-between; min-height: 40px; gap: 12px; }
.sc-back {
  font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--glow);
  background: none; border: 0; padding: 8px 10px 8px 0; min-height: 44px; cursor: pointer;
}
.sc-back:hover { color: #fff; }
.sc-back:focus-visible { outline: 3px solid var(--dawn); outline-offset: 2px; border-radius: 8px; }
.sc-step { margin: 0 0 0 auto; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: #9fb0aa; }

.sc-quiz { margin: 0; }
.sc-q { border: 0; margin: 0; padding: 0; min-width: 0; }
.sc-q[hidden] { display: none; }
.sc-q.is-in { animation: sc-in 0.34s cubic-bezier(0.2, 0.7, 0.2, 1); }
.sc-q-text {
  display: block; padding: 0; margin: 4px 0 18px;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.42rem, 5.6vw, 1.85rem); line-height: 1.18; color: var(--white);
}
.sc-opts { display: grid; gap: 10px; }
.sc-opts-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sc-opt { position: relative; display: block; cursor: pointer; }
.sc-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sc-opt span {
  display: flex; align-items: center; gap: 14px;
  min-height: 58px; padding: 14px 18px;
  border: 1.5px solid rgba(233, 190, 98, 0.36); border-radius: 14px;
  background: rgba(255, 253, 246, 0.035);
  color: #f3eee2; font-size: 1.03rem; font-weight: 500; line-height: 1.3;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
/* the ring fills with a dot when chosen: a shape change, not just a colour change */
.sc-opt span::before {
  content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid rgba(246, 215, 138, 0.7);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}
.sc-opts-row .sc-opt span { flex-direction: column; justify-content: center; gap: 8px; text-align: center; padding: 14px 8px; }
/* David's 1-10 rating: ten number keys, two rows of five on a phone, one row on a wide screen */
.sc-opts-scale { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.sc-opts-scale .sc-opt span {
  justify-content: center; padding: 0; min-height: 54px; gap: 0;
  font-family: var(--font-display); font-weight: 600; font-size: 1.25rem;
}
.sc-opts-scale .sc-opt span::before { display: none; }
.sc-opts-scale .sc-opt input:checked + span { background: var(--glow); color: var(--night); }
.sc-scale-ends { display: flex; justify-content: space-between; margin: 10px 2px 0; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; color: #9fb0aa; }
@media (hover: hover) { .sc-opt:hover span { border-color: var(--dawn); background: rgba(255, 253, 246, 0.07); } }
.sc-opt:active span { transform: scale(0.985); }
.sc-opt input:checked + span { border-color: var(--glow); background: rgba(246, 215, 138, 0.15); color: #fff; }
.sc-opt input:checked + span::before { background: var(--glow); box-shadow: inset 0 0 0 4px var(--night); border-color: var(--glow); }
.sc-opt input:focus-visible + span { outline: 3px solid var(--dawn); outline-offset: 2px; }
.sc-noscript { margin: 0; color: #f3eee2; }
.sc-noscript a { color: var(--glow); }

/* ---------- result (dawn) ---------- */
.sc-result {
  margin-top: 16px; padding: 26px 20px 24px;
  background: var(--white); color: var(--body);
  border-radius: 22px; box-shadow: 0 30px 70px rgba(4, 14, 13, 0.45);
}
.sc-result[hidden] { display: none; }
.sc-result:focus { outline: none; }
.sc-result.is-in { animation: sc-rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1); }
.sc-result-label { margin: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--teal); }
.sc-result-title {
  margin: 8px 0 14px; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.75rem, 6.6vw, 2.35rem); line-height: 1.08; color: var(--ink);
}
.sc-weight { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; font-size: 0.86rem; }
.sc-weight-label { color: var(--body); flex-basis: 100%; }
.sc-weight-marks { display: inline-flex; gap: 5px; }
.sc-weight-marks i { display: block; width: 24px; height: 8px; border-radius: 999px; border: 1.5px solid var(--teal); }
.sc-weight[data-level="1"] .sc-weight-marks i:nth-child(-n+1),
.sc-weight[data-level="2"] .sc-weight-marks i:nth-child(-n+2),
.sc-weight[data-level="3"] .sc-weight-marks i:nth-child(-n+3) { background: var(--teal); }
.sc-weight-word { color: var(--ink); }
.sc-rating { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; font-size: 0.86rem; }
.sc-rating-label { color: var(--body); flex-basis: 100%; }
.sc-rating-dots { display: inline-flex; gap: 4px; }
.sc-rating-dots i { display: block; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--teal); }
.sc-rating-dots i.is-on { background: var(--teal); }
.sc-rating-word { color: var(--ink); }
.sc-result-body { margin: 0; font-size: 1.04rem; line-height: 1.65; }
.sc-result-more { margin-top: 12px; }
.sc-result-more[hidden] { display: none; }
.sc-jumps { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.sc-jumps .sc-jump { margin-top: 0; }
.sc-jump-quiet { border-color: #d9cfb8; color: var(--ink); }
.sc-jump-quiet:hover { background: var(--ivory); color: var(--ink); }
.sc-jump {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; min-height: 44px;
  padding: 10px 18px; border: 1.5px solid var(--teal); border-radius: 999px;
  font-size: 0.92rem; font-weight: 600; color: var(--teal); text-decoration: none;
}
.sc-jump:hover { background: var(--teal); color: var(--white); }
.sc-jump:focus-visible { outline: 3px solid var(--dawn); outline-offset: 3px; }
.sc-sub { margin: 26px 0 10px; font-family: var(--font-display); font-weight: 600; font-size: 1.16rem; line-height: 1.25; color: var(--ink); }
.sc-tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sc-tips li { position: relative; padding-left: 26px; line-height: 1.55; color: var(--ink); }
.sc-tips li::before { content: ""; position: absolute; left: 2px; top: 0.5em; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--gold); }
.sc-fine { margin: 12px 0 0; font-size: 0.84rem; line-height: 1.5; color: var(--body); }
.sc-fit { margin-top: 24px; padding-top: 2px; border-top: 1px solid var(--cardline); }
.sc-fit p { margin: 0; line-height: 1.6; }
.sc-quote { margin: 16px 0 0; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: center; }
.sc-quote img { width: 56px; height: 70px; object-fit: cover; border-radius: 12px; }
.sc-quote figcaption { display: grid; gap: 4px; }
.sc-quote-text { font-family: var(--font-display); font-weight: 500; font-size: 1.04rem; line-height: 1.35; color: var(--ink); }
.sc-quote-who { font-size: 0.84rem; color: var(--body); }
.sc-quote-who a { font-weight: 600; }

/* ---------- call me ---------- */
.sc-call { scroll-margin-top: 96px; margin-top: 26px; padding: 22px 18px; background: var(--ivory); border: 1px solid var(--cardline); border-radius: 18px; }
.sc-call-label { margin: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--teal); }
.sc-call-title { margin: 6px 0 8px; font-family: var(--font-display); font-weight: 600; font-size: 1.32rem; line-height: 1.22; color: var(--ink); }
.sc-call-copy { margin: 0 0 16px; line-height: 1.6; }
.sc-call-form { display: grid; gap: 12px; }
.sc-field { display: grid; gap: 6px; font-size: 0.88rem; font-weight: 600; color: var(--ink); }
.sc-field input {
  font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); background: #fff;
  border: 1.5px solid #d9cfb8; border-radius: 12px; padding: 13px 14px; min-height: 50px; width: 100%;
}
.sc-field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(10, 92, 92, 0.15); }
.sc-times { border: 0; margin: 2px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sc-times legend { font-size: 0.88rem; font-weight: 600; color: var(--ink); margin-bottom: 8px; padding: 0; }
.sc-times label { position: relative; cursor: pointer; }
.sc-times input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sc-times span { display: block; padding: 10px 12px; min-height: 44px; border: 1.5px solid #d9cfb8; border-radius: 999px; background: #fff; color: var(--ink); font-size: 0.92rem; text-align: center; }
.sc-times input:checked + span { background: var(--teal); border-color: var(--teal); color: #fffdf6; }
.sc-times input:focus-visible + span { box-shadow: 0 0 0 3px rgba(10, 92, 92, 0.25); }
.sc-error { margin: 0; color: #9c3b2a; font-size: 0.9rem; font-weight: 600; }
.sc-error[hidden] { display: none; }
.sc-call-btn { margin-top: 4px; width: 100%; }
.sc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sc-preview { padding: 14px; background: #fff6df; border: 1.5px dashed var(--gold-deep); border-radius: 12px; font-size: 0.88rem; color: var(--ink); }
.sc-preview[hidden] { display: none; }
.sc-preview p { margin: 0 0 8px; }
.sc-preview pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--font-text); font-size: 0.84rem; line-height: 1.5; color: var(--body); }
.sc-or { margin: 14px 0 0; font-size: 0.9rem; line-height: 1.55; }
.sc-or a { font-weight: 600; }
.sc-again {
  display: block; margin: 20px auto 0; font: inherit; font-size: 0.92rem; font-weight: 600;
  color: var(--teal); background: none; border: 0; padding: 10px; min-height: 44px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.sc-again:focus-visible { outline: 3px solid var(--dawn); border-radius: 8px; }

/* ---------- client films, shown with the result (on the night sky) ---------- */
.sc-stories { margin-top: 34px; scroll-margin-top: 96px; }
.sc-stories[hidden] { display: none; }
.sc-stories .eyebrow { margin-bottom: 8px; }
.sc-stories-title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.55rem, 6vw, 2.1rem); line-height: 1.12; color: var(--white); }
.sc-stories-lead { margin: 8px 0 18px; color: #cfe0da; line-height: 1.55; }
/* phones: a swipe row (each film is tall); wide screens: three side by side */
.sc-stories-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  margin: 0 -24px; padding: 2px 24px 10px; scroll-padding: 0 24px; scrollbar-width: none;
}
.sc-stories-row::-webkit-scrollbar { display: none; }
.sc-story { scroll-snap-align: start; display: grid; gap: 12px; align-content: start; }
.sc-story .video-embed { aspect-ratio: 3 / 4; }
.sc-story .play-badge { width: 64px; height: 64px; }
.sc-story blockquote { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 1.1rem; line-height: 1.35; color: #faf6ec; }
.sc-story .who { margin: 0; font-size: 0.9rem; line-height: 1.5; color: var(--dawn); font-weight: 600; }
.sc-story .disclose { margin: 0; font-size: 0.8rem; line-height: 1.5; color: #9fb0aa; }
.sc-stories-cta { margin-top: 22px; width: 100%; }

/* ---------- "rather skip the quiz?" box (on the night sky, before the result) ---------- */
.sc-early { margin-top: 22px; padding: 22px 18px; border: 1px solid rgba(233, 190, 98, 0.26); border-radius: 18px; background: rgba(250, 246, 236, 0.04); }
.sc-early[hidden] { display: none; }
.sc-early-label { margin: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dawn); }
.sc-early-title { margin: 6px 0 8px; font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; line-height: 1.22; color: var(--white); }
.sc-early-copy { margin: 0 0 16px; line-height: 1.6; color: #cfe0da; }
.sc-early .sc-field { color: #f3eee2; }
.sc-early .sc-error { color: #f6b4a4; }
.sc-optional { font-weight: 400; color: #9fb0aa; }

.sc-crisis { margin: 26px auto 0; max-width: 36em; text-align: center; font-size: 0.84rem; line-height: 1.55; color: #9fb0aa; }
.sc-crisis a { color: var(--glow); font-weight: 700; }

@keyframes sc-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sc-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

@media (min-width: 760px) {
  .sc-inner { padding: 58px 24px 64px; }
  .sc-card { padding: 22px 26px 26px; }
  .sc-result { padding: 36px 36px 30px; }
  .sc-call { padding: 26px 26px; }
  .sc-early { padding: 26px 26px; }
  .sc-stories-row { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 0; }
  .sc-swipe { display: none; }
  .sc-stories-cta { width: auto; }
  .sc-call-btn { width: auto; justify-self: start; }
  .sc-times { grid-template-columns: repeat(4, auto); justify-content: start; }
  .sc-opts-scale { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .sc-q.is-in, .sc-result.is-in { animation: none; }
  .sc-arc-done, .sc-moon, .sc-moon-halo, .sc-dawn { transition: none; }
}
