*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --night: #1a1a2e; --deep: #16213e; --twilight: #0f3460; --dawn: #e9a065; --sunrise: #f5c842;
  --cream: #faf6ed; --paper: #fffdf8; --rule: #e8dfcd; --text: #2c2137; --text-light: #6b5e7b;
  --link: #1f4f8f;
}
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
body { font-family: 'DM Sans', sans-serif; color: var(--text); background: var(--cream); line-height: 1.68; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: 'Baloo 2', cursive; line-height: 1.2; color: var(--night); }
a { color: var(--link); text-underline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; background: var(--night); }
.brand { display: flex; align-items: center; gap: .5rem; white-space: nowrap; font-family: 'Baloo 2', cursive; font-weight: 800; font-size: 1.2rem; color: var(--cream); text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.topbar nav { display: flex; align-items: center; gap: 1rem; }
.topbar nav a { color: rgba(250,246,237,.8); text-decoration: none; font-size: .9rem; font-weight: 500; white-space: nowrap; }
.topbar nav a:hover { color: var(--cream); }
.topbar .cta { background: linear-gradient(135deg, var(--sunrise), var(--dawn)); color: var(--night); padding: .4rem 1rem; border-radius: 100px; font-weight: 600; }
.topbar .cta:hover { color: var(--night); }

/* hero: a strip of night sky running into dawn */
.hero {
  margin: 0 -1rem 1.5rem; padding: 2.5rem 1rem 2rem; color: var(--cream); position: relative; overflow: hidden;
  background:
    radial-gradient(70% 90% at 85% 120%, rgba(245,180,110,.75), rgba(214,130,120,.35) 40%, transparent 75%),
    linear-gradient(180deg, var(--night) 0%, var(--deep) 55%, #3a3466 100%);
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .7;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 22%, #fff, transparent), radial-gradient(1px 1px at 33% 12%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 58% 30%, #fff, transparent), radial-gradient(1px 1px at 76% 16%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 90% 40%, #fff, transparent), radial-gradient(1px 1px at 22% 58%, #fff, transparent),
    radial-gradient(1px 1px at 46% 70%, #fff, transparent);
}
.hero > * { position: relative; }
.hero h1 { color: var(--cream); font-size: clamp(1.8rem, 6vw, 2.75rem); font-weight: 800; letter-spacing: -.01em; max-width: 40rem; animation: rise .7s ease-out both; }
.crumbs { font-size: .8rem; margin-bottom: .75rem; color: rgba(250,246,237,.7); }
.crumbs a { color: rgba(250,246,237,.85); }
.updated { margin-top: .75rem; font-size: .8rem; letter-spacing: .04em; color: rgba(250,246,237,.75); animation: rise .7s .12s ease-out both; }
.hero .intro { color: rgba(250,246,237,.9); margin-top: 1rem; max-width: 40rem; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hero h1, .updated { animation: none; } }

/* article */
.guide { max-width: 46rem; margin: 0 auto; padding: 0 1rem 3rem; }
.tldr { background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--sunrise); border-radius: 12px; padding: 1rem 1.15rem; margin-bottom: 1.5rem; box-shadow: 0 6px 24px rgba(26,26,46,.06); }
.tldr strong { display: block; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: #a8641f; margin-bottom: .3rem; }
.intro { font-size: 1.05rem; }
.guide h2 { font-size: clamp(1.35rem, 4.2vw, 1.65rem); margin: 2.6rem 0 .7rem; }
.guide h3 { font-size: 1.12rem; margin: 1.5rem 0 .3rem; }
.guide p { margin-bottom: 1rem; }
.capsule { font-size: 1.08rem; font-weight: 500; }
.guide ul, .guide ol { padding-left: 1.3rem; margin-bottom: 1rem; }
.guide li { margin-bottom: .45rem; }
.toc { margin: 1.5rem 0 0; padding: 1rem 1.15rem; border-radius: 12px; background: rgba(15,52,96,.05); }
.toc p { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--text-light); margin-bottom: .4rem; }
.toc ol { margin: 0; }
.toc li { margin-bottom: .2rem; font-size: .95rem; }
figure { margin: 1.6rem 0; }
figure img { border-radius: 14px; }
figcaption { font-size: .85rem; color: var(--text-light); margin-top: .5rem; }
.source { font-size: .85rem; color: var(--text-light); }

/* tables */
.table-wrap { overflow-x: auto; margin: 1.2rem 0 1.4rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; font-variant-numeric: tabular-nums; }
caption { text-align: left; padding: .7rem .8rem .2rem; font-size: .8rem; color: var(--text-light); caption-side: top; }
th, td { padding: .5rem .7rem; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-weight: 600; font-size: .78rem; letter-spacing: .03em; color: var(--text-light); background: rgba(15,52,96,.04); white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { font-weight: 600; white-space: nowrap; }
.table-wrap.wide table { min-width: 980px; }
.table-wrap.wide td { min-width: 7rem; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.ours { background: rgba(245,200,66,.12); }

/* dawn heat strip: each cell shaded by how early civil dawn is */
.heat td { text-align: center; padding: .45rem .3rem; font-size: .8rem; }
.heat td[data-band="a"] { background: #eeb46a; color: var(--night); }
.heat td[data-band="b"] { background: #f6d39f; }
.heat td[data-band="c"] { background: #fbecd2; }
.heat td[data-band="d"] { background: transparent; color: var(--text-light); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .8rem; color: var(--text-light); margin: -.6rem 0 1.2rem; }
.legend span::before { content: ''; display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; border: 1px solid var(--rule); }
.legend .a::before { background: #eeb46a; } .legend .b::before { background: #f6d39f; } .legend .c::before { background: #fbecd2; }

/* chart */
.chart { background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; padding: .8rem .6rem .4rem; }
.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart svg { width: 100%; min-width: 540px; height: auto; display: block; font-family: 'DM Sans', sans-serif; }
.chart figcaption { padding: 0 .3rem; }

/* closing blocks */
.related ul { list-style: none; padding: 0; display: grid; gap: .5rem; }
.related li { margin: 0; }
.related a { display: block; padding: .65rem .9rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); text-decoration: none; font-weight: 500; transition: border-color .2s, transform .2s; }
.related a:hover { border-color: var(--dawn); transform: translateX(3px); }
.takeaways-box { background: var(--twilight); color: var(--cream); border-radius: 16px; padding: .2rem 1.2rem .6rem; margin-top: 2.4rem; }
.takeaways-box h2 { color: var(--cream); margin-top: 1.2rem; }
.takeaways li::marker { color: var(--sunrise); }
.faq h3 { color: var(--twilight); }
.promo { display: grid; grid-template-columns: 96px 1fr; gap: 1rem; align-items: center; margin: 2.4rem 0 0; padding: 1rem; border-radius: 16px; background: linear-gradient(135deg, #fff4dc, #fde6cf); border: 1px solid #f1d7b0; }
.promo img { border-radius: 12px; width: 96px; height: 96px; object-fit: cover; }
.promo p { margin-bottom: .6rem; font-size: .95rem; }
.promo-k { font-size: .72rem !important; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: #a8641f; margin-bottom: .2rem !important; }
.btn { display: inline-block; background: var(--twilight); color: #fff; text-decoration: none; padding: .55rem 1.2rem; border-radius: 100px; font-weight: 600; font-size: .9rem; transition: transform .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(15,52,96,.25); }
.meta { margin-top: 2.6rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: .92rem; color: var(--text-light); }
.meta h2 { font-size: 1.05rem; margin: 1rem 0 .3rem; color: var(--text); }
.site-foot { text-align: center; padding: 2rem 1rem; font-size: .85rem; color: var(--text-light); border-top: 1px solid var(--rule); }

/* hub */
.hub .cards { list-style: none; padding: 0; display: grid; gap: 1rem; }
.hub .cards a { display: block; padding: 1.1rem 1.2rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; text-decoration: none; color: var(--text); transition: border-color .2s, transform .2s, box-shadow .2s; }
.hub .cards a:hover { border-color: var(--dawn); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(26,26,46,.08); }
.hub .cards h2 { margin: 0 0 .3rem; font-size: 1.25rem; color: var(--twilight); }
.hub .cards p { margin: 0; font-size: .95rem; color: var(--text-light); }

@media (max-width: 380px) { .topbar nav a:not(.cta) { display: none; } }
@media (min-width: 720px) {
  .topbar { padding: .9rem 2rem; }
  .hero { margin: 0 calc(50% - 50vw) 2rem; padding: 3.5rem calc(50vw - 50% + 1rem) 2.75rem; }
  .promo { grid-template-columns: 140px 1fr; padding: 1.2rem; }
  .promo img { width: 140px; height: 140px; }
  .related ul { grid-template-columns: 1fr 1fr; }
}
