@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=DM+Sans:wght@400;500;600&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap");

:root {
  color-scheme: light;
  --ink: #292d29;
  --muted: #665f52;
  --paper: #e9ddbf;
  --paper-deep: #d9c89f;
  --surface: #f3ead4;
  --line: rgba(76, 69, 49, 0.28);
  --accent: #825e30;
  --accent-strong: #65471f;
  --ornament: rgba(104, 78, 42, 0.35);
  --shadow: rgba(58, 42, 18, 0.2);
  --chart: url("/assets/map-lines.svg");
  --hero-glow: radial-gradient(circle at 50% 36%, rgba(255, 248, 224, 0.78), transparent 47%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4ebd2;
  --muted: #b8c3ca;
  --paper: #111f35;
  --paper-deep: #0b1729;
  --surface: #1b2c42;
  --line: rgba(195, 181, 143, 0.26);
  --accent: #d8bc80;
  --accent-strong: #f5dda5;
  --ornament: rgba(217, 187, 126, 0.38);
  --shadow: rgba(0, 6, 20, 0.48);
  --chart: url("/assets/star-chart.svg");
  --hero-glow: radial-gradient(circle at 50% 36%, rgba(44, 73, 107, 0.6), transparent 48%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", Arial, sans-serif;
  line-height: 1.65;
  transition: background-color 250ms, color 250ms;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.43;
  background-image: var(--chart), radial-gradient(circle at 13% 24%, rgba(115, 90, 51, 0.10), transparent 23%), radial-gradient(circle at 86% 76%, rgba(115, 90, 51, 0.1), transparent 22%);
  background-position: center;
  background-size: 850px auto, auto, auto;
}
:root[data-theme="dark"] body::before { opacity: 0.64; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 4px; }
::selection { background: var(--accent); color: var(--surface); }
.skip-link {
  position: absolute; top: -100px; left: 1rem; z-index: 100;
  padding: .7rem 1rem; background: var(--surface); color: var(--ink);
}
.skip-link:focus { top: 1rem; }
.site-shell { max-width: 1800px; margin: 0 auto; overflow: clip; }
.site-header {
  min-height: 86px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  margin: 0 5.4%;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 2;
}
.wordmark {
  display: inline-flex; align-items: center; gap: .6rem;
  width: max-content; text-decoration: none;
  font-family: "Cinzel", Georgia, serif; font-size: 1rem;
  letter-spacing: .14em; font-weight: 600; text-transform: uppercase;
}
.mark-symbol { color: var(--accent); font-size: 2rem; line-height: .5; }
.site-nav { display: flex; justify-content: center; gap: clamp(1rem, 2.8vw, 3.2rem); }
.site-nav a, .site-footer a {
  font-size: .79rem; font-weight: 600; letter-spacing: .13em;
  text-decoration: none; text-transform: uppercase;
}
.site-nav a:hover, .site-footer a:hover, .text-link:hover { color: var(--accent-strong); }
.site-nav a[aria-current="page"] { color: var(--accent-strong); }
.theme-toggle {
  justify-self: end; display: flex; align-items: center; gap: .55rem;
  padding: .58rem .8rem; background: transparent; border: 1px solid var(--line);
  border-radius: 100px; color: var(--ink); cursor: pointer;
  font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
}
.theme-toggle:hover { background: var(--surface); }
.theme-icon { font-family: Georgia, serif; font-size: 1.1rem; line-height: 1; }

.hero {
  min-height: min(760px, calc(100svh - 86px)); height: clamp(590px, 75vw, 780px);
  display: grid; place-items: center; isolation: isolate;
  position: relative; text-align: center;
  margin: 0 1.7%;
  border-bottom: 1px solid var(--line);
  background: var(--hero-glow);
}
.hero::before, .hero::after {
  content: ""; position: absolute; inset: 5% 3%; z-index: -1;
  border: 1px solid var(--ornament); pointer-events: none;
}
.hero::after { inset: 6.2% 3.8%; opacity: .45; }
.hero-chart { width: min(77vw, 760px); aspect-ratio: 1; position: absolute; z-index: -1; opacity: .82; }
.chart-ring {
  position: absolute; inset: 8%; border: 1px solid var(--ornament); border-radius: 50%;
}
.ring-one::before, .ring-one::after {
  content: ""; position: absolute; top: 50%; left: -4%; width: 108%;
  border-top: 1px solid var(--ornament); transform: rotate(45deg);
}
.ring-one::after { transform: rotate(-45deg); }
.ring-two { inset: 20%; border-style: dashed; opacity: .55; }
.chart-north, .chart-east, .chart-south, .chart-west {
  position: absolute; font-family: "Cinzel", Georgia, serif;
  font-size: .73rem; color: var(--accent); letter-spacing: .18em;
}
.chart-north { top: 1%; left: 50%; transform: translateX(-50%); }
.chart-east { right: 1%; top: 50%; transform: translateY(-50%); }
.chart-south { bottom: 1%; left: 50%; transform: translateX(-50%); }
.chart-west { left: 1%; top: 50%; transform: translateY(-50%); }
.chart-star {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  font-size: clamp(21rem, 43vw, 37rem); line-height: 1;
  color: var(--ornament); font-weight: 100; opacity: .31;
}
.hero-content { position: relative; z-index: 1; max-width: 900px; padding: 6rem 1.2rem; }
.eyebrow {
  margin: 0 0 1rem; color: var(--accent-strong);
  font-size: .72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .27em; line-height: 1.5;
}
.hero-eyebrow { margin-bottom: 1.9rem; }
.tiny-diamond { font-size: .44rem; vertical-align: middle; padding: 0 .7rem; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Cinzel", Georgia, serif; font-weight: 500; line-height: 1.18; }
h1 em, h2 em { font-family: "Libre Baskerville", Georgia, serif; font-weight: 400; }
.hero h1 {
  font-size: clamp(4.3rem, 11vw, 10.7rem);
  letter-spacing: -.075em; margin: 0 0 1.4rem;
  text-shadow: 0 2px 20px var(--paper);
}
.hero h1 em { font-size: .93em; letter-spacing: -.09em; }
.hero-subtitle {
  max-width: 440px; margin: 0 auto 2rem;
  font-family: "Libre Baskerville", Georgia, serif; font-size: clamp(.96rem, 1.3vw, 1.13rem);
  line-height: 1.8;
}
.primary-link {
  display: inline-flex; align-items: center; gap: 1.7rem;
  padding: .87rem 1.25rem; border: 1px solid var(--accent);
  color: var(--ink); text-decoration: none; font-size: .72rem;
  font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.primary-link:hover { background: var(--accent); color: var(--paper); }
.primary-link span { font-size: 1.1rem; line-height: 1; }
.hero-footnote {
  position: absolute; bottom: 8.3%; left: 8%; right: 8%; display: flex;
  justify-content: space-between; align-items: center; gap: 1rem;
  font-size: .62rem; letter-spacing: .2em; font-weight: 600; color: var(--muted);
}
.hero-footnote span:nth-child(2) { font-size: 1.2rem; color: var(--accent); }
.section-wrap { width: min(1170px, 87%); margin: 0 auto; }
.works { padding: 8rem 0 3.7rem; }
.section-heading { max-width: 610px; margin-bottom: 4rem; }
.section-heading h2, .about h2 {
  font-size: clamp(2.8rem, 5.3vw, 5.2rem); letter-spacing: -.045em; margin-bottom: 1rem;
}
.section-heading > p:last-child { font-family: "Libre Baskerville", Georgia, serif; line-height: 1.85; color: var(--muted); }
.book-list { display: grid; gap: 5.6rem; }
.book-entry {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center; gap: clamp(2rem, 7vw, 7.5rem);
  padding-bottom: 5.6rem; border-bottom: 1px solid var(--line);
}
.book-entry:nth-of-type(even) .book-art { order: 2; }
.book-art {
  display: grid; place-items: center; min-height: 440px;
  border: 1px solid var(--line); position: relative;
  background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--surface) 83%, transparent), transparent 67%);
}
.book-art::before, .book-art::after {
  content: ""; position: absolute; width: 28px; height: 28px; pointer-events: none;
  border-color: var(--ornament); border-style: solid;
}
.book-art::before { top: 12px; left: 12px; border-width: 1px 0 0 1px; }
.book-art::after { bottom: 12px; right: 12px; border-width: 0 1px 1px 0; }
.book-art img {
  display: block; width: min(100%, 520px); max-height: 520px; object-fit: contain;
  filter: drop-shadow(15px 28px 18px var(--shadow));
  transition: transform 300ms ease;
}
.book-entry:hover .book-art img { transform: translateY(-7px); }
.book-copy { padding: 1.4rem 0; }
.book-copy h3 { font-size: clamp(2.2rem, 4vw, 4.2rem); margin: .5rem 0 .8rem; letter-spacing: -.04em; }
.book-title {
  padding: 0; border: 0; text-align: left; background: none; color: inherit;
  font: inherit; line-height: inherit; cursor: pointer;
}
.book-title:hover { color: var(--accent-strong); }
.book-title span { font-size: .38em; vertical-align: top; letter-spacing: 0; }
.byline { color: var(--muted); font-family: "Libre Baskerville", Georgia, serif; font-size: .86rem; font-style: italic; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.4rem 0 1.6rem; }
.tag {
  padding: .35rem .6rem; border: 1px solid var(--line);
  font-size: .62rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-strong); background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.book-teaser { max-width: 45ch; font-family: "Libre Baskerville", Georgia, serif; line-height: 1.85; font-size: .96rem; }
.book-actions { display: flex; gap: 1rem 2rem; flex-wrap: wrap; align-items: center; margin-top: 1.8rem; }
.detail-link, .text-link {
  color: var(--accent-strong); background: none; border: none; padding: 0;
  font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
}
.detail-link { border-bottom: 1px solid var(--accent); padding-bottom: .35rem; }
.detail-link:hover { color: var(--ink); }
.detail-link span, .text-link span { margin-left: .3rem; font-size: .94rem; }
.completed { padding: 3rem 0 6rem; }
.compact-heading { margin-bottom: 2rem; }
.empty-archive {
  display: flex; align-items: center; gap: 2rem;
  padding: 2rem 2.4rem; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 50%, transparent);
}
.archive-symbol { color: var(--accent); font-size: 3rem; line-height: 1; }
.empty-archive h3 { font-size: 1.13rem; margin-bottom: .25rem; }
.empty-archive p { margin: 0; color: var(--muted); font-size: .9rem; }
.about {
  display: grid; grid-template-columns: .65fr 1.35fr; gap: 7rem;
  padding: 6rem 0 8rem; border-top: 1px solid var(--line);
}
.about-portrait {
  align-self: center; width: min(100%, 320px); aspect-ratio: 1;
  border: 1px solid var(--ornament);
  border-radius: 50%; padding: 10px; position: relative;
}
.about-portrait::after {
  content: ""; position: absolute; inset: -6%; border: 1px solid var(--ornament);
  border-radius: 50%; opacity: .5; pointer-events: none;
}
.about-portrait img {
  display: block; position: absolute; inset: 10px;
  width: calc(100% - 20px); height: calc(100% - 20px);
  object-fit: cover; border-radius: 50%;
}
.about-content p:not(.eyebrow) {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: .98rem; line-height: 1.95; max-width: 68ch;
}
.site-footer {
  min-height: 110px; display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  margin: 0 5.4%; border-top: 1px solid var(--line);
  font-size: .73rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.site-footer span span { color: var(--accent); padding: 0 .3rem; }
.book-dialog {
  width: min(900px, calc(100vw - 2rem)); max-height: min(90vh, 900px);
  padding: 0; border: 1px solid var(--accent); background: var(--paper); color: var(--ink);
  box-shadow: 0 25px 90px rgba(0,0,0,.4);
}
.book-dialog::backdrop { background: rgba(6, 13, 24, .72); backdrop-filter: blur(4px); }
.dialog-panel {
  display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
  gap: 2.3rem; padding: 3.3rem; position: relative;
  background-image: var(--chart); background-size: 850px auto;
}
.dialog-close {
  position: absolute; right: 1rem; top: .7rem;
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 50%; cursor: pointer; font-size: 1.7rem; line-height: 1;
}
.dialog-close:hover { background: var(--accent); color: var(--paper); }
.dialog-art { align-self: center; }
.dialog-art img { display: block; width: 100%; filter: drop-shadow(10px 20px 15px var(--shadow)); }
.dialog-copy h2 { font-size: clamp(2rem, 3.5vw, 3.1rem); letter-spacing: -.04em; margin-bottom: .7rem; }
.dialog-summary { max-height: 35vh; overflow: auto; padding-right: .5rem; font-family: "Libre Baskerville", Georgia, serif; font-size: .92rem; line-height: 1.85; }
.dialog-summary p { margin-bottom: 1em; }
.availability { margin: 1.5rem 0 .9rem; border-top: 1px solid var(--line); padding-top: 1rem; color: var(--muted); font-size: .82rem; }
.dialog-series { display: inline-block; margin-bottom: .5rem; }
.aldrath-main { min-height: calc(100svh - 196px); display: grid; place-items: center; }
.aldrath-hero {
  width: min(900px, 85%); margin: 5rem auto; padding: 4rem 2rem 5rem;
  border: 1px solid var(--line); text-align: center; position: relative;
  background: var(--hero-glow);
}
.aldrath-hero::before { content: ""; position: absolute; inset: .7rem; border: 1px solid var(--ornament); pointer-events: none; }
.aldrath-sigil { font-size: 5rem; color: var(--accent); line-height: 1; margin-bottom: 2rem; }
.aldrath-hero h1 { font-size: clamp(3rem, 6vw, 6rem); letter-spacing: -.05em; }
.aldrath-hero > p:not(.eyebrow) { max-width: 530px; margin: 0 auto 1.8rem; font-family: "Libre Baskerville", Georgia, serif; line-height: 1.85; }
.aldrath-status { color: var(--muted); font-size: .69rem; font-weight: 600; text-transform: uppercase; letter-spacing: .2em; margin-bottom: 2rem; }

@media (max-width: 800px) {
  .site-header { grid-template-columns: 1fr auto; gap: .8rem; padding: 1rem 0; }
  .site-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; flex-wrap: wrap; }
  .hero { height: 650px; min-height: 0; }
  .book-entry { gap: 2rem; }
  .book-art { min-height: 300px; }
  .about { gap: 3rem; }
  .dialog-panel { padding: 2.5rem; }
}
@media (max-width: 620px) {
  .site-header { margin: 0 5%; }
  .wordmark { font-size: .83rem; }
  .site-nav { gap: 1.4rem; }
  .site-nav a { font-size: .68rem; }
  .theme-label { display: none; }
  .theme-toggle { width: 2.6rem; height: 2.6rem; justify-content: center; }
  .hero { height: 620px; margin: 0; }
  .hero::before { inset: 3% 4%; }
  .hero::after { inset: 4% 5%; }
  .hero-chart { width: 110vw; }
  .hero h1 { font-size: clamp(3.7rem, 16vw, 5.5rem); }
  .hero-eyebrow { font-size: .59rem; letter-spacing: .18em; }
  .hero-footnote { bottom: 6.5%; font-size: .48rem; }
  .section-wrap { width: min(100% - 2.5rem, 500px); }
  .works { padding-top: 5rem; }
  .book-list { gap: 3rem; }
  .book-entry { display: flex; flex-direction: column; align-items: stretch; gap: 1.5rem; padding-bottom: 3rem; }
  .book-entry:nth-of-type(even) .book-art { order: 0; }
  .book-art { min-height: 0; }
  .book-art img { width: min(100%, 460px); }
  .book-copy { padding: 0; }
  .book-copy h3 { font-size: clamp(2.4rem, 10vw, 3.5rem); }
  .completed { padding-bottom: 4rem; }
  .empty-archive { padding: 1.3rem; gap: 1rem; }
  .archive-symbol { font-size: 2rem; }
  .about { display: block; padding: 4rem 0 5rem; }
  .about-portrait { width: min(220px, 75%); margin: 0 auto 4rem; }
  .site-footer { margin: 0 5%; padding: 2rem 0; min-height: 0; align-items: flex-start; flex-direction: column; gap: 1rem; }
  .book-dialog { max-height: 93vh; }
  .dialog-panel { display: block; padding: 3.2rem 1.4rem 1.5rem; }
  .dialog-art { max-width: 190px; margin: 0 auto 1.5rem; }
  .dialog-copy h2 { font-size: 2rem; }
  .dialog-summary { max-height: none; }
  .aldrath-hero { width: 90%; padding: 3rem 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
