/* Anya's Scroll & Quill: wizarding-inspired theme (original artwork, self-hosted fonts) */
@font-face { font-family: "Cinzel"; src: url("/fonts/cinzel.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/garamond.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/garamond-italic.woff2") format("woff2"); font-weight: 400 800; font-style: italic; font-display: swap; }

:root {
  --night: #0b0d1a;
  --night-2: #141836;
  --ink: #2b1d0e;
  --ink-soft: #5a4630;
  --parchment: #f1e5c8;
  --parchment-2: #e6d4a8;
  --gold: #d9b45a;
  --gold-bright: #f3d98a;
  --gold-deep: #9c7420;
  --burgundy: #7a0f1c;
  --burgundy-2: #5d0b14;
  --text: #ece4d0;
  --muted: #b9b1c9;
  --radius: 14px;
  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

/* "Lumos": the light reading mode */
[data-theme="lumos"] {
  --night: #fbf4e2;
  --night-2: #f3e7c6;
  --text: #2b1d0e;
  --muted: #6b5a3f;
  --gold: #8a6416;
  --gold-bright: #7a560f;
  --shadow: 0 8px 22px rgba(90, 60, 10, .18);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 73% 9%, #fff7 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 41% 42%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 61%, #fff7 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 24% 77%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 61% 88%, #fff7 50%, transparent 51%),
    radial-gradient(ellipse at 50% -10%, var(--night-2), var(--night) 60%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}
[data-theme="lumos"] body {
  background: radial-gradient(ellipse at 50% -10%, #fffaf0, var(--night-2) 90%);
  background-attachment: fixed;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-bright); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #000; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1.2rem;
  padding: .6rem clamp(1rem, 4vw, 2.5rem);
  background: linear-gradient(180deg, rgba(11, 13, 26, .96), rgba(11, 13, 26, .86));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(217, 180, 90, .35);
  box-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}
[data-theme="lumos"] .site-header { background: linear-gradient(180deg, rgba(251, 244, 226, .96), rgba(243, 231, 198, .9)); box-shadow: 0 2px 14px rgba(90, 60, 10, .15); }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--gold-bright); }
.crest { width: 40px; height: 45px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-family: var(--display); font-size: 1.25rem; letter-spacing: .06em; }
.brand-text small { font-family: var(--display); font-size: .62rem; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); }
.site-nav { margin-left: auto; display: flex; gap: .2rem; flex-wrap: wrap; }
.site-nav a {
  font-family: var(--display); font-size: .86rem; letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; color: var(--text); padding: .5rem .8rem; border-radius: 999px;
  border: 1px solid transparent; transition: all .2s;
}
.site-nav a:hover { border-color: var(--gold); color: var(--gold-bright); }
.site-nav a[aria-current="page"] { border-color: var(--gold); background: rgba(217, 180, 90, .12); color: var(--gold-bright); }
.lumos {
  font-family: var(--display); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  background: transparent; color: var(--gold-bright); border: 1px solid var(--gold); border-radius: 999px;
  padding: .45rem .9rem; cursor: pointer; min-height: 40px;
}
.lumos:hover { background: rgba(217, 180, 90, .15); }
.lumos .lumos-off { display: none; }
[data-theme="lumos"] .lumos .lumos-on { display: none; }
[data-theme="lumos"] .lumos .lumos-off { display: inline; }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; text-align: center; padding: clamp(3.5rem, 11vw, 8rem) 1.2rem clamp(2.5rem, 6vw, 4rem); }
.hero-inner { max-width: 760px; margin: 0 auto; }
.kicker { font-family: var(--display); letter-spacing: .4em; text-transform: uppercase; font-size: .78rem; color: var(--gold); margin: 0 0 1rem; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(2.2rem, 7vw, 4.4rem); line-height: 1.08; margin: 0 0 1rem; color: var(--gold-bright); text-shadow: 0 0 28px rgba(243, 217, 138, .35), 0 3px 0 rgba(0, 0, 0, .4); }
.hero h1 span { display: block; font-size: .62em; letter-spacing: .08em; color: var(--text); font-weight: 500; }
.lede { font-size: clamp(1.1rem, 2.6vw, 1.4rem); color: var(--muted); max-width: 40ch; margin: 0 auto 1.8rem; font-style: italic; }
.cta { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; font-family: var(--display); letter-spacing: .1em; text-transform: uppercase; font-size: .85rem;
  text-decoration: none; padding: .9rem 1.5rem; border-radius: 10px; min-height: 44px;
  color: #fff3d0; background: linear-gradient(180deg, var(--burgundy), var(--burgundy-2));
  border: 1px solid var(--gold); box-shadow: 0 0 0 2px rgba(217, 180, 90, .25) inset, var(--shadow);
  transition: transform .15s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 0 0 2px rgba(243, 217, 138, .5) inset, 0 12px 30px rgba(122, 15, 28, .5); }
