:root{
  --bg: #0d0b09;
  --bg-alt: #141009;
  --text: #e9decb;
  --text-dim: #a89a80;
  --gold: #b6905a;
  --gold-bright: #d3ac72;
  --rule: #352a1c;
  --measure: 62ch;
  --shine-angle: 110deg;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
html, body { height: 100%; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', serif;
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

::selection{ background: var(--gold); color: #17130d; }

.display{ font-family: 'Cormorant Garamond', serif; }

/* ---------- Smooth cross-document navigation (progressive enhancement) ---------- */

@view-transition{
  navigation: auto;
}

::view-transition-old(root){
  animation: fade-out 0.45s ease both;
}

::view-transition-new(root){
  animation: fade-in 0.45s ease both;
}

@keyframes fade-out{
  to{ opacity: 0; transform: translateY(-16px); }
}

@keyframes fade-in{
  from{ opacity: 0; transform: translateY(16px); }
}

@media (prefers-reduced-motion: reduce){
  ::view-transition-old(root), ::view-transition-new(root){
    animation: none;
  }
}

/* ---------- Foil shine, driven by scroll angle ---------- */

.shine{
  background-image: linear-gradient(
    var(--shine-angle, 110deg),
    var(--gold) 0%,
    var(--gold) 30%,
    var(--gold-bright) 42%,
    #fff6df 50%,
    var(--gold-bright) 58%,
    var(--gold) 70%,
    var(--gold) 100%
  );
  background-size: 260% 260%;
  background-position: var(--shine-pos, 50% 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  will-change: background-position;
}

@media (prefers-reduced-motion: reduce){
  .shine{
    background-image: none;
    -webkit-text-fill-color: var(--gold-bright);
    color: var(--gold-bright);
  }
}

/* ---------- Buttons ---------- */

.btn{
  display: inline-block;
  text-decoration: none;
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.14em;
  font-size: 1.05rem;
  font-weight: 500;
  color: #17130d;
  background: var(--gold-bright);
  padding: 0.95rem 2.3rem;
  border-radius: 2px;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn:hover{
  background: #e6c48c;
  transform: translateY(-1px);
}

.btn-outline{
  background: transparent;
  color: var(--gold-bright);
  border: 1px solid var(--gold);
}

.btn-outline:hover{
  background: rgba(182, 144, 90, 0.12);
  color: #e6c48c;
  border-color: #e6c48c;
}

.btn-row{
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
}

@media (prefers-reduced-motion: reduce){
  .btn{ transition: none; }
}

/* ---------- Home screen ---------- */

.home-inner{
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.mandala{
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(70vw, 640px);
  height: min(70vw, 640px);
  transform: translate(-50%, -50%);
  opacity: 0.1;
  pointer-events: none;
  animation: spin 140s linear infinite;
  z-index: 0;
}

@keyframes spin{
  from{ transform: translate(-50%, -50%) rotate(0deg); }
  to{ transform: translate(-50%, -50%) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce){
  .mandala{ animation: none; }
}

.stage{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  text-align: center;
  padding: 6vh 6vw;
  position: relative;
  z-index: 1;
}

.kicker{
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.34em;
  font-size: 0.95rem;
  color: var(--text-dim);
  font-weight: 500;
}

.name{
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 5.5rem);
  letter-spacing: 0.05em;
  line-height: 1.05;
  margin: 0;
  animation: shimmer 9s ease-in-out infinite;
}

@keyframes shimmer{
  0%   { background-position: 10% 40%; }
  50%  { background-position: 90% 60%; }
  100% { background-position: 10% 40%; }
}

@media (prefers-reduced-motion: reduce){
  .name{ animation: none; background-position: 50% 50%; }
}

.tagline{
  font-style: italic;
  color: var(--text-dim);
  font-size: 1.55rem;
  max-width: 38ch;
  line-height: 1.65;
}

.blurb{
  font-style: normal;
  color: var(--text-dim);
  font-size: 1.35rem;
  max-width: 48ch;
  line-height: 1.65;
  opacity: 0.92;
}

/* ---------- Books/library screen ---------- */

.books-inner{
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.lib-header{
  padding: 5vh 7vw 2vh;
  text-align: center;
}

.home-link{
  display: inline-block;
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.28em;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-decoration: none;
  margin-bottom: 2.4rem;
  transition: color 0.2s ease;
}

.home-link:hover{ color: var(--gold-bright); }

.lib-header h1{
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  letter-spacing: 0.05em;
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 0.6rem;
}

.lib-sub{
  font-style: italic;
  color: var(--text-dim);
  font-size: 1.05rem;
}

.lib-main{
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 7vw 10vh;
}

.shelf{
  display: flex;
  flex-wrap: wrap;
  gap: 3.5rem;
  justify-content: center;
}

.book-card{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  width: 240px;
  text-decoration: none;
  color: inherit;
}

.book-cover{
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 1.5rem 3rem rgba(0,0,0,0.55);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.book-cover img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-card:hover .book-cover{
  transform: translateY(-6px);
  box-shadow: 0 2rem 4rem rgba(0,0,0,0.65);
}

.book-title{
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.16em;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--gold-bright);
}

.book-byline{
  font-size: 1.05rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-top: -1rem;
}

@media (prefers-reduced-motion: reduce){
  .book-cover, .home-link{ transition: none; }
}

/* ---------- Pilgrim book page ---------- */

.hero{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5rem;
  min-height: 100vh;
  padding: 10vh 7vw;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-copy{
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2.6rem;
  max-width: 46ch;
  min-width: 0;
}

.eyebrow{
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.28em;
  font-size: 0.95rem;
  color: var(--text-dim);
  font-weight: 500;
}

.title{
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  color: var(--text);
  font-weight: 500;
  margin: 0;
  overflow-wrap: break-word;
}

.byline{
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  letter-spacing: 0.16em;
  color: var(--gold-bright);
  font-weight: 500;
}

.epigraph{
  border-left: 1px solid var(--rule);
  padding-left: 1.6rem;
  font-style: italic;
  color: var(--text-dim);
  font-size: 1.15rem;
  line-height: 1.9;
  max-width: 34ch;
}

.cta-row{
  display: flex;
  align-items: center;
  gap: 1.6rem;
  flex-wrap: wrap;
}

.hint{
  color: var(--text-dim);
  font-size: 0.9rem;
  font-style: italic;
}

.hero-image{
  position: relative;
  overflow: hidden;
  width: 260px;
  flex-shrink: 0;
  border-radius: 2px;
  box-shadow: 0 1.5rem 3.5rem rgba(0,0,0,0.55);
}

.hero-image img{
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}

section{ padding: 11vh 7vw; }

.synopsis{
  background: var(--bg-alt);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.synopsis-inner{
  max-width: var(--measure);
  margin: 0 auto;
}

.synopsis p{
  margin: 0 0 1.5rem;
  color: var(--text);
}

.synopsis p:first-of-type::first-letter{
  font-family: 'Cormorant Garamond', serif;
  font-size: 3.6rem;
  float: left;
  line-height: 0.8;
  padding-right: 0.5rem;
  padding-top: 0.35rem;
  color: var(--gold-bright);
  font-weight: 500;
}

.closing-line{
  font-style: italic;
  color: var(--gold-bright);
  font-size: 1.2rem;
  text-align: center;
  margin-top: 3rem !important;
}

/* ---------- Excerpt ---------- */

.excerpt{
  background: var(--bg);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.excerpt-inner{
  max-width: 56ch;
  margin: 0 auto;
  text-align: center;
}

.excerpt h2{
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  letter-spacing: 0.28em;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0 0 2.4rem;
}

.excerpt p{
  font-family: 'EB Garamond', serif;
  font-style: italic;
  color: var(--text);
  line-height: 1.95;
  margin: 0 0 1.6rem;
  text-align: left;
}

.excerpt-break{
  color: var(--gold);
  letter-spacing: 0.5em;
  margin: 2.2rem 0;
  font-size: 0.9rem;
}

.excerpt-credit{
  font-style: normal !important;
  text-align: center !important;
  color: var(--text-dim) !important;
  font-size: 0.85rem !important;
  letter-spacing: 0.06em;
  margin-top: 2rem !important;
}

/* ---------- Pull quote ---------- */

.pull-quote{
  max-width: 640px;
  margin: 0 auto;
  padding: 8vh 7vw;
  text-align: center;
}

.pull-quote p{
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  line-height: 1.5;
  color: var(--gold-bright);
  margin: 0;
}

.pull-quote cite{
  display: block;
  font-style: normal;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-top: 1.4rem;
}

/* ---------- Themes / tags ---------- */

.themes{
  text-align: center;
  padding: 0 7vw 8vh;
}

.themes-label{
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.24em;
  font-size: 0.92rem;
  color: var(--text-dim);
  margin-bottom: 1.2rem;
}

.theme-tags{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}

.theme-tags span{
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  color: var(--gold);
  border: 1px solid var(--rule);
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
}

.comp-titles{
  font-style: italic;
  color: var(--text-dim);
  font-size: 1.08rem;
  margin-top: 1.6rem;
}

.comp-titles em{
  font-style: italic;
  color: var(--gold-bright);
}

.author{
  max-width: var(--measure);
  margin: 0 auto;
  text-align: center;
}

.author h2{
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  letter-spacing: 0.1em;
  font-size: 1.6rem;
  color: var(--text-dim);
  margin: 0 0 1.6rem;
}

.author p{
  font-style: italic;
  color: var(--text-dim);
  font-size: 1.15rem;
  line-height: 1.9;
}

.buy{
  text-align: center;
  border-top: 1px solid var(--rule);
}

.buy h2{
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 500;
  letter-spacing: 0.03em;
  margin: 0 0 2.2rem;
}

footer{
  padding: 5vh 7vw 7vh;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

footer span{
  font-family: 'Cormorant Garamond', serif;
  color: var(--gold);
}

.back-link{
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
}

.back-link:hover{ color: var(--gold-bright); }

/* ---------- Site-wide nav ---------- */

.site-nav{
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3.5vh 6vw 0;
  z-index: 2;
  font-family: 'Cormorant Garamond', serif;
}

.site-nav .nav-mark{
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.1em;
  font-size: 1.15rem;
}

.site-nav .nav-mark:hover{ color: var(--gold-bright); }

.site-nav .nav-links{
  display: flex;
  gap: 1.8rem;
}

.site-nav .nav-links a{
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.08em;
  font-size: 1.05rem;
}

.site-nav .nav-links a:hover{ color: var(--gold-bright); }

@media (max-width: 640px){
  .site-nav{ padding: 3vh 6vw 0; }
  .site-nav .nav-links{ gap: 1.1rem; }
  .site-nav .nav-links a{ font-size: 0.78rem; }
  .social-row{ gap: 0.9rem 1.2rem; }
}

/* ---------- Site-wide footer ---------- */

.site-footer{
  padding: 6vh 7vw 5vh;
  text-align: center;
  border-top: 1px solid var(--rule);
  color: var(--text-dim);
}

.site-footer .footer-mark{
  font-family: 'Cormorant Garamond', serif;
  color: var(--gold);
  letter-spacing: 0.14em;
  font-size: 1.3rem;
  margin-bottom: 1.4rem;
}

.newsletter{
  max-width: 460px;
  margin: 0 auto 2rem;
}

.newsletter p{
  font-size: 1.1rem;
  margin: 0 0 1rem;
  color: var(--text-dim);
}

.newsletter-form{
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.newsletter-form input[type="email"]{
  flex: 1;
  min-width: 200px;
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 2px;
  font-family: 'EB Garamond', serif;
  font-size: 1.1rem;
}

.newsletter-form input[type="email"]::placeholder{ color: var(--text-dim); }

.newsletter-form button{
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.1em;
  font-size: 1.1rem;
  color: #17130d;
  background: var(--gold-bright);
  border: none;
  padding: 0.75rem 1.6rem;
  border-radius: 2px;
  cursor: pointer;
}

.newsletter-form button:hover{ background: #e6c48c; }

.social-row{
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-bottom: 1.6rem;
}

.social-row a{
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.06em;
  font-size: 1.05rem;
}

.social-row a:hover{ color: var(--gold-bright); }

.footer-links{
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.footer-links a{
  color: var(--text-dim);
  text-decoration: none;
}

.footer-links a:hover{ color: var(--gold-bright); }

.footer-copyright{
  margin-top: 1rem;
  font-size: 0.9rem;
  opacity: 0.75;
}

/* ---------- 404 page ---------- */

.not-found{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.6rem;
  padding: 8vh 6vw;
}

.not-found h1{
  font-family: 'Cormorant Garamond', serif;
  color: var(--gold-bright);
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  margin: 0;
}

.not-found p{
  color: var(--text-dim);
  max-width: 40ch;
  line-height: 1.7;
}

@media (max-width: 900px){
  .hero{ flex-direction: column-reverse; min-height: auto; gap: 3rem; padding: 8vh 8vw 8vh; }
  .hero-image{ width: 200px; }
  .hero-copy{ gap: 2rem; text-align: center; align-items: center; }
  .epigraph{ text-align: left; }
  .title{ font-size: clamp(2.4rem, 13vw, 3.8rem); }
  section{ padding: 9vh 8vw; }
}
