/* ==========================================================================
   Tramontana Ventures · landing
   Escena por capas + logo. Las posiciones del sol (--sun-x / --sun-y) y la
   escala (--s) las calcula js/main.js para que todo encaje en cualquier pantalla.
   ========================================================================== */

:root {
  --ink: #1b1813;
  --gold: #a26e2c;
  --gold-light: #d9a55a;
  --os: 48px;                 /* margen extra de la escena para el parallax */
  --sun-x: 50%;
  --sun-y: 72%;
  --s: 1;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-inout: cubic-bezier(.65, 0, .35, 1);
}

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

html, body { height: 100%; }

body {
  overflow: hidden;
  background: #e5d3b0;
  color: var(--ink);
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

/* Hasta que cargan la fuente y la escena, pantalla de noche */
.js:not(.is-ready) body { background: #0e1326; }
.js:not(.is-ready) .stage,
.js:not(.is-ready) .brand,
.js:not(.is-ready) .mail { visibility: hidden; }

/* --------------------------------------------------------------------------
   Escena
   -------------------------------------------------------------------------- */

.stage {
  position: fixed;
  inset: calc(var(--os) * -1);
  overflow: hidden;
}

.layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

[data-depth] { will-change: transform; }

.layer > svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* Cielo base */
.sky {
  background:
    radial-gradient(140% 80% at 50% -10%, rgba(110, 86, 52, .07), transparent 55%),
    linear-gradient(180deg, #e6d6b6 0%, #ebd8b0 30%, #f0d8a6 55%, #f4d79d 72%, #f4d294 100%);
}

/* Sol */
.sun__halo,
.sun__core,
.sun__streak { position: absolute; border-radius: 50%; }

.sun__halo {
  width: calc(var(--s) * 2100px);
  height: calc(var(--s) * 1100px);
  left: calc(var(--sun-x) - var(--s) * 1050px);
  top: calc(var(--sun-y) - var(--s) * 550px);
  background: radial-gradient(closest-side,
    rgba(255, 253, 244, 1) 0%,
    rgba(255, 250, 230, .95) 6%,
    rgba(255, 243, 208, .8) 14%,
    rgba(254, 233, 186, .55) 28%,
    rgba(251, 224, 168, .3) 46%,
    rgba(249, 218, 158, .12) 68%,
    rgba(249, 218, 158, 0) 100%);
}

.sun__core {
  width: calc(var(--s) * 190px);
  height: calc(var(--s) * 190px);
  left: calc(var(--sun-x) - var(--s) * 95px);
  top: calc(var(--sun-y) - var(--s) * 95px);
  background:
    radial-gradient(circle, #fff 0%, #fff 8%, rgba(255, 255, 250, 0) 13%),
    radial-gradient(circle,
    #ffffff 0%, #fffefa 18%,
    rgba(255, 252, 238, .92) 28%,
    rgba(255, 245, 218, .55) 44%,
    rgba(255, 240, 205, .18) 60%,
    rgba(255, 238, 200, 0) 72%);
}

.sun__streak {
  width: calc(var(--s) * 1500px);
  height: calc(var(--s) * 9px);
  left: calc(var(--sun-x) - var(--s) * 750px);
  top: calc(var(--sun-y) - var(--s) * 4.5px);
  background: radial-gradient(closest-side, rgba(255, 249, 232, .75), rgba(255, 249, 232, 0));
}

/* Rayos de luz */
.rays {
  inset: auto;
  border-radius: 50%;
  width: calc(var(--s) * 1500px);
  height: calc(var(--s) * 1500px);
  left: calc(var(--sun-x) - var(--s) * 750px);
  top: calc(var(--sun-y) - var(--s) * 750px);
  -webkit-mask-image: radial-gradient(closest-side, #000 4%, rgba(0, 0, 0, .6) 30%, rgba(0, 0, 0, 0) 78%);
          mask-image: radial-gradient(closest-side, #000 4%, rgba(0, 0, 0, .6) 30%, rgba(0, 0, 0, 0) 78%);
  mix-blend-mode: screen;
}

/* Nubes, montañas: su tamaño y posición los pone el JS */
.clouds, .ridge { inset: auto; }

/* Luz del sol que se derrama sobre las montañas */
.glow {
  background:
    radial-gradient(calc(var(--s) * 760px) calc(var(--s) * 210px) at var(--sun-x) calc(var(--sun-y) + var(--s) * 50px),
      rgba(255, 240, 200, .95), rgba(255, 226, 168, .5) 38%, rgba(255, 222, 160, 0) 78%);
  mix-blend-mode: screen;
}

/* Polvo flotando en la luz */
.dust { width: 100%; height: 100%; }

/* Textura de papel */
.grain {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .32  0 0 0 0 .24  0 0 0 0 .15  0 0 0 .9 -.25'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='900' height='900'><filter id='m'><feTurbulence type='fractalNoise' baseFrequency='.004' numOctaves='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .34  0 0 0 0 .2  0 0 0 1.1 -.5'/></filter><rect width='100%' height='100%' filter='url(%23m)'/></svg>");
  background-size: 240px 240px, cover;
  background-repeat: repeat, no-repeat;
  mix-blend-mode: multiply;
  opacity: .5;
}

.vignette {
  background:
    linear-gradient(to top, rgba(20, 14, 8, .82) 0%, rgba(24, 17, 10, .5) 9%, rgba(24, 17, 10, 0) 24%),
    radial-gradient(130% 105% at 50% 42%, rgba(60, 40, 18, 0) 55%, rgba(60, 40, 18, .26) 100%);
}

/* Noche (solo durante la intro) */
.night {
  background: linear-gradient(180deg, #0b1022 0%, #161c37 40%, #2e2b48 72%, #4d3a4a 100%);
  mix-blend-mode: multiply;
  opacity: 0;
}

.stars { width: 100%; height: 100%; opacity: 0; }

/* Destello de lente que sigue un poco al cursor */
.flare {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  mix-blend-mode: screen;
}

.flare i {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  will-change: transform;
}

/* --------------------------------------------------------------------------
   Logo
   -------------------------------------------------------------------------- */

.brand {
  position: fixed;
  left: 50%;
  top: 41%;
  translate: -50% -50%;
  z-index: 5;
  width: min(51vw, 98vh, 860px);
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.rocket {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: block;
  width: 14.4cqi;
  height: 28.8cqi;
  color: var(--gold);
  position: relative;
  z-index: 2;
  border-radius: 40px;
  -webkit-tap-highlight-color: transparent;
  /* intensidad del acelerón: desplazamiento, giro, tamaño y caída de las chispas */
  --amp: 1;
  --rot: 1;
  --sp: 1;
  --fall: 1;
}

/* En móvil el cohete es la mitad de grande: el acelerón se amplía para que se note
   e invite a pulsarlo */
@media (hover: none), (max-width: 700px) {
  .rocket { --amp: 2.8; --rot: 2.4; --sp: 2.6; --fall: 1.9; }
}

.rocket:focus-visible { outline: 2px solid rgba(162, 110, 44, .55); outline-offset: 8px; }

.rocket__float { display: block; width: 100%; height: 100%; position: relative; }

/* El dibujo es más grande que el botón (viewBox -20 -45 140 345): el cohete ocupa
   exactamente el botón y el margen sobrante queda fuera, sin capturar clics */
.rocket__svg {
  position: absolute;
  left: -20%;
  top: -22.5%;
  width: 140%;
  height: 172.5%;
  display: block;
  overflow: visible;
  pointer-events: none;
}

.rocket .draw {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.rocket__port { fill: currentColor; }
.trail { fill: url(#trailGrad); }
.rocket__glow { opacity: 0; mix-blend-mode: multiply; }

.rocket__boost,
.rocket__trails,
.trail,
.rocket__ship,
.rocket__rig,
.rocket__glow,
.spark {
  transform-box: fill-box;
  transform-origin: 50% 0;
}

.rocket__glow,
.rocket__ship,
.rocket__rig,
.spark { transform-origin: 50% 50%; }

.spark { fill: #d9a04c; opacity: 0; }

.rocket__boost { transition: transform .55s var(--ease-out); }

.brand__name {
  font-weight: 500;
  line-height: 1;
  margin-top: -3.5cqi;
}

.brand__word {
  display: block;
  font-size: 8.6cqi;
  letter-spacing: .44em;
  padding-left: .44em;
  white-space: nowrap;
}

.brand__word > span { display: inline-block; }

.brand__sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5.2cqi;
  margin-top: 1.9cqi;
  font-size: 5.9cqi;
  letter-spacing: .55em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand__ventures { display: block; margin-right: -.55em; }

.line {
  display: block;
  width: 16.3cqi;
  height: max(2px, .42cqi);
  background: var(--gold);
  translate: 0 .06em;
}

.line--l { transform-origin: 100% 50%; }
.line--r { transform-origin: 0 50%; }

.brand__tagline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4.3cqi;
  margin-top: 5.9cqi;
  font-size: 3.7cqi;
  font-weight: 600;
  letter-spacing: .34em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand__tagline span { display: block; margin-right: -.34em; }

.dot {
  display: block;
  width: 1.9cqi;
  height: 1.9cqi;
  border-radius: 50%;
  background: var(--ink);
}

/* Email */
.mail {
  position: fixed;
  left: 50%;
  bottom: max(3.6vh, calc(env(safe-area-inset-bottom) + 14px));
  translate: -50% 0;
  z-index: 5;
  overflow: hidden;
  padding: 1.05em 1.7em;
  border-radius: 999px;
  font: 400 clamp(12px, 1.02vw, 15px)/1 "Montserrat", system-ui, sans-serif;
  letter-spacing: .02em;
  color: #f7f0e4;
  text-decoration: none;
  background: rgba(24, 17, 10, .5);
  border: 1px solid rgba(255, 240, 214, .34);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  transition: border-color .5s, background-color .5s, color .5s;
}

.mail::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 222, 160, .38) 50%, transparent 70%);
  translate: -120% 0;
  transition: translate 1s var(--ease-out);
}

.mail:hover, .mail:focus-visible {
  border-color: rgba(222, 174, 96, .75);
  background-color: rgba(24, 17, 10, .66);
  color: #fff;
  outline: none;
}

.mail:hover::after, .mail:focus-visible::after { translate: 120% 0; }

/* Estela que deja el cohete al despegar */
.contrail {
  position: fixed;
  left: 0;
  top: 0;
  width: 3px;
  height: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  border-radius: 3px;
  transform-origin: 50% 100%;
  background: linear-gradient(to top, rgba(162, 110, 44, .9), rgba(190, 138, 66, .45) 45%, rgba(220, 180, 120, 0));
}

/* --------------------------------------------------------------------------
   Intro (amanecer) · solo cuando la página está lista
   -------------------------------------------------------------------------- */

.is-ready .night  { animation: fade-out 3.6s .3s var(--ease-inout) both; }
.is-ready .stars  { animation: fade-out 2.4s .3s ease-in both; }
.is-ready .sun    { animation: sunrise 3.8s .1s cubic-bezier(.3, .1, .2, 1) both; }
.is-ready .glow   { animation: fade-in 3.2s .7s ease-out both; }
.is-ready .rays--a { animation: fade-in 3s 1.8s ease-out both, sway-a 34s 1.8s ease-in-out infinite alternate; }
.is-ready .rays--b { animation: fade-in 3s 2.4s ease-out both, sway-b 27s 2.4s ease-in-out infinite alternate; }
.is-ready .dust   { animation: fade-in 3s 2.6s ease-out both; }
.is-ready .flare  { animation: fade-in 2.5s 3.4s ease-out both; }

.is-ready .sun__halo { animation: breathe 9s 4s ease-in-out infinite alternate; }
.is-ready .sun__core { animation: shimmer 6s 4s ease-in-out infinite alternate; }

.is-ready .clouds--left  { animation: drift-l 70s ease-in-out infinite alternate; }
.is-ready .clouds--right { animation: drift-r 80s ease-in-out infinite alternate; }
.is-ready .clouds--wisps { animation: drift-w 50s ease-in-out infinite alternate; }

/* Cohete: se dibuja, se encienden las estelas y queda flotando */
.js .draw { stroke-dasharray: 1 1.02; stroke-dashoffset: 1; }
.is-ready .draw { animation: draw 1.7s 1s var(--ease-inout) both; }
.is-ready .rocket__port { animation: pop .6s 2.2s var(--ease-out) both; }
.is-ready .rocket__trails { animation: ignite .8s 2.5s cubic-bezier(.2, .9, .25, 1.2) both; }
.is-ready .trail--c { animation: flicker 1.9s 3.3s ease-in-out infinite; }
.is-ready .trail--l { animation: flicker 1.5s 3.4s ease-in-out infinite reverse; }
.is-ready .trail--r { animation: flicker 1.7s 3.5s ease-in-out infinite; }
.is-ready .rocket__glow { animation: glow 2.6s 2.6s ease-in-out infinite alternate; }
.is-ready .rocket__float { animation: lift 1.2s 2.5s var(--ease-out) both, float 5.5s 3.7s ease-in-out infinite alternate; }

/* Texto */
.is-ready .brand__word > span {
  animation: letter-in 1.3s calc(2.7s + var(--o) * .09s) var(--ease-out) both;
}
.is-ready .brand__ventures { animation: rise-in 1.1s 3.35s var(--ease-out) both; }
.is-ready .line { animation: grow-x 1.2s 3.45s var(--ease-out) both; }
.is-ready .brand__tagline > * { animation: rise-in .9s calc(3.85s + var(--k) * .13s) var(--ease-out) both; }
.is-ready .mail { animation: rise-in 1.1s 4.5s var(--ease-out) both; }

/* Acelerones en reposo: el JS añade .is-revving a ratos, como si quisiera despegar */
.rocket.is-revving .rocket__rig   { animation: rev-rig 1.4s ease-in-out; }
.rocket.is-revving .rocket__boost { animation: rev-thrust 1.4s ease-in-out; }
.rocket.is-revving .rocket__glow  { animation: rev-glow 1.4s ease-in-out; }
.rocket.is-revving .spark         { animation: spark .85s calc(.2s + var(--sd)) ease-out both; }

@media (hover: hover) {
  .rocket:hover .rocket__boost { transform: scaleY(1.35); }
  .rocket:hover .rocket__rig { animation: shake .11s linear infinite; }
  .rocket:hover .rocket__glow { opacity: .6; }
}

.rocket.is-launching .rocket__boost { transform: scaleY(1.9); animation: none; }
.rocket.is-launching .rocket__rig { animation: none; }

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */

@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

@keyframes sunrise {
  from { transform: translateY(calc(var(--s) * 190px)); filter: saturate(1.5) hue-rotate(-14deg) brightness(.8); }
  to   { transform: none; filter: none; }
}

@keyframes breathe {
  from { transform: scale(1); opacity: .92; }
  to   { transform: scale(1.06); opacity: 1; }
}

@keyframes shimmer {
  from { transform: scale(.97); opacity: .9; }
  to   { transform: scale(1.04); opacity: 1; }
}

@keyframes sway-a { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
@keyframes sway-b { from { transform: rotate(4deg) scale(1.05); opacity: .55; } to { transform: rotate(-4deg) scale(1); opacity: 1; } }

@keyframes drift-l { from { transform: translateX(calc(var(--s) * -30px)); } to { transform: translateX(calc(var(--s) * 30px)); } }
@keyframes drift-r { from { transform: translateX(calc(var(--s) * 26px)); } to { transform: translateX(calc(var(--s) * -34px)); } }
@keyframes drift-w { from { transform: translateX(calc(var(--s) * -40px)); opacity: .7; } to { transform: translateX(calc(var(--s) * 40px)); opacity: 1; } }

@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pop  { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: none; } }

@keyframes ignite {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}

@keyframes flicker {
  0%   { transform: scaleY(1);    opacity: 1; }
  15%  { transform: scaleY(.9);   opacity: .8; }
  30%  { transform: scaleY(1.07); opacity: 1; }
  50%  { transform: scaleY(.94);  opacity: .86; }
  70%  { transform: scaleY(1.05); opacity: .97; }
  85%  { transform: scaleY(.97);  opacity: .9; }
  100% { transform: scaleY(1);    opacity: 1; }
}

/* agacharse, vibrar, elevarse un poco y volver a posarse */
/* --amp escala los desplazamientos y --rot los giros (más fuertes en móvil) */
@keyframes rev-rig {
  0%   { transform: translate(0, 0) rotate(0); }
  10%  { transform: translate(0, calc(var(--amp) * 1.6px)) rotate(0); }
  15%  { transform: translate(calc(var(--amp) * -.8px), calc(var(--amp) * .4px))   rotate(calc(var(--rot) * -.9deg)); }
  20%  { transform: translate(calc(var(--amp) * .8px),  calc(var(--amp) * -1.6px))  rotate(calc(var(--rot) * .9deg)); }
  25%  { transform: translate(calc(var(--amp) * -.8px), calc(var(--amp) * -3.6px))  rotate(calc(var(--rot) * -.8deg)); }
  30%  { transform: translate(calc(var(--amp) * .8px),  calc(var(--amp) * -5.6px))  rotate(calc(var(--rot) * .8deg)); }
  35%  { transform: translate(calc(var(--amp) * -.7px), calc(var(--amp) * -7.4px))  rotate(calc(var(--rot) * -.7deg)); }
  40%  { transform: translate(calc(var(--amp) * .7px),  calc(var(--amp) * -8.8px))  rotate(calc(var(--rot) * .7deg)); }
  45%  { transform: translate(calc(var(--amp) * -.7px), calc(var(--amp) * -9.8px))  rotate(calc(var(--rot) * -.6deg)); }
  50%  { transform: translate(calc(var(--amp) * .6px),  calc(var(--amp) * -10.2px)) rotate(calc(var(--rot) * .6deg)); }
  55%  { transform: translate(calc(var(--amp) * -.5px), calc(var(--amp) * -10px))   rotate(calc(var(--rot) * -.5deg)); }
  60%  { transform: translate(calc(var(--amp) * .4px),  calc(var(--amp) * -9px))    rotate(calc(var(--rot) * .3deg)); }
  68%  { transform: translate(0, calc(var(--amp) * -5px)) rotate(0); }
  80%  { transform: translate(0, calc(var(--amp) * 1.8px)) rotate(0); }
  90%  { transform: translate(0, calc(var(--amp) * -.6px)) rotate(0); }
  100% { transform: translate(0, 0) rotate(0); }
}

@keyframes rev-thrust {
  0%   { transform: scaleY(1); }
  10%  { transform: scaleY(.85); }
  20%  { transform: scaleY(1.3); }
  28%  { transform: scaleY(1.2); }
  36%  { transform: scaleY(1.45); }
  44%  { transform: scaleY(1.3); }
  52%  { transform: scaleY(1.5); }
  60%  { transform: scaleY(1.35); }
  72%  { transform: scaleY(.9); }
  86%  { transform: scaleY(1.05); }
  100% { transform: scaleY(1); }
}

@keyframes rev-glow {
  0%, 100% { opacity: .2; transform: scale(.9); }
  25%      { opacity: .55; transform: scale(1.2); }
  50%      { opacity: .75; transform: scale(1.35); }
  70%      { opacity: .35; transform: scale(1); }
}

@keyframes spark {
  0%   { opacity: 0; transform: translate(0, 0) scale(var(--sp)); }
  12%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(var(--dx) * var(--fall)), calc(var(--dy) * var(--fall))) scale(calc(var(--sp) * .3)); }
}

@keyframes glow {
  from { opacity: .18; transform: scale(.9); }
  to   { opacity: .42; transform: scale(1.08); }
}

@keyframes lift  { from { transform: translateY(2cqi); } to { transform: none; } }
@keyframes float { from { transform: translateY(0); } to { transform: translateY(-1.1cqi); } }

@keyframes shake {
  0%   { transform: translate(0, -2px) rotate(0); }
  25%  { transform: translate(-1px, -1.4px) rotate(-.8deg); }
  50%  { transform: translate(.9px, -2.6px) rotate(.8deg); }
  75%  { transform: translate(-.6px, -2.2px) rotate(-.5deg); }
  100% { transform: translate(0, -2px) rotate(0); }
}

@keyframes letter-in {
  from { opacity: 0; transform: translateY(.3em); filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* --------------------------------------------------------------------------
   Móvil / pantallas verticales
   -------------------------------------------------------------------------- */

@media (max-aspect-ratio: 1/1) {
  .brand { width: min(88vw, 60vh); top: 39%; }
}

@media (max-aspect-ratio: 1/1) and (max-width: 560px) {
  .mail { font-size: 12.5px; padding: 1em 1.4em; }
}

/* Movimiento reducido: se muestra el estado final, sin animaciones */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
}
