/* =========================================================
   Sketch2Fly — Portada / Pitch Web
   Sistema visual: editorial · técnico · premium
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Color — fondo carbón frío, off-white, acento teal técnico */
  --bg:        oklch(0.155 0.018 232);
  --bg-soft:   oklch(0.195 0.018 232);
  --fg:        oklch(0.975 0.004 232);
  --muted:     oklch(0.72 0.014 232);
  --faint:     oklch(0.54 0.014 232);
  --line:      oklch(0.42 0.014 232);
  --line-soft: oklch(0.34 0.014 232);
  --accent:    #2b828c;
  --accent-dim: #1e4b5e;

  /* Tipografía */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Espaciado del marco */
  --frame: clamp(20px, 3.2vw, 56px);
  --gut: clamp(20px, 3vw, 52px);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--bg); }

/* ---------- Atmósfera de fondo ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
/* grilla fina — desactivada */
/* brillo de acento único, sutil */
.bg__glow {
  position: absolute;
  top: -18%;
  right: -8%;
  width: 60vw;
  height: 60vw;
  max-width: 820px;
  max-height: 820px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 62%);
  opacity: 0.16;
  filter: blur(8px);
}
/* grano sutil */
.bg__grain {
  position: absolute;
  inset: 0;
  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.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------- Sistema de páginas (sin scroll) ---------- */
html, body {
  height: 100%;
  overflow: hidden;
}

/* cada página ocupa 100% del viewport, apiladas */
.page {
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s var(--ease);
  overflow: hidden;
}
.page.is-active {
  z-index: 2;
  opacity: 1;
  pointer-events: auto;
}
.page:not(.is-active),
.page:not(.is-active) * {
  pointer-events: none !important;
}

/* el frame interior de la portada */
.frame {
  position: absolute;
  inset: 0;
  padding: var(--frame);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.frame::before {
  content: "";
  position: absolute;
  inset: calc(var(--frame) * 0.62);
  border: none;
  pointer-events: none;
}

/* =========================================================
   PORTADA
   ========================================================= */
.cover {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--gut);
}

/* ---------- Header ---------- */
.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
}
.brand {
  display: flex;
  align-items: center;
}
.brand__logo {
  height: clamp(64px, 6.4vw, 88px);
  width: auto;
  display: block;
  transition: opacity 0.4s var(--ease);
}
.brand:hover .brand__logo { opacity: 0.82; }

.head__meta {
  font-family: var(--font-mono);
  font-size: clamp(10px, 0.85vw, 12px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: right;
  line-height: 1.7;
}
.head__meta span { display: block; }
.head__meta b { color: var(--muted); font-weight: 400; }

/* ---------- Cuerpo: grilla asimétrica ---------- */
.body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(max-content, clamp(300px, 28vw, 390px));
  gap: var(--gut);
  align-items: stretch;
}

/* ---- Fondo full-bleed: carrusel del prototipo (recorre todas las secciones) ---- */
.dronebg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.carousel {
  position: absolute;
  inset: 0;
}
.cslide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 59% 48%;
  padding: clamp(32px, 6vw, 126px);
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.4s var(--ease), transform 9s ease-out;
  will-change: opacity, transform;
  filter: drop-shadow(0 40px 90px rgba(0,0,0,0.55));
}
.cslide.is-active {
  opacity: 0.52;
  transform: scale(1);
}
/* fuera de la portada: el dron se atenúa para no competir con el contenido */
.dronebg {
  transition: opacity 0.7s var(--ease);
}
.dronebg.is-dim { opacity: 0.13; }
/* velo para legibilidad: oscurece la izquierda (título) y la derecha (índice) */
.dronebg__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg,
      var(--bg) 0%,
      rgba(18,28,33,0.38) 32%,
      transparent 53%,
      rgba(18,28,33,0.34) 82%,
      rgba(6,12,16,0.78) 100%),
    radial-gradient(116% 110% at 58% 48%, transparent 42%, rgba(6,12,16,0.78) 100%);
}