.btn.ghost { background: transparent; color: var(--gold-bright); }
.center { text-align: center; }

/* ------------------------------------------------------------- structure */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }
.wrap.narrow { max-width: 780px; }
.page-hero { text-align: center; padding: clamp(2.5rem, 7vw, 5rem) 1.2rem 1.5rem; }
.page-hero h1 { font-family: var(--display); font-size: clamp(1.8rem, 5vw, 3rem); margin: 0 0 .4rem; color: var(--gold-bright); text-shadow: 0 0 22px rgba(243, 217, 138, .3); }
.page-hero p { color: var(--muted); font-style: italic; margin: 0; }
.home-section { margin-bottom: 3.2rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; border-bottom: 1px solid rgba(217, 180, 90, .3); padding-bottom: .5rem; }
.section-head h2 { font-family: var(--display); font-size: clamp(1.25rem, 3.4vw, 1.7rem); margin: 0; color: var(--gold-bright); }
.section-head a { font-family: var(--display); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.divider { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 0 auto 2.5rem; max-width: 420px; color: var(--gold); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.divider svg { width: 18px; height: 18px; display: block; }

/* ----------------------------------------------------------------- cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1.4rem; }
.parchment {
  color: var(--ink);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, .5), transparent 55%),
    linear-gradient(180deg, var(--parchment), var(--parchment-2));
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 0 40px rgba(122, 80, 20, .22);
  border: 1px solid rgba(122, 80, 20, .4);
}
.card { display: flex; flex-direction: column; text-decoration: none; padding: 1.4rem 1.4rem 1.2rem; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-4px) rotate(-.4deg); color: var(--ink); }
.card h3 { font-family: var(--display); font-size: 1.2rem; line-height: 1.25; margin: .6rem 0 .3rem; color: var(--burgundy-2); }
.card p { margin: 0 0 .6rem; }
.meta { color: var(--ink-soft); font-size: .95rem; font-style: italic; }
.card .more { margin-top: auto; font-family: var(--display); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--burgundy); }
.card-icon { width: 34px; height: 34px; color: var(--burgundy); }
.card-icon svg { width: 100%; height: 100%; }
.empty { padding: 1.6rem; text-align: center; font-style: italic; }

.art-card { background: none; box-shadow: none; border: 0; padding: 0; color: var(--text); }
.art-card:hover { color: var(--gold-bright); }
.art-card h3 { color: var(--gold-bright); }
.art-card .meta { color: var(--muted); }
.frame {
  padding: 12px; border-radius: 6px;
  background: linear-gradient(135deg, #e6c36e, #8f6a1b 45%, #e6c36e 70%, #7a5614);
  box-shadow: var(--shadow), inset 0 0 0 2px rgba(0, 0, 0, .35);
}
.frame img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 6px solid #2a1a0a; background: #2a1a0a; }
.frame.big img { aspect-ratio: auto; object-fit: contain; max-height: 80vh; margin: 0 auto; }

/* ----------------------------------------------------------------- pieces */
.piece-head { text-align: center; padding: clamp(2rem, 6vw, 3.5rem) 0 1.4rem; }
.piece-head h1 { font-family: var(--display); font-size: clamp(1.8rem, 5.2vw, 2.9rem); line-height: 1.15; margin: .4rem 0 .5rem; color: var(--gold-bright); text-shadow: 0 0 22px rgba(243, 217, 138, .28); }
.piece-head .meta { color: var(--muted); }
.crumbs { margin: 0; font-family: var(--display); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.prose { padding: clamp(1.4rem, 4.5vw, 2.8rem); font-size: clamp(1.15rem, 2.2vw, 1.3rem); line-height: 1.75; }
.prose h2, .prose h3 { font-family: var(--display); color: var(--burgundy-2); line-height: 1.25; }
.prose a { color: var(--burgundy); }
.prose p { margin: 0 0 1.1em; }
.prose code { font-family: var(--serif); font-size: .95em; background: rgba(122, 15, 28, .08); border: 1px solid rgba(122, 80, 20, .3); border-radius: 4px; padding: 0 .3em; }
.prose blockquote { margin: 1.2em 0; padding: .2em 1.2em; border-left: 4px solid var(--gold-deep); font-style: italic; color: var(--ink-soft); }
.prose img { border-radius: 8px; margin: 1.2em auto; }
.dropcap > p:first-of-type::first-letter {
  font-family: var(--display); font-weight: 700; float: left; font-size: 3.7em; line-height: .85;
  padding: .06em .1em 0 0; color: var(--burgundy);
}
.the-end { text-align: center; color: var(--gold); margin: 1.6rem 0 0; }
.the-end svg { width: 22px; height: 22px; display: inline-block; }
.art-full { margin: 0 0 1.6rem; }
.art-full figcaption { text-align: center; color: var(--muted); font-style: italic; margin-top: .7rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin: 2rem 0 4rem; font-family: var(--display); font-size: .85rem; }
.pager a { max-width: 48%; }

/* ---------------------------------------------------------------- footer */
.site-footer { text-align: center; padding: 3rem 1.2rem 4.5rem; color: var(--muted); }
.site-footer .motto { font-style: italic; font-size: 1.15rem; margin: 0 0 .6rem; color: var(--text); }
.fine { margin: .3rem auto; max-width: 62ch; font-size: .95rem; }
.fine.small { font-size: .8rem; opacity: .8; }

/* -------------------------------------------------- floating candles */
.candles { position: fixed; inset: 0 0 auto 0; height: 0; z-index: 1; pointer-events: none; }
.candle { position: absolute; top: 80px; width: 8px; height: 36px; border-radius: 2px 2px 1px 1px; background: linear-gradient(90deg, #efe4c4, #fff7df 50%, #d8c79b); animation: bob 5s ease-in-out infinite; opacity: .9; }
.candle i { position: absolute; left: 50%; top: -17px; width: 10px; height: 17px; margin-left: -5px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: radial-gradient(ellipse at 50% 70%, #fff6c9, #ffc94d 55%, rgba(255, 150, 20, .1) 80%); box-shadow: 0 0 14px 6px rgba(255, 200, 80, .55); animation: flicker 1.4s ease-in-out infinite alternate; }
[data-theme="lumos"] .candle { opacity: .55; }
.c1 { left: 6%; top: 150px; animation-delay: -.4s; } .c2 { left: 14%; top: 230px; animation-delay: -1.6s; height: 30px; }
.c3 { left: 24%; top: 120px; animation-delay: -2.2s; height: 42px; } .c4 { left: 38%; top: 200px; animation-delay: -3.1s; height: 28px; }
.c5 { left: 52%; top: 135px; animation-delay: -.9s; height: 38px; } .c6 { left: 66%; top: 210px; animation-delay: -2.7s; }
.c7 { left: 78%; top: 125px; animation-delay: -1.2s; height: 44px; } .c8 { left: 88%; top: 195px; animation-delay: -3.6s; height: 32px; }
.c9 { left: 95%; top: 140px; animation-delay: -2s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes flicker { from { transform: scale(1) rotate(-2deg); opacity: .92; } to { transform: scale(1.12, .94) rotate(2deg); opacity: 1; } }
main, .site-footer, .site-header { position: relative; z-index: 2; }
.site-header { z-index: 20; }

/* --------------------------------------------------------- small screens */
@media (max-width: 760px) {
  body { font-size: 1.12rem; }
  .site-header { flex-wrap: wrap; gap: .5rem .8rem; }
  .site-nav { order: 3; width: 100%; margin: 0; justify-content: center; gap: 0; }
  .site-nav a { font-size: .74rem; padding: .5rem .6rem; }
  .lumos { margin-left: auto; }
  .brand-text small { display: none; }
  .candles { display: none; }
  .pager { flex-direction: column; }
  .pager a { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .candle, .candle i { animation: none; }
  .card, .btn { transition: none; }
}
@media print {
  .site-header, .candles, .site-footer, .pager, .skip, .lumos { display: none !important; }
  body { background: #fff; color: #000; }
  .parchment { background: #fff; box-shadow: none; border: 0; color: #000; }
  .piece-head h1 { color: #000; text-shadow: none; }
}

.book-line { margin: 0 0 .4rem; font-style: italic; color: var(--gold); }
.card .book-line { color: var(--burgundy); }
.piece-head .book-line { font-size: 1.1rem; }
