/* ==========================================================================
   MISIÓN CHAN CHAN — Landing Page
   Sistema de diseño inspirado en la arquitectura de adobe de Chan Chan,
   sus friezes de olas y peces, y la costa norte del Perú al atardecer.
   ========================================================================== */

/* ---------- 1. TOKENS ---------- */
:root{
  /* Paleta — costa norte al atardecer sobre muros de adobe */
  --ink:            #211509;   /* fondo profundo, sombra de adobe */
  --ink-soft:       #2c1c0f;
  --adobe:          #b96f3a;   /* adobe / arcilla cocida */
  --adobe-dark:     #7a4526;   /* adobe en sombra */
  --sand:           #e8d9be;   /* arena clara */
  --sand-dim:       #d8c6a4;
  --gold:           #c9a227;   /* oro ceremonial, acento de valor */
  --turquoise:      #2f9c95;   /* mar / turquesa, acento frío */
  --turquoise-dim:  #1f6b66;

  /* Tipografía */
  --font-display: 'Fraunces', serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'Space Mono', monospace;

  /* Ritmo */
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --gap-section: clamp(5rem, 10vw, 9rem);
  --pad-inline: clamp(1.5rem, 6vw, 6rem);

  --shadow-soft: 0 20px 60px -20px rgba(15, 9, 3, 0.55);
  --shadow-lift: 0 30px 70px -18px rgba(15, 9, 3, 0.65);
  --ease: cubic-bezier(.22,.68,0,1);
}

