/* ============================================================
   FOKKO — EL GUARDIÁN
   styles.css
   Estética: terracota, luz de vela, refugio cálido
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,300;0,400;1,300;1,400&family=DM+Sans:wght@200;300;400&display=swap');

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

:root {
  --bg:          #080503;
  --surface:     #120d08;
  --terra:       #C4735A;
  --terra-dim:   rgba(196,115,90,0.10);
  --terra-mid:   rgba(196,115,90,0.28);
  --rose:        #B05A6A;
  --cream:       #F2EBE0;
  --white:       #F5EFE6;
  --body:        rgba(245,239,230,0.80);
  --muted:       rgba(245,239,230,0.44);
  --serif:       'Playfair Display', Georgia, serif;
  --sans:        'DM Sans', Helvetica Neue, Arial, sans-serif;
  --ease-out:    cubic-bezier(0.16,1,0.3,1);
  --ease-warm:   cubic-bezier(0.34,1.06,0.64,1);
  hyphens: none;
}

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

body {
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.82;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Canvas ── */
#canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
}

nav, .wrapper { position: relative; z-index: 2; }

/* ── Nav — íntimo, casi invisible ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  padding: 1.6rem clamp(1.5rem,6vw,4rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(8,5,3,0.94) 0%, transparent 100%);
}
.nav-logo {
  font-size: 0.70rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.5s ease;
}
.nav-logo:hover { color: var(--white); }
.nav-tag {
  font-size: 0.60rem;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--terra);
  opacity: 0.8;
}

/* ── Hero ── */
#hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(5rem,10vw,9rem) clamp(1.5rem,8vw,6rem);
  position: relative;
  overflow: hidden;
}

/* Glow cálido — como una chimenea lejana */
.hero-glow {
  position: absolute;
  bottom: -10%; left: 50%;
  transform: translateX(-50%);
  width: clamp(300px,70vw,700px);
  height: clamp(200px,45vh,480px);
  background: radial-gradient(ellipse at center bottom,
    rgba(196,115,90,0.09) 0%,
    rgba(176,90,106,0.04) 40%,
    transparent 70%);
  pointer-events: none;
  animation: warmBreath 8s ease-in-out infinite;
  z-index: 0;
}
@keyframes warmBreath {
  0%,100% { opacity:0.5; transform:translateX(-50%) scaleX(0.95); }
  50%      { opacity:1;   transform:translateX(-50%) scaleX(1.05); }
}

.hero-eyebrow {
  font-size: clamp(0.58rem,1.2vw,0.70rem);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out);
  position: relative; z-index: 1;
}

/* Playfair Display — cálido, humano, literario con peso emocional */
.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.6rem,8vw,7rem);
  font-weight: 300;
  line-height: 1.05;
  color: var(--white);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.3s var(--ease-out) 0.15s, transform 1.3s var(--ease-out) 0.15s;
  margin-bottom: 1.8rem;
  position: relative; z-index: 1;
}

.hero-title .warm {
  font-style: italic;
  color: var(--terra);
}

.hero-subtitle {
  font-family: var(--serif);
  font-size: clamp(1rem,2.4vw,1.6rem);
  font-weight: 300;
  font-style: italic;
  color: rgba(245,239,230,0.60);
  max-width: 520px;
  line-height: 1.65;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.2s var(--ease-out) 0.35s, transform 1.2s var(--ease-out) 0.35s;
  margin-bottom: 3.2rem;
  position: relative; z-index: 1;
}

.hero-cta {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s var(--ease-out) 0.6s, transform 1s var(--ease-out) 0.6s;
  position: relative; z-index: 1;
}

/* ── Scroll hint ── */
.scroll-hint {
  position: absolute;
  bottom: 2.4rem; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  opacity: 0;
  animation: fadeUp 1.4s var(--ease-out) 2.6s forwards;
  z-index: 1;
}
.scroll-hint span {
  font-size: 0.56rem; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--muted);
}
.scroll-line {
  width: 1px; height: 42px;
  background: linear-gradient(to bottom, var(--terra), transparent);
  animation: scrollAnim 2.6s ease-in-out infinite;
}
@keyframes scrollAnim {
  0%   { transform:scaleY(0); transform-origin:top; }
  50%  { transform:scaleY(1); transform-origin:top; }
  51%  { transform:scaleY(1); transform-origin:bottom; }
  100% { transform:scaleY(0); transform-origin:bottom; }
}
@keyframes fadeUp { to { opacity:0.65; } }

