/* SleepTime — sleep.amitsharma.co.nz */

:root {
  --night-0: #05081a;
  --night-1: #0b1026;
  --night-2: #121a3a;
  --night-3: #1a2450;
  --line: rgba(160, 178, 255, 0.14);
  --line-soft: rgba(160, 178, 255, 0.08);
  --ink: #eaeeff;
  --ink-2: #c3cbef;
  --muted: #8f99c4;
  --gold: #f0c36b;
  --gold-2: #ffdd9c;
  --violet: #8b7bff;
  --teal: #56d6c6;
  --danger: #ff8b8b;
  --card: rgba(255, 255, 255, 0.04);
  --card-2: rgba(255, 255, 255, 0.06);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.75);
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1120px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --night-0: #f6f4ef;
  --night-1: #fffdf8;
  --night-2: #ffffff;
  --night-3: #f1eee6;
  --line: rgba(20, 26, 58, 0.12);
  --line-soft: rgba(20, 26, 58, 0.07);
  --ink: #15193a;
  --ink-2: #333a63;
  --muted: #6a7196;
  --gold: #b8791a;
  --gold-2: #96610f;
  --violet: #5a48d6;
  --teal: #16897c;
  --card: rgba(20, 26, 58, 0.03);
  --card-2: rgba(20, 26, 58, 0.05);
  --shadow: 0 20px 50px -24px rgba(30, 30, 60, 0.28);
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: var(--font);
  background: var(--night-0);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* ---------- sky ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(139, 123, 255, 0.30), transparent 62%),
    radial-gradient(900px 600px at 12% 4%, rgba(86, 214, 198, 0.16), transparent 60%),
    linear-gradient(180deg, var(--night-1) 0%, var(--night-0) 58%, var(--night-0) 100%);
}
:root[data-theme="light"] .sky {
  background:
    radial-gradient(1100px 640px at 80% -10%, rgba(240, 195, 107, 0.35), transparent 62%),
    radial-gradient(900px 600px at 8% 0%, rgba(139, 123, 255, 0.14), transparent 60%),
    linear-gradient(180deg, #fffdf8 0%, #f6f4ef 100%);
}
.stars { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.8; }
:root[data-theme="light"] .stars { opacity: 0; }
.star { position: absolute; border-radius: 50%; background: #fff; animation: twinkle 4s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0.16; } 50% { opacity: 0.9; } }

.moon {
  position: fixed;
  top: 4vh; right: 6vw;
  width: 130px; height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 32%, #fff6df 0%, #f4cd85 55%, #dda94f 100%);
  box-shadow: 0 0 90px 20px rgba(240, 195, 107, 0.22);
  z-index: -1;
  opacity: 0.55;
  filter: blur(0.3px);
}
@media (max-width: 860px) { .moon { width: 84px; height: 84px; top: 2vh; right: 5vw; opacity: 0.4; } }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--night-0) 72%, transparent);
  border-bottom: 1px solid var(--line-soft);
}
.head-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.02em; font-size: 1.05rem; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand span b { color: var(--gold); font-weight: 800; }
.head-nav { display: flex; align-items: center; gap: 4px; }
.head-nav a { text-decoration: none; color: var(--muted); font-size: 0.9rem; font-weight: 500; padding: 8px 12px; border-radius: 10px; transition: color .18s, background .18s; }
.head-nav a:hover { color: var(--ink); background: var(--card); }
@media (max-width: 720px) { .head-nav a.hide-sm { display: none; } }
.theme-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card); display: grid; place-items: center; transition: transform .18s, background .18s;
}
.theme-btn:hover { background: var(--card-2); transform: translateY(-1px); }
.theme-btn svg { width: 17px; height: 17px; }
:root[data-theme="light"] .icon-sun { display: none; }
:root:not([data-theme="light"]) .icon-moon { display: none; }

/* ---------- hero ---------- */
.hero { padding: 52px 0 8px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 26%, transparent);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); }
h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
  line-height: 1.06; letter-spacing: -0.035em; font-weight: 800;
  max-width: 15ch; margin: 0 auto 16px;
}
h1 em { font-style: normal; background: linear-gradient(100deg, var(--gold-2), var(--gold) 45%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { color: var(--ink-2); font-size: clamp(1rem, 2vw, 1.14rem); max-width: 56ch; margin: 0 auto; }
.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-top: 22px; color: var(--muted); font-size: 0.85rem; }
.trust span { display: inline-flex; align-items: center; gap: 7px; }
.trust svg { width: 14px; height: 14px; color: var(--teal); }

/* ---------- calculator ---------- */
.calc {
  margin: 34px auto 0;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line-soft); }
