/* ============================================================
   Surf Brujas — Gothic Surf Witch
   Brujas del Mar aesthetic · ink & ocean · linocut vibes
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  --deep-ocean:   #0a0e1a;
  --midnight:     #0d1b2a;
  --twilight:     #1a2744;
  --wave-dark:    #0c2d4a;
  --wave-mid:     #0e4a6e;
  --wave-light:   #1a7fa0;
  --foam:         #b8e4f0;
  --moon-glow:    #f5e6c8;
  --gold:         #d4a843;
  --marigold:     #f4821e;
  --crimson:      #c0392b;
  --magenta:      #9b1fa8;
  --lavender:     #c57fe0;
  --white:        #ffffff;
  --text-primary: #e8d5c4;
  --text-muted:   #a09080;

  --font-display: 'Texturina', 'Palatino Linotype', serif;
  --font-title:   'Rye', 'Georgia', serif;
  --font-accent:  'Sancreek', 'Georgia', serif;
  --font-body:    'Cardo', 'Georgia', serif;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--deep-ocean);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ============================================================
   HERO SECTION — full-screen parallax panorama
   ============================================================ */
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;

  /* Parallax panorama background */
  background-image: url('../assets/images/surf_panorama.jpg');
  background-attachment: fixed;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

/* Dark ink overlay for text legibility over the cream illustration */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 20, 0.58);
  z-index: 0;
  pointer-events: none;
}

/* iOS / touch devices: fixed attachment doesn't work, fall back to scroll */
@media (hover: none) and (pointer: coarse) {
  .hero {
    background-attachment: scroll;
  }
}

/* ---------- Stars ---------- */
.stars-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.star {
  position: absolute;
  background: var(--white);
  border-radius: 50%;
  animation: twinkle var(--duration, 3s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}

@keyframes twinkle {
  0%   { opacity: 0.1; transform: scale(0.8); }
  100% { opacity: 0.9; transform: scale(1.2); }
}

/* ---------- Moon ---------- */
.moon-container {
  position: absolute;
  top: 6%;
  right: 12%;
  z-index: 2;
  animation: moonFloat 8s ease-in-out infinite;
}

.moon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8e7, var(--moon-glow) 50%, #d4b87a 100%);
  box-shadow:
    0 0 30px 10px rgba(245, 230, 200, 0.3),
    0 0 80px 30px rgba(245, 230, 200, 0.12),
    inset -8px -6px 0 rgba(0, 0, 0, 0.15);
}

.moon-halo {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  border: 1.5px solid rgba(245, 230, 200, 0.25);
  animation: haloBreath 6s ease-in-out infinite;
}

.moon-halo:nth-child(2) {
  inset: -35px;
  border-color: rgba(245, 230, 200, 0.12);
  animation-delay: 1s;
}

@keyframes moonFloat {
  0%, 100% { transform: translateY(0px) rotate(-2deg); }
  50%       { transform: translateY(-14px) rotate(2deg); }
}

@keyframes haloBreath {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.08); opacity: 0.6; }
}

/* ---------- Shooting Stars ---------- */
.shooting-stars {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.shooting-star {
  position: absolute;
  width: 140px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 220, 0.9), transparent);
  border-radius: 2px;
  animation: shoot var(--shoot-dur, 6s) ease-in-out infinite;
  animation-delay: var(--shoot-delay, 0s);
  opacity: 0;
  transform-origin: right center;
}

@keyframes shoot {
  0%   { opacity: 0; transform: translateX(0) rotate(-35deg); }
  5%   { opacity: 1; }
  30%  { opacity: 0; transform: translateX(-600px) rotate(-35deg); }
  100% { opacity: 0; transform: translateX(-600px) rotate(-35deg); }
}

/* ---------- Title Card ---------- */
.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2rem 1.5rem 1rem;
  margin-bottom: 26vh;
}

.game-eyebrow {
  font-family: var(--font-accent);
  font-size: clamp(0.9rem, 2.5vw, 1.25rem);
  color: var(--marigold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeSlideDown 1s ease forwards 0.4s;
}

.game-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-optical-sizing: auto;
  font-size: clamp(3.5rem, 12vw, 10rem);
  line-height: 1;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--moon-glow) 0%, var(--gold) 40%, var(--marigold) 70%, var(--lavender) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 22px rgba(212, 168, 67, 0.5));
  opacity: 0;
  animation: fadeSlideUp 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.6s;
}

.game-subtitle {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1rem, 3vw, 1.6rem);
  color: var(--lavender);
  letter-spacing: 0.08em;
  margin-top: 0.5rem;
  opacity: 0;
  animation: fadeSlideUp 1s ease forwards 1.2s;
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: clamp(0.8rem, 2.2vw, 1rem);
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-top: 1.4rem;
  max-width: 560px;
  margin-inline: auto;
  opacity: 0;
  animation: fadeSlideUp 1s ease forwards 1.6s;
}

/* ---------- CTA Button ---------- */
.cta-group {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.2rem;
  opacity: 0;
  animation: fadeSlideUp 1s ease forwards 2s;
}

