/* ============================================================
   Nteon - Sitio en construccion
   Identidad v2: azul marino de fondo, Pliegue en su version para
   fondo oscuro, coral solo como chispa (cursor, punto, CTA).
   La obra se arma en una sola linea de tiempo: plano, guias,
   cotas, contorno y despues el Pliegue con su firma oficial.
   ============================================================ */

/* ---------- Tipografias autoalojadas (SIL OFL) ---------- */
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 700; font-display: swap; src: url('fonts/bricolage-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 700; font-display: swap; src: url('fonts/bricolage-700-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 800; font-display: swap; src: url('fonts/bricolage-800-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 800; font-display: swap; src: url('fonts/bricolage-800-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Figtree'; font-weight: 400; font-display: swap; src: url('fonts/figtree-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; font-weight: 400; font-display: swap; src: url('fonts/figtree-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Figtree'; font-weight: 500; font-display: swap; src: url('fonts/figtree-500-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; font-weight: 500; font-display: swap; src: url('fonts/figtree-500-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Figtree'; font-weight: 600; font-display: swap; src: url('fonts/figtree-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; font-weight: 600; font-display: swap; src: url('fonts/figtree-600-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Tokens ---------- */
:root {
  --navy:      #042C53;
  --navy-deep: #03213F;
  --electric:  #378ADD;
  --electric-text: #7EB6EC;   /* azul electrico legible sobre marino */
  --coral:     #FF7A59;
  --coral-text: #FF9B7E;
  --white:     #FFFFFF;
  --soft:      #C3D3E4;
  --muted:     #9FB3CA;
  --line:      rgba(255, 255, 255, .14);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --ease: cubic-bezier(.16, 1, .3, 1);

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--navy);
  color: var(--white);
  font-family: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--electric-text);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Pagina ---------- */
.page {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1240px;
  margin-inline: auto;
  padding: 28px clamp(16px, 4vw, 40px);
}

/* Recurso grafico propio: el icono gigante, recortado, al 5% */
.watermark {
  position: fixed;
  bottom: -18vh;
  left: -14vw;
  z-index: 0;
  width: min(820px, 95vw);
  aspect-ratio: 52 / 56;
  background: url("../logos/nteon-icono-blanco.svg") no-repeat center / contain;
  opacity: .04;
  pointer-events: none;
}

.top,
.stage,
.foot { position: relative; z-index: 1; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top__logo {
  display: block;
  width: auto;
  height: 32px;
}

/* ---------- Escenario ---------- */
.stage {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(20px, 4vh, 40px);
  padding-block: clamp(24px, 5vh, 64px);
  text-align: center;
}

/* Titular que se escribe con cursor coral. El ::before reserva el
   espacio del texto completo para que nada salte mientras se escribe. */
.title {
  margin: 0;
  font-family: "Bricolage Grotesque", "Figtree", sans-serif;
  font-size: clamp(1.85rem, 8vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.02;
}

.title__line {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  text-align: left;
}

.title__line::before {
  content: attr(data-type);
  visibility: hidden;
}

.title__line--soft { color: var(--electric-text); }

.typed {
  position: absolute;
  inset: 0;
}

.caret {
  display: inline-block;
  width: .08em;
  height: .82em;
  margin-left: .06em;
  border-radius: 2px;
  background: var(--coral);
  vertical-align: -.04em;
  animation: blink 1.05s steps(1) infinite;
}

.caret.is-typing { animation: none; }

@keyframes blink {
  50% { opacity: 0; }
}

/* Sin JS: el titular se ve completo */
html:not(.js) .title__line::before { visibility: visible; }

/* Botones */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: .98rem;
  font-weight: 700;
  letter-spacing: -.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .35s var(--ease);
}

.btn:hover { transform: translateY(-2px); }
.btn:hover svg { transform: translateX(3px); }

/* Boton coral con texto azul marino, como pide la guia */
.btn--primary {
  background: var(--coral);
  color: var(--navy);
  box-shadow: 0 10px 30px rgba(255, 122, 89, .22);
}

.btn--primary:hover { box-shadow: 0 14px 38px rgba(255, 122, 89, .32); }

.btn--ghost {
  border-color: rgba(255, 255, 255, .26);
  color: var(--white);
}

.btn--ghost:hover { border-color: var(--electric-text); }

/* ---------- El plano ---------- */
.plan {
  position: relative;
  display: grid;
  justify-items: center;
  margin: 0;
}

.bp {
  display: block;
  width: min(440px, 78vw, 52vh);
  max-width: 100%;
  height: auto;
  overflow: visible;
}

.bp-grid { opacity: .5; }
.bp-guides { opacity: .3; }
.bp-dims { opacity: .55; }
.bp-labels { opacity: .55; font-family: "Figtree", sans-serif; font-size: 2.1px; font-weight: 600; }
.bp-labels text { text-anchor: middle; }
.bp-outline { opacity: 0; }
.weld { opacity: 0; }

.bp-guides path,
.bp-dims path,
.bp-outline path { stroke-dasharray: 1; stroke-dashoffset: 0; }

.pl-bar,
.pl-ribbon {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

/* Con JS, el plano espera a que arranque la obra (sin parpadeo) */
.js .bp:not(.is-building):not(.is-built) { visibility: hidden; }

/* ---- Linea de tiempo de la obra ---- */
.bp.is-building .bp-grid {
  animation: gridIn 1s var(--ease) both;
}

.bp.is-building .bp-guides path {
  stroke-dashoffset: 1;
  animation: draw 1s var(--ease) forwards;
}

.bp.is-building .bp-guides path:nth-child(1) { animation-delay: .20s; }
.bp.is-building .bp-guides path:nth-child(2) { animation-delay: .30s; }
.bp.is-building .bp-guides path:nth-child(3) { animation-delay: .38s; }
.bp.is-building .bp-guides path:nth-child(4) { animation-delay: .46s; }
.bp.is-building .bp-guides path:nth-child(5) { animation-delay: .54s; }
.bp.is-building .bp-guides path:nth-child(6) { animation-delay: .62s; }

.bp.is-building .bp-guides {
  animation: guidesSettle 1.2s var(--ease) 3.6s both;
}

.bp.is-building .bp-dims path {
  stroke-dashoffset: 1;
  animation: draw .7s var(--ease) forwards;
}

.bp.is-building .bp-dims path:nth-child(1) { animation-delay: 1.00s; }
.bp.is-building .bp-dims path:nth-child(2) { animation-delay: 1.12s; }
.bp.is-building .bp-dims path:nth-child(3) { animation-delay: 1.24s; }

.bp.is-building .bp-labels {
  animation: fadeTo .5s var(--ease) 1.45s both;
}

.bp.is-building .bp-outline {
  opacity: .95;
  animation: outlineOut .7s var(--ease) 3.5s forwards;
}

.bp.is-building .bp-outline path {
  stroke-dashoffset: 1;
  animation: draw 1s cubic-bezier(.65, 0, .35, 1) forwards;
}

.bp.is-building .bp-outline path:nth-child(1) { animation-delay: .95s; }
.bp.is-building .bp-outline path:nth-child(2) { animation-delay: 1.15s; }
.bp.is-building .bp-outline path:nth-child(3) { animation-delay: 1.35s; }

/* La firma oficial: barra izquierda sube, la cinta se despliega en
   diagonal, la barra derecha sube, se pasa un poco y se asienta. */
.bp.is-building .pl-bar--l {
  transform: scaleY(0);
  animation: rise .55s var(--ease) 2.05s forwards;
}

.bp.is-building .pl-ribbon {
  clip-path: inset(0 100% 100% 0);
  animation: unfold .7s cubic-bezier(.65, 0, .35, 1) 2.45s forwards;
}

.bp.is-building .pl-bar--r {
  transform: scaleY(0);
  animation: settle .75s var(--ease) 3.0s forwards;
}

.bp.is-building .pl-shade {
  opacity: 0;
  animation: fadeIn .5s var(--ease) 3.55s forwards;
}

@keyframes draw       { to { stroke-dashoffset: 0; } }
@keyframes gridIn     { from { opacity: 0; } to { opacity: .5; } }
@keyframes guidesSettle { from { opacity: .6; } to { opacity: .3; } }
@keyframes fadeTo     { from { opacity: 0; } to { opacity: .55; } }
@keyframes fadeIn     { to { opacity: 1; } }
@keyframes outlineOut { to { opacity: 0; } }
@keyframes rise       { to { transform: none; } }
@keyframes unfold     { to { clip-path: inset(0 0 0 0); } }

@keyframes settle {
  0%   { transform: scaleY(0); }
  62%  { transform: scaleY(1.07); }
  100% { transform: none; }
}

/* La chispa coral pasa por el doblez como un punto de soldadura */
.weld.is-on { animation: weld 2.2s ease-in-out forwards; }

.weld__halo {
  transform-box: fill-box;
  transform-origin: center;
  animation: halo 1.1s ease-in-out infinite;
}

@keyframes weld {
  0%   { opacity: 0; }
  12%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes halo {
  50% { transform: scale(1.5); }
}

/* ---------- Pie ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .86rem;
}

.foot__links {
  display: flex;
  gap: 24px;
}

.foot a { text-decoration: none; transition: color .3s var(--ease); }
.foot a:hover { color: var(--white); }

/* ---------- Pagina 404 ---------- */
.lost {
  display: grid;
  place-content: center;
  justify-items: center;
  max-width: 34rem;
  margin-inline: auto;
  padding-block: 64px;
  text-align: center;
}

.lost .actions { justify-content: center; }

.lead {
  max-width: 46ch;
  margin: 22px 0 0;
  color: var(--soft);
  font-size: 1.06rem;
}

.lost__code {
  color: var(--electric-text);
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.lost .title { margin-top: 14px; font-size: clamp(2.2rem, 5vw, 3.6rem); }

/* ---------- Responsive ---------- */
@media (max-width: 520px) {
  .top__logo { height: 28px; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
  .foot { flex-direction: column; align-items: center; text-align: center; }
}

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

  .weld { display: none; }
}
