:root {
  --night: #141a33;
  --night-deep: #0d1124;
  --night-soft: #1f2748;
  --brass: #e3b866;
  --brass-dim: #b48d47;
  --rose: #d98f8a;
  --steam: #f4ecdf;
  --steam-dim: #c9c0b2;
  --tile: #2a3560;
  --radius: 14px;
  --max: 1080px;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--night);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%232a3560' stroke-width='1.2' opacity='.55'%3E%3Cpath d='M48 20l8.5 19.5L76 48l-19.5 8.5L48 76l-8.5-19.5L20 48l19.5-8.5z'/%3E%3Crect x='30' y='30' width='36' height='36' transform='rotate(45 48 48)'/%3E%3Ccircle cx='48' cy='48' r='4'/%3E%3C/g%3E%3C/svg%3E");
  color: var(--steam);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--brass); color: var(--night-deep); padding: .5rem 1rem;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 10; }

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

/* Header */
.site-header {
  background: rgba(13, 17, 36, .86);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(227, 184, 102, .18);
  position: sticky; top: 0; z-index: 5;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 64px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--serif); font-size: 1.6rem; font-weight: 600;
  color: var(--steam); text-decoration: none; letter-spacing: .02em;
}
.brand img { width: 30px; height: 30px; }
.nav { display: flex; gap: .25rem 1.25rem; flex-wrap: wrap; }
.nav a {
  color: var(--steam-dim); text-decoration: none; font-size: .95rem;
  padding: .25rem 0; border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--brass); border-bottom-color: var(--brass-dim); }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 5rem 0 4.5rem; text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(227, 184, 102, .16), transparent 60%);
  pointer-events: none;
}
.hero .moon { width: 92px; height: 92px; margin: 0 auto 1.25rem; }
.eyebrow {
  font-size: .8rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--brass); margin: 0 0 .75rem;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .75rem; }
h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h3 { font-size: 1.5rem; }
.lede { font-size: 1.2rem; color: var(--steam-dim); max-width: 38rem; margin: 0 auto 2rem; }

