/* ============================================================
   Tokens
   ============================================================ */
:root {
  --black: #08040a;
  --violet-deep: #241025;
  --violet: #3a123d;
  --violet-2: #4b164c;
  --ivory: #f4ecdf;
  --ivory-dim: rgba(244, 236, 223, 0.66);
  --gold: #c9a227;
  --gold-light: #d4af37;
  --gold-deep: #b8942e;
  --rose: #cf9a95;

  --font-serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-sans: 'Manrope', -apple-system, 'Segoe UI', sans-serif;

  --ease-premium: cubic-bezier(0.16, 0.7, 0.2, 1);
}

/* ============================================================
   Reset
   ============================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: var(--black);
  scrollbar-width: thin;
  scrollbar-color: var(--violet-2) transparent;
}

body {
  background: var(--black);
  color: var(--ivory);
  font-family: var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

input {
  font-family: inherit;
}

/* ============================================================
   Scroll driver — tall track that powers the eagle's flight
   ============================================================ */
.scroll-driver {
  position: relative;
  height: 380vh;
}

.stage {
  position: sticky;
  top: 0;
  height: 100svh;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
}

/* ---- backdrop: violet → black, the world the eagle lives in ---- */
.stage__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 85% at 50% 18%, var(--violet-2) 0%, var(--violet) 32%, var(--violet-deep) 58%, var(--black) 82%);
}

.stage__backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(140% 100% at 50% 100%, rgba(0,0,0,0.65) 0%, transparent 55%);
}

/* ---- eagle layer ----
   No z-index here on purpose: a stacking context would trap the video's
   screen blend and paint its black frame as an opaque rectangle instead of
   letting it dissolve into the backdrop. */
.stage__eagle-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.stage__eagle {
  width: 145vw;
  max-width: 1900px;
  height: auto;
  mix-blend-mode: screen;
  filter: sepia(0.16) saturate(1.18) brightness(1.06) contrast(1.08);
  opacity: 0;
  /* The bird sits in the left quarter of the frame; anchoring the origin
     there keeps it in place as it scales instead of drifting to centre. */
  transform-origin: 25% 50%;
  will-change: opacity, transform;
}

/* ---- fine film grain, extremely subtle ---- */
.stage__grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ============================================================
   Content layer
   ============================================================ */
.stage__content {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8vh clamp(20px, 6vw, 64px);
}

/* ---- hero ---- */
.hero {
  text-align: center;
  max-width: 1000px;
  will-change: transform, opacity;
}

.hero__kicker {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: clamp(18px, 3vh, 28px);
  text-shadow: 0 2px 20px rgba(8, 4, 10, 0.7);
  opacity: 0;
  animation: rise-in 1.2s var(--ease-premium) 0.15s forwards;
}

.hero__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(34px, 6.6vw, 92px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--ivory);
  text-shadow: 0 4px 40px rgba(8, 4, 10, 0.55), 0 1px 4px rgba(8, 4, 10, 0.4);
}

.hero__title .line {
  display: block;
  overflow: hidden;
}

.hero__title em {
  font-style: italic;
  color: var(--gold-light);
}

.hero__title .line {
  opacity: 0;
  transform: translateY(46px);
  animation: rise-in 1.15s var(--ease-premium) forwards;
}

.hero__title .line:nth-child(1) { animation-delay: 0.32s; }
.hero__title .line:nth-child(2) { animation-delay: 0.48s; }
.hero__title .line:nth-child(3) { animation-delay: 0.64s; }

.hero__subtitle {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(14px, 1.6vw, 17px);
  letter-spacing: 0.02em;
  color: var(--ivory-dim);
  margin-top: clamp(18px, 3vh, 30px);
  text-shadow: 0 2px 16px rgba(8, 4, 10, 0.6);
  opacity: 0;
  animation: rise-in 1.2s var(--ease-premium) 0.85s forwards;
}

@keyframes rise-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- scroll cue ---- */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(28px, 5vh, 48px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.6s var(--ease-premium);
}

.scroll-cue.is-visible {
  opacity: 1;
}

.scroll-cue.is-hidden {
  opacity: 0;
}

.scroll-cue__label {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  font-weight: 500;
}

.scroll-cue__line {
  position: relative;
  width: 1px;
  height: 34px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  overflow: hidden;
}

.scroll-cue__dot {
  position: absolute;
  top: 0;
  left: -1.5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 6px var(--gold-light);
  animation: cue-drop 2.2s ease-in-out infinite;
}

@keyframes cue-drop {
  0% { transform: translateY(0); opacity: 0; }
  30% { opacity: 1; }
  85% { opacity: 0; }
  100% { transform: translateY(34px); opacity: 0; }
}

/* ============================================================
   Form panel
   ============================================================ */
