/* ==========================================================================
   ZTRATAX — Buku I: Warisan Hitam
   Stylesheet utama · tema kristal hitam + amber
   ========================================================================== */

:root {
  --bg:          #0a0a0f;
  --bg-alt:      #101018;
  --surface:     #14141c;
  --border:      #2a2a35;
  --text:        #e8e6e0;
  --muted:       #8a8898;
  --accent:      #d4a04a;
  --accent-soft: #f0c060;
  --accent-glow: rgba(212, 160, 74, 0.15);
  --serif:       'Cormorant Garamond', Georgia, serif;
  --sans:        'Inter', system-ui, -apple-system, sans-serif;
  --max-width:   1100px;
  --read-width:  680px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent-soft); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent-soft);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.8;
}

.nav-links a:hover { opacity: 1; color: var(--accent-soft); }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 800px) {
  .hero { grid-template-columns: 320px 1fr; align-items: center; gap: 3rem; padding: 5rem 1.5rem 4rem; }
}

.hero-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  max-width: 320px;
  margin: 0 auto;
  width: 100%;
  background: linear-gradient(160deg, #1a1a24 0%, #0d0d14 100%);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(212, 160, 74, 0.1);
}

.crystal {
  position: absolute;
  width: 120px;
  height: 200px;
  background: linear-gradient(145deg, #1a1a24, #050508);
  clip-path: polygon(50% 0%, 100% 30%, 85% 100%, 15% 100%, 0% 30%);
  opacity: 0.85;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  box-shadow: 0 0 60px rgba(212, 160, 74, 0.2), inset 0 0 30px rgba(212, 160, 74, 0.05);
}

.crystal::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  width: 1px; height: 100%;
  background: linear-gradient(180deg, transparent, rgba(212, 160, 74, 0.3), transparent);
  transform: translateX(-50%);
}

.cover-text {
  position: absolute;
  bottom: 1.5rem;
  left: 0; right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  z-index: 2;
}

.cover-series {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--accent);
  opacity: 0.9;
}

.cover-title {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.cover-subtitle {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.2;
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.hero-content h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.premise {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.7;
  color: #c8c6c0;
  margin-bottom: 2rem;
  max-width: 560px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.meta-line {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.2s;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: #0a0a0f;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-soft);
  background: var(--accent-glow);
}

/* ---------- Sections ---------- */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section-alt {
  max-width: 100%;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4rem 1.5rem;
}

.section-alt > * { max-width: var(--max-width); margin-left: auto; margin-right: auto; }

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-align: center;
}

.section-lead {
  text-align: center;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  font-size: 1rem;
}

/* ---------- Chapter grid ---------- */
.chapter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 700px) {
  .chapter-grid { grid-template-columns: repeat(3, 1fr); }
}

.chapter-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.75rem 1.5rem;
  color: var(--text);
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.chapter-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s;
}

.chapter-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.chapter-card:hover::before { transform: scaleY(1); }

.chapter-num {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.chapter-card h3 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0.5rem 0 0.5rem;
  line-height: 1.25;
}

.chapter-card p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.chapter-read {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-soft);
}

/* ---------- Journey map ---------- */
.journey {
  list-style: none;
  counter-reset: journey;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  max-width: 700px;
  margin: 0 auto;
}

.journey li {
  counter-increment: journey;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem 1.25rem 1rem 3rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.journey li::before {
  content: counter(journey);
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.4rem; height: 1.4rem;
  background: var(--accent);
  color: #0a0a0f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.journey strong {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 600;
}

.journey span {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- About grid ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 700px) {
  .about-grid { grid-template-columns: repeat(3, 1fr); }
}

.about-grid h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--accent-soft);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.about-grid h3:not(:first-child) { margin-top: 1.5rem; }

.about-grid p {
  font-size: 0.95rem;
  color: #b8b6b0;
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.about-grid .btn { margin-top: 0.5rem; }

/* ---------- Reader (chapter pages) ---------- */
.reader {
  max-width: var(--read-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.chapter-header {
  text-align: center;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.chapter-header h1 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.chapter-meta {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.prose {
  font-family: var(--serif);
  font-size: 1.18rem;
  line-height: 1.75;
  color: #d8d6d0;
}

.prose p {
  margin-bottom: 1.4rem;
  text-align: justify;
  hyphens: auto;
}

.prose p:first-of-type::first-letter {
  font-size: 3.2rem;
  float: left;
  line-height: 0.9;
  padding: 0.15rem 0.5rem 0 0;
  color: var(--accent);
  font-weight: 700;
}

.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.chapter-nav .btn { font-size: 0.85rem; padding: 0.65rem 1.2rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: #050508;
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-inner p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.footer-inner strong { color: var(--text); font-weight: 600; }

.footer-small { font-size: 0.75rem !important; margin-top: 0.5rem; }

/* ---------- Mobile tweaks ---------- */
@media (max-width: 500px) {
  .prose { font-size: 1.08rem; }
  .prose p { text-align: left; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.82rem; }
  .chapter-nav { flex-direction: column; }
  .chapter-nav .btn { width: 100%; text-align: center; }
}