/* ============================================
   KENDALL KING — Thriller Author
   ============================================ */

:root {
  --bg: #0a0a0b;
  --bg-soft: #111113;
  --surface: #16161a;
  --ink: #f4f1ec;
  --ink-dim: #a7a39c;
  --ink-faint: #6b6862;
  --accent: #d92027;        /* blood red */
  --accent-deep: #8e1117;
  --line: rgba(244, 241, 236, 0.12);
  --maxw: 1320px;
  --nav-h: 70px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a, button, input, summary, label { cursor: none; }
::selection { background: var(--accent); color: #fff; }

h1, h2, h3 { font-family: 'Archivo', sans-serif; font-weight: 900; line-height: 0.95; letter-spacing: -0.02em; }

/* ---------- Film grain ---------- */
.grain {
  position: fixed; inset: -150%;
  z-index: 9990; pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.5s steps(2) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0,0); } 50% { transform: translate(-3%, 2%); } 100% { transform: translate(2%,-2%); }
}

/* ---------- Custom cursor ---------- */
.cursor, .cursor-dot { position: fixed; top: 0; left: 0; z-index: 9995; pointer-events: none; border-radius: 50%; mix-blend-mode: difference; }
.cursor {
  width: 38px; height: 38px; border: 1px solid #fff;
  transform: translate(-50%, -50%);
  transition: width .3s var(--ease), height .3s var(--ease), background .3s var(--ease);
}
.cursor-dot { width: 5px; height: 5px; background: #fff; transform: translate(-50%, -50%); }
.cursor.is-hover { width: 64px; height: 64px; background: #fff; }
@media (hover: none) {
  .cursor, .cursor-dot { display: none; }
  body, a, button, input, summary, label { cursor: auto; }
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--accent); z-index: 9994; transition: width .1s linear;
  box-shadow: 0 0 12px var(--accent);
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem clamp(1.2rem, 4vw, 3rem);
  transition: padding .4s var(--ease), background .4s var(--ease), backdrop-filter .4s;
}
/* scrim so nav stays readable over the hero image before scrolling */
.nav::before {
  content: ''; position: absolute; inset: 0 0 -34px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(10,10,11,.7), rgba(10,10,11,.25) 70%, transparent);
  opacity: 1; transition: opacity .4s var(--ease);
}
.nav.scrolled::before { opacity: 0; }
.nav.scrolled {
  padding: .85rem clamp(1.2rem, 4vw, 3rem);
  background: rgba(10,10,11,0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__logo img { height: 20px; width: auto; transition: opacity .3s; }
.nav__logo:hover img { opacity: .7; }
.nav__cta { font-size: .8rem; }

/* ---------- Buttons ---------- */
.btn {
  --pad: .85rem 1.6rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: var(--pad); font-family: 'Inter', sans-serif; font-size: .85rem; font-weight: 600;
  letter-spacing: .03em; border-radius: 100px; border: 1px solid var(--ink);
  position: relative; overflow: hidden; transition: color .4s var(--ease), border-color .4s; z-index: 0;
}
.btn::after {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--ink);
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease);
}
.btn:hover { color: var(--bg); }
.btn:hover::after { transform: scaleX(1); }
.btn--solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--solid::after { background: #fff; }
.btn--solid:hover { color: var(--accent); border-color: #fff; }
.btn--ghost { border-color: var(--line); }
.btn--ghost::after { background: var(--ink); }

/* ---------- Sections base ---------- */
.section { padding: clamp(5rem, 12vh, 11rem) clamp(1.2rem, 5vw, 4rem); position: relative; }
.section__title { font-size: clamp(2.2rem, 6vw, 5rem); text-transform: uppercase; }

/* ---------- HERO (image only, as on the live site) ---------- */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; display: flex; align-items: flex-end; }
.hero__media { position: absolute; inset: -8% 0; z-index: 0; will-change: transform; }
.hero__img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; transform: scale(1.08); animation: heroZoom 14s var(--ease-out) forwards; }
@keyframes heroZoom { to { transform: scale(1); } }
.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg) 1%, rgba(10,10,11,.1) 30%, rgba(10,10,11,0) 55%),
    radial-gradient(120% 80% at 30% 100%, rgba(217,32,39,.10), transparent 60%);
}
.hero__scroll { position: absolute; right: clamp(1.2rem, 5vw, 4rem); bottom: clamp(5rem,12vh,8rem); z-index: 3; display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.hero__scroll-text { writing-mode: vertical-rl; font-size: .72rem; letter-spacing: .25em; text-transform: uppercase; color: var(--ink-dim); }
.hero__scroll-line { width: 1px; height: 60px; background: linear-gradient(var(--accent), transparent); position: relative; overflow: hidden; }
.hero__scroll-line::after { content:''; position:absolute; top:0; left:0; width:100%; height:40%; background: var(--ink); animation: scrollDot 1.8s var(--ease) infinite; }
@keyframes scrollDot { 0%{transform:translateY(-100%)} 100%{transform:translateY(250%)} }
@media (max-width: 768px){
  .hero__scroll{ display:none; }
  /* parallax is disabled on touch devices (script.js), so no overscan needed */
  .hero__media { inset: 0; }
}

.hero__marquee { position: absolute; bottom: 0; left: 0; width: 100%; z-index: 2; border-top: 1px solid var(--line); background: rgba(10,10,11,.4); overflow: hidden; }
.marquee__track { display: flex; white-space: nowrap; will-change: transform; animation: marquee 22s linear infinite; }
.marquee__track span { font-family: 'Archivo Black'; font-size: .9rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); padding: .6rem 0; }
@keyframes marquee { to { transform: translateX(-33.33%); } }