.btn {
  display: inline-block;
  padding: 0.75rem 2.4rem;
  border-radius: 40px;
  font-family: var(--font-accent);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--marigold));
  color: var(--deep-ocean);
  border: none;
  box-shadow: 0 4px 20px rgba(212, 168, 67, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 30px rgba(212, 168, 67, 0.6);
}

.btn-secondary {
  background: transparent;
  color: var(--foam);
  border: 1.5px solid rgba(184, 228, 240, 0.5);
  box-shadow: 0 4px 20px rgba(26, 127, 160, 0.2);
}

.btn-secondary:hover {
  transform: translateY(-3px) scale(1.04);
  background: rgba(184, 228, 240, 0.08);
  border-color: var(--foam);
  box-shadow: 0 8px 30px rgba(26, 127, 160, 0.4);
}

/* ============================================================
   OCEAN WAVES
   ============================================================ */
.ocean {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 36vh;
  z-index: 5;
  pointer-events: none;
}

.wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 100%;
}

.wave svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
}

/* Wave 1 — darkest, back */
.wave--1 {
  animation: waveScroll1 14s linear infinite;
  opacity: 0.55;
}

/* Wave 2 — mid */
.wave--2 {
  animation: waveScroll2 10s linear infinite;
  opacity: 0.75;
}

/* Wave 3 — front, lightest */
.wave--3 {
  animation: waveScroll3 7s linear infinite;
  opacity: 1;
}

@keyframes waveScroll1 {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes waveScroll2 {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes waveScroll3 {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---------- Bruja Surfer Image ---------- */
.surfer-container {
  position: absolute;
  bottom: 24vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  animation: surfRide 5s ease-in-out infinite;
  opacity: 0;
  animation-delay: 2.4s;
  animation-fill-mode: forwards;
}

.surfer-container img {
  height: 220px;
  width: auto;
  display: block;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.75));
}

@keyframes surfRide {
  0%   { transform: translateX(-50%) translateY(0px)   rotate(-2deg); opacity: 1; }
  25%  { transform: translateX(-50%) translateY(-14px) rotate(3deg);  opacity: 1; }
  50%  { transform: translateX(-50%) translateY(-4px)  rotate(-1deg); opacity: 1; }
  75%  { transform: translateX(-50%) translateY(-18px) rotate(4deg);  opacity: 1; }
  100% { transform: translateX(-50%) translateY(0px)   rotate(-2deg); opacity: 1; }
}

/* ============================================================
   FEATURES / INFO SECTION
   ============================================================ */
.features {
  position: relative;
  z-index: 20;
  padding: 5rem 1.5rem 4rem;
  background: linear-gradient(to bottom, var(--midnight) 0%, #111824 100%);
}

.section-title {
  font-family: var(--font-title);
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 400;
  text-align: center;
  color: var(--gold);
  letter-spacing: 0.06em;
  margin-bottom: 3rem;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--marigold), var(--magenta));
  margin: 0.6rem auto 0;
  border-radius: 2px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 2rem;
  max-width: 1050px;
  margin: 0 auto;
}

.feature-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: transform 0.35s, box-shadow 0.35s, border-color 0.35s;
  opacity: 0;
  transform: translateY(30px);
}

.feature-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.35s, border-color 0.35s;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(197, 127, 224, 0.35);
}

.feature-icon {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  display: block;
  animation: iconPulse 4s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.12); }
}

.feature-card h3 {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 400;
  color: var(--moon-glow);
  letter-spacing: 0.05em;
  margin-bottom: 0.7rem;
}

.feature-card p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ============================================================
   WORLD / LORE SECTION
   ============================================================ */
.lore {
  position: relative;
  padding: 4rem 1.5rem 5rem;
  background: linear-gradient(to bottom, #111824 0%, var(--twilight) 100%);
  overflow: hidden;
  text-align: center;
}

.lore::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(155, 31, 168, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(26, 127, 160, 0.08) 0%, transparent 60%);
}

.lore-content {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}

.lore-quote {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.3rem, 4vw, 2rem);
  color: var(--lavender);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.lore-quote.visible {
  opacity: 1;
  transform: translateY(0);
}

.lore-body {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  color: var(--text-muted);
  line-height: 1.85;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

.lore-body.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Floating marigold petals */
.petals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.petal {
  position: absolute;
  font-size: 1.2rem;
  animation: petalFall var(--petal-dur, 12s) linear infinite;
  animation-delay: var(--petal-delay, 0s);
  opacity: 0;
}

@keyframes petalFall {
  0%   { transform: translateY(-30px) rotate(0deg);   opacity: 0; }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.5; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--deep-ocean);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 2rem 1.5rem;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* ============================================================
   KEYFRAME UTILITIES
   ============================================================ */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE TWEAKS
   ============================================================ */
@media (max-width: 600px) {
  .moon-container { top: 5%; right: 6%; }
  .moon { width: 68px; height: 68px; }
  .surfer-container { bottom: 20vh; }
  .surfer-container img { height: 160px; }
  .cta-group { flex-direction: column; align-items: center; }
  .btn { width: 80%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
