/* Peaceful Studios — shared styles.
   Day: the warm cream, gold and terracotta of The Open Deck.
   Night: a dim, soft-brass palette with no bright white and no blue, easy on dark-adapted eyes.
   No external fonts or scripts: the serif stack uses Cormorant/EB Garamond when installed, else a classic system serif. */

:root {
  /* Day (waking hours) */
  --bg: #efe4cf;
  --surface: #faf3e4;
  --tint: #e6d8bd;
  --ink: #4a3d2f;
  --muted: #6e5d47;
  --accent: #8a4b30;       /* links, buttons, small text: passes contrast on cream */
  --accent-ink: #faf3e4;
  --deco: #bd6b40;         /* terracotta, decoration only */
  --gold: #b9903f;         /* gold, decoration only */
  --line: #d9c6a1;
  --todo-bg: #f6e2b0;
  --todo-ink: #4a3500;
  color-scheme: light;
}
:root[data-theme="night"] {
  --bg: #14100d;
  --surface: #1c1713;
  --tint: #221c16;
  --ink: #dccfb9;
  --muted: #a39580;
  --accent: #cdb279;
  --accent-ink: #14100d;
  --deco: #bf9a63;
  --gold: #8f7648;
  --line: #36302a;
  --todo-bg: #372d14;
  --todo-ink: #e8d6a4;
  color-scheme: dark;
}
/* Without JavaScript, follow the device setting */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #14100d;
    --surface: #1c1713;
    --tint: #221c16;
    --ink: #dccfb9;
    --muted: #a39580;
    --accent: #cdb279;
    --accent-ink: #14100d;
    --deco: #bf9a63;
    --gold: #8f7648;
    --line: #36302a;
    --todo-bg: #372d14;
    --todo-ink: #e8d6a4;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.125rem/1.7 "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  transition: background-color 0.4s ease, color 0.4s ease;
}
@media (prefers-reduced-motion: reduce) { body { transition: none; } }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.mono, .eyebrow, .nav, .theme-toggle, .btn {
  font-family: "Cutive Mono", "Courier New", Courier, monospace;
}

.wrap { width: 100%; max-width: 62rem; margin-inline: auto; padding-inline: 1.25rem; }

/* Header */
.site-header { padding-block: 1.1rem; border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; }
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem; color: var(--accent); text-decoration: none;
  font-family: "Cormorant Garamond", "Iowan Old Style", Georgia, serif; font-weight: 600; font-size: 1.15rem;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.brand svg { width: 1.7rem; height: 1.7rem; flex: none; color: var(--deco); }
.header-end { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.25rem; }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; list-style: none; font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; }
.nav a { color: var(--muted); text-decoration: none; padding-block: 0.25rem; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--gold); }

.theme-toggle {
  display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.3rem 0.85rem; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--gold); }
.theme-toggle svg { width: 1rem; height: 1rem; flex: none; }

