/* ============================================================
   EL CAMINO CUÁNTICO — Design System
   Museum-grade landing. Void · Copper · Parchment · Matrix
   ============================================================ */

/* ---------- Fonts ---------- */
/* Loaded via <link> in HTML: Cormorant Garamond, Inter, Cinzel, JetBrains Mono */

/* ---------- Tokens ---------- */
:root {
  --void: #0A0908;
  --void-2: #0D0C0A;
  --parchment: #EDE6D6;
  --parchment-muted: #A89F8D;
  --copper: #B87333;
  --copper-deep: #7A4A22;
  --copper-light: #D4A574;
  --amber-deep: #3D2817;
  --matrix-green: #00FF41;
  --matrix-green-dim: #00AA2B;

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --latin: 'Cinzel', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --measure: 720px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  background: var(--void);
  color: var(--parchment);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  cursor: none; /* replaced by custom cursor on desktop */
}
body.no-custom-cursor { cursor: auto; }

/* subtle noise texture over void */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* soft vignette */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.55) 100%);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------- Layout primitives ---------- */
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 28px; position: relative; z-index: 2; }
section { position: relative; z-index: 2; }

.section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18vh 0;
}
.section--tight { min-height: auto; padding: 16vh 0; }

/* ---------- Type styles ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--copper);
  opacity: 0.85;
  margin-bottom: 2.2rem;
}
.eyebrow .dim { color: var(--matrix-green-dim); }

.headline {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--parchment);
}
.headline em { font-style: italic; color: var(--copper-light); }

.subhead {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.7;
  color: var(--parchment-muted);
  opacity: 0.72;
  max-width: 640px;
}

.body-lg {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  line-height: 1.55;
  color: var(--parchment);
}
.body {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--parchment-muted);
  max-width: 640px;
}

/* Latin phrase (Cinzel) */
.latin {
  font-family: var(--latin);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--copper);
  text-transform: uppercase;
}

/* Matrix / CLI text */
.cli {
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--matrix-green);
  text-shadow: 0 0 8px rgba(0,255,65,0.28);
}
.cli .prompt { color: var(--matrix-green-dim); }
.cli .muted { color: var(--matrix-green-dim); }

/* ============================================================
   HERO / LA PUERTA
   ============================================================ */
#hero {
  height: 100vh;
  min-height: 640px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-inner {
  max-width: 860px;
  padding: 0 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 3;
}

/* Black silence overlay + terminal intro */
#intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--void);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.2s var(--ease);
}
#intro-overlay.hidden { opacity: 0; pointer-events: none; }
#intro-terminal {
  font-family: var(--mono);
  font-size: clamp(0.8rem, 2.4vw, 1.05rem);
  line-height: 1.9;
  color: var(--matrix-green);
  text-shadow: 0 0 10px rgba(0,255,65,0.35);
  width: min(560px, 88vw);
  text-align: left;
  white-space: pre-wrap;
  opacity: 0;
}
#intro-terminal .caret {
  display: inline-block;
  width: 0.6ch;
  background: var(--matrix-green);
  animation: blink 1s steps(1) infinite;
  color: transparent;
}
@keyframes blink { 50% { opacity: 0; } }

/* El Sello — logo original patinado + transición verde Matrix → cobre + partícula viajera */
.sello-stage {
  position: relative;
  width: clamp(240px, 50vw, 460px);
  aspect-ratio: 672 / 354;
  margin: 0 auto 2.4rem;
  opacity: 0;
  will-change: transform, opacity;
}
/* Sello — imagen patinada de cobre, sin transiciones de color.
   El sello se materializa directamente en cobre oxidado, con respiración
   perpetua de luz. */
.sello-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
  filter:
    saturate(1.15)
    brightness(1.03)
    drop-shadow(0 0 22px rgba(184, 115, 51, 0.38));
  animation: sello-breathe 4s ease-in-out infinite;
}
.sello-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.sello-overlay.is-visible { opacity: 1; }
@keyframes sello-breathe {
  0%, 100% { filter:
    hue-rotate(0deg) saturate(1.15) brightness(1.03)
    drop-shadow(0 0 18px rgba(184, 115, 51, 0.30)); }
  50%      { filter:
    hue-rotate(0deg) saturate(1.20) brightness(1.10)
    drop-shadow(0 0 26px rgba(212, 165, 116, 0.45)); }
}

.hero-headline { margin-bottom: 1.6rem; }
.hero-sub { margin: 0 auto 2.4rem; }
.hero-sub br { display: block; }
.hero-latin {
  font-size: clamp(0.72rem, 2vw, 1rem);
  margin-bottom: 3rem;
}