.tab {
  background: none; border: 0; padding: 15px 8px 13px;
  font-size: 0.86rem; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; transition: color .18s, background .18s, border-color .18s;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.tab svg { width: 18px; height: 18px; }
.tab:hover { color: var(--ink-2); background: var(--card); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent); }
@media (max-width: 560px) { .tab { font-size: 0.72rem; padding: 12px 4px 10px; } .tab svg { width: 16px; height: 16px; } }

.panel { padding: 30px 26px 26px; }
@media (max-width: 560px) { .panel { padding: 22px 16px 20px; } }
.panel[hidden] { display: none; }
.panel-q { text-align: center; color: var(--ink-2); font-size: 1.02rem; font-weight: 500; margin-bottom: 18px; }

/* time field */
.timefield { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.tf-group {
  display: flex; align-items: center; gap: 2px;
  background: var(--night-2); border: 1px solid var(--line);
  border-radius: 16px; padding: 8px 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.tf-unit { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tf-input {
  width: 74px; background: none; border: 0; text-align: center;
  font-size: clamp(2.2rem, 6vw, 3rem); font-weight: 800; letter-spacing: -0.03em;
  color: var(--ink); font-variant-numeric: tabular-nums; padding: 0;
}
.tf-input:focus { outline: none; color: var(--gold); }
.tf-colon { font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.tf-chev { background: none; border: 0; padding: 2px 8px; color: var(--muted); line-height: 0; border-radius: 8px; transition: color .15s, background .15s; }
.tf-chev:hover { color: var(--gold); background: var(--card-2); }
.tf-chev svg { width: 14px; height: 14px; }
.ampm { display: flex; flex-direction: column; gap: 4px; background: var(--night-2); border: 1px solid var(--line); border-radius: 14px; padding: 5px; }
.ampm button {
  border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 0.82rem;
  padding: 7px 14px; border-radius: 10px; transition: all .18s;
}
.ampm button[aria-pressed="true"] { background: var(--gold); color: #1a1405; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  padding: 7px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  transition: all .18s;
}
.chip:hover { border-color: color-mix(in srgb, var(--gold) 50%, transparent); color: var(--ink); transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #1a1405; }

.now-block { text-align: center; }
.now-time { font-size: clamp(2.6rem, 8vw, 4rem); font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.now-time small { display: block; font-size: 0.85rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

.cta {
  display: block; width: 100%; max-width: 340px; margin: 22px auto 0;
  background: linear-gradient(100deg, var(--gold-2), var(--gold));
  color: #1a1405; border: 0; border-radius: 14px;
  padding: 15px 22px; font-size: 1rem; font-weight: 700; letter-spacing: -0.01em;
  box-shadow: 0 12px 30px -12px rgba(240, 195, 107, 0.6);
  transition: transform .18s, box-shadow .18s;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -14px rgba(240, 195, 107, 0.7); }
.cta:active { transform: translateY(0); }

/* results */
.results { margin-top: 28px; }
.results[hidden] { display: none; }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.results-head h2 { font-size: 1.06rem; font-weight: 700; letter-spacing: -0.01em; }
.results-head p { color: var(--muted); font-size: 0.86rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 12px; }
.rcard {
  position: relative; text-align: center; padding: 18px 12px 15px;
  background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .2s, border-color .2s, box-shadow .2s;
  animation: rise .42s cubic-bezier(.2,.7,.3,1) backwards;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.rcard:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--gold) 45%, transparent); box-shadow: 0 14px 30px -18px rgba(0,0,0,.8); }
.rcard.best { border-color: color-mix(in srgb, var(--gold) 60%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 12%, var(--night-2)), var(--night-2)); }
.rcard .badge {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: #1a1405; font-size: 0.66rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.rcard .time { font-size: 1.62rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.rcard .time span { font-size: 0.86rem; font-weight: 600; color: var(--muted); margin-left: 5px; }
.rcard .meta { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.rcard .cyc { display: inline-flex; gap: 3px; margin-top: 9px; }
.rcard .cyc i { width: 5px; height: 5px; border-radius: 50%; background: var(--violet); opacity: .55; }
.rcard.best .cyc i { background: var(--gold); opacity: 1; }
.rcard .act { position: absolute; inset: auto 8px 8px auto; display: flex; gap: 4px; opacity: 0; transition: opacity .18s; }
.rcard:hover .act, .rcard:focus-within .act { opacity: 1; }
.rcard .act button { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); background: var(--card-2); display: grid; place-items: center; color: var(--muted); }
.rcard .act button:hover { color: var(--gold); }
.rcard .act svg { width: 13px; height: 13px; }

.result-note {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--violet) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--violet) 24%, transparent);
  color: var(--ink-2); font-size: 0.87rem;
}
.result-note b { color: var(--ink); }

.tools-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.ghost {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  padding: 10px 16px; border-radius: 12px; font-size: 0.87rem; font-weight: 600; text-decoration: none;
  transition: all .18s;
}
.ghost:hover { color: var(--ink); border-color: color-mix(in srgb, var(--gold) 45%, transparent); transform: translateY(-1px); }
.ghost svg { width: 15px; height: 15px; }

/* age selector */
.age-row {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--line-soft);
  font-size: 0.9rem; color: var(--muted);
}
.age-row select {
  background: var(--night-2); color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; font: inherit; font-weight: 600; font-size: 0.88rem;
}
.age-out { color: var(--teal); font-weight: 700; }

/* ---------- ads ---------- */
.ad-slot { margin: 34px auto; text-align: center; min-height: 100px; }
.ad-slot--rect { min-height: 280px; }
.ad-label { display: block; font-size: 0.63rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); opacity: .55; margin-bottom: 6px; }

