@font-face {
  font-family: "Young Serif";
  src: url("assets/fonts/young-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("assets/fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #03061a;
  --deep: #060c2e;
  --navy: #0b1650;
  --royal: #1a35a6;
  --glow: #3558f0;
  --text: #f2f5ff;
  --muted: #a9b5e6;
  --yellow: #f3d13e;
  --ink: #0b1540;
  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--night); }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--night);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.08; margin: 0; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 20;
  background: var(--yellow); color: var(--ink); padding: 10px 16px; border-radius: 6px; font-weight: 700;
}
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 4px; }

/* ---------- header ---------- */
.site-head { position: relative; z-index: 5; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 22px; padding-bottom: 22px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: clamp(1.05rem, 4.4vw, 1.25rem); line-height: 1; white-space: nowrap; }
.brand svg { width: 40px; height: auto; flex: none; color: var(--yellow); }
.nav { display: flex; gap: clamp(14px, 3.5vw, 32px); font-weight: 600; }
.nav a { white-space: nowrap; text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; color: var(--muted); }
.nav a:hover, .nav a:focus-visible { color: var(--text); border-bottom-color: var(--yellow); }

@media (max-width: 520px) {
  .site-head .wrap { flex-wrap: wrap; row-gap: 4px; padding-top: 18px; padding-bottom: 10px; }
  .nav { width: 100%; gap: 22px; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(900px 620px at 88% 112%, rgba(53, 88, 240, 0.65), transparent 62%),
    radial-gradient(760px 520px at -4% -6%, rgba(40, 62, 170, 0.55), transparent 62%),
    linear-gradient(165deg, var(--navy) 0%, var(--deep) 55%, var(--night) 100%);
}
.hero-body { padding-top: clamp(48px, 9vw, 120px); padding-bottom: clamp(80px, 13vw, 170px); position: relative; }
.hero h1 { font-size: clamp(2.5rem, 7.2vw, 5.4rem); max-width: 14ch; letter-spacing: -0.015em; }
.hero-sub { font-size: clamp(1.1rem, 2.2vw, 1.4rem); max-width: 34ch; margin-top: 1.4em; color: var(--muted); line-height: 1.5; }
.hero-wing {
  position: absolute; z-index: -1; right: -6%; bottom: -9%;
  width: min(86vw, 860px); height: auto; color: rgba(86, 120, 255, 0.2);
  transform: rotate(-7deg);
  animation: glide-in 1.8s cubic-bezier(.16, .84, .3, 1) both;
}
@keyframes glide-in {
  from { opacity: 0; transform: translate(-22%, 6%) rotate(-13deg); }
  to   { opacity: 1; transform: translate(0, 0) rotate(-7deg); }
}

.btn {
  display: inline-block; text-decoration: none; font-weight: 700; font-size: 1rem; cursor: pointer;
  padding: 14px 26px; border-radius: 999px; background: var(--yellow); color: var(--ink);
  border: 2px solid var(--yellow); margin-top: 1.8em; transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--text); border-color: var(--text); }
.btn.ghost { background: transparent; color: var(--text); border-color: rgba(242, 245, 255, 0.55); }
.btn.ghost:hover { background: var(--text); color: var(--ink); border-color: var(--text); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.btn-row .btn { margin-top: 1.4em; }

/* ---------- shelf ---------- */
.shelf {
  padding: clamp(60px, 9vw, 112px) 0;
  background:
    radial-gradient(700px 420px at 10% 0%, rgba(30, 52, 150, 0.45), transparent 65%),
    linear-gradient(180deg, var(--night) 0%, #070d38 100%);
}
.shelf h2, .about h2 { font-size: clamp(2.1rem, 4.8vw, 3.4rem); }
.shelf-intro { max-width: 46ch; color: var(--muted); margin-top: 0.9em; }
.books {
  list-style: none; margin: clamp(36px, 6vw, 64px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 146px), 1fr));
  gap: clamp(30px, 4vw, 52px) clamp(20px, 3vw, 36px);
}
@media (min-width: 700px) { .books { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); } }
.book { display: block; text-decoration: none; }
.book h3 { font-size: 1.2rem; margin-top: 18px; line-height: 1.2; }
.book p { color: var(--muted); font-size: 0.97rem; margin: 6px 0 0; line-height: 1.45; }
.book:hover .cover-wrap, .book:focus-visible .cover-wrap { transform: translateY(-6px); box-shadow: 0 1px 0 rgba(255,255,255,.14) inset, 0 30px 54px -14px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.1); }