/* scroll indicator */
.scroll-cue {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 3;
  opacity: 0;
}
.scroll-cue .line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, transparent, var(--copper));
  animation: cue-slide 2.4s ease-in-out infinite;
}
.scroll-cue .lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--parchment-muted);
  opacity: 0.5;
}
@keyframes cue-slide {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}

.hero-whisper {
  position: absolute;
  bottom: 26px;
  right: 32px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--parchment-muted);
  opacity: 0.4;
  max-width: 260px;
  text-align: right;
  z-index: 3;
  line-height: 1.6;
}

/* ============================================================
   Reveal system (JS toggles .in)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(8px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
  filter: blur(0);
}
.reveal.d1 { transition-delay: 0.12s; }
.reveal.d2 { transition-delay: 0.24s; }
.reveal.d3 { transition-delay: 0.36s; }

/* ============================================================
   CLI card (science equation, form)
   ============================================================ */
.cli-card {
  border: 1px solid rgba(0,255,65,0.22);
  background: linear-gradient(180deg, rgba(0,20,6,0.45), rgba(0,10,3,0.25));
  border-radius: 8px;
  padding: 1.5rem 1.6rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--matrix-green);
  text-shadow: 0 0 8px rgba(0,255,65,0.22);
  box-shadow: inset 0 0 40px rgba(0,255,65,0.04), 0 20px 60px rgba(0,0,0,0.4);
  overflow-x: auto;
}
.cli-card .bar {
  display: flex;
  gap: 7px;
  margin-bottom: 1rem;
  opacity: 0.5;
}
.cli-card .bar i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--matrix-green-dim);
  display: inline-block;
}
.cli-card .prompt { color: var(--matrix-green-dim); }
.cli-card .ok { color: var(--matrix-green); }
.cli-card [data-typed] { white-space: pre-wrap; }

/* ============================================================
   EL PUENTE — equivalence lines
   ============================================================ */
.bridge-line {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  line-height: 1.5;
  color: var(--parchment);
  padding: 1.4rem 0;
  border-bottom: 1px solid rgba(184,115,51,0.14);
}
.bridge-line:last-child { border-bottom: none; }
.bridge-line .phys { color: var(--parchment-muted); }
.bridge-line .faith { color: var(--copper-light); font-style: italic; }
.bridge-line .arrow { color: var(--copper); padding: 0 0.5em; font-family: var(--mono); font-size: 0.8em; }

/* ============================================================
   LOS 12 TESTIGOS
   ============================================================ */
.witness-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(184,115,51,0.14);
  border: 1px solid rgba(184,115,51,0.14);
  margin-top: 2.4rem;
}
.witness-grid .cell {
  background: var(--void);
  padding: 1.5rem 1.2rem;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.15rem;
  color: var(--parchment);
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
  position: relative;
}
.witness-grid .cell .idx {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--copper);
  opacity: 0.6;
  display: block;
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
}
.witness-grid .cell:hover {
  background: var(--amber-deep);
  color: var(--copper-light);
}
.witness-summary {
  display: flex;
  gap: 2.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.witness-summary .stat { }
.witness-summary .num {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2.6rem;
  color: var(--copper);
  line-height: 1;
}
.witness-summary .cap {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--parchment-muted);
  opacity: 0.7;
  margin-top: 0.5rem;
}

/* ============================================================
   LA INVITACIÓN — email capture
   ============================================================ */
#invite { text-align: left; }
.signal-form { margin-top: 2.6rem; max-width: 560px; }
.signal-input-row {
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(0,255,65,0.3);
  border-radius: 6px;
  background: rgba(0,15,5,0.3);
  font-family: var(--mono);
  overflow: hidden;
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.signal-input-row:focus-within {
  border-color: var(--matrix-green);
  box-shadow: 0 0 24px rgba(0,255,65,0.18);
}
.signal-input-row .lead {
  display: flex;
  align-items: center;
  padding: 0 0 0 1rem;
  color: var(--matrix-green-dim);
  font-size: 1rem;
  user-select: none;
}
.signal-form input[type="email"] {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--matrix-green);
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 1rem 0.8rem;
  text-shadow: 0 0 6px rgba(0,255,65,0.25);
}
.signal-form input[type="email"]::placeholder { color: rgba(0,170,43,0.55); }
.signal-form button.submit {
  background: transparent;
  border: none;
  border-left: 1px solid rgba(0,255,65,0.3);
  color: var(--matrix-green);
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  padding: 0 1.4rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.signal-form button.submit:hover { background: rgba(0,255,65,0.12); }
.signal-form button.submit:focus-visible { outline: 2px solid var(--matrix-green); outline-offset: 2px; }

.lang-choice {
  display: flex;
  gap: 1.8rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--parchment-muted);
}
.lang-choice label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  letter-spacing: 0.05em;
}
.lang-choice input[type="radio"] {
  appearance: none;
  width: 13px; height: 13px;
  border: 1px solid var(--copper);
  border-radius: 50%;
  position: relative;
  cursor: pointer;
}
.lang-choice input[type="radio"]:checked {
  background: var(--copper);
  box-shadow: 0 0 8px rgba(184,115,51,0.5);
}
.lang-choice input[type="radio"]:focus-visible { outline: 2px solid var(--copper-light); outline-offset: 2px; }