/* ---------- affiliate ---------- */
.rec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.rec {
  display: block; text-decoration: none; padding: 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .2s, border-color .2s;
}
.rec:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.rec h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.rec p { font-size: 0.87rem; color: var(--muted); }
.rec .go { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--gold); font-size: 0.85rem; font-weight: 700; }

/* ---------- content ---------- */
.section { padding: 54px 0; }
.section + .section { border-top: 1px solid var(--line-soft); }
h2.sec { font-size: clamp(1.5rem, 3.4vw, 2rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 14px; }
h3.sub { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.02em; margin: 26px 0 8px; }
.prose p { color: var(--ink-2); margin-bottom: 14px; }
.prose ul { color: var(--ink-2); padding-left: 20px; margin-bottom: 14px; }
.prose li { margin-bottom: 7px; }
.prose strong { color: var(--ink); }
.lead-note { color: var(--muted); font-size: 0.95rem; }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 460px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line-soft); }
th { background: var(--card); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
td:last-child { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }

.faq details {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); margin-bottom: 10px; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 16px 18px; font-weight: 650; font-size: 0.98rem;
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold); font-size: 1.3rem; font-weight: 400; line-height: 1; flex: none; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .ans { padding: 0 18px 16px; color: var(--ink-2); font-size: 0.93rem; }

.cards-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 18px; }
.mini { padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.mini .n { font-size: 1.7rem; font-weight: 800; color: var(--gold); letter-spacing: -0.03em; }
.mini h3 { font-size: 0.98rem; font-weight: 700; margin: 6px 0 5px; }
.mini p { font-size: 0.87rem; color: var(--muted); }

.linkgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-top: 16px; }
.linkgrid a {
  text-decoration: none; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--line-soft); color: var(--ink-2);
  font-size: 0.88rem; font-weight: 500; transition: all .18s;
}
.linkgrid a:hover { color: var(--ink); border-color: color-mix(in srgb, var(--gold) 40%, transparent); }

