/* ============================================
   HEAVEN HACKED - Site Styles
   Palette derived from book cover art:
   Deep navy, warm gold, clean cream white
   ============================================ */

/* --- COLOR SYSTEM --- */
:root {
  /* Primary palette */
  --navy:        #0c1a2e;
  --navy-light:  #162d4a;
  --navy-mid:    #1e3a5f;
  --gold:        #c9a84e;
  --gold-light:  #dcc06a;
  --gold-dark:   #a8893e;
  --cream:       #faf8f3;
  --cream-dark:  #f0ece2;

  /* Text colors */
  --text-primary:   #1a2a3a;
  --text-secondary: #3d5068;
  --text-light:     #f0ece2;
  --text-muted:     #6b7d8f;

  /* Functional */
  --border:      #d8d2c4;
  --shadow:      rgba(12, 26, 46, 0.12);
  --shadow-heavy: rgba(12, 26, 46, 0.22);

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --section-pad: clamp(3rem, 8vw, 6rem);
  --content-max: 1100px;
  --content-narrow: 720px;
}

/* --- RESET & BASE --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--gold-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
a:hover {
  color: var(--gold);
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); margin-bottom: 0.75rem; }

p + p { margin-top: 1.25rem; }

.lead {
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* --- LAYOUT --- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--narrow {
  max-width: var(--content-narrow);
}

.section {
  padding: var(--section-pad) 0;
}

.section--dark {
  background: var(--navy);
  color: var(--text-light);
}
.section--dark h2,
.section--dark h3 {
  color: var(--gold);
}
.section--dark a {
  color: var(--gold-light);
}
.section--dark a:hover {
  color: #fff;
}

.section--alt {
  background: var(--cream-dark);
}

.text-center { text-align: center; }

/* --- HEADER / NAV --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(12, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(201, 168, 78, 0.2);
  transition: background 0.3s;
}

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

.nav__logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.nav__logo:hover {
  color: var(--gold-light);
}

.nav__links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav__links a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
  letter-spacing: 0.01em;
}
.nav__links a:hover {
  color: var(--gold);
}

.nav__cta {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: var(--gold);
  color: var(--navy) !important;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none !important;
  transition: background 0.2s, transform 0.15s;
}
.nav__cta:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}

/* Mobile menu toggle */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-light);
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}