/* Hero */
.hero { padding-block: clamp(3rem, 9vw, 6rem) clamp(2.5rem, 6vw, 4rem); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.8;
  background:
    radial-gradient(1.5px 1.5px at 6% 14%, var(--gold) 60%, transparent 62%),
    radial-gradient(1.5px 1.5px at 93% 10%, var(--gold) 60%, transparent 62%),
    radial-gradient(1.5px 1.5px at 4% 78%, var(--gold) 60%, transparent 62%),
    radial-gradient(1.5px 1.5px at 96% 70%, var(--gold) 60%, transparent 62%),
    radial-gradient(1.5px 1.5px at 48% 94%, var(--gold) 60%, transparent 62%);
}
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: center; }
@media (min-width: 52rem) { .hero .wrap { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
.eyebrow { text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.78rem; color: var(--accent); margin: 0 0 1rem; }
h1, h2, h3 { font-family: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; line-height: 1.15; text-wrap: balance; margin: 0 0 0.75rem; font-weight: 500; color: var(--accent); }
h1 { font-size: clamp(2.3rem, 6vw, 3.7rem); letter-spacing: 0.01em; }
h1 strong { font-weight: 600; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); }
h3 { font-size: 1.3rem; }
.lede { font-size: 1.3rem; font-style: italic; color: var(--muted); max-width: 36rem; margin: 0 0 1.75rem; }
.rule { display: flex; align-items: center; gap: 0.5rem; width: min(18rem, 80%); margin: 0.25rem 0 1.25rem; color: var(--deco); }
.rule span { flex: 1; height: 1px; background: linear-gradient(to right, transparent, var(--gold), transparent); }
.rule svg { width: 0.75rem; height: 0.75rem; flex: none; }
.moon-panel { max-width: 18rem; width: 100%; margin-inline: auto; }
.moon-panel svg { width: 100%; height: auto; display: block; }

/* Buttons */
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); padding: 0.7rem 1.5rem; border-radius: 2px; text-decoration: none; font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; border: 1px solid var(--accent); }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Sections */
section { padding-block: clamp(2rem, 5vw, 3.5rem); }
.band { background: var(--surface); border-block: 1px solid var(--line); }
.prose { max-width: 40rem; }
.prose p { margin: 0 0 1rem; }
.prose ul { padding-left: 1.2rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.4rem; }
.page-title { padding-block: clamp(2.5rem, 7vw, 4.5rem) 1rem; }
.page-title h1 { margin-bottom: 0.5rem; }

.features { display: grid; gap: 1.5rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 1.5rem 0 0; padding: 0; list-style: none; }
.features li { border-top: 1px solid var(--gold); padding-top: 0.9rem; }
.features h3 { margin-bottom: 0.2rem; }
.features p { margin: 0; color: var(--muted); }

.tiers { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin-top: 1.5rem; }
.tier { background: var(--surface); border: 1px solid var(--gold); padding: 1.5rem; position: relative; }
.tier::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--line); pointer-events: none; }
.tier h3, .tier p { position: relative; }
.tier p { margin: 0; color: var(--muted); }
.band .tier { background: var(--bg); }

.details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.6rem 1.5rem; margin: 1rem 0 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 30rem) { .details { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; } .details dd { margin-bottom: 0.8rem; } }

.note { border-left: 2px solid var(--gold); padding: 0.25rem 0 0.25rem 1rem; color: var(--muted); max-width: 40rem; }
.todo { background: var(--todo-bg); color: var(--todo-ink); padding: 0.9rem 1.1rem; border-radius: 4px; font-size: 1rem; }

/* Footer */
.site-footer { padding-block: 2.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; }
.site-footer p { margin: 0 0 0.4rem; }
.site-footer a { color: var(--muted); }

/* Sections: explore cards, books, breadcrumb */
.crumb { margin: 0 0 1rem; font-family: "Cutive Mono", "Courier New", Courier, monospace; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--ink); text-decoration: underline; }

.explore { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); margin-top: 1.5rem; }
.explore a.card { display: block; background: var(--bg); border: 1px solid var(--gold); padding: 1.6rem; text-decoration: none; color: var(--ink); position: relative; }
.explore a.card::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--line); pointer-events: none; }
.explore a.card:hover { border-color: var(--accent); }
.explore .card h3 { position: relative; margin-bottom: 0.4rem; }
.explore .card p { position: relative; margin: 0 0 0.9rem; color: var(--muted); }
.explore .card .go { position: relative; font-family: "Cutive Mono", "Courier New", Courier, monospace; font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }

.books { display: grid; gap: 2rem 1.75rem; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); margin: 1.75rem 0 0; padding: 0; list-style: none; }
.book { display: flex; flex-direction: column; gap: 0.6rem; }
.book .cover { aspect-ratio: 3 / 4; width: 100%; background: var(--tint); border: 1px solid var(--line); display: block; object-fit: cover; box-shadow: 0 14px 24px -16px rgba(0,0,0,0.45); }
.book h3 { font-size: 1.15rem; margin: 0; }
.book p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.book .btn { align-self: flex-start; padding: 0.5rem 1rem; font-size: 0.75rem; }