.disclaimer {
  margin-top: 24px; padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 0.85rem;
}

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line-soft); padding: 38px 0 44px; margin-top: 20px; }
.foot-in { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.foot-in p { color: var(--muted); font-size: 0.85rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 18px; }
.foot-links a { color: var(--muted); font-size: 0.85rem; text-decoration: none; }
.foot-links a:hover { color: var(--gold); }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: var(--night-3); border: 1px solid var(--line); color: var(--ink);
  padding: 11px 18px; border-radius: 12px; font-size: 0.88rem; font-weight: 600;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all .25s; z-index: 90;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- Identity B typographic hygiene (dark identity kept) ----
   SleepTime keeps its own dark art direction; only the numeric discipline
   and the zero-motion rule are shared with the rest of the tool network. */
.time, .now-time, .rcard .time, .cycle, .dur, .num, .v, .amt,
input[type="time"], input[type="number"], input[inputmode="decimal"],
td, th, output, time {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Token aliases so the shared network furniture (netbar, related cards,
   source citations) renders inside SleepTime's own dark identity. */
:root {
  --netbar-bg: #05081a;
  --surface: var(--night-1);
  --surface-2: var(--night-0);
  --accent: var(--gold);
  --accent-2: var(--gold-2);
  --accent-soft: rgba(240, 195, 107, .10);
  --accent-line: rgba(240, 195, 107, .30);
  --warn: var(--gold);
}
:root[data-theme="light"] {
  --netbar-bg: #15193a;
  --accent-soft: rgba(184, 121, 26, .09);
  --accent-line: rgba(184, 121, 26, .30);
}

/* ---------- publisher / follow strip ----------
   Added 2026-07-30. `socialStrip()` in network.mjs has been rendering on this
   site since it was introduced, but SleepTime is the one tool that keeps its
   own dark stylesheet (apply.mjs marks it `light: false`), so it never got the
   matching rules from _shared/styles.css and the strip shipped unstyled.
   Any future addition to the shared stylesheet needs a mirror here. */
.soc-strip{
  margin-top:1.5rem;padding-top:1.25rem;border-top:1px solid var(--line);
  display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.75rem 1.25rem;
}
.soc-lead{margin:0;font-size:.88rem;line-height:1.5;color:var(--muted);max-width:56ch}
.soc-lead strong{color:var(--ink);font-weight:600}
.soc-name{color:inherit;text-decoration:underline;text-decoration-color:var(--line);text-underline-offset:3px}
.soc-name:hover,.soc-name:focus-visible{text-decoration-color:var(--accent)}
.soc-name:hover strong,.soc-name:focus-visible strong{color:var(--accent)}
.soc-links{display:flex;flex-wrap:wrap;gap:.5rem}
.soc-link{
  display:inline-block;padding:.35rem .75rem;border:1px solid var(--line);border-radius:999px;
  font-size:.82rem;line-height:1.35;color:var(--ink);text-decoration:none;background:var(--surface);
}
.soc-link:hover,.soc-link:focus-visible{border-color:var(--accent);color:var(--accent)}
@media (max-width:640px){
  .soc-strip{flex-direction:column;align-items:flex-start}
  .soc-lead{max-width:none}
}

/* ============================================================================
   AAA+++ STUDIO PREMIUM — the §3 mechanics, re-expressed for SleepTime
   Spec: _plans/AAA-PLUS-STUDIO-PREMIUM.md §2.2/§2.2b, §3, §4, §5 (cluster U).

   SleepTime is the ONE site in clusters T/U that apply.mjs marks `light:false`,
   so it never receives _shared/styles.css. Importing that sheet here would
   fight this whole art direction (night sky, gold, warm dark) and ship a
   second, mostly-dead stylesheet. Instead the mechanics are RE-EXPRESSED in
   this file, in this identity, against the SAME token VALUES as Identity B —
   radius 10/14/8, one lift shadow, --t-fast/--t-med, --ease-out — so the two
   identities stay in step even though the sheets are separate.

   Standing cost of `light:false`: any future AAA+++ component added to
   _shared/styles.css has to be mirrored here by hand.
   ========================================================================== */

:root {
  /* the third voice — system stack only, zero new requests (§7) */
  --mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Code", Consolas, Menlo, monospace;
  --fs-mono: .8125rem;
  --track-label: .11em;
  --t-fast: 140ms;
  --t-med: 220ms;
  --ease-out: cubic-bezier(0.25, 1, 0.4, 1);
  /* §2.2b: 18/12/26px pill radii were the "free template" tell here too. */
  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 8px;
  /* §3.2: exactly ONE elevating shadow, spent on the calculator and nothing
     else. Warmed toward the night sky rather than neutral black. */
  --shadow: 0 1px 0 rgba(255, 255, 255, .04), 0 24px 56px -28px rgba(2, 4, 16, .9);
  --ink-num: var(--ink);
  --surface-sunken: #0a0e22;
}
:root[data-theme="light"] {
  --shadow: 0 1px 0 rgba(20, 26, 58, .04), 0 18px 40px -26px rgba(30, 30, 60, .3);
  --surface-sunken: #f1eee6;
}

/* ---- the mono "spec" voice (§3.4) -------------------------------------- */
/* Times, cycle counts, latency figures, source vintages. Without this register
   a sleep calculator reads as a lifestyle blog; with it, as an instrument that
   knows exactly what it is claiming. */
.spec, .srcline, .crumbs, .vintage, .freshness, .kicker, .eyebrow, .cite {
  font-family: var(--mono);
  font-size: var(--fs-mono);
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums lining-nums;
}
.spec, .cite { color: var(--muted); }
.kicker { text-transform: uppercase; letter-spacing: var(--track-label); color: var(--gold); }
.eyebrow { text-transform: uppercase; letter-spacing: var(--track-label); }

/* ---- tabular numerals with intent (§3.4) ------------------------------- */
.num, td.n, .result-v, .rcard .time, .now-time, .mini .n, table td, table th, .pager {
  font-variant-numeric: tabular-nums lining-nums;
}
.result-v {
  font-size: clamp(2.1rem, 6vw, 2.9rem);
  font-weight: 650; line-height: 1.04; letter-spacing: -.02em; color: var(--ink-num);
}
.result-u {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}

/* ---- the keel (§3.3) --------------------------------------------------- */
h2.sec::before, .keel::before {
  content: ""; display: block; width: 44px; height: 2px;
  background: var(--gold); margin-bottom: 14px;
}

/* ---- elevation: one floating object (§3.2) ----------------------------- */
/* Chips, result cards, rec cards, the CTA and the theme button all lifted a
   little on hover, which is how elevation stops meaning anything — and every
   translate was a paint the page did not need. The calculator is the object
   that asks for action; it floats. Nothing else does. */
.calc { border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.tbl-wrap, .rec, .mini, .faq details, .rcard, .chip, .ghost, .linkgrid a, .soc-link { box-shadow: none; }
.rcard:hover, .rec:hover, .chip:hover, .ghost:hover, .theme-btn:hover, .cta:hover { transform: none; }
.rcard:hover { box-shadow: none; }
.cta { box-shadow: none; transition: filter var(--t-fast) var(--ease-out); }
.cta:hover { filter: brightness(1.06); }
.cta:active { transform: none; }
.tbl-wrap, .rec, .mini { border-radius: var(--radius); }
.rcard, .ampm, .tf-group { border-radius: var(--radius); }

/* ---- sunken input wells (§4, calculator-card row) ---------------------- */
/* The hour/minute fields ARE this instrument's inputs. A sunken well with an
   inset hairline reads as a field on a panel; the old flat group read as
   display type you happened to be able to click. 48px keeps the tap target
   honest on mobile. */
.tf-group, .ampm, .age-row select {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, .35);
}
:root[data-theme="light"] .tf-group,
:root[data-theme="light"] .ampm,
:root[data-theme="light"] .age-row select { box-shadow: inset 0 1px 0 rgba(20, 26, 58, .06); }
.tf-unit { min-height: 48px; justify-content: center; }
.age-row select { min-height: 44px; border-radius: var(--radius-sm); }

/* ---- focus & hover with intent (§3.6) ---------------------------------- */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 2px; }
/* .tf-input killed its own outline, so keyboard users lost the site's single
   most important control the moment they tabbed into it. */
.tf-input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; color: var(--gold); }
a.draw, .rel-card .rel-t {
  text-decoration: none;
  background: linear-gradient(var(--gold), var(--gold)) 0 100% / 0 1px no-repeat;
  transition: background-size var(--t-med) var(--ease-out);
}
a.draw:hover, a.draw:focus-visible, .rel-card:hover .rel-t { background-size: 100% 1px; }
.rcard, .rec, .chip, .ghost, .linkgrid a, .tab {
  transition: border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}

