/* === Reset & Base === */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  color: #F0E6D3;
  background: #0D0D1A;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* === Typography === */

h1, h2, h3, strong, .nav-brand, .steps li::before {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

h2 {
  color: #F0E6D3;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 24px;
}

h3 {
  color: #F0E6D3;
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 8px;
}

p {
  margin-bottom: 16px;
}

a {
  color: #E63946;
  transition: color 0.2s;
}

a:hover {
  color: #ff4d5a;
}

em {
  font-style: italic;
}

/* === Navigation === */

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 13, 26, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(240, 230, 211, 0.08);
}

nav .nav-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

nav .nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #F0E6D3;
  font-weight: 700;
  font-size: 1.1rem;
}

nav .nav-brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

nav .nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

nav .nav-links a {
  text-decoration: none;
  color: rgba(240, 230, 211, 0.7);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

nav .nav-links a:hover {
  color: #F0E6D3;
}

/* Mobile nav toggle */
nav .nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

nav .nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #F0E6D3;
  margin: 5px 0;
  transition: transform 0.2s;
}

/* === Sections === */

section {
  padding: 80px 24px;
}

section:nth-child(odd) {
  background: #0D0D1A;
}

section:nth-child(even) {
  background: #111126;
}

.section-inner {
  max-width: 680px;
  margin: 0 auto;
}

/* === Hero (Book Cover Style) === */

.hero {
  text-align: center;
  padding: 0;
  background: #0D0D1A;
  overflow: hidden;
}

/* The cover container */
.hero-cover {
  position: relative;
  width: 380px;
  max-width: calc(100vw - 48px);
  aspect-ratio: 2 / 3;
  margin: 80px auto 0;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.7),
    0 4px 20px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

/* Background — warm crimson/wine atmospheric gradient */
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(180, 40, 50, 0.5) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(120, 20, 30, 0.4) 0%, transparent 50%),
    linear-gradient(160deg, #5c1a1e 0%, #2a0a0e 40%, #1a0a10 70%, #0d0510 100%);
}

/* Dark overlay band across the centre (matches cover generator "center-band") */
.hero-overlay {
  position: absolute;
  top: 30%;
  left: 0;
  right: 0;
  height: 40%;
  background: rgba(0, 0, 0, 0.88);
}

