/* Book of Intentions — bookofintentions.app
   Same two palettes as the app (lib/theme.js in ~/BookOfIntentions):
   Midnight by default, Parchment when the reader's device is in light mode. */

@font-face { font-family: "Fraunces"; font-weight: 300; font-style: normal; font-display: swap; src: url("/fonts/Fraunces_300Light.ttf") format("truetype"); }
@font-face { font-family: "Fraunces"; font-weight: 300; font-style: italic; font-display: swap; src: url("/fonts/Fraunces_300Light_Italic.ttf") format("truetype"); }
@font-face { font-family: "Fraunces"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/Fraunces_400Regular.ttf") format("truetype"); }
@font-face { font-family: "Fraunces"; font-weight: 400; font-style: italic; font-display: swap; src: url("/fonts/Fraunces_400Regular_Italic.ttf") format("truetype"); }
@font-face { font-family: "Fraunces"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/Fraunces_600SemiBold.ttf") format("truetype"); }

:root {
  color-scheme: dark light;
  --ink: #1d1a26;
  --card: #252031;
  --text: #ece5d8;
  --dim: #b7afa4;
  --faint: #9d958a;
  --gold: #d2a84f;
  --gold-line: rgba(210, 168, 79, 0.35);
  --gold-fill: rgba(210, 168, 79, 0.08);
  --line: rgba(236, 229, 216, 0.12);
  --moon-dark: #2a2635;
  --measure: 34rem;
}

@media (prefers-color-scheme: light) {
  :root {
    --ink: #f2e8d5;
    --card: #fbf4e6;
    --text: #3a2f26;
    --dim: #5f4e39;
    --faint: #715f4b;
    --gold: #8a5f22;
    --gold-line: rgba(138, 95, 34, 0.35);
    --gold-fill: rgba(138, 95, 34, 0.07);
    --line: rgba(95, 78, 57, 0.22);
    --moon-dark: #e4d6bc;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: "Fraunces", Georgia, serif;
  font-weight: 300;
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }

/* top bar */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 60rem; margin: 0 auto; padding: 1.25rem;
}
.bar .home { display: flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; }
.bar .home img { width: 32px; height: 32px; border-radius: 8px; }
.bar .home span { font-size: 1rem; letter-spacing: 0.02em; }
.bar nav { display: flex; gap: 1.25rem; font-size: 0.95rem; }
.bar nav a { color: var(--dim); text-decoration: none; }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--gold); }

/* small capitals label, as the app uses for chapter headings */
.label {
  font-size: 0.75rem; font-weight: 400; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 0.75rem;
}

h1, h2, h3 { font-weight: 300; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(2.4rem, 8vw, 3.6rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 5vw, 2.2rem); }
h3 { font-size: 1.3rem; font-weight: 400; }
em { font-style: italic; }
p { margin: 0 0 1rem; }
.dim { color: var(--dim); }
.small { font-size: 0.9rem; }
.faint { color: var(--faint); font-size: 0.9rem; }

/* hero */
.hero { text-align: center; padding-top: 3.5rem; padding-bottom: 3rem; }
.hero .moon { width: 88px; height: 88px; margin: 0 auto 1.75rem; display: block; }
.hero h1 { margin-bottom: 1rem; }
.hero .lede { font-size: 1.3rem; color: var(--dim); max-width: 28rem; margin: 0 auto 2rem; font-style: italic; }
.moon-name { display: block; margin-top: -1rem; margin-bottom: 1.75rem; font-size: 0.8rem; color: var(--faint); letter-spacing: 0.08em; }

.button {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1.4rem; border: 1px solid var(--gold-line); border-radius: 999px;
  background: var(--gold-fill); color: var(--text); text-decoration: none; font-size: 1rem;
}
.button:hover { border-color: var(--gold); text-decoration: none; }
.button svg { width: 18px; height: 18px; fill: currentColor; }
.buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.buttons.start { justify-content: flex-start; margin: 1.75rem 0 0.75rem; }

/* section rhythm */
section { padding: 3rem 0; border-top: 1px solid var(--line); }
section > .wrap > h2 { margin-bottom: 1.25rem; }

.ornament { text-align: center; color: var(--gold); font-size: 1.2rem; padding: 1rem 0 0; }

/* chapters */
.chapters { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1.5rem; }
.chapters li { display: grid; grid-template-columns: 3.25rem 1fr; gap: 0.25rem 1rem; align-items: baseline; }
.chapters .num { color: var(--gold); font-size: 0.85rem; letter-spacing: 0.12em; }
.chapters h3 { grid-column: 2; }
.chapters p { grid-column: 2; margin: 0.25rem 0 0; color: var(--dim); }

/* episodes */
.episode {
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  padding: 1.5rem; margin: 1.5rem 0;
}
.episode .meta { font-size: 0.85rem; color: var(--faint); letter-spacing: 0.04em; margin-bottom: 0.4rem; }
.episode h3 { margin-bottom: 0.6rem; }
.episode p { color: var(--dim); }
.episode .links { margin: 0; }
.episode .soon { font-style: italic; color: var(--faint); margin: 0; }

/* prose pages */
.page { padding-top: 2.5rem; padding-bottom: 3rem; }
.page h1 { font-size: clamp(2.2rem, 7vw, 3rem); margin-bottom: 0.5rem; }
.page .sub { font-style: italic; color: var(--faint); margin-bottom: 2rem; }
.page h2 { font-size: 1.4rem; font-weight: 400; margin: 2rem 0 0.75rem; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; text-align: center; font-size: 0.9rem; color: var(--faint); }
footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; justify-content: center; margin-bottom: 0.75rem; }
footer nav a { color: var(--dim); text-decoration: none; }
footer nav a:hover { color: var(--gold); }
footer p { margin: 0.25rem 0; }

@media (max-width: 480px) {
  body { font-size: 1.0625rem; }
  .bar nav { gap: 0.9rem; font-size: 0.9rem; }
  .bar .home span { display: none; }
  .chapters li { grid-template-columns: 2.5rem 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero .moon { animation: rise 1.2s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* news */
.posts { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 1.75rem; }
.post-item h3 { margin: 0.2rem 0 0.4rem; }
.post-item h3 a { color: var(--text); text-decoration: none; }
.post-item h3 a:hover { color: var(--gold); }
.post-item p { margin: 0; color: var(--dim); }
.post-item .meta, .episode .meta { font-size: 0.85rem; color: var(--faint); letter-spacing: 0.04em; }
.tag { color: var(--gold); }
.label a { color: inherit; text-decoration: none; }
.prose p, .prose li { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.35rem; }
.prose h2 { font-size: 1.4rem; font-weight: 400; margin: 2rem 0 0.75rem; }
.prose img { max-width: 100%; height: auto; border-radius: 10px; }
.prose blockquote { margin: 1.5rem 0; padding-left: 1rem; border-left: 2px solid var(--gold-line); font-style: italic; color: var(--dim); }
