/* ------------------------------------------------------------------
   Bedtime Bible · blog
   Same palette and typefaces as the homepage. Night is the brand.
   Fonts are the site's self-hosted woff2, served from the root /fonts/.
   ------------------------------------------------------------------ */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/fraunces.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/fraunces-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/plex-mono.woff2") format("woff2");
}

:root {
  --midnight: #0B1026;
  --surface: #141A36;
  --card: #1C2344;
  --vellum: #F3EBDA;
  --muted: #A9B0CC;
  --amber: #E8B761;
  --amber-deep: #C8873A;
  --edge: rgba(232, 214, 177, 0.12);
  --edge-strong: rgba(232, 214, 177, 0.24);

  --display: "Fraunces", Georgia, serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;

  --w: min(720px, calc(100vw - 2 * var(--gutter)));
  --w-wide: min(1080px, calc(100vw - 2 * var(--gutter)));
  --gutter: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--midnight);
  color: var(--vellum);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { width: var(--w); margin-inline: auto; }
.wrap-wide { width: var(--w-wide); margin-inline: auto; }

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

/* ---------- Header ---------- */
.site-head {
  border-bottom: 1px solid var(--edge);
}
.site-head .wrap-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}
.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  color: var(--vellum);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.head-link {
  font-family: var(--body);
  font-size: 15px;
  font-weight: 600;
  color: var(--midnight);
  background: var(--amber);
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 999px;
  white-space: nowrap;
}
.head-link:hover { background: var(--amber-deep); color: var(--midnight); }

/* ---------- Primary nav ---------- */
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.6vw, 28px);
}
.site-nav > a:not(.head-link) {
  font-family: var(--body);
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}
.site-nav > a:not(.head-link):hover,
.site-nav > a[aria-current="page"]:not(.head-link) {
  color: var(--vellum);
}

@media (max-width: 560px) {
  .site-head .wrap-wide { flex-wrap: wrap; gap: 10px 16px; }
  .wordmark { font-size: 17px; }
  .site-nav { gap: 14px; font-size: 14px; }
}

/* ---------- Kicker / eyebrow ---------- */
.kicker {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--amber);
  margin: 0 0 14px;
}

/* ---------- Blog index ---------- */
.index-head {
  padding: clamp(56px, 9vh, 110px) 0 24px;
}
.index-head h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(38px, 6vw, 60px);
  line-height: 1.05;
  margin: 0 0 16px;
}
.index-head p { color: var(--muted); font-size: 19px; margin: 0; max-width: 46ch; }

.post-list { list-style: none; padding: 0; margin: 8px 0 clamp(80px, 14vh, 140px); }
.post-list li { border-top: 1px solid var(--edge); }
.post-card {
  display: block;
  padding: 30px 0;
  text-decoration: none;
  color: inherit;
}
.post-card:hover .post-card-title { color: var(--amber); }
.post-card time {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}
.post-card-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: 1.15;
  margin: 8px 0 8px;
  transition: color 0.2s ease;
}
.post-card p { color: var(--muted); margin: 0; }

/* ---------- Article ---------- */
.article-head {
  padding: clamp(48px, 8vh, 96px) 0 0;
}
.article-head h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 5.2vw, 52px);
  line-height: 1.08;
  margin: 14px 0 20px;
  letter-spacing: -0.005em;
}
.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 8px;
}
.byline .sep { opacity: 0.5; }
.byline .name { color: var(--vellum); font-weight: 600; }

.hero-figure { margin: 34px 0 8px; }
.hero-figure img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--edge);
  display: block;
}

/* ---------- Prose ---------- */
.prose { padding: 8px 0 24px; }
.prose > * + * { margin-top: 1.35em; }
.prose p { margin: 0; }
.prose h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(23px, 3vw, 30px);
  line-height: 1.2;
  margin: 1.9em 0 0.1em;
}
.prose h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  margin: 1.6em 0 0;
}
.prose a { text-decoration: underline; }
.prose ul, .prose ol { margin: 0; padding-left: 1.3em; }
.prose li + li { margin-top: 0.5em; }
.prose blockquote {
  margin: 0;
  padding: 6px 0 6px 22px;
  border-left: 2px solid var(--amber);
  color: var(--vellum);
  font-style: italic;
}
.prose strong { color: #fff; font-weight: 600; }
.prose hr { border: none; border-top: 1px solid var(--edge); margin: 2.4em 0; }

/* ---------- Sources ---------- */
.sources {
  margin: 40px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--edge);
}
.sources h2 {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
}
.sources ol { margin: 0; padding-left: 1.2em; color: var(--muted); font-size: 15px; }

/* ---------- Article CTA ---------- */
.article-cta {
  margin: 44px 0 0;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 16px;
}
.article-cta p { margin: 0 0 16px; color: var(--vellum); }
.article-cta .store-badge img { height: 48px; width: auto; display: block; }

.back-link {
  display: inline-block;
  margin: 40px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---------- Footer ---------- */
.site-foot {
  border-top: 1px solid var(--edge);
  margin-top: clamp(72px, 12vh, 130px);
  padding: 34px 0 48px;
  color: var(--muted);
  font-size: 14px;
}
.site-foot .foot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 26px;
  align-items: center;
  justify-content: space-between;
}
.site-foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--vellum); }
.foot-legal { margin: 18px 0 0; opacity: 0.7; font-size: 12.5px; line-height: 1.6; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