.form-panel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8vh clamp(20px, 6vw, 64px);
  opacity: 0;
  transform: translateY(28px);
  pointer-events: none;
  will-change: transform, opacity;
}

.form-panel.is-active {
  pointer-events: auto;
}

.form {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: clamp(32px, 4vw, 44px) clamp(26px, 3.4vw, 40px);
  border-radius: 2px;
  background: linear-gradient(155deg, rgba(36, 16, 37, 0.55), rgba(8, 4, 10, 0.5));
  border: 1px solid rgba(212, 175, 55, 0.22);
  backdrop-filter: blur(22px) saturate(1.1);
  -webkit-backdrop-filter: blur(22px) saturate(1.1);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* El control envuelve sólo input + label, para que la línea dorada quede
   anclada al input y no se desplace cuando aparece el mensaje de error. */
.field__control {
  position: relative;
  display: block;
}

.field input {
  width: 100%;
  padding: 14px 2px 10px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(244, 236, 223, 0.28);
  color: var(--ivory);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.01em;
  border-radius: 0;
  transition: border-color 0.5s var(--ease-premium);
}

.field input:focus {
  outline: none;
  border-bottom-color: var(--gold-light);
}

.field label {
  position: absolute;
  left: 2px;
  top: 14px;
  font-size: 15px;
  color: var(--ivory-dim);
  letter-spacing: 0.01em;
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.35s var(--ease-premium), color 0.35s var(--ease-premium);
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  transform: translateY(-18px) scale(0.72);
  color: var(--gold-light);
}

.field__control::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 0;
  background: var(--gold-light);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.7);
  transition: width 0.5s var(--ease-premium);
}

.field__control:focus-within::after {
  width: 100%;
}

/* ---- validación ---- */
.field__error {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--rose);
  margin-top: 7px;
  min-height: 13px;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.4s var(--ease-premium), transform 0.4s var(--ease-premium);
}

.field.is-invalid .field__error {
  opacity: 1;
  transform: translateY(0);
}

.field.is-invalid input {
  border-bottom-color: var(--rose);
}

/* Especificidad alta a propósito: tiene que ganarle a la regla del label
   flotante, que si no deja la etiqueta en dorado sobre un campo con error. */
.field.is-invalid .field__control input + label {
  color: var(--rose);
}

.form__notice {
  font-size: 12px;
  letter-spacing: 0.03em;
  line-height: 1.5;
  color: var(--rose);
  text-align: center;
  min-height: 0;
}

.form__notice:not(:empty) {
  margin-top: -4px;
}

.cta {
  position: relative;
  overflow: hidden;
  margin-top: 8px;
  padding: 16px 28px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-deep));
  color: var(--violet-deep);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 1px;
  transition: transform 0.35s var(--ease-premium), box-shadow 0.35s var(--ease-premium), filter 0.35s var(--ease-premium);
  box-shadow: 0 10px 30px -12px rgba(201, 162, 39, 0.55);
}

.cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 16px 38px -14px rgba(201, 162, 39, 0.7);
}

.cta:active {
  transform: translateY(0);
}

.cta.is-busy {
  cursor: default;
  transform: none;
  filter: none;
  color: rgba(36, 16, 37, 0.75);
}

/* Un brillo lento cruza el botón mientras se envía. */
.cta.is-busy::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  animation: cta-sheen 1.5s var(--ease-premium) infinite;
}

@keyframes cta-sheen {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.cta:focus-visible {
  outline: 1px solid var(--gold-light);
  outline-offset: 3px;
}

/* ---- success state ---- */
.form__success {
  display: none;
  width: 100%;
  max-width: 420px;
  text-align: center;
  padding: clamp(40px, 6vw, 56px) clamp(26px, 3.4vw, 40px);
}

.form__success.is-visible {
  display: block;
  animation: rise-in 0.9s var(--ease-premium) forwards;
}

.form__success-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(30px, 4vw, 42px);
  color: var(--gold-light);
  margin-bottom: 12px;
}

.form__success-text {
  font-size: 14px;
  color: var(--ivory-dim);
  letter-spacing: 0.02em;
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .hero__title .line,
  .hero__kicker,
  .hero__subtitle,
  .scroll-cue,
  .form__success.is-visible {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .scroll-driver {
    height: 420vh;
  }

  .stage__eagle {
    width: 260vw;
  }

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

  .hero__title {
    font-size: clamp(30px, 9vw, 44px);
  }
}

@media (max-width: 480px) {
  .form {
    max-width: 100%;
    padding: 30px 22px;
  }

  .hero__kicker {
    letter-spacing: 0.24em;
  }
}

@media (min-width: 1600px) {
  .stage__eagle {
    width: 1500px;
  }
}