.form-note {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--parchment-muted);
  opacity: 0.55;
  margin-top: 1.5rem;
}
.form-success {
  display: none;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--matrix-green);
  text-shadow: 0 0 8px rgba(0,255,65,0.25);
  margin-top: 2.6rem;
  padding: 1.4rem 1.6rem;
  border: 1px solid rgba(0,255,65,0.3);
  border-radius: 6px;
  background: rgba(0,15,5,0.3);
  line-height: 1.9;
}
.form-success.show { display: block; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid rgba(184,115,51,0.14);
  padding: 6rem 0 4rem;
  position: relative;
  z-index: 2;
}
.footer-seal {
  width: 120px;
  aspect-ratio: 672 / 354;
  margin: 0 auto 2rem;
  opacity: 0.8;
}
.footer-seal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: saturate(1.1) brightness(1) drop-shadow(0 0 8px rgba(184,115,51,0.2));
}
.footer-names {
  text-align: center;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--parchment);
  margin-bottom: 0.8rem;
}
.footer-emails {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--copper);
  margin-bottom: 1.6rem;
}
.footer-emails a { transition: color 0.3s var(--ease); }
.footer-emails a:hover { color: var(--copper-light); }
.footer-latin {
  text-align: center;
  font-size: 0.72rem;
  margin-bottom: 2.4rem;
}
.footer-quote {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.15rem;
  color: var(--parchment-muted);
  max-width: 540px;
  margin: 0 auto 2.4rem;
  line-height: 1.6;
}
.footer-copy {
  text-align: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--parchment-muted);
  opacity: 0.5;
}

/* Footer easter-egg terminal */
.egg-terminal {
  max-width: 560px;
  margin: 0 auto 3.4rem;
  border: 1px solid rgba(0,255,65,0.18);
  border-radius: 8px;
  background: rgba(0,12,4,0.4);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.8;
  overflow: hidden;
}
.egg-terminal .egg-bar {
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid rgba(0,255,65,0.14);
  color: var(--matrix-green-dim);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 7px;
}
.egg-terminal .egg-bar i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--matrix-green-dim); display: inline-block; opacity: 0.6;
}
.egg-output {
  padding: 1rem 1rem 0.4rem;
  min-height: 90px;
  max-height: 260px;
  overflow-y: auto;
  color: var(--matrix-green);
  text-shadow: 0 0 6px rgba(0,255,65,0.2);
  white-space: pre-wrap;
  word-break: break-word;
}
.egg-output .cmd { color: var(--parchment-muted); }
.egg-input-row {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem 0.9rem;
  gap: 0.5rem;
}
.egg-input-row .pmt { color: var(--matrix-green-dim); }
.egg-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--matrix-green);
  font-family: var(--mono);
  font-size: 0.82rem;
  text-shadow: 0 0 6px rgba(0,255,65,0.2);
  caret-color: var(--matrix-green);
}

/* ============================================================
   Custom cursor + particles
   ============================================================ */
#cursor {
  position: fixed;
  top: 0; left: 0;
  width: 10px; height: 10px;
  border: 1px solid var(--copper);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9500;
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease), height 0.25s var(--ease),
              border-color 0.25s var(--ease), background 0.25s var(--ease);
  mix-blend-mode: normal;
  will-change: transform;
}
#cursor.hover { width: 30px; height: 30px; border-color: var(--copper-light); background: rgba(212,165,116,0.06); }
#cursor.cli { width: 20px; height: 20px; border-color: var(--matrix-green); background: rgba(0,255,65,0.05); }

#particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .witness-grid { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 14vh 0; }
  #hero { flex-direction: column; }
  .hero-inner { margin-top: auto; }
  .hero-whisper { position: static; text-align: center; max-width: 320px; margin: 2.4rem auto auto; opacity: 0.5; padding: 0 20px; }
  .scroll-cue { display: none; }
  .signal-input-row { flex-direction: column; }
  .signal-form button.submit { border-left: none; border-top: 1px solid rgba(0,255,65,0.3); padding: 0.9rem; }
  .witness-summary { gap: 1.6rem; }
}
@media (max-width: 440px) {
  .witness-grid { grid-template-columns: 1fr; }
}

/* Focus states, general */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--copper-light);
  outline-offset: 3px;
}
::selection { background: rgba(184,115,51,0.35); color: var(--parchment); }