/* ---- Hero: bloque de título principal ---- */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vh, 72px) 0;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: clamp(10px, 0.9vw, 12px);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: clamp(22px, 3.4vh, 40px);
}
.kicker::before {
  content: "";
  width: clamp(28px, 4vw, 56px);
  height: 1px;
  background: var(--accent);
}
.hero__title {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.4vh, 18px);
  text-shadow: 0 2px 44px rgba(0,0,0,0.5);
}
.hero__label {
  font-family: var(--font-mono);
  font-size: clamp(15px, 1.4vw, 22px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}
/* wordmark del logo (SKETCH2FLY sin UTILITY DRONES) */
.hero__wordmark-wrap {
  overflow: hidden;
  line-height: 0;
  width: clamp(280px, 44vw, 700px);
  /* recorta el 32% inferior (UTILITY DRONES): height = width × (763×0.68/2871) */
  height: calc(clamp(280px, 44vw, 700px) * 0.18076);
}
.hero__wordmark {
  display: block;
  width: 100%;
  height: auto;
  filter: brightness(0) invert(1);
}
.hero__sub {
  margin-top: clamp(22px, 3vh, 34px);
  max-width: 46ch;
  font-size: clamp(17px, 1.35vw, 22px);
  line-height: 1.5;
  color: oklch(0.87 0.008 232);
  text-wrap: pretty;
  text-shadow: 0 1px 20px rgba(0,0,0,0.5);
}
/* control del carrusel (etiqueta + indicadores) */
.hero__ctl {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: clamp(30px, 4.6vh, 56px);
}
.hero__tag {
  font-family: var(--font-mono);
  font-size: clamp(10px, 0.85vw, 12px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.dots {
  display: flex;
  gap: 9px;
}
.dot {
  width: 22px;
  height: 3px;
  border: 0;
  padding: 0;
  background: var(--line);
  cursor: pointer;
  transition: background 0.4s var(--ease), width 0.4s var(--ease);
}
.dot:hover { background: var(--muted); }
.dot.is-active { background: var(--accent); width: 34px; }

/* ---- Índice (navegación del pitch) ---- */
.index {
  border: 0;
  justify-self: end;
  align-self: center;
  width: max-content;
  min-width: 0;
  max-width: min(390px, 34vw);
  padding: clamp(16px, 2.1vh, 26px) clamp(16px, 1.5vw, 24px);
  display: flex;
  flex-direction: column;
  background: rgba(8,15,20,0.44);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.index__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.index__list {
  list-style: none;
  display: flex;
  flex-direction: column;
}
.index__item { border-top: 1px solid var(--line); }
.index__item:last-child { border-bottom: 1px solid var(--line); }

.index__link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: clamp(10px, 1.45vh, 15px) 4px;
  position: relative;
  transition: padding-left 0.5s var(--ease);
}
.index__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.05em;
  transition: color 0.4s var(--ease);
}
.index__title {
  font-size: clamp(14px, 1.12vw, 17px);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--fg);
  white-space: nowrap;
  transition: color 0.4s var(--ease), transform 0.5s var(--ease);
}
.index__arrow {
  font-family: var(--font-mono);
  color: var(--accent);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}
/* línea de progreso al hover */
.index__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  height: 1px; width: 0;
  background: var(--accent);
  transition: width 0.5s var(--ease);
}
.index__link:hover { padding-left: 16px; }
.index__link:hover .index__num { color: var(--accent); }
.index__link:hover .index__title { color: var(--fg); }
.index__link:hover .index__arrow { opacity: 1; transform: translateX(0); }
.index__link:hover::after { width: 100%; }

/* ---------- Footer / CTA ---------- */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 22px;
}
.cover__updated {
  font-family: var(--font-mono);
  font-size: clamp(10px, 0.8vw, 12px);
  letter-spacing: 0.1em;
  color: var(--faint);
  text-align: right;
}

.cta {
  --pad: clamp(16px, 1.6vw, 22px);
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: var(--pad) calc(var(--pad) * 1.4);
  border: 1px solid var(--accent);
  font-family: var(--font-mono);
  font-size: clamp(12px, 1vw, 14px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg);
  background: var(--accent-dim);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.45s var(--ease), background 0.45s var(--ease), border-color 0.45s var(--ease);
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  transform: translateX(-101%);
  transition: transform 0.5s var(--ease);
}
.cta__arrow { transition: transform 0.45s var(--ease); }
.cta:hover { color: var(--bg); border-color: var(--accent); }
.cta:hover::before { transform: translateX(0); }
.cta:hover .cta__arrow { transform: translateX(5px); }

.scrollcue {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.scrollcue__line {
  width: clamp(40px, 6vw, 80px);
  height: 1px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.scrollcue__line::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 35%;
  background: var(--accent);
  animation: drift 2.4s var(--ease) infinite;
}
@keyframes drift {
  0% { transform: translateX(-120%); }
  60%,100% { transform: translateX(330%); }
}

/* =========================================================
   PÁGINAS DE SECCIÓN
   ========================================================= */
.section-frame {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: var(--frame);
  overflow: hidden;
}

/* barra de navegación entre secciones */
.section-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  flex: none;
}
.snav__back,
.snav__next {
  font-family: var(--font-mono);
  font-size: clamp(10px, 0.9vw, 12px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0;
  transition: color 0.35s var(--ease);
}
.snav__back:hover,
.snav__next:hover { color: var(--accent); }
.snav__info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.snav__num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--accent);
}
.snav__name {
  font-size: clamp(13px, 1vw, 15px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}

/* cuerpo de la sección */
.section-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
}

/* placeholder vacío — listo para llenar */
.section-placeholder {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(16px, 2.4vh, 28px);
  padding: clamp(28px, 4vw, 60px);
  background: rgba(10,16,21,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  min-width: clamp(280px, 48vw, 640px);
}
.sp__num {
  font-family: var(--font-mono);
  font-size: clamp(48px, 7vw, 110px);
  font-weight: 400;
  line-height: 1;
  color: var(--line);
  letter-spacing: -0.03em;
}
.sp__title {
  font-size: clamp(32px, 4.2vw, 68px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--fg);
}
.sp__hint {
  font-family: var(--font-mono);
  font-size: clamp(11px, 0.9vw, 13px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

/* =========================================================
   Carga escalonada
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    animation: rise 0.9s var(--ease) forwards;
    animation-delay: var(--d, 0s);
  }
  @keyframes rise {
    to { opacity: 1; transform: none; }
  }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 880px) {
  .body {
    grid-template-columns: 1fr;
    gap: clamp(36px, 8vh, 64px);
  }
  .index {
    border-left: none;
    border-top: 1px solid var(--line-soft);
    padding-left: 0;
    padding-top: 26px;
  }
  .hero { padding: 8px 0 0; }
  .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }
  .scrollcue { order: -1; }
  .head__meta span:nth-child(2) { display: none; }
}

@media (max-width: 540px) {
  .frame::before { inset: 0; border: none; }
  .head__meta { display: none; }
  .cta { width: 100%; justify-content: space-between; }
}