/* Steam wisps */
.steam { position: absolute; bottom: 0; left: 50%; width: 280px; height: 120px; transform: translateX(-50%); opacity: .35; pointer-events: none; }
.steam path { fill: none; stroke: var(--steam); stroke-width: 2; stroke-linecap: round; animation: rise 7s ease-in-out infinite; }
.steam path:nth-child(2) { animation-delay: -2.3s; }
.steam path:nth-child(3) { animation-delay: -4.6s; }
@keyframes rise {
  0% { transform: translateY(20px); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: translateY(-30px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .steam path { animation: none; opacity: .6; }
  html { scroll-behavior: auto; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.5rem; border-radius: 999px; font-weight: 700; font-size: 1rem;
  text-decoration: none; border: 1px solid var(--brass); cursor: pointer;
  font-family: var(--sans); transition: background .2s, color .2s;
}
.btn-primary { background: var(--brass); color: var(--night-deep); }
.btn-primary:hover { background: var(--steam); border-color: var(--steam); color: var(--night-deep); }
.btn-ghost { background: transparent; color: var(--brass); }
.btn-ghost:hover { background: rgba(227, 184, 102, .12); color: var(--steam); }
.btn[aria-disabled="true"] { opacity: .75; cursor: default; }
.btn-row { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* Sections */
section { padding: 4rem 0; }
.panel {
  background: linear-gradient(180deg, rgba(31, 39, 72, .92), rgba(20, 26, 51, .92));
  border: 1px solid rgba(227, 184, 102, .2);
  border-radius: var(--radius);
  padding: 2rem;
}
.divider { display: flex; justify-content: center; margin: 0 auto; color: var(--brass-dim); }
.divider svg { width: 160px; height: 18px; }

/* Book feature */
.book {
  display: grid; grid-template-columns: minmax(200px, 320px) 1fr; gap: 3rem; align-items: center;
}
.book .btn-row { justify-content: flex-start; }
.cover {
  aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden;
  box-shadow: 0 24px 50px rgba(0, 0, 0, .45), 0 0 0 1px rgba(227, 184, 102, .25);
  background: linear-gradient(170deg, #243163 0%, #141a33 55%, #3b2a3a 100%);
  position: relative;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: space-between; padding: 12% 10%;
  text-align: center; font-family: var(--serif);
}
.cover-fallback .t { font-size: 1.9rem; line-height: 1.05; color: var(--steam); }
.cover-fallback .a { font-size: 1.1rem; letter-spacing: .18em; text-transform: uppercase; color: var(--brass); }
.cover-fallback svg { width: 70px; height: 70px; }
.cover.has-img .cover-fallback { display: none; }
.tagline { font-family: var(--serif); font-style: italic; font-size: 1.4rem; color: var(--rose); margin: 0 0 1rem; }
.meta { color: var(--steam-dim); font-size: .95rem; margin: 0 0 1.25rem; }
.blurb p { margin: 0 0 1rem; }
.blurb .hook { font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--steam); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.card { padding: 1.5rem; }
.card h3 { color: var(--brass); }
.card p { margin: 0; color: var(--steam-dim); }

/* Series list */
.series-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1.25rem; }
.series-item { display: grid; grid-template-columns: 110px 1fr; gap: 1.5rem; align-items: center; }
.series-item .cover { width: 110px; }
.series-item .cover-fallback .t { font-size: .95rem; }
.series-item .cover-fallback .a { font-size: .55rem; }
.series-item .cover-fallback svg { width: 28px; height: 28px; }
.badge {
  display: inline-block; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .15rem .6rem; border-radius: 999px; border: 1px solid var(--brass-dim); color: var(--brass);
  margin-bottom: .4rem;
}
.cover.mystery { display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 2.6rem; color: var(--brass-dim); }

/* Prose pages */
.prose { max-width: 42rem; margin: 0 auto; }
.prose p { margin: 0 0 1.1rem; }
.page-head { text-align: center; padding: 4rem 0 1rem; }

/* Newsletter */
.signup { max-width: 34rem; margin: 0 auto; text-align: center; }
.signup form { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; margin-top: 1.25rem; }
.signup input[type="email"] {
  flex: 1 1 240px; min-width: 0; padding: .8rem 1.1rem; border-radius: 999px;
  border: 1px solid rgba(227, 184, 102, .4); background: var(--night-deep); color: var(--steam);
  font: inherit;
}
.signup input::placeholder { color: #8c8577; }
.signup .fine { font-size: .85rem; color: var(--steam-dim); margin-top: .9rem; }
.signup .status { min-height: 1.5em; margin-top: .75rem; color: var(--rose); }
.hp { position: absolute; left: -5000px; }

/* Footer */
.site-footer {
  border-top: 1px solid rgba(227, 184, 102, .18); background: rgba(13, 17, 36, .9);
  padding: 2rem 0; margin-top: 3rem; color: var(--steam-dim); font-size: .9rem;
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer a { color: var(--steam-dim); }
.site-footer a:hover { color: var(--brass); }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

.center { text-align: center; }
.muted { color: var(--steam-dim); }

@media (max-width: 760px) {
  .hero { padding: 3.5rem 0 4rem; }
  .book { grid-template-columns: 1fr; gap: 2rem; }
  .book .cover { max-width: 260px; margin: 0 auto; }
  .book .btn-row { justify-content: center; }
  .book-copy { text-align: left; }
  .panel { padding: 1.4rem; }
  section { padding: 3rem 0; }
  .series-item { grid-template-columns: 80px 1fr; gap: 1rem; align-items: start; }
  .series-item .cover { width: 80px; }
}

/* Contact */
.contact { max-width: 36rem; margin: 0 auto; }
.contact form { display: grid; gap: .4rem; }
.contact label { font-weight: 700; font-size: .95rem; margin-top: .6rem; }
.contact input[type="text"], .contact input[type="email"], .contact textarea {
  width: 100%; padding: .75rem 1rem; border-radius: 10px;
  border: 1px solid rgba(227, 184, 102, .4); background: var(--night-deep); color: var(--steam);
  font: inherit; resize: vertical;
}
.contact button { justify-self: start; margin-top: 1rem; }
.contact .status { min-height: 1.5em; color: var(--rose); margin: .5rem 0 0; }
.contact .fine { font-size: .85rem; margin: 1rem 0 0; }