/* ---------- 2. RESET ---------- */
*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
body{
  margin: 0;
  background: var(--ink);
  color: var(--sand);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
ul{ list-style: none; margin: 0; padding: 0; }
h1,h2,h3,h4{ font-family: var(--font-display); font-weight: 600; margin: 0; color: var(--sand); }
p{ margin: 0 0 1.1em; color: var(--sand-dim); }
p:last-child{ margin-bottom: 0; }
em{ color: var(--gold); font-style: italic; }
:focus-visible{ outline: 2px solid var(--turquoise); outline-offset: 3px; border-radius: 4px; }

/* Grano sutil sobre toda la página para sensación de textura de adobe */
.grain-overlay{
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 3. FRISO DECORATIVO (motivo Chimú de olas y peces) ---------- */
.frieze-divider{
  height: 46px;
  background-color: var(--adobe-dark);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='92' height='46' viewBox='0 0 92 46'%3E%3Cg fill='none' stroke='%23e8d9be' stroke-width='2.5' stroke-linecap='round' opacity='0.55'%3E%3Cpath d='M0 23 Q11.5 8 23 23 T46 23 T69 23 T92 23'/%3E%3Cpath d='M0 34 Q11.5 19 23 34 T46 34 T69 34 T92 34' opacity='0.5'/%3E%3C/g%3E%3Cg fill='%23c9a227' opacity='0.65'%3E%3Ccircle cx='23' cy='12' r='2'/%3E%3Ccircle cx='69' cy='12' r='2'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 92px 46px;
  border-top: 1px solid rgba(232,217,190,0.12);
  border-bottom: 1px solid rgba(0,0,0,0.35);
}

/* ---------- 4. BOTONES ---------- */
.btn{
  position: relative;
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 0.95em 1.9em;
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  letter-spacing: 0.01em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}
.btn:hover{ transform: translateY(-3px); }
.btn-primary{
  background: linear-gradient(135deg, var(--gold), #a97e1e 70%);
  color: var(--ink);
  box-shadow: 0 14px 30px -10px rgba(201,162,39,0.55);
}
.btn-primary:hover{ box-shadow: 0 20px 40px -12px rgba(201,162,39,0.7); }
.btn-primary::after{
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.55) 45%, transparent 60%);
  transform: translateX(-120%);
}
.btn-primary:hover::after{ transform: translateX(120%); transition: transform 0.85s var(--ease); }
.btn-ghost{
  background: rgba(232,217,190,0.06);
  border-color: rgba(232,217,190,0.35);
  color: var(--sand);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover{ border-color: var(--turquoise); background: rgba(47,156,149,0.12); }
.btn-nav{ padding: 0.7em 1.5em; font-size: 0.85rem; }

/* ---------- 5. HEADER ---------- */
.site-header{
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1.4rem var(--pad-inline);
  transition: padding 0.4s var(--ease), background 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled{
  padding: 0.85rem var(--pad-inline);
  background: rgba(33, 21, 9, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: rgba(232,217,190,0.1);
  box-shadow: 0 12px 30px -18px rgba(0,0,0,0.6);
}
.header-inner{
  max-width: 1360px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}
.logo{ display: flex; align-items: center; gap: 0.7rem; flex-shrink: 0; }
.logo-glyph{ color: var(--gold); font-size: 1.1rem; transform: rotate(0deg); transition: transform 0.6s var(--ease); }
.logo:hover .logo-glyph{ transform: rotate(90deg); }
.logo-text{ font-family: var(--font-display); font-size: 0.78rem; line-height: 1.25; letter-spacing: 0.08em; color: var(--sand-dim); }
.logo-text strong{ display: block; color: var(--sand); font-size: 1rem; font-weight: 700; }

.main-nav ul{ display: flex; gap: 2.1rem; }
.nav-link{
  position: relative; font-size: 0.88rem; font-weight: 500; color: var(--sand-dim);
  padding: 0.3rem 0; transition: color 0.3s var(--ease);
}
.nav-link::after{
  content: ''; position: absolute; left: 0; bottom: -3px; width: 0; height: 2px;
  background: var(--gold); transition: width 0.35s var(--ease);
}
.nav-link:hover, .nav-link.active{ color: var(--sand); }
.nav-link:hover::after, .nav-link.active::after{ width: 100%; }

.nav-toggle{
  display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px;
}
.nav-toggle span{ width: 24px; height: 2px; background: var(--sand); transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }

/* ---------- 6. HERO ---------- */
.hero{
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 8rem var(--pad-inline) 4rem;
  overflow: hidden;
}
.hero-layers{ position: absolute; inset: 0; z-index: 0; }
.hero-layer{ position: absolute; inset: 0; will-change: transform; }
.hero-layer--sky{
  background:
    radial-gradient(ellipse 70% 55% at 50% 8%, rgba(201,162,39,0.22), transparent 65%),
    linear-gradient(180deg, #241609 0%, #1c1108 45%, var(--ink) 100%);
}
.hero-layer--dunes-far{
  bottom: 0; top: auto; height: 55%;
  background: linear-gradient(180deg, transparent, var(--adobe-dark) 82%);
  clip-path: polygon(0 45%, 12% 38%, 27% 48%, 42% 32%, 58% 44%, 74% 30%, 88% 42%, 100% 34%, 100% 100%, 0 100%);
  opacity: 0.55;
}
.hero-layer--citadel{
  bottom: 0; top: auto; height: 46%;
  background: linear-gradient(180deg, transparent, var(--ink-soft) 88%);
  clip-path: polygon(0 60%, 6% 60%, 6% 30%, 12% 30%, 12% 55%, 18% 55%, 18% 20%, 24% 20%, 24% 50%, 32% 50%, 32% 15%, 40% 15%, 40% 48%, 48% 48%, 48% 25%, 56% 25%, 56% 52%, 64% 52%, 64% 18%, 72% 18%, 72% 46%, 80% 46%, 80% 28%, 88% 28%, 88% 55%, 94% 55%, 94% 40%, 100% 40%, 100% 100%, 0 100%);
  opacity: 0.85;
}
.hero-layer--dunes-near{
  bottom: 0; top: auto; height: 30%;
  background: linear-gradient(180deg, transparent, var(--ink) 75%);
  clip-path: polygon(0 55%, 20% 40%, 45% 58%, 70% 35%, 100% 50%, 100% 100%, 0 100%);
}
.hero-frieze{
  position: absolute; left: 0; right: 0; bottom: 0; height: 40px;
  background-color: var(--adobe-dark);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='92' height='40' viewBox='0 0 92 40'%3E%3Cg fill='none' stroke='%23e8d9be' stroke-width='2' stroke-linecap='round' opacity='0.4'%3E%3Cpath d='M0 20 Q11.5 6 23 20 T46 20 T69 20 T92 20'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x; background-size: 92px 40px;
  opacity: 0.9;
}
.eyebrow{
  display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--turquoise); margin-bottom: 1.1rem;
}
.hero-content{ position: relative; z-index: 2; max-width: 880px; }
.hero-title{
  font-size: clamp(3rem, 9vw, 6.4rem); line-height: 0.96; letter-spacing: -0.01em;
  margin-bottom: 1.2rem;
}
.hero-title-line{ display: block; color: var(--sand); }
.hero-title-line--accent{
  font-style: italic; font-weight: 500;
  background: linear-gradient(120deg, var(--gold), #e7c65e 55%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-subtitle{
  font-family: var(--font-display); font-style: italic; font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  color: var(--sand); margin-bottom: 1rem;
}
.hero-text{ max-width: 560px; margin: 0 auto 2.4rem; color: var(--sand-dim); font-size: 1.05rem; }
.hero-actions{ display: flex; gap: 1.1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 3.5rem; }

.hero-art{ position: relative; z-index: 2; width: min(880px, 92vw); }
.hero-art-frame{
  position: relative; aspect-ratio: 16/7.2; border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(232,217,190,0.09), rgba(232,217,190,0.02));
  border: 1px solid rgba(232,217,190,0.18);
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 0.8rem;
  backdrop-filter: blur(10px); box-shadow: var(--shadow-lift);
}
.placeholder-tag{
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.05em; color: var(--sand-dim);
  text-transform: uppercase; order: 2;
}
.placeholder-icon{ font-size: 2rem; color: rgba(232,217,190,0.25); order: 1; }

.scroll-cue{
  position: absolute; bottom: 1.8rem; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 26px; height: 42px; border: 2px solid rgba(232,217,190,0.4); border-radius: 20px;
}
.scroll-cue span{
  position: absolute; top: 7px; left: 50%; width: 4px; height: 8px; margin-left: -2px;
  background: var(--gold); border-radius: 3px; animation: scrollcue 1.8s infinite;
}
@keyframes scrollcue{ 0%{ opacity: 1; transform: translateY(0); } 70%{ opacity: 0; transform: translateY(14px); } 100%{ opacity: 0; } }

/* ---------- 7. SECCIONES ---------- */
.section{ padding: var(--gap-section) var(--pad-inline); position: relative; }
.section--inverted{ background: var(--ink-soft); }
.section-inner{ max-width: 1280px; margin: 0 auto; }
.section-inner--split{ display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: center; }
.section-inner--reverse .section-copy{ order: 2; }
.section-inner--reverse .section-media{ order: 1; }
.section-heading{ max-width: 680px; margin: 0 0 3.2rem; }
.section-title{ font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.1; }
.section-copy p{ font-size: 1.03rem; }
.section-copy--centered{ max-width: 760px; margin: 0 auto 2.6rem; text-align: center; }
.subsection-title{ font-size: 1.4rem; color: var(--gold); }
.subsection-title--pad{ margin: 3.2rem 0 1.6rem; }

.prose-block{ max-width: 700px; margin: 0 auto 3rem; font-size: 1.06rem; }

/* Marcos de imagen / placeholders */
.media-frame{
  position: relative; border-radius: var(--radius-md); overflow: hidden;
  background: linear-gradient(160deg, rgba(232,217,190,0.08), rgba(232,217,190,0.02));
  border: 1px solid rgba(232,217,190,0.16);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem;
  aspect-ratio: 4/3;
}
.media-frame--tall{ aspect-ratio: 3/4; }
.media-frame--square{ aspect-ratio: 1/1; margin-bottom: 1.1rem; }
.media-frame--round{ aspect-ratio: 1/1; border-radius: 50%; margin: 0 auto 1.1rem; width: 64%; }

/* Panel destacado (¿Por qué elegimos Chan Chan? / Música) */
.highlight-panel{
  display: grid; grid-template-columns: auto 1fr; gap: 1.8rem; align-items: flex-start;
  max-width: 820px; margin: 0 auto; padding: clamp(1.8rem, 4vw, 2.8rem);
  background: linear-gradient(155deg, rgba(185,111,58,0.16), rgba(185,111,58,0.03));
  border: 1px solid rgba(201,162,39,0.25);
  border-radius: var(--radius-lg);
}
.highlight-panel--music{ margin-top: 3.4rem; }
.highlight-panel-icon{
  width: 58px; height: 58px; border-radius: 50%; flex-shrink: 0;
  background: rgba(201,162,39,0.14); border: 1px solid rgba(201,162,39,0.4);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: var(--gold);
}
.highlight-panel h3{ margin-bottom: 0.7rem; font-size: 1.3rem; }

/* ---------- 8. TARJETAS ---------- */
.card-grid{ display: grid; gap: 1.6rem; }
.card-grid--3{ grid-template-columns: repeat(3, 1fr); }
.card-grid--4{ grid-template-columns: repeat(4, 1fr); }
.card-grid--values{ margin-top: 1rem; }

.card{
  position: relative;
  padding: 2.1rem 1.8rem;
  background: rgba(232,217,190,0.045);
  border: 1px solid rgba(232,217,190,0.12);
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.card:hover{
  transform: translateY(-8px);
  border-color: rgba(201,162,39,0.4);
  background: rgba(232,217,190,0.07);
  box-shadow: var(--shadow-soft);
}
.card h3, .card h4{ font-size: 1.12rem; margin-bottom: 0.6rem; }
.card p{ font-size: 0.94rem; margin-bottom: 0; }
.card-icon{
  width: 50px; height: 50px; border-radius: 50%; margin-bottom: 1.2rem;
  background: rgba(47,156,149,0.14); border: 1px solid rgba(47,156,149,0.4);
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem; color: var(--turquoise);
}
.card-list{ display: flex; flex-direction: column; gap: 0.65rem; }
.card-list li{ display: flex; align-items: center; gap: 0.7rem; font-size: 0.94rem; color: var(--sand-dim); }
.card-list i{ color: var(--gold); width: 1.1em; text-align: center; }

.card--guardian:hover, .card--scenario:hover{ border-color: rgba(47,156,149,0.4); }
.card--member{ text-align: center; }
.card--member .media-frame--round{ background: rgba(47,156,149,0.08); }
.card--member .placeholder-icon{ font-size: 1.8rem; }
.card--value{ text-align: left; }
.card--learn{ display: flex; flex-direction: row; align-items: center; gap: 1.2rem; padding: 1.5rem 1.8rem; }
.card--learn .card-icon{ margin-bottom: 0; flex-shrink: 0; }
.card--learn h3{ font-size: 1.02rem; margin: 0; }

/* ---------- 9. FOOTER ---------- */
.site-footer{ position: relative; background: var(--ink); padding-top: 0; }
.footer-frieze{
  height: 46px;
  background-color: var(--adobe-dark);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='92' height='46' viewBox='0 0 92 46'%3E%3Cg fill='none' stroke='%23e8d9be' stroke-width='2.5' stroke-linecap='round' opacity='0.55'%3E%3Cpath d='M0 23 Q11.5 8 23 23 T46 23 T69 23 T92 23'/%3E%3Cpath d='M0 34 Q11.5 19 23 34 T46 34 T69 34 T92 34' opacity='0.5'/%3E%3C/g%3E%3Cg fill='%23c9a227' opacity='0.65'%3E%3Ccircle cx='23' cy='12' r='2'/%3E%3Ccircle cx='69' cy='12' r='2'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x; background-size: 92px 46px;
}
.footer-inner{
  max-width: 720px; margin: 0 auto; padding: 4.5rem var(--pad-inline) 3rem;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.6rem;
}
.footer-brand{ display: flex; align-items: center; gap: 0.7rem; }
.footer-brand .logo-text{ font-size: 0.8rem; }
.footer-quote{ font-family: var(--font-display); font-style: italic; font-size: 1.3rem; color: var(--gold); }
.footer-social{ display: flex; gap: 1.3rem; }
.footer-social a{
  width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(232,217,190,0.2); color: var(--sand-dim);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.footer-social a:hover{ color: var(--turquoise); border-color: var(--turquoise); transform: translateY(-3px); }
.footer-legal{ font-size: 0.82rem; color: rgba(216,198,164,0.55); }

/* ---------- 10. REVEAL ON SCROLL ---------- */
.reveal{ opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-visible{ opacity: 1; transform: translateY(0); }
.card-grid .reveal:nth-child(2){ transition-delay: 0.08s; }
.card-grid .reveal:nth-child(3){ transition-delay: 0.16s; }
.card-grid .reveal:nth-child(4){ transition-delay: 0.24s; }

/* ---------- 11. RESPONSIVE ---------- */
@media (max-width: 1024px){
  .card-grid--4{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px){
  .main-nav{
    position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px); height: 100vh;
    background: rgba(28,17,8,0.97); backdrop-filter: blur(16px);
    padding: 6.5rem 2.2rem 2rem; transform: translateX(100%);
    transition: transform 0.45s var(--ease);
    border-left: 1px solid rgba(232,217,190,0.1);
  }
  .main-nav.is-open{ transform: translateX(0); }
  .main-nav ul{ flex-direction: column; gap: 1.6rem; }
  .nav-link{ font-size: 1.05rem; }
  .nav-toggle{ display: flex; }
  .btn-nav{ display: none; }
  .section-inner--split{ grid-template-columns: 1fr; }
  .section-inner--reverse .section-copy{ order: 1; }
  .section-inner--reverse .section-media{ order: 2; }
  .card-grid--3{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px){
  :root{ --gap-section: 4.5rem; }
  .card-grid--3, .card-grid--4{ grid-template-columns: 1fr; }
  .hero{ padding-top: 7rem; }
  .hero-actions{ flex-direction: column; width: 100%; }
  .hero-actions .btn{ justify-content: center; }
  .footer-social{ flex-wrap: wrap; justify-content: center; }
  .card--learn{ flex-direction: row; }
}
