:root {
  --ink: #f6f0e2;
  --muted: #a9b4c8;
  --night: #040a17;
  --blue: #071833;
  --panel: rgba(9, 25, 52, 0.72);
  --line: rgba(191, 211, 237, 0.18);
  --gold: #dbbe7a;
  --aqua: #76ced1;
  --violet: #a996f0;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--night);
  font-family: var(--sans);
  min-width: 320px;
  overflow-x: hidden;
}
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.sky { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; background: radial-gradient(circle at 48% -20%, #143464 0, #061329 43%, #030812 100%); }
#starfield { width: 100%; height: 100%; opacity: .9; }
.nebula { position: absolute; width: 42rem; height: 42rem; border-radius: 50%; filter: blur(100px); opacity: .17; }
.nebula-one { background: #325fc5; top: 5%; left: -18rem; }
.nebula-two { background: #7e4dbb; right: -22rem; top: 48%; }
.grain { position: absolute; inset: 0; opacity: .06; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E"); }

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.4rem clamp(1.25rem, 5vw, 5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background .35s, border-color .35s, padding .35s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled { padding-top: .85rem; padding-bottom: .85rem; background: rgba(3, 9, 20, .78); backdrop-filter: blur(18px); border-color: var(--line); }
.brand { display: inline-flex; align-items: center; gap: .8rem; }
.brand-mark { width: 3.1rem; height: 2.2rem; display: grid; grid-template-columns: 1fr 1px 1fr; place-items: center; font: 600 .78rem var(--serif); letter-spacing: .04em; border: 1px solid rgba(219,190,122,.55); transform: rotate(45deg); }
.brand-mark > * { transform: rotate(-45deg); }
.brand-mark i { display: block; width: 1px; height: 1.35rem; background: rgba(219,190,122,.5); }
.brand-name { font-size: .78rem; text-transform: uppercase; letter-spacing: .2em; }
nav { display: flex; gap: 2rem; }
nav a { color: #d8dfeb; font-size: .78rem; text-transform: uppercase; letter-spacing: .16em; position: relative; }
nav a::after { content: ""; position: absolute; left: 0; bottom: -.45rem; height: 1px; width: 0; background: var(--gold); transition: width .25s; }
nav a:hover::after, nav a:focus-visible::after { width: 100%; }

main, footer { width: min(100%, 1600px); margin: 0 auto; }
.hero { min-height: 100svh; padding: 10rem clamp(1.25rem, 8vw, 8rem) 6rem; display: grid; grid-template-columns: 1.15fr .85fr; gap: 5vw; align-items: center; position: relative; }
.eyebrow { color: var(--gold); font-size: .75rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; margin: 0 0 1.25rem; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; }
h1 { font-size: clamp(3.7rem, 7vw, 7.6rem); line-height: .86; letter-spacing: -.04em; max-width: 13ch; }
h1 em { color: var(--gold); font-weight: 400; }
.hero-intro { max-width: 40rem; color: #bdc7d9; font-family: var(--serif); font-size: clamp(1.18rem, 1.55vw, 1.45rem); line-height: 1.55; margin: 2.2rem 0; }
.primary-action { display: inline-flex; align-items: center; gap: 1.2rem; border-bottom: 1px solid rgba(219,190,122,.55); padding: .75rem 0; text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; }
.primary-action span { color: var(--gold); transition: transform .25s; }
.primary-action:hover span { transform: translateY(.3rem); }

.hero-orbit { justify-self: center; width: min(38vw, 30rem); aspect-ratio: 1; position: relative; display: grid; place-items: center; }
.orbit { position: absolute; inset: 3%; border: 1px solid rgba(219,190,122,.22); border-radius: 50%; animation: spin 28s linear infinite; }
.orbit-inner { inset: 19%; border-color: rgba(118,206,209,.24); animation-direction: reverse; animation-duration: 18s; }
.orbit span { position: absolute; top: 48%; left: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 16px var(--gold); }
.orbit-inner span { left: auto; right: -3px; top: 23%; background: var(--aqua); box-shadow: 0 0 16px var(--aqua); }
.source-point { width: 7.8rem; aspect-ratio: 1; border: 1px solid rgba(246,240,226,.65); transform: rotate(45deg); display: flex; align-items: center; justify-content: center; gap: .45rem; box-shadow: 0 0 80px rgba(84,125,201,.2), inset 0 0 35px rgba(124,159,223,.1); }
.source-point span, .source-point small { transform: rotate(-45deg); font: 500 2.1rem var(--serif); }
.source-point small { font-size: 1rem; color: var(--gold); }
.hero-orbit > p { position: absolute; bottom: 13%; margin: 0; color: #8291aa; font-size: .57rem; letter-spacing: .25em; }
.scroll-cue { position: absolute; bottom: 2.4rem; left: clamp(1.25rem, 8vw, 8rem); display: flex; align-items: center; gap: .8rem; color: #6f7e96; font-size: .75rem; letter-spacing: .15em; text-transform: uppercase; }
.scroll-cue span { width: 2.2rem; height: 1px; background: #52627c; }
@keyframes spin { to { transform: rotate(360deg); } }

.collection { padding: 8rem clamp(1.25rem, 5vw, 5rem); min-height: 100vh; }
.section-heading { display: grid; grid-template-columns: 1fr auto; align-items: end; border-bottom: 1px solid var(--line); padding-bottom: 1.8rem; margin-bottom: 3rem; }
.section-heading .eyebrow { grid-column: 1 / -1; }
.section-heading h2, .author h2 { font-size: clamp(3rem, 5vw, 5.5rem); line-height: .95; }
.section-heading > p:last-child { color: var(--muted); margin: 0 0 .5rem; font-family: var(--serif); font-size: 1.15rem; }
.book-explorer { display: grid; grid-template-columns: minmax(15rem, .64fr) minmax(0, 1.8fr); gap: clamp(2rem, 5vw, 5rem); }
.book-tabs { border-top: 1px solid var(--line); }
.book-tab { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); color: #909db2; text-align: left; display: grid; grid-template-columns: 2.5rem 1fr; gap: 1rem; padding: 1.5rem .5rem 1.5rem 0; cursor: pointer; transition: color .25s, padding-left .25s, background .25s; }
.book-tab:hover { color: var(--ink); padding-left: .35rem; }
.book-tab:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }
.book-tab.is-active { color: var(--ink); background: linear-gradient(90deg, transparent, rgba(219,190,122,.055)); }
.tab-number { font-family: var(--serif); color: var(--gold); font-size: .8rem; padding-top: .15rem; }
.book-tab b { display: block; font: 500 1.12rem/1.2 var(--serif); margin-bottom: .45rem; }
.book-tab small { color: #738199; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }

.book-stage { min-height: 38rem; display: grid; grid-template-columns: minmax(17rem, .8fr) 1fr; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(20px); overflow: hidden; }
.book-art { position: relative; display: grid; place-items: center; min-height: 38rem; overflow: hidden; transition: background .5s; background: radial-gradient(circle at 50% 42%, rgba(77,131,186,.4), transparent 55%), linear-gradient(160deg, #102b4e, #07101f); }
.book-art[data-theme="architect"] { background: radial-gradient(circle at 50% 42%, rgba(196,156,77,.32), transparent 56%), linear-gradient(160deg, #292015, #090b12); }
.book-art[data-theme="whispers"] { background: radial-gradient(circle at 50% 42%, rgba(90,129,110,.43), transparent 56%), linear-gradient(160deg, #102b29, #07100f); }
.book-art[data-theme="little-giant"] { background: radial-gradient(circle at 50% 42%, rgba(121,116,221,.4), transparent 56%), linear-gradient(160deg, #181c49, #07101f); }
.cover-glow { position: absolute; width: 60%; height: 70%; background: rgba(91,140,210,.24); filter: blur(50px); transition: background .5s; }
[data-theme="architect"] .cover-glow { background: rgba(218,174,85,.2); }
[data-theme="whispers"] .cover-glow { background: rgba(104,174,130,.22); }
[data-theme="little-giant"] .cover-glow { background: rgba(139,132,235,.27); }
.book-cover { position: relative; width: min(64%, 15rem); aspect-ratio: .65; transform: perspective(900px) rotateY(8deg); transform-style: preserve-3d; filter: drop-shadow(-1.5rem 2rem 1.5rem rgba(0,0,0,.42)); transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.book-art:hover .book-cover { transform: perspective(900px) rotateY(0deg) translateY(-.4rem); }
.cover-field { position: absolute; inset: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.17); background: linear-gradient(140deg, rgba(40,98,145,.92), rgba(6,16,36,.98)); padding: 1.25rem 1.05rem; display: flex; flex-direction: column; align-items: center; text-align: center; }
[data-theme="architect"] .cover-field { background: linear-gradient(140deg, #594425, #17140f 70%); }
[data-theme="whispers"] .cover-field { background: linear-gradient(140deg, #315d51, #0b1c1a 70%); }
[data-theme="little-giant"] .cover-field { background: linear-gradient(140deg, #494b91, #111632 70%); }
.cover-field::before, .cover-field::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(219,190,122,.35); width: 12rem; height: 12rem; top: 21%; }
.cover-field::after { width: 8rem; height: 8rem; top: calc(21% + 2rem); border-color: rgba(255,255,255,.16); }
.cover-kicker, .cover-imprint { z-index: 1; text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; color: rgba(255,255,255,.73); }
.cover-imprint { margin-top: auto; }
.cover-symbol { z-index: 1; width: 2.7rem; height: 2.7rem; margin: 3.2rem 0 1.4rem; border: 1px solid var(--gold); transform: rotate(45deg); box-shadow: 0 0 24px rgba(219,190,122,.25); }
[data-theme="architect"] .cover-symbol { border-radius: 50%; box-shadow: inset 0 0 0 8px transparent, inset 0 0 0 9px rgba(219,190,122,.35); }
[data-theme="whispers"] .cover-symbol { border-radius: 55% 0 55% 0; transform: rotate(-45deg); }
[data-theme="little-giant"] .cover-symbol { border-radius: 50%; transform: none; box-shadow: 0 0 24px rgba(190,184,255,.35); }
.cover-title { z-index: 1; font: 500 1.65rem/1.02 var(--serif); }
.book-spine { position: absolute; right: -12px; top: 5px; bottom: 5px; width: 12px; background: #020711; transform: rotateY(90deg); transform-origin: left; }
.book-details { padding: clamp(2rem, 5vw, 4.5rem); display: flex; flex-direction: column; justify-content: center; }
.detail-meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--gold); text-transform: uppercase; font-size: .75rem; letter-spacing: .12em; margin-bottom: 2.5rem; }
.book-details h3 { font-size: clamp(2.6rem, 4.5vw, 5.25rem); line-height: .86; letter-spacing: -.035em; max-width: 10ch; }
#book-title[data-book="little-giant"] { font-size: clamp(2.3rem, 3.8vw, 4.1rem); line-height: .94; max-width: 12ch; }
.book-tagline { font: 500 1.25rem/1.3 var(--serif); color: #d9cba7; margin: 1.6rem 0 1rem; }
.book-tagline[hidden] { display: none; }
.book-edition { color: #d0d9e9; font-size: .875rem; line-height: 1.5; margin: .85rem 0 .4rem; }
.book-description { color: #aab6ca; line-height: 1.75; font-size: .9rem; max-width: 37rem; }
.book-isbn { color: #94a3ba; font-size: .8rem; line-height: 1.55; margin-top: 1rem; }
.detail-actions { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; margin-top: 2.1rem; }
.amazon-link { background: var(--ink); color: #07101e; padding: .95rem 1.2rem; text-transform: uppercase; font-size: .64rem; letter-spacing: .13em; font-weight: 600; transition: transform .2s, background .2s; }
.amazon-link:hover { transform: translateY(-2px); background: var(--gold); }
.book-pager { display: flex; gap: .55rem; }
.book-pager button { width: 2.8rem; height: 2.8rem; border: 1px solid var(--line); color: var(--ink); background: transparent; cursor: pointer; transition: border-color .2s, background .2s; }
.book-pager button:hover { border-color: var(--gold); background: rgba(219,190,122,.08); }

.author { padding: 10rem clamp(1.25rem, 9vw, 9rem); display: grid; grid-template-columns: .75fr 1fr; gap: clamp(4rem, 10vw, 10rem); align-items: center; }
.author-portrait { position: relative; display: grid; place-items: center; }
.portrait-frame { width: min(100%, 27rem); aspect-ratio: .78; position: relative; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(circle at 50% 38%, rgba(72,115,180,.42), transparent 45%), linear-gradient(150deg, #10294c, #060d1b); }
.portrait-frame::after { content: ""; position: absolute; inset: 1rem; border: 1px solid rgba(219,190,122,.18); }
.portrait-frame svg { width: 100%; height: 100%; stroke: rgba(219,190,122,.57); stroke-width: .8; fill: none; }
.portrait-initials { position: absolute; z-index: 2; bottom: 2rem; right: 2rem; font: 500 4rem var(--serif); color: rgba(255,255,255,.08); }
.portrait-orbit { position: absolute; width: 114%; aspect-ratio: 1; border: 1px solid rgba(118,206,209,.15); border-radius: 50%; z-index: -1; }
.author-lede { color: var(--gold); font: 500 1.35rem var(--serif); margin: 1.5rem 0 2rem; }
.author-copy > p:not(.eyebrow):not(.author-lede) { color: #aeb8ca; line-height: 1.85; max-width: 41rem; font-size: .93rem; }
.signature { border-top: 1px solid var(--line); margin-top: 2.3rem; padding-top: 1.7rem; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; max-width: 41rem; }
.signature span { font: italic 1.35rem var(--serif); color: #e8ddc4; }
.signature small { font-size: .75rem; letter-spacing: .09em; text-transform: uppercase; color: #64738c; }

footer { border-top: 1px solid var(--line); padding: 4rem clamp(1.25rem, 5vw, 5rem) 2rem; }
.footer-brand { margin-left: .7rem; }
footer > p { font: 500 clamp(1.5rem, 3vw, 2.7rem) var(--serif); color: #cad3e0; margin: 2.7rem 0 4rem; }
footer > div { border-top: 1px solid var(--line); padding-top: 1.3rem; display: flex; justify-content: space-between; color: #697891; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
footer > div a { color: #b9c3d2; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.book-stage.is-changing .book-art { animation: fadeSlide .42s ease; }
.book-stage.is-changing .book-details { animation: detailIn .42s ease; }
@keyframes fadeSlide { 0% { opacity: .45; transform: scale(.985); } 100% { opacity: 1; transform: none; } }
@keyframes detailIn { 0% { opacity: .15; transform: translateX(12px); } 100% { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 9rem; text-align: center; }
  h1 { margin-inline: auto; }
  .hero-intro { margin-inline: auto; }
  .hero-orbit { width: min(76vw, 25rem); }
  .scroll-cue { display: none; }
  .book-explorer { grid-template-columns: 1fr; }
  .book-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .book-tab { grid-template-columns: 1fr; padding: 1rem; border: 1px solid var(--line); border-left: 0; }
  .book-tab:first-child { border-left: 1px solid var(--line); }
  .book-tab b { font-size: .92rem; }
  .book-tab small { display: none; }
  .book-tab:hover { padding-left: 1rem; }
  .book-stage { grid-template-columns: .78fr 1fr; }
  .author { grid-template-columns: .8fr 1fr; gap: 3rem; }
}

@media (max-width: 660px) {
  .site-header { padding: 1.15rem 1.1rem; }
  .brand-name { display: none; }
  nav { gap: 1.2rem; }
  .hero { min-height: auto; padding: 10rem 1.15rem 6rem; gap: 4rem; }
  h1 { font-size: clamp(3.6rem, 17vw, 5.2rem); }
  .hero-orbit { width: min(88vw, 22rem); }
  .collection { padding: 6rem 1rem; }
  .section-heading { display: block; }
  .section-heading > p:last-child { margin-top: 1rem; }
  .book-tabs { overflow-x: auto; grid-template-columns: repeat(4, minmax(9.5rem, 1fr)); padding-bottom: .35rem; }
  .book-tab { min-width: 9.5rem; }
  .book-stage { grid-template-columns: 1fr; }
  .book-art { min-height: 28rem; }
  .book-cover { width: min(52%, 13rem); }
  .book-details { padding: 2rem 1.4rem 2.3rem; }
  .detail-meta { margin-bottom: 1.7rem; }
  .book-details h3 { font-size: 3.25rem; }
  .detail-actions { align-items: stretch; }
  .amazon-link { display: flex; align-items: center; justify-content: center; }
  .author { grid-template-columns: 1fr; padding: 6rem 1.2rem; }
  .author-portrait { width: min(80%, 20rem); justify-self: center; }
  .signature { align-items: flex-start; flex-direction: column; }
  footer > div { flex-direction: column; gap: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Extended collection and imprint sections */
.book-tab[hidden] { display: none; }
.filter-row { display: flex; flex-wrap: wrap; gap: .65rem; margin: -1rem 0 2rem; }
.filter-chip { display: inline-flex; align-items: center; gap: .6rem; border: 1px solid var(--line); border-radius: 99px; padding: .7rem 1rem; color: #aeb9ca; background: rgba(7,19,39,.56); font: 500 .78rem var(--sans); letter-spacing: .04em; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.filter-chip:hover, .filter-chip:focus-visible { border-color: rgba(219,190,122,.65); color: var(--ink); }
.filter-chip.is-active { background: rgba(219,190,122,.12); border-color: rgba(219,190,122,.55); color: var(--gold); }
.filter-chip span { opacity: .72; font-size: .75rem; }
.art-note { position: absolute; bottom: 1.4rem; color: rgba(240,244,255,.65); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; }
.format-links { display: flex; flex-wrap: wrap; gap: .75rem; color: #75839a; margin-top: 1.4rem; font-size: .75rem; }
.format-links a, .text-link { color: var(--gold); }
.format-links a:hover, .text-link:hover { text-decoration: underline; text-underline-offset: .25em; }
.about-press { display: grid; grid-template-columns: .7fr 1fr; gap: clamp(3rem, 9vw, 9rem); align-items: center; padding: 8rem clamp(1.25rem, 9vw, 9rem); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: linear-gradient(100deg, transparent, rgba(14,34,66,.4)); }
.about-orbit { position: relative; width: min(100%, 22rem); aspect-ratio: 1; border: 1px solid rgba(219,190,122,.25); border-radius: 50%; display: flex; align-items: center; justify-content: center; gap: 1rem; justify-self: center; box-shadow: inset 0 0 5rem rgba(65,113,186,.09), 0 0 5rem rgba(65,113,186,.09); }
.about-orbit::before, .about-orbit::after { content: ""; position: absolute; width: 70%; aspect-ratio: 1; border: 1px solid rgba(118,206,209,.16); border-radius: 50%; transform: rotate(45deg) scaleY(.42); }
.about-orbit::after { transform: rotate(-45deg) scaleY(.42); border-color: rgba(219,190,122,.18); }
.about-orbit span { z-index: 1; color: var(--gold); font: 500 2.6rem var(--serif); }
.about-orbit i { height: 3rem; width: 1px; z-index: 1; background: rgba(219,190,122,.4); }
.about-copy h2 { font: 500 clamp(2.8rem, 5vw, 5.2rem)/.95 var(--serif); max-width: 12ch; }
.about-copy > p:not(.eyebrow) { color: #aeb8ca; font-size: .95rem; line-height: 1.85; max-width: 42rem; }
.text-link { display: inline-flex; gap: .8rem; border-bottom: 1px solid rgba(219,190,122,.42); padding: .65rem 0; font-size: .7rem; letter-spacing: .13em; text-transform: uppercase; }
@media (max-width: 900px) { .book-tabs { grid-template-columns: repeat(4, minmax(8.5rem, 1fr)); overflow-x: auto; } }
@media (max-width: 660px) { .book-tabs { grid-template-columns: repeat(4, minmax(9.5rem, 1fr)); } .about-press { grid-template-columns: 1fr; padding: 6rem 1.2rem; gap: 3rem; } .about-orbit { width: min(72vw, 18rem); } }