/* Text block positioned over the overlay band */
.hero-text-block {
  position: absolute;
  top: 30%;
  left: 7%;
  right: 7%;
  height: 40%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Title — matches cover generator: EB Garamond 700, white, text-shadow */
.hero-title {
  font-family: 'EB Garamond', 'Garamond', 'Georgia', serif;
  font-weight: 700;
  color: #fff;
  font-size: 3.4rem;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

/* Brand mark: waveform + underscore (matches cover generator algorithm) */
.brand-mark {
  display: block;
  width: 160px;
  height: 39px;
  margin: 2px auto 4px;
}

/* "Author" line — tagline styled as the cover generator author treatment */
.hero-author {
  font-family: 'EB Garamond', 'Garamond', 'Georgia', serif;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  margin: 0;
}

/* Below-cover content: subhead + App Store badge */
.hero-below {
  max-width: 500px;
  margin: 48px auto 40px;
  padding: 0 24px;
}

.hero-below .subhead {
  font-size: 1.05rem;
  color: rgba(240, 230, 211, 0.65);
  line-height: 1.7;
  margin-bottom: 24px;
}

/* Store Badges */
.store-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.store-badge {
  display: inline-block;
  transition: opacity 0.2s;
}

.store-badge:hover {
  opacity: 0.8;
}

.store-badge img {
  display: block;
}

/* Screenshot Row */
.screenshot-row {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 0 48px;
}

.screenshot-row::-webkit-scrollbar {
  display: none;
}

.screenshot-track {
  display: flex;
  gap: 16px;
  padding: 0 24px;
  width: max-content;
  margin: 0 auto;
}

.screenshot-track img {
  height: 480px;
  width: auto;
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Centre screenshots when they fit */
@media (min-width: 1200px) {
  .screenshot-row {
    overflow-x: hidden;
  }

  .screenshot-track {
    justify-content: center;
    width: auto;
  }
}

/* === Cover Gallery === */

.library-section {
  padding-bottom: 56px;
}

.library-section .section-inner {
  text-align: center;
  margin-bottom: 32px;
}

.library-section .section-inner p {
  max-width: 520px;
  margin: 0 auto;
  color: rgba(240, 230, 211, 0.6);
}

.cover-row {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.cover-row::-webkit-scrollbar {
  display: none;
}

.cover-track {
  display: flex;
  gap: 20px;
  padding: 0 24px;
  width: max-content;
  margin: 0 auto;
}

.cover-track img {
  height: 280px;
  width: auto;
  border-radius: 6px;
  flex-shrink: 0;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s;
}

.cover-track img:hover {
  transform: translateY(-4px);
}

@media (min-width: 1400px) {
  .cover-row {
    overflow-x: hidden;
  }

  .cover-track {
    justify-content: center;
    width: auto;
  }
}

/* === How It Works steps === */

.steps {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.steps li {
  position: relative;
  padding: 16px 0 16px 48px;
}

.steps li::before {
  content: attr(data-step);
  position: absolute;
  left: 0;
  top: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(230, 57, 70, 0.12);
  color: #E63946;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps li strong {
  color: #F0E6D3;
}

/* === Score Brief Callout === */

.score-brief-callout {
  margin: 40px 0 16px;
  padding: 28px 28px 20px;
  border-left: 3px solid #E63946;
  background: rgba(230, 57, 70, 0.06);
  border-radius: 0 8px 8px 0;
}

.score-brief-callout p {
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #F0E6D3;
  margin-bottom: 12px;
}

.score-brief-callout cite {
  display: block;
  font-style: normal;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(240, 230, 211, 0.45);
}

/* === AI & Ethics callout === */

.callout {
  background: rgba(230, 57, 70, 0.08);
  border-left: 3px solid #E63946;
  border-radius: 0 8px 8px 0;
  padding: 20px 24px;
  margin: 24px 0;
}

.callout p {
  margin-bottom: 8px;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* === Support / FAQ === */

.faq {
  margin: 24px 0;
}

.faq details {
  border-bottom: 1px solid rgba(240, 230, 211, 0.08);
}

.faq details:first-child {
  border-top: 1px solid rgba(240, 230, 211, 0.08);
}

.faq summary {
  padding: 18px 0;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #F0E6D3;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  font-size: 1.2rem;
  font-weight: 300;
  color: rgba(240, 230, 211, 0.4);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq details[open] summary::after {
  content: '\2212';
}

.faq details p {
  padding: 0 0 18px;
  color: rgba(240, 230, 211, 0.7);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* === Privacy list === */

.privacy-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.privacy-list li {
  padding: 10px 0 10px 28px;
  position: relative;
}

.privacy-list li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: #E63946;
  font-weight: 700;
}

/* === Lightbox === */

.zoomable {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: rgba(240, 230, 211, 0.6);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 8px;
  transition: color 0.2s;
}

.lightbox-close:hover {
  color: #F0E6D3;
}

/* === Footer === */

footer {
  background: #080812;
  color: rgba(240, 230, 211, 0.4);
  text-align: center;
  padding: 40px 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.85rem;
}

footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}

footer .footer-links a {
  color: rgba(240, 230, 211, 0.5);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

footer .footer-links a:hover {
  color: #F0E6D3;
}

footer p {
  margin-bottom: 0;
}

/* === Responsive === */

@media (max-width: 640px) {
  nav .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(13, 13, 26, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
    border-bottom: 1px solid rgba(240, 230, 211, 0.08);
  }

  nav .nav-links.open {
    display: flex;
  }

  nav .nav-toggle {
    display: block;
  }

  .hero-cover {
    margin-top: 56px;
    width: 300px;
  }

  .hero-title {
    font-size: 2.6rem;
  }

  .hero-author {
    font-size: 0.85rem;
  }

  .brand-mark {
    width: 120px;
    height: 20px;
  }

  .hero-below {
    margin: 36px auto 32px;
  }

  .hero-below .subhead {
    font-size: 0.95rem;
  }

  .screenshot-track {
    padding: 0 20px;
  }

  .screenshot-track img {
    height: 400px;
  }

  section {
    padding: 56px 20px;
  }

  h2 {
    font-size: 1.5rem;
  }

  .score-brief-callout {
    padding: 20px;
  }

  .score-brief-callout p {
    font-size: 1rem;
  }

  .cover-track {
    gap: 14px;
    padding: 0 20px;
  }

  .cover-track img {
    height: 220px;
  }
}
