/* Layout: a grimoire read by candlelight — centred title page, then alternating spreads. Single dark look by choice. */
:root {
  --night: #0D1714;
  --moss: #13231D;
  --moss-2: #1C3329;
  --vine: #2A4A3B;
  --parchment: #EDE6D3;
  --parchment-soft: #CFC8B4;
  --faded: #B9B29E;
  --gold: #E2BD62;
  --gold-hi: #F3D58E;
  --font-display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --font-body: 'Alegreya Sans', 'Gill Sans', 'Segoe UI', sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--night); color: var(--parchment); font-family: var(--font-body); font-size: 18px; line-height: 1.55; }
img { max-width: 100%; display: block; }
a { color: var(--gold); }
a:hover { color: var(--gold-hi); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; font-family: var(--font-display); }

.wrap {
  width: 100%;
  max-width: 1248px;
  margin-inline: auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}
.rubric { margin: 0; font-family: var(--font-display); font-size: 13px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--faded); }

/* Header */
.sw-header .wrap { padding-block: 20px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; text-decoration: none; color: var(--faded); }
.back:hover { color: var(--parchment); }
.sw-nav { display: flex; flex-wrap: wrap; gap: 0 28px; font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: 0.14em; }
.sw-nav a { text-decoration: none; padding-block: 12px; }

/* Title page */
.title-page { position: relative; overflow: hidden; border-bottom: 1px solid var(--vine); }
.title-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.title-page .wrap { position: relative; z-index: 1; padding-block: 64px 230px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 22px; }
.title-page h1 { margin: 0; font-weight: 900; font-size: clamp(48px, 11vw, 148px); line-height: 0.95; letter-spacing: 0.04em; color: var(--gold); text-shadow: 0 0 40px rgba(226, 189, 98, 0.25); }
.motto { margin: 0; font-family: var(--font-display); font-size: clamp(18px, 2.2vw, 26px); letter-spacing: 0.08em; }
.lede { margin: 0; max-width: 58ch; font-size: clamp(18px, 1.8vw, 20px); color: var(--parchment-soft); }
.flourish { width: 220px; max-width: 70%; height: auto; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 10px; }
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 28px; border-radius: 6px; font-family: var(--font-body); font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer; border: 1px solid var(--gold); transition: background-color 160ms ease, color 160ms ease; }
.btn-gold { background: var(--gold); color: var(--night); }
.btn-gold:hover { background: var(--gold-hi); color: var(--night); }
.btn-ghost { background: transparent; color: var(--gold); }
.btn-ghost:hover { background: var(--moss-2); color: var(--gold-hi); }
.skyline { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 230px; }
.skyline .land { fill: var(--moss); }
.skyline .glow { fill: var(--gold); opacity: 0.85; }
.skyline .spire { stroke: var(--gold); stroke-width: 2; fill: none; }

/* Image slots */
.slot { position: relative; margin: 0; overflow: hidden; background: var(--moss); border: 1px solid var(--vine); border-radius: 10px; max-width: 100%; }
.slot::before { content: attr(data-label); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; font-size: 15px; color: var(--faded); }
.slot img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.slot.is-missing img { display: none; }
.r-16x9 { aspect-ratio: 16 / 9; }
.r-4x3 { aspect-ratio: 4 / 3; }

.chapter { padding-block: 112px 0; }
.chapter-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; margin-bottom: 40px; }
.chapter-head h2 { margin: 0; font-weight: 700; font-size: clamp(32px, 4.5vw, 56px); line-height: 1.05; }
.chapter-head p { margin: 0; max-width: 56ch; color: var(--parchment-soft); }
.trailer { padding-block: 72px 0; }

/* Elements */
.elements { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 14px; }
.element { border: 1px solid var(--vine); background: var(--moss); border-radius: 10px; padding: 26px 12px; display: flex; flex-direction: column; align-items: center; gap: 14px; transition: border-color 200ms ease, transform 200ms ease; }
.element:hover { border-color: var(--gold); transform: translateY(-3px); }
.element .sigil { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--gold); display: flex; align-items: center; justify-content: center; color: var(--gold); }
.element b { font-family: var(--font-display); font-size: 16px; letter-spacing: 0.08em; }
.recipe { margin-top: 20px; border: 1px solid var(--vine); border-radius: 10px; padding: 22px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 16px; font-family: var(--font-display); font-size: 18px; }
.recipe .rubric { font-size: 12px; }
.recipe .rune { padding: 10px 18px; border-radius: 999px; background: var(--moss-2); }
.recipe .op { color: var(--gold); }
.recipe .result { padding: 10px 20px; border-radius: 999px; background: var(--gold); color: var(--night); font-weight: 700; }

/* Modes */
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.mode { background: var(--moss); border: 1px solid var(--vine); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.mode .slot { border: 0; border-bottom: 1px solid var(--vine); border-radius: 0; background: var(--moss-2); }
.mode-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.mode-body .numeral { margin: 0; font-family: var(--font-display); font-size: 13px; letter-spacing: 0.28em; color: var(--gold); }
.mode-body h3 { margin: 0; font-size: 26px; }
.mode-body p { margin: 0; font-size: 17px; color: var(--parchment-soft); }

/* Wardrobe */
.spread { display: flex; flex-wrap: wrap; gap: 40px 56px; align-items: center; }
.spread .slot { flex: 1 1 500px; min-width: 0; }
.spread-copy { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.spread-copy h2 { margin: 0; font-weight: 700; font-size: clamp(32px, 4.5vw, 52px); line-height: 1.05; }
.spread-copy p { margin: 0; color: var(--parchment-soft); max-width: 46ch; }
.charms { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.charms li { display: flex; gap: 14px; align-items: center; }
.charms li::before { content: ""; width: 8px; height: 8px; transform: rotate(45deg); background: var(--gold); flex: none; }

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }

/* Sign-up */
.seal { margin-top: 112px; border: 1px solid var(--gold); border-radius: 12px; padding: 56px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; }
.seal h2 { margin: 0; font-weight: 700; font-size: clamp(30px, 4vw, 48px); color: var(--gold); }
.seal > p { margin: 0; color: var(--parchment-soft); }
.seal form { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.seal label { font-size: 15px; color: var(--parchment-soft); }
.field-row { display: flex; flex-wrap: wrap; gap: 10px; }
.field-row input { flex: 1 1 220px; min-width: 0; min-height: 52px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--vine); background: var(--moss); color: var(--parchment); font: inherit; font-size: 17px; }
.form-note { margin: 4px 0 0; min-height: 1.5em; font-size: 15px; color: var(--parchment-soft); text-align: center; }

.sw-footer { margin-top: 96px; border-top: 1px solid var(--vine); }
.sw-footer .wrap { padding-block: 28px 40px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: 15px; color: var(--faded); }
.sw-footer a { color: var(--faded); }
