/* SleepTime — sleep.amit.marketing */

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