/* Epochara — site.css
   Palette derives from the brand mark & The Bane-Blood covers (night sky). */

:root {
  --ink: #070f12;
  --ink-2: #0e2229;
  --teal: #16333d;
  --cream: #efe6d3;
  --amber: #ffb24a;
  --violet: #9d86ff;
  --line: rgba(239, 230, 211, 0.12);
  --line-strong: rgba(239, 230, 211, 0.26);
  --muted: rgba(239, 230, 211, 0.64);
  --muted-2: rgba(239, 230, 211, 0.44);
  --serif: Georgia, "Iowan Old Style", "Times New Roman", Times, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wrap: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

#sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
}

a { color: var(--cream); text-decoration: none; }
a:hover { color: #fff; }

img { max-width: 100%; display: block; }

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

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  background: rgba(7, 15, 18, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 22px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand img { width: 26px; height: 26px; border-radius: 50%; }
.brand span {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding-left: 0.28em;
  color: var(--cream);
}
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a {
  font-size: 13.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-links a:hover { color: var(--cream); }
.nav-cta {
  font-size: 13.5px;
  letter-spacing: 0.08em;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--cream) !important;
  white-space: nowrap;
}
.nav-cta:hover { border-color: var(--amber); color: var(--amber) !important; }
@media (max-width: 620px) {
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 12.5px; letter-spacing: 0.1em; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 22px 90px;
}
.hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 170px;
  background: linear-gradient(180deg, transparent, var(--ink));
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 780px; }
.eyebrow {
  font-size: 12.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 22px;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5.6vw, 3.5rem);
  line-height: 1.14;
  margin: 0 0 22px;
  letter-spacing: 0.005em;
  text-wrap: balance;
}
.hero-sub {
  font-size: clamp(1rem, 2.2vw, 1.16rem);
  color: var(--muted);
  margin: 0 auto 34px;
  max-width: 620px;
  text-wrap: pretty;
}

/* compact page header (sub-pages) */
.page-head { position: relative; z-index: 1; padding: 152px 0 30px; }
.page-head::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 110px;
  background: linear-gradient(180deg, transparent, var(--ink));
  pointer-events: none;
}
.page-head h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 12px; line-height: 1.12;
}
.page-head p { color: var(--muted); max-width: 640px; margin: 0; }

/* book detail header (transparent — shows the sky behind) */
.detail-head { position: relative; z-index: 1; padding: 128px 0 64px; }
.detail-head::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 120px;
  background: linear-gradient(180deg, transparent, var(--ink));
  pointer-events: none;
}

/* ---------- buttons ---------- */
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 15px;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--amber); color: #10170f; font-weight: 600; }
.btn-primary:hover { background: #ffc266; color: #10170f; }
.btn-ghost { border-color: var(--line-strong); color: var(--cream); }
.btn-ghost:hover { border-color: var(--cream); color: #fff; }
.btn-sm { padding: 9px 18px; font-size: 13.5px; }

/* ---------- layout ---------- */
main { position: relative; z-index: 1; }
.content { position: relative; background: var(--ink); }
.section { padding: 92px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section.alt { background: linear-gradient(180deg, var(--ink), var(--ink-2) 60%, var(--ink)); }

.sec-head { max-width: 660px; margin: 0 0 46px; }
.sec-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.sec-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  margin: 0 0 14px;
  letter-spacing: 0.01em;
}
.sec-head p { color: var(--muted); margin: 0; }
.kicker {
  font-size: 12px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--amber); margin: 0 0 14px;
}

/* ---------- featured ---------- */
.featured {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 52px;
  align-items: center;
}
.featured .cover { width: 100%; }
@media (max-width: 760px) {
  .featured { grid-template-columns: 1fr; gap: 30px; }
  .featured .cover { max-width: 240px; margin: 0 auto; }
}
.featured-title { font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 12px 0 6px; }
.featured-series { font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-2); margin: 0 0 20px; }
.featured-hook { color: var(--muted); margin: 0 0 28px; max-width: 520px; }