/* ---- breadcrumb (§6.2) ------------------------------------------------- */
.crumbs { display: block; margin-bottom: 14px; color: var(--muted); text-transform: uppercase; text-align: left; }
.crumbs a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.crumbs a:hover { color: var(--ink-2); border-bottom-color: var(--gold); }
.crumbs .sep { margin: 0 .5em; color: var(--line); }

/* ---- the promoted source / citation line (§6.4) ------------------------ */
/* This line carries more weight here than anywhere else in the network: the
   90-minute cycle is a MODEL, and a model published without its provenance is
   indistinguishable from a claim. */
.srcline {
  display: block; text-align: left; border-top: 1px solid var(--line);
  padding-top: 8px; margin-top: 12px;
  color: var(--muted); text-transform: uppercase;
}
.srcline .sep { color: var(--line); margin: 0 .5em; }
.srcline a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.srcline a:hover { color: var(--ink-2); border-bottom-color: var(--gold); }

/* ---- the method mini-spec (§4) ---------------------------------------- */
.method ol { list-style: none; margin: 0; padding: 0; counter-reset: mstep; }
.method li {
  counter-increment: mstep; border-top: 1px solid var(--line);
  padding: 14px 0 14px 44px; position: relative; color: var(--ink-2);
}
.method li:last-child { border-bottom: 1px solid var(--line); }
.method li::before {
  content: counter(mstep, decimal-leading-zero);
  position: absolute; left: 0; top: 14px;
  font-family: var(--mono); font-size: var(--fs-mono);
  letter-spacing: .06em; color: var(--gold);
}
.method .formula {
  font-family: var(--mono); font-size: .875rem;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm); padding: 12px 14px; margin: 10px 0 0;
  overflow-x: auto; white-space: pre; color: var(--ink-2);
}
/* The assumption band — the honest half of a model-based tool. Hairline-ruled,
   mono kicker, deliberately NOT a scary alert box. */