/* ── Botón — terracota suave, acogedor ── */
.btn-primary {
  display: inline-block;
  padding: 0.9rem 2.6rem;
  border: 1px solid rgba(196,115,90,0.38);
  color: var(--white);
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  background: rgba(196,115,90,0.06);
  position: relative; overflow: hidden;
  cursor: pointer;
  transition: border-color 0.5s ease, background 0.5s ease;
}
.btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center,
    rgba(196,115,90,0.10) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.btn-primary:hover {
  border-color: rgba(196,115,90,0.7);
  background: rgba(196,115,90,0.09);
}
.btn-primary:hover::before { opacity: 1; }

/* ── Reveal — lento, suave, seguro ── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out);
}
.reveal.visible { opacity:1; transform:translateY(0); }
.reveal-d1 { transition-delay:0.12s; }
.reveal-d2 { transition-delay:0.26s; }
.reveal-d3 { transition-delay:0.42s; }
.reveal-d4 { transition-delay:0.58s; }

/* ── Divider — línea corta y cálida ── */
.divider {
  display: block;
  width: 48px; height: 1px;
  background: var(--terra-mid);
  margin: 0 auto;
  opacity: 0.55;
}

/* ── Labels & títulos ── */
.label {
  font-size: 0.60rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--terra);
  display: block;
  margin-bottom: 1.4rem;
  opacity: 0.85;
}

.sec-title {
  font-family: var(--serif);
  font-size: clamp(1.7rem,4.4vw,3.2rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 1.6rem;
}

.sec-body {
  font-size: clamp(0.97rem,1.6vw,1.08rem);
  color: var(--body);
  line-height: 1.92;
}

/* Pull quote — con líneas horizontales, centrado, íntimo ── */
.pull-quote {
  font-family: var(--serif);
  font-size: clamp(1.1rem,2.4vw,1.5rem);
  font-style: italic;
  color: rgba(196,115,90,0.88);
  text-align: center;
  margin: 2.8rem auto;
  line-height: 1.65;
  max-width: 460px;
  padding: 0 1rem;
}
.pull-quote::before,
.pull-quote::after {
  content: '';
  display: block;
  width: 28px; height: 1px;
  background: var(--terra-mid);
  margin: 0 auto;
}
.pull-quote::before { margin-bottom: 1.3rem; }
.pull-quote::after  { margin-top:    1.3rem; }

/* ── Secciones ── */
.sec {
  padding: clamp(5rem,13vw,9.5rem) clamp(1.5rem,8vw,5rem);
  max-width: 1040px;
  margin: 0 auto;
}

/* ── Identidad — centrada, íntima ── */
#identidad { text-align: center; }
#identidad .inner { max-width: 620px; margin: 0 auto; }

/* ── Herida ── */
#herida { text-align: center; }
#herida .sec-body { max-width: 540px; margin: 0 auto; }

/* ── Dones — cards con calor, bordes suaves ── */
#dones { text-align: center; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
  margin-top: 3rem;
  text-align: left;
}

