/* SleepRegressionAges.com — design system v1 · night-sky calm */
:root {
  --night: #1a2440;
  --night-deep: #121a30;
  --lavender: #b8a9e0;
  --lavender-soft: #e6e0f5;
  --cream: #faf8f4;
  --ink: #2a3350;
  --ink-soft: #5a6480;
  --amber: #e8a04c;
  --amber-deep: #c9822e;
  --card: #ffffff;
  --line: #e4e0d8;
  --good: #4c8a5c;
  --now: #c9612e;
  --radius: 14px;
  --maxw: 1080px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--cream); color: var(--ink);
  font-size: 17px; line-height: 1.65;
}
h1, h2, h3, .serif { font-family: "Fraunces", Georgia, serif; color: var(--night); }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); line-height: 1.15; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 2.2rem 0 0.8rem; }
h3 { font-size: 1.15rem; margin: 1.6rem 0 0.5rem; }
p { margin: 0 0 1rem; }
a { color: var(--night); text-decoration-color: var(--lavender); text-underline-offset: 3px; }
a:hover { color: var(--amber-deep); }
ul, ol { margin: 0 0 1rem 1.3rem; }
li { margin-bottom: 0.4rem; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }

/* Header */
header.site {
  background: var(--night); color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 12px rgba(18,26,48,0.25);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; max-width: var(--maxw); margin: 0 auto; gap: 12px; }