/* ---------- BOOK ---------- */
.book { background: linear-gradient(var(--bg), var(--bg-soft)); overflow: hidden; /* .book__glow bleeds past the section; without this it widens the mobile viewport */ }
.book__grid { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.book__title { font-size: clamp(2.4rem, 6.5vw, 5.4rem); line-height: 0.92; letter-spacing: -0.03em; }
.book__title .line { display: block; overflow: hidden; }
.book__title .line > span { display: block; transform: translateY(100%); }
.book__title .accent > span { color: var(--accent); }
.book__tagline { font-family: 'Archivo'; font-weight: 700; font-size: clamp(1rem, 1.8vw, 1.35rem); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); margin-top: 1.4rem; }
.book__quote { font-family: 'Archivo'; font-weight: 500; font-size: clamp(1.2rem, 2.2vw, 1.7rem); line-height: 1.35; color: var(--ink-dim); border-left: 2px solid var(--accent); padding-left: 1.2rem; margin: 1.2rem 0 2rem; }
.book__visual { position: relative; }
.book__cover { position: relative; border-radius: 14px; overflow: hidden; box-shadow: 0 40px 80px -30px rgba(0,0,0,.9); transform: perspective(1000px) rotateY(-6deg); transition: transform .6s var(--ease); }
.book__cover:hover { transform: perspective(1000px) rotateY(0deg); }
.book__cover img { width: 100%; aspect-ratio: 1/1.05; object-fit: cover; }
.book__cover-tag { position: absolute; top: 1rem; left: 1rem; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: .45rem .9rem; border-radius: 100px; }
.book__glow { position: absolute; inset: -20%; z-index: -1; background: radial-gradient(circle, rgba(217,32,39,.25), transparent 65%); filter: blur(40px); }
@media (max-width: 980px) {
  .book__grid { grid-template-columns: 1fr; }
  .book__visual { max-width: 420px; margin: 0 auto; order: -1; }
}

/* ---------- QUOTE ---------- */
.quote { background: var(--bg-soft); text-align: center; }
.quote blockquote {
  font-family: 'Archivo'; font-weight: 700; font-size: clamp(1.5rem, 3.6vw, 2.9rem);
  line-height: 1.2; letter-spacing: -0.01em; max-width: 56rem; margin: 0 auto; text-wrap: balance;
}
.quote blockquote .dim { color: var(--ink-dim); }
.quote blockquote .red { color: var(--accent); }

/* ---------- ABOUT ---------- */
.about { background: linear-gradient(var(--bg-soft), var(--bg)); }
.about__grid { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
.about__copy p { color: var(--ink-dim); margin-bottom: 1.2rem; max-width: 46ch; }
.about__copy .section__title { margin-bottom: 1.6rem; }
.about__visual { position: relative; }
.about__photo { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 40px 80px -30px rgba(0,0,0,.9); }
.about__photo img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .9s var(--ease); }
.about__photo:hover img { transform: scale(1.04); }
@media (max-width: 980px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__visual { max-width: 480px; margin: 0 auto; }
}

