/* ============================================================
   JOHN DURGIN AUTHOR — Custom Site
   Color: Black / Blood Red / White  |  L.F.O.D. Press
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400;1,700&family=Work+Sans:wght@300;400;500;600;700&display=swap');

/* ---- Design Tokens ---- */
:root {
  --color-bg:        #0a0a0a;
  --color-surface:   #111111;
  --color-surface-2: #181818;
  --color-border:    #2a2a2a;
  --color-divider:   #1e1e1e;

  --color-text:      #f0efec;
  --color-text-muted:#9a9894;
  --color-text-faint:#555350;

  --color-red:       #841d10;
  --color-red-hover: #a02516;
  --color-red-glow:  rgba(132, 29, 16, 0.35);

  --color-white:     #ffffff;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Work Sans', 'Helvetica Neue', sans-serif;

  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --radius-sm: 2px;
  --radius-md: 4px;

  --content-narrow:  680px;
  --content-default: 960px;
  --content-wide:    1200px;

  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-20);
}
body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.7;
}
img, picture, video { display: block; max-width: 100%; height: auto; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
a { color: inherit; }
h1,h2,h3,h4,h5,h6 { text-wrap: balance; line-height: 1.2; font-family: var(--font-display); }
p, li { text-wrap: pretty; }
ul { list-style: none; }
::selection { background: var(--color-red-glow); color: var(--color-white); }
:focus-visible { outline: 2px solid var(--color-red); outline-offset: 3px; }

/* ---- Layout Helpers ---- */
.container {
  width: 100%;
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
.container--wide { max-width: var(--content-wide); }
.container--narrow { max-width: var(--content-narrow); }

/* ---- Navigation ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition);
}
.site-header--scrolled { box-shadow: 0 4px 24px rgba(0,0,0,0.5); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo__text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: 0.01em;
  line-height: 1;
}
.nav-logo__text span { color: var(--color-red); }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.nav-links a:hover,
.nav-links a.active { color: var(--color-white); }
.nav-links a.active { color: var(--color-red); }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.nav-mobile {
  display: none;
  flex-direction: column;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-4) var(--space-6);
  gap: var(--space-1);
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
  transition: color var(--transition);
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile a:hover, .nav-mobile a.active { color: var(--color-red); }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn--primary {
  background: var(--color-red);
  color: var(--color-white);
  border-color: var(--color-red);
}
.btn--primary:hover {
  background: var(--color-red-hover);
  border-color: var(--color-red-hover);
  box-shadow: 0 0 24px var(--color-red-glow);
}
.btn--outline {
  background: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}
.btn--outline:hover {
  background: rgba(255,255,255,0.08);
}
.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}
.btn--ghost:hover { color: var(--color-white); border-color: var(--color-text-muted); }

/* ---- Dividers ---- */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: var(--space-12);
}
.divider--red { border-color: var(--color-red); }

/* ---- Section Labels ---- */
.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-red);
  margin-bottom: var(--space-4);
}

/* ---- HOME PAGE ---- */
.home-hero {
  padding-block: clamp(var(--space-16), 8vw, var(--space-24));
  border-bottom: 1px solid var(--color-border);
}
.home-hero__inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: clamp(var(--space-10), 5vw, var(--space-16));
  align-items: start;
}
.home-hero__cover {
  position: sticky;
  top: calc(64px + var(--space-8));
}
.home-hero__cover img {
  width: 100%;
  max-width: 280px;
  box-shadow: 0 0 60px var(--color-red-glow), 0 20px 60px rgba(0,0,0,0.6);
  border: 1px solid rgba(132,29,16,0.3);
}
.home-hero__badge {
  display: inline-block;
  background: var(--color-red);
  color: var(--color-white);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-4);
  margin-bottom: var(--space-4);
}
.home-hero__title {
  font-size: var(--text-3xl);
  font-weight: 900;
  font-style: italic;
  color: var(--color-white);
  margin-bottom: var(--space-6);
  line-height: 1.05;
}
.home-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}
.home-hero__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-10);
}
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-red);
  padding: var(--space-3) var(--space-4);
}
.stat-card__value {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--space-1);
}
.stat-card__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Note from John */
.note-section {
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
  border-bottom: 1px solid var(--color-border);
}
.note-section__text {
  font-size: var(--text-base);
  line-height: 1.85;
  color: var(--color-text-muted);
  max-width: 72ch;
}
.note-section__text p + p { margin-top: var(--space-5); }

/* Synopsis */
.synopsis-section {
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
  border-bottom: 1px solid var(--color-border);
}
.synopsis-section__tagline {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}
.synopsis-section__hook {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--space-8);
  letter-spacing: 0.02em;
}
.synopsis-section__body p {
  font-size: var(--text-base);
  line-height: 1.85;
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}
.synopsis-section__body p:last-child {
  color: var(--color-text);
  font-style: italic;
}

/* Final CTA */
.home-cta {
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
  text-align: center;
}
.home-cta h2 {
  font-size: var(--text-xl);
  color: var(--color-white);
  margin-bottom: var(--space-6);
}
.home-cta__btns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
}

@media (max-width: 680px) {
  .home-hero__inner {
    grid-template-columns: 1fr;
  }
  .home-hero__cover {
    position: static;
    text-align: center;
  }
  .home-hero__cover img {
    margin-inline: auto;
    max-width: 220px;
  }
  .home-hero__stats {
    grid-template-columns: 1fr;
  }
}