/* --- HERO --- */
.hero {
  padding: calc(var(--section-pad) + 4rem) 0 var(--section-pad);
  background: linear-gradient(175deg, var(--navy) 0%, #0e2240 60%, var(--navy-mid) 100%);
  color: var(--text-light);
  overflow: hidden;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 50% 80%, rgba(201, 168, 78, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero__text {
  max-width: 540px;
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
}

.hero__title {
  color: #fff;
  margin-bottom: 0.5rem;
}

.hero__tagline {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  font-weight: 400;
  font-style: italic;
  color: var(--gold-light);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.hero__desc {
  font-size: 1.1rem;
  line-height: 1.8;
  color: rgba(240, 236, 226, 0.85);
  margin-bottom: 2rem;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero__cover {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__cover img {
  max-width: 380px;
  width: 100%;
  border-radius: 4px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(201, 168, 78, 0.15);
}

/* --- BUTTONS --- */
.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  line-height: 1.4;
}

.btn--primary {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
.btn--primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  color: var(--navy);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201, 168, 78, 0.3);
}

.btn--outline {
  background: transparent;
  color: var(--gold-light);
  border-color: var(--gold);
}
.btn--outline:hover {
  background: var(--gold);
  color: var(--navy);
  transform: translateY(-2px);
}

.btn--dark {
  background: var(--navy);
  color: var(--gold);
  border-color: var(--navy);
}
.btn--dark:hover {
  background: var(--navy-light);
  border-color: var(--navy-light);
  transform: translateY(-2px);
}

/* --- ABOUT THE BOOK --- */
.book-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}

.book-feature {
  padding: 2rem;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: box-shadow 0.3s, transform 0.2s;
}
.book-feature:hover {
  box-shadow: 0 8px 24px var(--shadow);
  transform: translateY(-2px);
}

.book-feature__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.book-feature h3 {
  font-family: var(--font-heading);
  color: var(--navy);
}

.book-feature p {
  color: var(--text-secondary);
  font-size: 0.98rem;
}

/* --- EXCERPT TEASER --- */
.excerpt-teaser {
  position: relative;
}

.excerpt-teaser__text {
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  line-height: 1.9;
  color: var(--text-light);
  font-style: italic;
  max-width: 700px;
  margin: 0 auto 2rem;
}

.excerpt-teaser__text::before {
  content: '\201C';
  font-size: 4rem;
  color: var(--gold);
  line-height: 0;
  vertical-align: -0.5em;
  margin-right: 0.1em;
}

/* --- AUTHOR SECTION --- */
.author {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2.5rem;
  align-items: start;
}

.author__photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  box-shadow: 0 4px 15px var(--shadow);
}

.author__placeholder {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 3rem;
  color: var(--gold);
  border: 3px solid var(--gold);
}

/* --- EMAIL SIGNUP --- */
.signup-form {
  max-width: 500px;
  margin: 0 auto;
}

.signup-form__fields {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.signup-form input[type="text"],
.signup-form input[type="email"] {
  flex: 1;
  padding: 0.85rem 1rem;
  border: 2px solid rgba(201, 168, 78, 0.3);
  border-radius: 6px;
  font-size: 1rem;
  font-family: var(--font-body);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-light);
  transition: border-color 0.2s;
}
.signup-form input::placeholder {
  color: rgba(240, 236, 226, 0.5);
}
.signup-form input:focus {
  outline: none;
  border-color: var(--gold);
}

.signup-form button {
  padding: 0.85rem 1.5rem;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.2s;
  white-space: nowrap;
}
.signup-form button:hover {
  background: var(--gold-light);
}

.signup-form__note {
  font-size: 0.85rem;
  color: rgba(240, 236, 226, 0.5);
  margin-top: 0.75rem;
}

/* --- CHAPTER LIST --- */
.chapter-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
  list-style: none;
}

.chapter-list li {
  padding: 0.85rem 1.25rem;
  background: #fff;
  border-radius: 6px;
  border-left: 3px solid var(--gold);
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: background 0.2s;
}
.chapter-list li:hover {
  background: var(--cream-dark);
}

.chapter-list li span {
  font-weight: 600;
  color: var(--navy);
}

/* --- FOOTER --- */
.site-footer {
  background: var(--navy);
  color: var(--text-light);
  padding: 2.5rem 0;
  border-top: 2px solid var(--gold-dark);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer__copy {
  font-size: 0.9rem;
  color: rgba(240, 236, 226, 0.6);
}

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

.footer__links a {
  color: rgba(240, 236, 226, 0.6);
  text-decoration: none;
  font-size: 0.9rem;
}
.footer__links a:hover {
  color: var(--gold);
}

/* --- EXCERPT PAGE --- */
.excerpt-page {
  padding: calc(var(--section-pad) + 3rem) 0 var(--section-pad);
}

.excerpt-content {
  max-width: var(--content-narrow);
  margin: 0 auto;
}

.excerpt-content h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--navy);
  margin: 3rem 0 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.excerpt-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.excerpt-content h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  color: var(--navy-mid);
  margin: 2.5rem 0 0.75rem;
}

.excerpt-content .chapter-subtitle {
  font-family: var(--font-heading);
  font-style: italic;
  color: var(--gold-dark);
  font-size: 1.15rem;
  margin-bottom: 2rem;
}

.excerpt-content .epigraph {
  font-style: italic;
  color: var(--text-secondary);
  border-left: 3px solid var(--gold);
  padding-left: 1.5rem;
  margin: 2rem 0;
  line-height: 1.8;
}

.excerpt-content .epigraph cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-weight: 600;
  color: var(--text-muted);
}

.excerpt-content p {
  margin-bottom: 1.25rem;
}

.excerpt-content strong {
  color: var(--navy);
  font-weight: 700;
}

.excerpt-fade {
  position: relative;
  padding-bottom: 4rem;
}

.excerpt-fade::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8rem;
  background: linear-gradient(transparent, var(--cream));
  pointer-events: none;
}

.excerpt-cta {
  text-align: center;
  padding: 3rem 0;
}

.excerpt-cta p {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-style: italic;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__text {
    max-width: 100%;
    order: 2;
  }

  .hero__cover {
    order: 1;
  }

  .hero__cover img {
    max-width: 260px;
  }

  .hero__actions {
    justify-content: center;
  }

  .nav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid rgba(201, 168, 78, 0.2);
  }

  .nav__links.active {
    display: flex;
  }

  .nav__toggle {
    display: block;
  }

  .nav__toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .nav__toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .nav__toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .author {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }

  .signup-form__fields {
    flex-direction: column;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .book-features {
    grid-template-columns: 1fr;
  }

  .chapter-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero__cover img {
    max-width: 200px;
  }

  .btn {
    width: 100%;
  }

  .hero__actions {
    flex-direction: column;
  }
}
