/* Slaaphelder — night-first stylesheet.
   One file, no build step, no dependencies. */

:root {
  --bg:        #0b0e14;
  --surface:   #141926;
  --surface-2: #1b2131;
  --line:      #262e40;
  --text:      #e8e6e1;
  --muted:     #9aa4b8;
  --accent:    #e8b86d;   /* lamplight */
  --accent-dim:#8a6a35;
  --radius: 14px;
  --wrap: 720px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:        #fbfaf7;
    --surface:   #ffffff;
    --surface-2: #f4f2ed;
    --line:      #e3ded3;
    --text:      #1c1e24;
    --muted:     #5f6675;
    --accent:    #9a6b18;
    --accent-dim:#c9a463;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 97%, transparent);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(12px);
}
/* keep headings clear of the sticky header when jumped to via anchor */
.prose h2, .prose h3 { scroll-margin-top: 78px; }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 14px; padding-bottom: 14px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 620; letter-spacing: -.01em;
  color: var(--text); text-decoration: none; font-size: 1.05rem;
}
.brand-mark {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent);
  box-shadow: inset -4px -1px 0 0 var(--bg);
  transform: rotate(-20deg);
}
.site-header nav { display: flex; gap: 20px; }
.site-header nav a {
  color: var(--muted); text-decoration: none; font-size: .935rem;
}
.site-header nav a:hover { color: var(--text); }

/* ---------- hero ---------- */
.hero { padding: 64px 0 34px; }
.hero h1 {
  font-size: clamp(2rem, 6vw, 2.9rem);
  line-height: 1.12; letter-spacing: -.025em;
  margin: 0 0 16px; max-width: 16ch;
}
.lede { color: var(--muted); font-size: 1.09rem; max-width: 56ch; margin: 0; }

/* ---------- cards ---------- */
.cards { display: grid; gap: 14px; margin: 30px 0 56px; }
.card {
  display: block; padding: 22px 24px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.card:hover {
  border-color: var(--accent-dim); transform: translateY(-2px);
  text-decoration: none;
}
.card .cat {
  display: inline-block; font-size: .74rem; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 9px;
}
.card h2 {
  margin: 0 0 8px; font-size: 1.22rem; line-height: 1.3;
  letter-spacing: -.015em;
}
.card p { margin: 0 0 12px; color: var(--muted); font-size: .96rem; }
.card .meta { font-size: .8rem; color: var(--muted); opacity: .8; }

/* ---------- article ---------- */
.article { padding: 34px 20px 64px; }
.crumb { font-size: .875rem; margin: 0 0 22px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }

.article h1 {
  font-size: clamp(1.75rem, 5vw, 2.45rem);
  line-height: 1.18; letter-spacing: -.025em; margin: 0 0 14px;
}
.byline { color: var(--muted); font-size: .875rem; margin: 0 0 22px; }

.disclosure {
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px; margin: 0 0 36px;
  font-size: .9rem; color: var(--muted);
}

/* ---------- prose ---------- */
.prose > *:first-child { margin-top: 0; }
.prose h2 {
  font-size: 1.5rem; line-height: 1.25; letter-spacing: -.02em;
  margin: 48px 0 14px; padding-top: 8px;
}
.prose h3 {
  font-size: 1.16rem; line-height: 1.35; margin: 34px 0 10px;
  letter-spacing: -.01em;
}
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--accent-dim); }
.prose strong { color: var(--text); font-weight: 640; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 42px 0; }

.prose blockquote {
  margin: 26px 0; padding: 16px 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; color: var(--muted);
}
.prose blockquote p:last-child { margin-bottom: 0; }

/* tables — the comparison table is the money element, so it gets care */
.prose table {
  width: 100%; border-collapse: collapse; margin: 26px 0;
  font-size: .9rem; display: block; overflow-x: auto;
  white-space: nowrap;
}
@media (min-width: 700px) {
  .prose table { display: table; white-space: normal; }
}
.prose thead th {
  text-align: left; font-size: .74rem; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.prose tbody td {
  padding: 12px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.prose tbody tr:hover { background: var(--surface); }
.prose tbody td:first-child { font-weight: 600; }

/* ---------- opt-in ---------- */
.optin {
  margin: 56px 0 0; padding: 28px 26px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.optin h2 { margin: 0 0 8px; font-size: 1.25rem; letter-spacing: -.015em; }
.optin > p { margin: 0 0 18px; color: var(--muted); font-size: .96rem; }

.optin-form { display: flex; flex-wrap: wrap; gap: 10px; }
.optin-form input[type=email] {
  flex: 1 1 220px; padding: 12px 14px; font: inherit; font-size: .95rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px;
}
.optin-form input[type=email]:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}
.optin-form button {
  padding: 12px 22px; font: inherit; font-size: .95rem; font-weight: 600;
  background: var(--accent); color: #16120a;
  border: 0; border-radius: 9px; cursor: pointer;
}
.optin-form button:hover { filter: brightness(1.08); }
.optin-note { flex: 1 0 100%; font-size: .85rem; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 72px;
  padding: 36px 0 44px; font-size: .9rem;
}
.foot-cols {
  display: flex; flex-wrap: wrap; gap: 24px;
  justify-content: space-between; margin-bottom: 26px;
}
.foot-cols p { margin: 6px 0 0; max-width: 34ch; font-size: .875rem; }
.foot-nav { display: flex; flex-direction: column; gap: 8px; }
.foot-nav a { color: var(--muted); text-decoration: none; }
.foot-nav a:hover { color: var(--accent); }

@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .hero { padding: 44px 0 24px; }
  .site-header nav { gap: 14px; }
}