.assume {
  border-left: 2px solid var(--gold); background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px; margin: 18px 0 0; color: var(--ink-2); font-size: .93rem;
  text-align: left;
}
.assume .assume-k {
  display: block; font-family: var(--mono); font-size: .7rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px;
}
.assume b, .assume strong { color: var(--ink); }

/* ---- related cards that earn the click (§6.1) -------------------------- */
.rel-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 24px; }
.rel-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 18px 14px;
  background: var(--card); border: 1px solid var(--line);
  border-top: 2px solid var(--gold);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: none; text-decoration: none; color: inherit;
  transition: border-color var(--t-fast) var(--ease-out);
}
.rel-card:hover { border-color: color-mix(in srgb, var(--gold) 45%, transparent); border-top-color: var(--gold); }
.rel-card .rel-t { font-weight: 650; color: var(--ink); font-size: 1.02rem; align-self: flex-start; }
.rel-card .rel-why { color: var(--ink-2); font-size: .92rem; line-height: 1.5; margin: 0; }
.rel-card .freshness { margin-top: auto; padding-top: 10px; color: var(--muted); align-self: flex-end; }
.rel-card.bridge { border-style: dashed; border-top-style: solid; background: var(--card-2); }

/* ---- netbar promoted (§4) ---------------------------------------------- */
.netbar .netbar-label { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; opacity: .72; }
.netbar .nb-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* ---- header lockup (§4) ------------------------------------------------ */
.brand-lockup { display: flex; flex-direction: column; line-height: 1.15; }
.brand-sub {
  display: block; font-family: var(--mono); font-size: .7rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 2px;
}
@media (max-width: 520px) { .brand-sub { display: none; } }

/* ---- table caption vintage chip (§4) ---------------------------------- */
table caption.vintage {
  caption-side: top; text-align: left; padding: 12px 14px;
  color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--line);
}

/* ---- entrance choreography (§3.7) ------------------------------------- */
/* Above the fold, once, on load. Gated behind no-preference so reduced-motion
   readers get the finished page rather than a stranded one, and nothing here
   animates layout — CLS stays 0.00. */
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: aaa-rise 420ms var(--ease-out) both; }
  .reveal-2 { animation-delay: 60ms; }
  .reveal-3 { animation-delay: 120ms; }
  @keyframes aaa-rise { from { opacity: 0; transform: translateY(12px); } }
}

/* ---- confident emptiness (§3) ------------------------------------------ */
.breathe { min-height: 18vh; }
@media (max-width: 640px) { .breathe { min-height: 10vh; } }
