/* ============================================
   THE LEGEND OF THE KRONICALS
   Light fantasy promotional website
   Avatar: The Last Airbender meets Harry Potter
   ============================================ */

:root {
  /* Type Scale */
  --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);
  --text-hero: clamp(3rem, 0.5rem + 7vw, 8rem);

  /* Spacing */
  --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;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* Fonts */
  --font-display: 'Zodiak', 'Georgia', serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;
}

/* ============================================
   WARM FANTASY PALETTE
   ============================================ */

:root {
  --color-bg: #faf8f4;
  --color-surface: #ffffff;
  --color-surface-2: #f3f0ea;
  --color-surface-offset: #f7f5f0;
  --color-surface-warm: #fdf6ee;
  --color-border: #e2ddd4;
  --color-divider: #ebe6dd;

  --color-text: #2c2520;
  --color-text-muted: #6b6058;
  --color-text-faint: #9b9189;
  --color-text-inverse: #faf8f4;

  --color-primary: #b8860b;
  --color-primary-hover: #d4a017;
  --color-primary-active: #9a7209;
  --color-primary-light: #f5e6c4;

  --color-accent-blue: #4a7fb5;
  --color-accent-violet: #7b5ea7;
  --color-accent-emerald: #3d8b6e;
  --color-accent-warm: #c77b3f;

  --shadow-sm: 0 1px 3px rgb(44 37 32 / 0.06);
  --shadow-md: 0 4px 12px rgb(44 37 32 / 0.08);
  --shadow-lg: 0 12px 32px rgb(44 37 32 / 0.1);
  --shadow-card: 0 2px 8px rgb(44 37 32 / 0.06), 0 0 0 1px rgb(44 37 32 / 0.03);
}

/* ============================================
   GLOBAL STYLES
   ============================================ */

body {
  background: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover {
  color: var(--color-primary-hover);
}

/* ============================================
   HEADER / NAV
   ============================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-4) var(--space-6);
  background: rgb(250 248 244 / 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgb(226 221 212 / 0.6);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-header--scrolled {
  box-shadow: var(--shadow-md);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.logo svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
}

.nav-links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  position: relative;
  padding-bottom: var(--space-1);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--color-text);
}

.nav-links a:hover::after {
  width: 100%;
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
}

.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: all 0.3s ease;
}

/* ============================================
   HERO
   ============================================ */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgb(250 248 244 / 0.05) 0%,
    rgb(44 37 32 / 0.15) 20%,
    rgb(44 37 32 / 0.45) 50%,
    rgb(44 37 32 / 0.8) 70%,
    var(--color-bg) 88%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--content-default);
  padding: var(--space-8);
  padding-top: var(--space-24);
}

.hero-series {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #f5e6c4;
  margin-bottom: var(--space-4);
  font-weight: 500;
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  color: #ffffff;
  line-height: 1.05;
  margin-bottom: var(--space-6);
  text-shadow: 0 2px 20px rgb(0 0 0 / 0.3);
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: rgb(255 255 255 / 0.85);
  font-style: italic;
  margin-bottom: var(--space-8);
  max-width: 40ch;
  margin-inline: auto;
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.2);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-8);
  background: var(--color-primary);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.3s ease;
}

.hero-cta:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgb(184 134 11 / 0.35);
  color: #ffffff;
}

.scroll-indicator {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: rgb(255 255 255 / 0.6);
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

/* ============================================
   SECTIONS
   ============================================ */

.section {
  padding: clamp(var(--space-12), 8vw, var(--space-24)) var(--space-6);
}

.section-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
}

.section-label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  font-weight: 600;
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--color-text);
  margin-bottom: var(--space-6);
}

.section-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 55ch;
  margin-bottom: var(--space-12);
}

/* ============================================
   BOOK SYNOPSIS
   ============================================ */

.synopsis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.synopsis-image {
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
}

.synopsis-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 3/4;
}

.synopsis-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.synopsis-text p {
  color: var(--color-text-muted);
  line-height: 1.8;
}

.synopsis-text p:first-of-type {
  font-size: var(--text-lg);
  color: var(--color-text);
  font-family: var(--font-display);
  font-style: italic;
  line-height: 1.6;
}