/* ---- BOOKS PAGE ---- */
.page-hero {
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
  border-bottom: 1px solid var(--color-border);
}
.page-hero h1 {
  font-size: var(--text-3xl);
  font-weight: 900;
  color: var(--color-white);
  margin-bottom: var(--space-3);
}
.page-hero p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 60ch;
}

.books-section {
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
  border-bottom: 1px solid var(--color-divider);
}
.books-section h2 {
  font-size: var(--text-xl);
  color: var(--color-white);
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.books-section h2 span {
  display: block;
  font-size: var(--text-xs);
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-red);
  margin-bottom: var(--space-2);
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-8) var(--space-6);
}
.book-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.book-card__cover {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}
.book-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.book-card:hover .book-card__cover img { transform: scale(1.04); }
.book-card__title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.3;
}
.book-card__meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.book-card__link {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-red);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: auto;
  transition: color var(--transition);
}
.book-card__link:hover { color: var(--color-red-hover); }
.book-card__link::after { content: ' →'; }

/* Book card buy button */
.btn--book {
  width: 100%;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  margin-top: auto;
}

/* Featured book (new release) */
.book-featured {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-10);
  align-items: start;
  padding: var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-red);
  margin-bottom: var(--space-10);
}
.book-featured__cover img {
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.book-featured__badge {
  display: inline-block;
  background: var(--color-red);
  color: var(--color-white);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px var(--space-3);
  margin-bottom: var(--space-3);
}
.book-featured__title {
  font-size: var(--text-2xl);
  font-weight: 900;
  font-style: italic;
  color: var(--color-white);
  margin-bottom: var(--space-4);
}
.book-featured__desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.75;
  margin-bottom: var(--space-6);
  max-width: 60ch;
}
.book-featured__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
@media (max-width: 600px) {
  .book-featured {
    grid-template-columns: 1fr;
  }
  .book-featured__cover { max-width: 180px; }
}

/* Coming soon books */
.coming-soon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-6);
}
.coming-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.coming-card__cover {
  aspect-ratio: 2/3;
  overflow: hidden;
}
.coming-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(20%);
  transition: filter 0.3s ease, transform 0.4s ease;
}
.coming-card:hover .coming-card__cover img {
  filter: grayscale(0);
  transform: scale(1.03);
}
.coming-card__info {
  padding: var(--space-4);
}
.coming-card__title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--space-2);
}
.coming-card__tag {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-red);
}

/* ---- ABOUT PAGE ---- */
.about-section {
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: clamp(var(--space-10), 6vw, var(--space-16));
  align-items: start;
}
.about-bio h1 {
  font-size: var(--text-3xl);
  font-weight: 900;
  color: var(--color-white);
  margin-bottom: var(--space-6);
}
.about-bio p {
  font-size: var(--text-base);
  line-height: 1.85;
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
  max-width: 68ch;
}
.about-bio p strong { color: var(--color-white); font-weight: 600; }
.about-sidebar {
  position: sticky;
  top: calc(64px + var(--space-8));
}
.about-photo {
  width: 100%;
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-6);
}
.about-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-sidebar {
    position: static;
    order: -1;
  }
  .about-photo { max-width: 280px; margin-inline: auto; display: block; }
}

/* ---- FAQ PAGE ---- */
.faq-section {
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 720px;
}
.faq-item {
  border-bottom: 1px solid var(--color-border);
}
.faq-item:first-child { border-top: 1px solid var(--color-border); }
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-5) 0;
  text-align: left;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition);
}
.faq-question:hover { color: var(--color-white); }
.faq-question[aria-expanded="true"] { color: var(--color-red); }
.faq-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  position: relative;
}
.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.faq-icon::before { width: 12px; height: 2px; top: 9px; left: 4px; }
.faq-icon::after  { width: 2px; height: 12px; top: 4px; left: 9px; }
.faq-question[aria-expanded="true"] .faq-icon::after { transform: rotate(90deg); opacity: 0; }
.faq-answer {
  display: none;
  padding-bottom: var(--space-5);
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--color-text-muted);
}
.faq-answer.open { display: block; }
.faq-answer a { color: var(--color-red); text-decoration: underline; text-underline-offset: 3px; }
.faq-answer a:hover { color: var(--color-red-hover); }

/* ---- FOOTER ---- */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-10), 6vw, var(--space-16));
  margin-bottom: var(--space-12);
}
.footer-brand__logo {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--space-3);
}
.footer-brand__logo span { color: var(--color-red); }
.footer-brand p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 36ch;
  line-height: 1.7;
}
.footer-social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.footer-social a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: color var(--transition), border-color var(--transition);
}
.footer-social a:hover { color: var(--color-white); border-color: var(--color-text-muted); }

/* Newsletter */
.footer-newsletter h3 {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--space-2);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.footer-newsletter p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}
.newsletter-form {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  background: var(--color-surface-2, #181818);
  border: 1px solid var(--color-border);
  color: var(--color-white);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition);
}
.newsletter-form input[type="email"]::placeholder { color: var(--color-text-faint); }
.newsletter-form input[type="email"]:focus { border-color: var(--color-red); }
.newsletter-form button {
  background: var(--color-red);
  color: var(--color-white);
  border: 2px solid var(--color-red);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
}
.newsletter-form button:hover {
  background: var(--color-red-hover);
  box-shadow: 0 0 16px var(--color-red-glow);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
}
.footer-bottom p {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.footer-bottom a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-xs);
  transition: color var(--transition);
}
.footer-bottom a:hover { color: var(--color-red); }
.footer-bottom__links {
  display: flex;
  gap: var(--space-6);
}

@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---- Scroll Animations ---- */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .fade-up { opacity: 1; transform: none; transition: none; }
}