/* ---------- covers ---------- */
.cover-wrap {
  position: relative; aspect-ratio: 2 / 3; border-radius: 5px; color: var(--fg, var(--yellow));
  background: linear-gradient(155deg, var(--g1, #0b1540), var(--g2, #03061a));
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 22px 44px -14px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.07);
  transition: transform .18s ease, box-shadow .18s ease; overflow: hidden; container-type: inline-size;
}
.cover-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 70% at 0% 0%, rgba(255,255,255,.16), transparent 60%);
}
.cover-wrap img { width: 100%; height: 100%; object-fit: cover; }
.cover-type {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  padding: 9% 8% 8%; font-family: var(--serif); line-height: 1.02; z-index: 1;
}
.cover-type .t { display: block; font-size: 12.5cqw; overflow-wrap: normal; }
.cover-type .t.long { font-size: 8.6cqw; line-height: 1.08; }
.cover-type .s { display: block; font-family: var(--sans); font-size: 5.4cqw; font-weight: 600; margin-top: 4cqw; opacity: 0.92; line-height: 1.25; }
.cover-type .cover-mark { width: 17cqw; height: auto; opacity: 0.6; }
.tag {
  position: absolute; bottom: 14px; right: -4px; z-index: 2; background: var(--yellow); color: var(--ink);
  font-size: 0.78rem; font-weight: 800; padding: 5px 12px 5px 10px; border-radius: 4px 0 0 4px;
}
.tag.soon { background: var(--text); }

/* ---------- about ---------- */
.about {
  padding: clamp(60px, 9vw, 120px) 0; position: relative; overflow: hidden;
  background:
    radial-gradient(800px 520px at 100% 100%, rgba(53, 88, 240, 0.5), transparent 62%),
    linear-gradient(140deg, #12248a 0%, var(--navy) 42%, var(--deep) 100%);
}
.about .wrap { display: grid; gap: clamp(28px, 5vw, 72px); grid-template-columns: 1fr; position: relative; }
@media (min-width: 860px) { .about .wrap { grid-template-columns: 1fr 1.1fr; align-items: start; } }
.about p { color: #dfe6ff; max-width: 52ch; }
.about .contact-line { margin-top: 1.6em; margin-bottom: 0; color: var(--text); }
.noscript-note { color: var(--muted); font-size: 0.95rem; }

/* ---------- footer ---------- */
.site-foot { background: var(--night); color: var(--muted); padding: 36px 0 44px; font-size: 0.95rem; border-top: 1px solid rgba(255,255,255,.08); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 14px 36px; justify-content: space-between; align-items: center; }
.site-foot a { color: var(--text); }
.foot-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.05rem; text-decoration: none; }
.foot-brand svg { width: 34px; height: auto; color: var(--yellow); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }

/* ---------- book page ---------- */
.page {
  min-height: 100vh;
  background:
    radial-gradient(900px 600px at 90% -5%, rgba(40, 66, 190, 0.5), transparent 62%),
    linear-gradient(180deg, var(--navy) 0%, var(--deep) 40%, var(--night) 100%);
}
.book-page { padding: clamp(24px, 5vw, 56px) 0 clamp(64px, 9vw, 120px); }
.book-layout { display: grid; grid-template-columns: 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
@media (min-width: 820px) { .book-layout { grid-template-columns: minmax(240px, 340px) 1fr; } }
.book-layout .cover-wrap { max-width: 340px; width: 100%; }
.crumb { display: inline-block; margin-bottom: 26px; font-weight: 600; color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--text); text-decoration: underline; }
.book-copy h1 { font-size: clamp(2.2rem, 5.6vw, 4rem); max-width: 16ch; }
.book-copy .sub { font-family: var(--serif); font-size: clamp(1.15rem, 2.4vw, 1.6rem); color: var(--yellow); margin-top: 0.5em; }
.book-copy .tagline { font-size: 1.2rem; font-weight: 600; margin-top: 1.4em; max-width: 36ch; }
.book-copy .blurb { margin-top: 1.4em; max-width: 56ch; color: #dfe6ff; }
.status-note { margin-top: 1.6em; padding: 14px 18px; background: rgba(255,255,255,.07); border-left: 5px solid var(--yellow); border-radius: 0 6px 6px 0; max-width: 52ch; }
.more { margin-top: clamp(56px, 9vw, 104px); }
.more h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.books.small { margin-top: 28px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); gap: 24px 20px; }
@media (min-width: 700px) { .books.small { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); } }
.books.small .book h3 { font-size: 1rem; margin-top: 12px; }
.books.small .tag { font-size: 0.68rem; padding: 4px 9px 4px 8px; bottom: 9px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-wing { animation: none; }
  .cover-wrap { transition: none; }
}