.book-details {
  display: flex;
  gap: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-4);
}

.book-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.book-detail-label {
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.book-detail-value {
  font-size: var(--text-sm);
  color: var(--color-primary);
  font-weight: 600;
}

/* ============================================
   CHARACTER CARDS
   ============================================ */

.characters-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.character-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-card);
}

.character-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-accent, var(--color-primary));
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.character-card:hover {
  border-color: rgb(from var(--card-accent, var(--color-primary)) r g b / 0.3);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgb(44 37 32 / 0.12);
}

.character-card:hover::before {
  opacity: 1;
}

.character-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
  background: rgb(from var(--card-accent, var(--color-primary)) r g b / 0.1);
  color: var(--card-accent, var(--color-primary));
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
}

.character-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-1);
  color: var(--color-text);
}

.character-title {
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--card-accent, var(--color-primary));
  margin-bottom: var(--space-4);
  font-weight: 600;
}

.character-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* Card accent colors */
.character-card[data-accent="shadow"] { --card-accent: #7b5ea7; }
.character-card[data-accent="light"] { --card-accent: #d4a017; }
.character-card[data-accent="rune"] { --card-accent: #3d8b6e; }

/* ============================================
   WORLD LORE
   ============================================ */

.lore-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
}

.lore-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-card);
}

.lore-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.lore-card-image {
  height: 220px;
  overflow: hidden;
}

.lore-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.lore-card:hover .lore-card-image img {
  transform: scale(1.05);
}

.lore-card-content {
  padding: var(--space-6);
}

.lore-card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.lore-card-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ============================================
   QUOTE / DIVIDER SECTION
   ============================================ */

.quote-section {
  padding: clamp(var(--space-16), 10vw, var(--space-32)) var(--space-6);
  text-align: center;
  position: relative;
  background: var(--color-surface-warm);
}

.quote-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: var(--space-12);
  background: linear-gradient(to bottom, transparent, var(--color-primary));
}

.quote-text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--color-text);
  max-width: 45ch;
  margin: 0 auto var(--space-4);
  line-height: 1.4;
}

.quote-attribution {
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

/* ============================================
   FULL-BLEED IMAGE DIVIDER
   ============================================ */

.image-divider {
  position: relative;
  height: 50vh;
  min-height: 300px;
  overflow: hidden;
}

.image-divider img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-divider::before,
.image-divider::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 120px;
  z-index: 1;
}

.image-divider::before {
  top: 0;
  background: linear-gradient(to bottom, var(--color-bg), transparent);
}

.image-divider::after {
  bottom: 0;
  background: linear-gradient(to top, var(--color-bg), transparent);
}

/* ============================================
   NEWSLETTER / ABOUT
   ============================================ */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: start;
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.about-text p {
  color: var(--color-text-muted);
  line-height: 1.8;
}

.newsletter-card {
  background: var(--color-surface-warm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
}

.newsletter-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.newsletter-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  line-height: 1.7;
}

.newsletter-form {
  display: flex;
  gap: var(--space-3);
}

.newsletter-input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text);
  font-size: var(--text-sm);
}

.newsletter-input::placeholder {
  color: var(--color-text-faint);
}

.newsletter-input:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgb(184 134 11 / 0.15);
}

.newsletter-btn {
  padding: var(--space-3) var(--space-6);
  background: var(--color-primary);
  color: #ffffff;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.newsletter-btn:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 12px rgb(184 134 11 / 0.25);
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  background: var(--color-surface-2);
}

.footer-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.footer-logo {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--color-primary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.footer-text {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
  .synopsis-grid,
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .characters-grid {
    grid-template-columns: 1fr 1fr;
  }

  .lore-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    z-index: 99;
  }

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

  .nav-links a {
    font-size: var(--text-lg);
  }

  .mobile-toggle {
    display: flex;
    z-index: 101;
  }

  .characters-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: var(--text-3xl);
  }

  .newsletter-form {
    flex-direction: column;
  }

  .book-details {
    flex-wrap: wrap;
    gap: var(--space-4);
  }

  .synopsis-image {
    order: -1;
  }
}