.card {
  background: rgba(18,13,8,0.55);
  border: 1px solid rgba(196,115,90,0.10);
  padding: 1.7rem 1.5rem;
  position: relative; overflow: hidden;
  transition: background 0.5s ease, border-color 0.5s ease, transform 0.5s var(--ease-warm);
}
/* Glow cálido de esquina superior derecha */
.card::after {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  background: radial-gradient(circle,
    rgba(196,115,90,0.07) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.card:hover {
  background: rgba(196,115,90,0.06);
  border-color: rgba(196,115,90,0.25);
  transform: translateY(-3px);
}
.card:hover::after { opacity: 1; }

.card-icon {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--terra);
  opacity: 0.45;
  margin-bottom: 1rem;
  transition: opacity 0.4s ease;
}
.card:hover .card-icon { opacity: 0.9; }

.card-text {
  font-size: 0.93rem;
  color: rgba(245,239,230,0.82);
  line-height: 1.68;
}

/* ── Companion ── */
#companion { text-align: center; }

.chat-ui {
  background: rgba(14,9,5,0.88);
  border: 1px solid rgba(196,115,90,0.12);
  padding: 2rem;
  position: relative;
  max-width: 500px;
  margin: 3rem auto 0;
}
/* Borde superior cálido */
.chat-ui::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(to right,
    transparent, rgba(196,115,90,0.4), transparent);
}
.chat-header {
  display: flex; align-items: center; gap: 0.7rem;
  padding-bottom: 1.1rem; margin-bottom: 1.3rem;
  border-bottom: 1px solid rgba(196,115,90,0.08);
}
.chat-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--terra-dim);
  border: 1px solid rgba(196,115,90,0.28);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.64rem; color: var(--terra); flex-shrink: 0;
}
.chat-name {
  font-size: 0.72rem; letter-spacing: 0.14em;
  color: var(--terra); text-transform: uppercase;
}
.chat-status {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--terra); margin-left: auto;
  animation: blink 3s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:0.9} 50%{opacity:0.15} }

.chat-bubble {
  font-size: clamp(0.95rem,1.5vw,1.02rem);
  color: rgba(245,239,230,0.80);
  line-height: 1.92;
  text-align: left;
}

.typing-cursor {
  display: inline-block;
  width: 1px; height: 0.9em;
  background: var(--terra); margin-left: 2px;
  vertical-align: text-bottom;
  animation: cur 1.3s step-end infinite;
}
@keyframes cur { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── Ritual ── */
#ritual { text-align: center; }

.ritual-list {
  margin: 3.5rem auto 0;
  max-width: 500px; text-align: left;
}
.ritual-item {
  display: flex; align-items: flex-start; gap: 1.3rem;
  padding: 1.3rem 0;
  border-bottom: 1px solid rgba(196,115,90,0.07);
  transition: padding-left 0.5s var(--ease-out);
}
.ritual-item:first-child { border-top: 1px solid rgba(196,115,90,0.07); }
.ritual-item:hover { padding-left: 0.3rem; }

.rnum {
  font-size: 0.60rem;
  letter-spacing: 0.2em;
  color: rgba(196,115,90,0.45);
  flex-shrink: 0;
  padding-top: 0.22rem;
  transition: color 0.4s ease;
}
.ritual-item:hover .rnum { color: var(--terra); }

.rq {
  font-family: var(--serif);
  font-size: clamp(1.02rem,2.2vw,1.28rem);
  font-style: italic;
  color: var(--white);
  line-height: 1.45;
  transition: color 0.4s ease;
}
.ritual-item:hover .rq { color: rgba(196,115,90,0.88); }

/* ── Final ── */
#final {
  min-height: 60vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; position: relative;
  padding: clamp(4rem,10vw,8rem) clamp(1.5rem,6vw,4rem);
}
.final-glow {
  position: absolute;
  bottom: -5%; left: 50%;
  transform: translateX(-50%);
  width: 650px; height: 300px;
  background: radial-gradient(ellipse at center bottom,
    rgba(196,115,90,0.07) 0%,
    rgba(176,90,106,0.03) 50%,
    transparent 70%);
  pointer-events: none; z-index: 0;
}
.final-l1 {
  font-family: var(--serif);
  font-size: clamp(1.4rem,3.8vw,3rem);
  font-weight: 300;
  font-style: italic;
  color: rgba(245,239,230,0.52);
  margin-bottom: 0.2rem;
  position: relative; z-index: 1;
}
.final-l2 {
  font-family: var(--serif);
  font-size: clamp(1.4rem,3.8vw,3rem);
  font-weight: 300;
  font-style: italic;
  color: var(--white);
  margin-bottom: 3.4rem;
  position: relative; z-index: 1;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .cards-grid { grid-template-columns: 1fr; }
  .pull-quote { font-size: 1.08rem; }
}

::selection { background: rgba(196,115,90,0.22); color: var(--white); }
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(196,115,90,0.22); border-radius: 2px; }
