/* ================= Karan M'Nair / E.L. Chase — site styles ================= */

:root {
  --bg: #08080a;
  --bg-raised: #111114;
  --bg-card: #16161a;
  --line: #2a2a30;
  --text: #e9e5db;
  --text-dim: #9a958c;
  --text-faint: #605c56;

  --blood: #8c1010;
  --blood-bright: #c81f2b;
  --blood-glow: rgba(200, 31, 43, 0.35);

  --gold: #c9a44c;
  --gold-bright: #e6c874;
  --gold-glow: rgba(230, 200, 116, 0.3);

  --serif: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --display: "Playfair Display", "Cormorant Garamond", Georgia, serif;
  --mono: "Special Elite", "Courier New", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* film-grain texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; margin: 0 0 0.5em; letter-spacing: 0.01em; }

.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.eyebrow.horror { color: var(--blood-bright); }
.eyebrow.thriller { color: var(--gold-bright); }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(8, 8, 10, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand {
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}
.brand strong { font-weight: 700; }
.brand .split-name { color: var(--blood-bright); }
.brand .divider { color: var(--text-faint); font-size: 0.9rem; }
.brand .split-name.chase { color: var(--gold-bright); }

.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  padding: 10px 16px;
  border-radius: 3px;
  transition: color 0.2s ease, background 0.2s ease;
  position: relative;
}
.main-nav a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.main-nav a.active { color: var(--text); }
.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: 4px;
  height: 2px;
  background: linear-gradient(90deg, var(--blood-bright), var(--gold-bright));
}
.main-nav a.nav-horror.active::after { background: var(--blood-bright); }
.main-nav a.nav-thriller.active::after { background: var(--gold-bright); }

.nav-toggle { display: none; }