.logo { display: flex; align-items: center; text-decoration: none; }
.logo svg { width: 165px; height: auto; display: block; }
.nav-links { display: flex; gap: 22px; list-style: none; margin: 0; flex-wrap: wrap; }
.nav-links a { color: #dcd6ee; text-decoration: none; font-size: 0.92rem; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: #ffffff; }
.nav-links a.cta { background: var(--amber); color: var(--night-deep); padding: 7px 14px; border-radius: 8px; font-weight: 700; }
.nav-links a.cta:hover { background: #f0b06a; }

/* Hero */
.hero { background: linear-gradient(165deg, var(--night) 0%, #2a3560 70%, #3a3f6e 100%); color: #fff; padding: 56px 0 60px; position: relative; overflow: hidden; }
.hero h1 { color: #fff; max-width: 720px; }
.hero .lede { color: #cfc8e8; font-size: 1.12rem; max-width: 640px; margin-top: 14px; }
.hero .stars { position: absolute; inset: 0; pointer-events: none; opacity: 0.5; }
.hero .crumbs { font-size: 0.85rem; margin-bottom: 18px; color: #a99fd0; }
.hero .crumbs a { color: #cfc8e8; }
.badge { display: inline-block; background: rgba(184,169,224,0.18); border: 1px solid rgba(184,169,224,0.45); color: #dcd6ee; border-radius: 999px; padding: 4px 14px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 16px; }

/* Main content */
main { padding: 44px 0 20px; }
.content { max-width: 780px; }
.grid2 { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .grid2 { grid-template-columns: minmax(0,1fr); } }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 1.2rem 0; }
.card.tint { background: var(--lavender-soft); border-color: #d5cbee; }
.card.note { background: #fdf6ec; border-color: #ecd9b8; }
.card h3 { margin-top: 0; }

/* Ages chart table */
.chart-table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 6px rgba(26,36,64,0.07); font-size: 0.95rem; }
.chart-table th { background: var(--night); color: #fff; text-align: left; padding: 12px 14px; font-weight: 600; }
.chart-table td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.chart-table tr:nth-child(even) td { background: #f7f5f0; }
.chart-table a { font-weight: 600; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Timeline (calculator output) */
.timeline { list-style: none; margin: 1.4rem 0; padding: 0; }
.timeline li { border-left: 4px solid var(--line); padding: 12px 0 12px 20px; margin: 0; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -9px; top: 20px; width: 14px; height: 14px; border-radius: 50%; background: var(--line); }
.timeline li.passed { border-color: #c9d6cb; opacity: 0.75; }
.timeline li.passed::before { background: var(--good); }
.timeline li.now { border-color: var(--now); background: #fdf1e8; border-radius: 0 10px 10px 0; }
.timeline li.now::before { background: var(--now); box-shadow: 0 0 0 5px rgba(201,97,46,0.2); }
.timeline li.upcoming::before { background: var(--lavender); }
.timeline .tl-when { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.timeline li.now .tl-when { color: var(--now); }
.timeline .tl-title { font-family: "Fraunces", Georgia, serif; font-size: 1.1rem; color: var(--night); margin: 2px 0 4px; }
.timeline p { margin: 0; font-size: 0.94rem; }

/* Calculator form */
.calc-box { background: var(--night); color: #fff; border-radius: var(--radius); padding: 28px; margin: 1.4rem 0; }
.calc-box label { display: block; font-weight: 600; margin-bottom: 8px; color: #dcd6ee; }
.calc-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.calc-box input[type="date"] { font-size: 1.05rem; padding: 11px 14px; border-radius: 9px; border: 1px solid #4a5580; background: #fff; color: var(--ink); min-width: 200px; }
.calc-box .check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 0.92rem; color: #cfc8e8; }
.btn { display: inline-block; background: var(--amber); color: var(--night-deep); font-weight: 700; font-size: 1.02rem; padding: 12px 26px; border-radius: 9px; border: 0; cursor: pointer; text-decoration: none; }
.btn:hover { background: #f0b06a; color: var(--night-deep); }

/* FAQ */
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; padding: 0; }
.faq summary { cursor: pointer; font-weight: 600; padding: 15px 18px; color: var(--night); list-style: none; position: relative; padding-right: 40px; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 12px; font-size: 1.3rem; color: var(--lavender); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq .faq-a { padding: 0 18px 15px; }
.faq .faq-a p:last-child { margin-bottom: 0; }

/* Side rail */
.rail .card { margin-top: 0; }
.rail ul { list-style: none; margin-left: 0; }
.rail li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.94rem; }
.rail li:last-child { border-bottom: 0; }
.rail .soon { color: var(--ink-soft); }
.rail .soon em { font-style: normal; font-size: 0.78rem; background: #efece4; border-radius: 5px; padding: 1px 7px; margin-left: 6px; }

/* Sources */
.sources { font-size: 0.88rem; color: var(--ink-soft); border-top: 1px solid var(--line); margin-top: 2.6rem; padding-top: 1.2rem; }
.sources ol { margin-left: 1.2rem; }

/* Disclaimer */
.disclaimer { font-size: 0.85rem; color: var(--ink-soft); background: #f4f1ea; border-radius: 10px; padding: 12px 16px; margin: 1.6rem 0; }

/* Footer */
footer.site { background: var(--night-deep); color: #a8a2c4; margin-top: 60px; padding: 40px 0 30px; font-size: 0.9rem; }
footer.site .cols { display: flex; gap: 40px; flex-wrap: wrap; justify-content: space-between; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
footer.site a { color: #cfc8e8; text-decoration: none; }
footer.site a:hover { color: #fff; }
footer.site ul { list-style: none; margin: 10px 0 0; }
footer.site li { margin-bottom: 6px; }
footer.site .logo svg { width: 165px; }
footer.site .fine { max-width: var(--maxw); margin: 26px auto 0; padding: 18px 20px 0; border-top: 1px solid #2a3455; font-size: 0.8rem; color: #7a749a; }

@media (max-width: 640px) {
  .nav { flex-direction: column; align-items: flex-start; }
  .nav-links { gap: 14px; }
  body { font-size: 16px; }
  .hero { padding: 40px 0 44px; }
}

/* Technical SEO pass additions */
.skip { position: absolute; left: -9999px; top: 0; background: var(--amber); color: var(--night-deep); padding: 10px 18px; border-radius: 0 0 8px 0; z-index: 100; font-weight: 700; }
.skip:focus { left: 0; }
.prevnext { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; margin: 2rem 0 1.4rem; font-size: 0.94rem; }
.prevnext a { font-weight: 600; }

/* Language selector (TB multilingual standard; links activate as languages ship) */
.lang { display: flex; gap: 4px; align-items: center; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.03em; }
.lang .on { background: var(--lavender); color: var(--night-deep); border-radius: 6px; padding: 3px 8px; }
.lang .off { color: #6a6490; padding: 3px 6px; cursor: default; }
.lang a { background: transparent; color: #dcd6ee; border-radius: 6px; padding: 3px 8px; text-decoration: none; }
.lang a:hover { background: rgba(184,169,224,0.25); color: #fff; }
@media (max-width: 640px) { .lang { margin-top: 4px; } }