/* ---------- JOURNEY ---------- */
.journey { background: var(--bg); }
.journey__grid { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
.journey__socials { display: flex; gap: 1rem; margin-top: 2.2rem; }
.journey__socials a {
  width: 54px; height: 54px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; color: var(--ink-dim);
  transition: color .3s, border-color .3s, background .3s, transform .3s var(--ease);
}
.journey__socials a:hover { color: #fff; border-color: var(--accent); background: rgba(217,32,39,.14); transform: translateY(-4px); }
.journey__socials svg { width: 20px; height: 20px; fill: currentColor; }
.journey__photo { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 40px 80px -30px rgba(0,0,0,.9); }
.journey__photo img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .9s var(--ease); }
.journey__photo:hover img { transform: scale(1.04); }
@media (max-width: 980px) {
  .journey__grid { grid-template-columns: 1fr; }
  .journey__photo { max-width: 480px; margin: 0 auto; }
}

/* ---------- INNER CIRCLE ---------- */
.circle { background: var(--bg-soft); overflow: hidden; }
.circle::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 90% at 80% 20%, rgba(217,32,39,.12), transparent 60%);
}
.circle__inner { position: relative; max-width: 680px; margin: 0 auto; }
.circle__eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1.6rem;
}
.circle__inner > p { color: var(--ink-dim); margin: 1.4rem 0 2rem; max-width: 44ch; }
.circle__inner > p strong { color: var(--ink); font-weight: 600; }
.perks { list-style: none; display: grid; gap: .7rem; margin-bottom: 2.5rem; }
.perks li { display: flex; align-items: center; gap: .8rem; font-size: .95rem; color: var(--ink); }
.perks li::before {
  content: ''; flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 12px rgba(217,32,39,.8);
}
.signup {
  display: grid; gap: .9rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.6rem;
}
.signup .row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 560px) { .signup .row { grid-template-columns: 1fr; } }
.field label {
  display: block; font-size: .68rem; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: .45rem;
}
.field input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); font-family: 'Inter', sans-serif; font-size: .95rem;
  padding: .85rem 1rem; outline: none; transition: border-color .25s, box-shadow .25s;
}
.field input::placeholder { color: var(--ink-faint); }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217,32,39,.18); }
.signup .btn { width: 100%; padding: 1rem; }
.signup .fine { font-size: .74rem; color: var(--ink-faint); text-align: center; }
.signup.success { text-align: center; padding: 2.6rem 1.6rem; }
.signup.success h3 { font-family: 'Archivo Black'; text-transform: uppercase; font-size: 1.4rem; margin-bottom: .6rem; }
.signup.success p { color: var(--ink-dim); font-size: .9rem; }
.signup.success .tick {
  width: 54px; height: 54px; margin: 0 auto 1.1rem; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 0 40px rgba(217,32,39,.45); font-size: 1.4rem;
}

/* ---------- FOOTER ---------- */
.footer { padding: clamp(3rem, 8vh, 6rem) clamp(1.2rem, 5vw, 4rem) 2rem; border-top: 1px solid var(--line); overflow: hidden; }
.footer__big { display: flex; justify-content: center; margin-bottom: 3rem; }
.footer__big img { width: min(90%, 900px); opacity: .85; }
.footer__row { max-width: var(--maxw); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); }
.footer__row a { transition: color .3s; }
.footer__row a:hover { color: var(--accent); }

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .1s; }
.reveal.d2 { transition-delay: .2s; }
.reveal.d3 { transition-delay: .3s; }
.reveal-mask > span { transition: transform 1s var(--ease); }
.reveal-mask.in > span { transform: translateY(0) !important; }
.reveal-words .word { display: inline-block; overflow: hidden; vertical-align: top; }
.reveal-words .word > span { display: inline-block; transform: translateY(105%); transition: transform .8s var(--ease); }
.reveal-words.in .word > span { transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav__cta { --pad: .65rem 1.1rem; font-size: .72rem; }
  .footer__row { justify-content: center; text-align: center; }
  /* animating a full-screen fixed layer is costly on mobile GPUs */
  .grain { animation: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal, .reveal-mask > span, .reveal-words .word > span { opacity: 1 !important; transform: none !important; }
  .hero__img { transform: none; }
  html { scroll-behavior: auto; }
}
