/* ==========================================================================
   Tessa F. Grayson — Author Website
   Design system: cinematic, dark, editorial. Anthracite / black / warm grey
   with a single bordeaux accent. Inspired by A24, Netflix, Penguin Random
   House digital properties.
   ========================================================================== */

@import url('../fonts/fonts.css');

:root {
  /* Colors */
  --black: #0a0908;
  --anthracite-900: #121110;
  --anthracite-800: #1a1817;
  --anthracite-700: #242220;
  --anthracite-600: #322f2c;
  --grey-500: #6f6a65;
  --grey-400: #8a8480;
  --grey-300: #a8a29c;
  --grey-200: #c9c4bf;
  --grey-100: #e7e3df;
  --white: #f6f3ef;
  --bordeaux-900: #3d0a12;
  --bordeaux-700: #5c0f1a;
  --bordeaux-600: #7a1522;
  --bordeaux-500: #8f1c29;
  --bordeaux-400: #a8303d;

  /* Semantic */
  --bg: var(--black);
  --bg-raised: var(--anthracite-800);
  --text: var(--grey-100);
  --text-muted: var(--grey-400);
  --accent: var(--bordeaux-500);
  --accent-bright: var(--bordeaux-400);
  --border: rgba(246, 243, 239, 0.1);

  /* Type */
  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing / layout */
  --container: 1240px;
  --gutter: clamp(1.5rem, 5vw, 4rem);
  --radius: 2px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.7s;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
body, h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--white);
  line-height: 1.1;
}
h1 { font-size: clamp(2.6rem, 6vw, 5.2rem); font-weight: 350; }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
h4 { font-size: 1.15rem; letter-spacing: 0.02em; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-bright);
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--accent-bright);
}

p.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--grey-200); line-height: 1.7; }
.text-muted { color: var(--text-muted); }
.italic { font-style: italic; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 0.95em 2em;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: all 0.4s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(246, 243, 239, 0.35);
}
.btn-ghost:hover { border-color: var(--white); background: rgba(246, 243, 239, 0.06); }

.btn-dark {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}
.btn-dark:hover { background: var(--anthracite-700); }

.btn-sm { padding: 0.7em 1.5em; font-size: 0.72rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.6rem 0;
  transition: background 0.5s var(--ease), padding 0.5s var(--ease), border-color 0.5s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(10, 9, 8, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 1rem 0;
  border-bottom-color: var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }

.brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  color: var(--white);
}
.brand strong { font-weight: 500; }

.nav-primary { display: flex; align-items: center; gap: 2.4rem; }
.nav-primary a {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey-200);
  position: relative;
  padding: 0.3rem 0;
  transition: color 0.3s var(--ease);
}
.nav-primary a::after {
  content: '';
  position: absolute; left: 0; right: 100%; bottom: -2px;
  height: 1px;
  background: var(--accent-bright);
  transition: right 0.35s var(--ease);
}
.nav-primary a:hover, .nav-primary a[aria-current="page"] { color: var(--white); }
.nav-primary a:hover::after, .nav-primary a[aria-current="page"]::after { right: 0; }

.nav-toggle { display: none; }
.nav-actions { display: flex; align-items: center; gap: 1.2rem; }

@media (max-width: 980px) {
  .nav-primary {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--anthracite-900);
    flex-direction: column;
    justify-content: center;
    gap: 2.2rem;
    transform: translateY(-100%);
    transition: transform 0.5s var(--ease);
    z-index: 90;
  }
  .nav-primary.is-open { transform: translateY(0); }
  .nav-primary a { font-size: 1.1rem; }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 26px;
    z-index: 110;
    position: relative;
  }
  .nav-toggle span { display: block; height: 1px; width: 100%; background: var(--white); transition: transform 0.35s var(--ease), opacity 0.35s var(--ease); }
  .nav-toggle.is-active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle.is-active span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .nav-actions .btn-sm { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--black);
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 20%;
  will-change: transform;
}
.hero-media::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,9,8,0.35) 0%, rgba(10,9,8,0.35) 40%, rgba(10,9,8,0.96) 100%),
    linear-gradient(90deg, rgba(10,9,8,0.75) 0%, rgba(10,9,8,0.05) 55%);
}
.hero-content {
  position: relative;
  z-index: 1;
  padding: 0 var(--gutter) 6.5rem;
  max-width: 900px;
}
.hero-content h1 { margin: 1.1rem 0 1.6rem; }
.hero-content .lead { max-width: 560px; margin-bottom: 2.4rem; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-scroll {
  position: absolute;
  bottom: 2.4rem; right: var(--gutter);
  z-index: 1;
  display: flex; align-items: center; gap: 0.7rem;
  font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--grey-300);
}
.hero-scroll .line { width: 1px; height: 34px; background: linear-gradient(var(--grey-300), transparent); animation: scrollpulse 2.2s ease-in-out infinite; }
@keyframes scrollpulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