/* ---------------- Hero / generic section ---------------- */
.hero {
  position: relative;
  padding: 120px 0 90px;
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%, var(--blood-glow), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 0%, var(--gold-glow), transparent 60%);
  opacity: 0.6;
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero .kicker {
  font-family: var(--mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1.05;
  margin-bottom: 22px;
}
.hero h1 .red { color: var(--blood-bright); }
.hero h1 .amber { color: var(--gold-bright); }
.hero p.lede {
  max-width: 640px;
  margin: 0 auto;
  font-size: 1.15rem;
  color: var(--text-dim);
  font-family: var(--serif);
  font-style: italic;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  padding: 15px 30px;
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: all 0.25s ease;
  cursor: pointer;
  background: transparent;
}
.btn-horror { border-color: var(--blood); color: var(--blood-bright); }
.btn-horror:hover { background: var(--blood); color: #fff; box-shadow: 0 0 30px var(--blood-glow); }
.btn-thriller { border-color: var(--gold); color: var(--gold-bright); }
.btn-thriller:hover { background: var(--gold); color: #14110a; box-shadow: 0 0 30px var(--gold-glow); }
.btn-ghost { color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }
.btn-row { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }

/* ---------------- Sections ---------------- */
section.block { padding: 100px 0; border-bottom: 1px solid var(--line); }
section.block.tight { padding: 70px 0; }
section.block:last-of-type { border-bottom: none; }

.block-head { text-align: center; max-width: 720px; margin: 0 auto 60px; }
.block-head h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
.block-head p { color: var(--text-dim); font-family: var(--serif); font-size: 1.1rem; }

/* Split personas section */
.personas { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.persona {
  background: var(--bg);
  padding: 70px 50px;
  position: relative;
  overflow: hidden;
}
.persona::before {
  content: attr(data-glyph);
  position: absolute;
  right: -20px; top: -40px;
  font-family: var(--display);
  font-size: 12rem;
  font-weight: 700;
  opacity: 0.05;
  line-height: 1;
  pointer-events: none;
}
.persona.horror::before { color: var(--blood-bright); }
.persona.thriller::before { color: var(--gold-bright); }
.persona h3 { font-size: 2rem; margin-bottom: 4px; }
.persona.horror h3 { color: var(--blood-bright); }
.persona.thriller h3 { color: var(--gold-bright); }
.persona .role { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.72rem; color: var(--text-dim); margin-bottom: 26px; display: block; }
.persona p { color: var(--text-dim); margin-bottom: 16px; max-width: 46ch; }
.persona p:last-of-type { margin-bottom: 30px; }
.persona strong { color: var(--text); font-weight: 600; }

/* Author photo */
.author-photo-ring {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  margin: 0 auto 30px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #2b1c14, #0c0806 70%);
  box-shadow: 0 0 0 6px #17100b, 0 0 0 7px var(--line), 0 20px 40px -18px rgba(0,0,0,0.7);
}
.author-photo-ring img {
  position: absolute;
  width: 417px;
  height: auto;
  max-width: none;
  left: -146px;
  top: 10px;
  display: block;
}

/* Prose blocks (from homepage copy) */
.prose { max-width: 720px; margin: 0 auto; text-align: center; }
.prose p { color: var(--text-dim); font-size: 1.08rem; margin: 0 0 1.1em; }
.prose p.emph { color: var(--text); font-family: var(--serif); font-style: italic; font-size: 1.3rem; }
.prose .signoff { margin-top: 40px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.85rem; color: var(--text-faint); }

/* Book grid */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 36px;
}
.book-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.book-card:hover { transform: translateY(-6px); }
.pen-nair .book-card:hover { border-color: var(--blood); box-shadow: 0 18px 40px -18px var(--blood-glow); }
.pen-chase .book-card:hover { border-color: var(--gold); box-shadow: 0 18px 40px -18px var(--gold-glow); }
.book-card .cover-wrap { aspect-ratio: 2 / 3; overflow: hidden; background: #000; }
.book-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.book-card:hover img { transform: scale(1.06); }
.book-card .meta { padding: 16px 16px 20px; }
.book-card .book-no { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }
.pen-nair .book-no { color: var(--blood-bright); }
.pen-chase .book-no { color: var(--gold-bright); }
.book-card h4 { font-size: 1.08rem; margin: 6px 0 6px; line-height: 1.25; }
.book-card .tagline { font-family: var(--serif); font-style: italic; font-size: 0.9rem; color: var(--text-dim); }

/* Book detail page */
.book-detail { display: grid; grid-template-columns: 340px 1fr; gap: 64px; align-items: start; }
.book-detail .cover-frame {
  border: 1px solid var(--line);
  padding: 14px;
  background: var(--bg-card);
  position: sticky; top: 110px;
}
.book-detail .cover-frame img { width: 100%; }
.book-detail .series-tag { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.72rem; margin-bottom: 14px; display: inline-block; }
.pen-nair .series-tag { color: var(--blood-bright); }
.pen-chase .series-tag { color: var(--gold-bright); }
.book-detail h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 10px; }
.book-detail .tagline-large { font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--text-dim); margin-bottom: 34px; }
.book-detail .synopsis p { color: var(--text-dim); margin-bottom: 1.3em; font-size: 1.05rem; }
.book-detail .synopsis p:first-of-type { color: var(--text); font-size: 1.15rem; }
.book-detail .cta-row { margin-top: 40px; display: flex; gap: 16px; flex-wrap: wrap; }

.crumb { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; color: var(--text-faint); margin-bottom: 40px; }
.crumb a { color: var(--text-dim); }
.crumb a:hover { color: var(--text); }

.next-book { margin-top: 100px; padding-top: 50px; border-top: 1px solid var(--line); }
.next-book .label { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.7rem; color: var(--text-faint); margin-bottom: 18px; }

/* Rights inquiry form */
.rights-form { display: flex; flex-direction: column; gap: 22px; }
.form-row { display: flex; flex-direction: column; gap: 8px; }
.form-row label { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; color: var(--text-dim); }
.form-row .optional { text-transform: none; letter-spacing: 0; color: var(--text-faint); }
.form-row input, .form-row select, .form-row textarea {
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  padding: 13px 16px;
  border-radius: 2px;
  resize: vertical;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.rights-form .btn { align-self: flex-start; }
.rights-form .btn:disabled { opacity: 0.6; cursor: not-allowed; }
.form-status { font-family: var(--mono); font-size: 0.82rem; margin: 0; min-height: 1.2em; }
.form-status.success { color: var(--gold-bright); }
.form-status.error { color: var(--blood-bright); }

/* About / warning section */
.warning-block { text-align: center; }
.warning-block .prose p.emph { font-size: 1.15rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 50px 0 40px;
  text-align: center;
}
.site-footer .brand { justify-content: center; margin-bottom: 14px; }
.site-footer p { color: var(--text-faint); font-size: 0.85rem; font-family: var(--mono); letter-spacing: 0.04em; }
.site-footer .foot-links { margin-top: 14px; display: flex; gap: 24px; justify-content: center; }
.site-footer .foot-links a { color: var(--text-dim); font-size: 0.8rem; }
.site-footer .foot-links a:hover { color: var(--text); }

/* Responsive */
@media (max-width: 860px) {
  .personas { grid-template-columns: 1fr; }
  .book-detail { grid-template-columns: 1fr; }
  .book-detail .cover-frame { position: static; max-width: 280px; margin: 0 auto; }
  .main-nav { position: fixed; top: 76px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 10px 20px 20px; display: none; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 14px 6px; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: block; background: none; border: none; color: var(--text); font-size: 1.6rem; cursor: pointer; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; }
}

@media (max-width: 560px) {
  .hero { padding: 90px 0 60px; }
  section.block { padding: 60px 0; }
  .persona { padding: 50px 28px; }
}