/* ---------- covers & cards ---------- */
.cover {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--line);
  background: var(--ink-2);
}
.cover img { width: 100%; height: auto; aspect-ratio: 5 / 8; object-fit: cover; }

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 34px;
}
@media (max-width: 820px) { .book-grid { grid-template-columns: repeat(2, 1fr); gap: 26px; } }
@media (max-width: 520px) { .book-grid { grid-template-columns: 1fr; } }
.book-card { display: flex; flex-direction: column; }
.book-card .cover { margin-bottom: 18px; transition: transform 0.2s ease; }
.book-card:hover .cover { transform: translateY(-4px); }
.book-card h3 { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; margin: 0 0 6px; }
.book-card .sub { font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); margin: 0 0 10px; }
.book-card .hook { color: var(--muted); font-size: 15px; margin: 0 0 14px; }

.price-badge {
  display: inline-block;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
.price-badge.free { border-color: var(--amber); color: var(--amber); background: rgba(255, 178, 74, 0.09); }

/* ---------- about ---------- */
.about-block { display: grid; grid-template-columns: 160px 1fr; gap: 40px; align-items: start; }
.about-block .avatar {
  width: 160px; height: 160px; border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line), 0 16px 40px rgba(0,0,0,.5);
}
.about-block p { color: var(--muted); margin: 0 0 18px; }
.about-block p:last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  .about-block { grid-template-columns: 1fr; gap: 26px; }
  .about-block .avatar { width: 118px; height: 118px; }
}

/* ---------- newsletter ---------- */
.newsletter {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 52px 34px;
  background: rgba(14, 34, 41, 0.55);
}
.newsletter h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 3.6vw, 2.2rem); margin: 0 0 14px; }
.newsletter p { color: var(--muted); margin: 0 0 26px; }
.nl-form { display: flex; gap: 10px; max-width: 460px; margin: 0 auto 16px; }
.nl-form input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(7, 15, 18, 0.7);
  color: var(--cream);
  font-size: 15px;
  font-family: var(--sans);
}
.nl-form input::placeholder { color: var(--muted-2); }
.nl-form input:focus { outline: none; border-color: var(--amber); }
.nl-note { font-size: 12.5px; color: var(--muted-2); margin: 0; }
@media (max-width: 480px) { .nl-form { flex-direction: column; } }

/* ---------- book detail ---------- */
.detail-top {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 54px;
  align-items: start;
}
@media (max-width: 780px) {
  .detail-top { grid-template-columns: 1fr; gap: 32px; }
  .detail-top .cover { max-width: 250px; margin: 0 auto; }
}
.detail-meta { font-size: 12.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-2); margin: 0 0 14px; }
.detail-title { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 4.6vw, 3rem); margin: 0 0 10px; }
.detail-sub { color: var(--muted); margin: 0 0 22px; font-size: 1.02rem; }
.buy-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 0; }
.blurb { margin-top: 66px; max-width: 700px; }
.blurb p { margin: 0 0 20px; }
.blurb p:first-child { font-family: var(--serif); font-size: 1.22rem; line-height: 1.5; color: var(--cream); }
.series-nav { margin-top: 60px; padding-top: 30px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.series-nav a { color: var(--muted); }
.series-nav a:hover { color: var(--amber); }

/* ---------- legal ---------- */
.legal { max-width: 760px; }
.legal h2 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; margin: 40px 0 12px; }
.legal h2:first-of-type { margin-top: 0; }
.legal p, .legal li { color: var(--muted); }
.legal a { color: var(--amber); }

/* ---------- footer ---------- */
footer {
  position: relative;
  z-index: 1;
  background: var(--ink);
  border-top: 1px solid var(--line);
  padding: 44px 0;
  font-size: 13.5px;
  color: var(--muted-2);
}
.foot-inner { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: center; justify-content: space-between; }
.foot-links { display: flex; flex-wrap: wrap; gap: 20px; }
.foot-links a, footer a { color: var(--muted); }
.foot-links a:hover, footer a:hover { color: var(--cream); }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .book-card .cover { transition: none; }
}