/* ---------- Sections ---------- */
section { position: relative; padding: clamp(4.5rem, 9vw, 8rem) 0; }
.section-tight { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-head { max-width: 720px; margin-bottom: 3.5rem; }
.section-head h2 { margin-top: 0.8rem; }
.bg-raised { background: var(--anthracite-900); }
.bg-black { background: var(--black); }
.divider { height: 1px; background: var(--border); border: none; margin: 0; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-stagger > * { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal-stagger.is-visible > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.15s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.25s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.35s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.45s; }

/* ---------- Book cards ---------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.4rem;
}
@media (max-width: 1080px) { .book-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .book-grid { grid-template-columns: 1fr; } }

.book-card { display: flex; flex-direction: column; }
.book-cover {
  position: relative;
  aspect-ratio: 5 / 8;
  overflow: hidden;
  background: var(--anthracite-800);
  margin-bottom: 1.4rem;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.7);
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.book-card:hover .book-cover img { transform: scale(1.045); }
.book-card h3 { font-size: 1.3rem; margin-bottom: 0.3rem; }
.book-card .book-tagline { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 0.9rem; font-style: italic; }
.book-card .book-actions { display: flex; gap: 0.7rem; margin-top: auto; padding-top: 1rem; flex-wrap: wrap; }
.book-langs { display: flex; gap: 0.4rem; margin-top: 0.7rem; }
.lang-pill {
  font-size: 0.65rem; letter-spacing: 0.08em; font-weight: 600;
  color: var(--grey-300); border: 1px solid var(--border); border-radius: 999px;
  padding: 0.25em 0.7em;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--anthracite-900); border-top: 1px solid var(--border); padding: 5rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 3rem; margin-bottom: 3.5rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { color: var(--grey-300); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 1.2rem; font-family: var(--font-body); }
.footer-grid ul li { margin-bottom: 0.7rem; }
.footer-grid a { color: var(--grey-300); font-size: 0.92rem; transition: color 0.3s; }
.footer-grid a:hover { color: var(--white); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 2rem; border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--grey-500); flex-wrap: wrap; gap: 1rem; }
.social-row { display: flex; gap: 1.1rem; }
.social-row a { width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: border-color 0.3s, background 0.3s; }
.social-row a:hover { border-color: var(--accent-bright); background: rgba(143,28,41,0.15); }
.social-row svg { width: 16px; height: 16px; fill: var(--grey-200); }

/* ---------- Forms ---------- */
.form-field { margin-bottom: 1.3rem; }
.form-field label { display: block; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey-400); margin-bottom: 0.6rem; }
.form-field input, .form-field textarea {
  width: 100%; background: transparent; border: 1px solid var(--border);
  padding: 0.9em 1em; border-radius: var(--radius); color: var(--white);
  transition: border-color 0.3s;
}
.form-field input:focus, .form-field textarea:focus { outline: none; border-color: var(--accent-bright); }
.form-field textarea { min-height: 140px; resize: vertical; }
.form-note { font-size: 0.78rem; color: var(--grey-500); margin-top: 0.8rem; }

.newsletter-box {
  background: linear-gradient(135deg, var(--bordeaux-900) 0%, var(--anthracite-900) 70%);
  border: 1px solid var(--border);
  padding: clamp(2.4rem, 5vw, 4.5rem);
  border-radius: 4px;
  text-align: center;
}
.newsletter-form { display: flex; gap: 0.8rem; max-width: 480px; margin: 2rem auto 0; }
.newsletter-form input { flex: 1; background: rgba(246,243,239,0.06); border: 1px solid rgba(246,243,239,0.2); padding: 0.95em 1.2em; border-radius: var(--radius); color: var(--white); }
.newsletter-form input::placeholder { color: var(--grey-400); }
@media (max-width: 540px) { .newsletter-form { flex-direction: column; } }

/* ---------- Utility layout ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }

.breadcrumbs { font-size: 0.75rem; color: var(--grey-500); letter-spacing: 0.05em; margin-bottom: 1.6rem; }
.breadcrumbs a { color: var(--grey-400); }
.breadcrumbs a:hover { color: var(--white); }
.breadcrumbs .sep { margin: 0 0.5em; }

.page-hero { padding: 10.5rem 0 4.5rem; background: var(--anthracite-900); border-bottom: 1px solid var(--border); }
.page-hero .eyebrow { margin-bottom: 1rem; }

.pull-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.5;
  color: var(--white);
  border-left: 2px solid var(--accent);
  padding-left: 1.8rem;
  margin: 2.5rem 0;
}

.badge {
  display: inline-block;
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
  color: var(--accent-bright); border: 1px solid var(--bordeaux-600); border-radius: 999px;
  padding: 0.4em 1em; margin-bottom: 1rem;
}

.stat { text-align: center; }
.stat .num { font-family: var(--font-display); font-size: clamp(2.2rem, 4vw, 3rem); color: var(--white); }
.stat .label { font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin-top: 0.4rem; }

/* World map / languages */
.world-map { position: relative; max-width: 760px; margin: 0 auto; }
.world-map svg { width: 100%; height: auto; }
.world-map .continent { fill: var(--anthracite-700); stroke: var(--anthracite-600); stroke-width: 0.6; transition: fill 0.4s; }
.map-pin { cursor: default; }
.map-pin circle.dot { fill: var(--accent-bright); }
.map-pin circle.pulse { fill: var(--accent-bright); opacity: 0.35; transform-origin: center; animation: pulse 2.6s ease-out infinite; }
.map-pin text { fill: var(--grey-100); font-family: var(--font-body); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
@keyframes pulse { 0% { transform: scale(1); opacity: 0.45; } 100% { transform: scale(3.4); opacity: 0; } }
.lang-legend { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; margin-top: 2.4rem; }
.lang-legend .lang-pill { padding: 0.5em 1.1em; font-size: 0.72rem; }

/* FAQ accordion */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q { display: flex; align-items: center; justify-content: space-between; padding: 1.6rem 0; cursor: pointer; }
.faq-q h3 { font-size: 1.05rem; }
.faq-q .plus { font-size: 1.4rem; color: var(--accent-bright); transition: transform 0.4s var(--ease); flex-shrink: 0; margin-left: 1.5rem; }
.faq-item.is-open .faq-q .plus { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.5s var(--ease); }
.faq-a p { padding-bottom: 1.6rem; color: var(--grey-300); max-width: 65ch; }

/* Timeline (News) */
.timeline-item { display: grid; grid-template-columns: 140px 1fr; gap: 2rem; padding: 2.2rem 0; border-top: 1px solid var(--border); }
.timeline-item:last-child { border-bottom: 1px solid var(--border); }
.timeline-date { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-bright); padding-top: 0.2rem; }
@media (max-width: 640px) { .timeline-item { grid-template-columns: 1fr; gap: 0.5rem; } }

/* Press kit */
.asset-card { border: 1px solid var(--border); padding: 1.6rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.asset-card .name { font-weight: 500; color: var(--white); }
.asset-card .meta { font-size: 0.78rem; color: var(--text-muted); }

/* Table (editions) */
.edition-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.edition-table th, .edition-table td { text-align: left; padding: 1rem 0.5rem; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.edition-table th { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); font-weight: 500; }

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--white); padding: 1em 1.5em;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* Utility */
.mt-0 { margin-top: 0; }
.center { text-align: center; margin-left: auto; margin-right: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
