:root {
  --bg: #050505;
  --fg: #f4f4f1;
  --muted: #9a9a96;
  --accent: #84ccd2;
  --line: rgba(244, 244, 241, 0.22);
  --line-strong: rgba(244, 244, 241, 0.58);
  --page-x: 24px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  color: var(--fg);
  background:
    radial-gradient(circle at 72% 18%, rgba(255,255,255,0.055), transparent 28%),
    linear-gradient(180deg, #080808 0%, var(--bg) 62%);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 320px 100%, 100% 320px;
  opacity: 0.12;
  pointer-events: none;
}

.noise {
  position: fixed;
  inset: -50%;
  z-index: 10;
  opacity: 0.045;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
  animation: grain 0.32s steps(2) infinite;
}

.cursor-glow {
  position: fixed;
  width: 34rem;
  aspect-ratio: 1;
  border-radius: 50%;
  left: var(--mouse-x, 75%);
  top: var(--mouse-y, 25%);
  z-index: -1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(134,66,191,0.12), transparent 62%);
  pointer-events: none;
  transition: left 120ms linear, top 120ms linear;
  animation: glow-shift 9s ease-in-out infinite alternate;
  will-change: filter;
}

@keyframes glow-shift {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(-88deg); }
}

/* ============================ LOADER ============================ */
.sf-loader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 18%, rgba(255,255,255,0.055), transparent 28%),
    linear-gradient(180deg, #080808 0%, var(--bg) 62%);
  transition: opacity 0.8s ease;
}

.sf-loader::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 320px 100%, 100% 320px;
  opacity: 0.12;
  pointer-events: none;
}

.sf-loader::after {
  content: "";
  position: absolute;
  inset: -50%;
  z-index: 3;
  opacity: 0.045;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
  animation: grain 0.32s steps(2) infinite;
}

.sf-mobius {
  position: relative;
  z-index: 2;
  width: auto;
  height: auto;
  max-width: min(92vw, 1200px);
  max-height: min(90vh, 1380px);
  pointer-events: none;
}

.sf-loader.is-done {
  opacity: 0;
  pointer-events: none;
}

/* ===================== HERO (base: mobile) ===================== */
.hero {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  padding: 36px var(--page-x) 40px;
}

.hero-copy { position: relative; z-index: 4; }

.eyebrow {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  line-height: 1.0;
  letter-spacing: -0.03em;
  font-weight: 800;
  text-transform: uppercase;
}

h1 span { display: block; }

.hl-1 { font-size: 40px; letter-spacing: 0.06em; }
.hl-2 { font-size: 42px; margin-left: 0; letter-spacing: 0.06em; }

/* Lockup: "La próxima versión de" + logo SINFIN.
   El bloque se ajusta al ancho de la frase y el logo se alinea
   a la derecha de ella, por eso el logo "sigue" a la frase. */
.hero-brand {
  display: block;
  position: relative;
  z-index: 6;
  margin-top: 10px;
  font-weight: 800;
  line-height: 0.98;
  text-transform: uppercase;
}

.hl-3 {
  display: block;
  font-size: 22px;
  letter-spacing: 0.1em;
}

.hero-logo {
  display: block;
  width: 260px;
  max-width: 100%;
  height: auto;
  margin-top: 12px;
  pointer-events: none;
}

.intro {
  margin: 20px 0 0;
  color: #c9c9c5;
  font-size: 15px;
  line-height: 1.5;
  transition: color 900ms ease;
}

.intro:hover {
  color: #8642BF;
  animation: intro-hover 3.4s ease-in-out 900ms infinite;
}

@keyframes intro-hover {
  0%, 100% { color: #8642BF; }
  50% { color: #84ccd2; }
}

.actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  margin-top: 22px;
}

.primary-button {
  width: 100%;
  padding: 15px 18px 15px 21px;
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  border: 1px solid var(--fg);
  color: var(--bg);
  background: var(--fg);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 200ms ease, background 200ms ease, transform 200ms ease;
}

.primary-button:hover,
.primary-button:focus-visible {
  color: var(--fg);
  background: transparent;
  transform: translateY(-2px);
  outline: none;
}

.arrow { font-size: 20px; line-height: 1; }

.social-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.social-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,0.015);
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.social-icon svg { width: 18px; height: 18px; display: block; }

.social-icon svg * {
  vector-effect: non-scaling-stroke;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-icon svg .fill-dot,
.social-icon svg .fill-shape { fill: currentColor; stroke: none; }

.social-icon:hover,
.social-icon:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(132,204,210,0.08);
  transform: translateY(-2px);
  outline: none;
}

/* ===================== VISUAL FRAME ===================== */
.visual-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 62svh;
  padding: 24px;
  border: 1px solid var(--line-strong);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.05), transparent 34%),
    rgba(255,255,255,0.018);
}

.visual-frame::before {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: 1;
  background: linear-gradient(110deg, transparent 38%, rgba(255,255,255,0.11) 50%, transparent 62%);
  transform: translateX(-70%);
  animation: sweep 6s ease-in-out infinite;
  pointer-events: none;
}

.visual-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.18;
  background: repeating-linear-gradient(
    180deg,
    rgba(255,255,255,0.045) 0,
    rgba(255,255,255,0.045) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: soft-light;
}

.frame-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 68% 28%, rgba(255,255,255,0.12), transparent 34%),
    #070707;
}

.frame-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.62;
  filter: grayscale(0.35) saturate(1.35) contrast(1.15) brightness(0.6);
  transform: scale(1.035);
}

.frame-media::before {
  content: "";
  position: absolute;
  inset: -45%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='.85'/%3E%3C/svg%3E");
  animation: grain 0.24s steps(2) infinite;
  mix-blend-mode: screen;
}

.frame-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5,5,5,0.28), rgba(5,5,5,0.05) 42%, rgba(5,5,5,0.48)),
    linear-gradient(90deg, rgba(5,5,5,0.38), transparent 45%, rgba(5,5,5,0.16));
}

.visual-frame.video-unavailable .frame-media { display: none; }

.frame-meta {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.frame-meta-bottom { position: absolute; left: 24px; right: 24px; bottom: 24px; }

.frame-corners span {
  position: absolute;
  z-index: 3;
  width: 22px;
  height: 22px;
  border-color: var(--fg);
  opacity: 0.9;
}
.frame-corners span:nth-child(1) { top: 52px; left: 24px; border-top: 1px solid; border-left: 1px solid; }
.frame-corners span:nth-child(2) { top: 52px; right: 24px; border-top: 1px solid; border-right: 1px solid; }
.frame-corners span:nth-child(3) { bottom: 52px; left: 24px; border-bottom: 1px solid; border-left: 1px solid; }
.frame-corners span:nth-child(4) { bottom: 52px; right: 24px; border-bottom: 1px solid; border-right: 1px solid; }

.discipline {
  position: absolute;
  inset: 50% 24px auto;
  z-index: 3;
  transform: translateY(-50%);
}

.discipline-index {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.discipline-word {
  display: block;
  max-width: 100%;
  font-size: 40px;
  line-height: 0.95;
  letter-spacing: -0.055em;
  font-weight: 800;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  animation: word-in 600ms cubic-bezier(.2,.7,.2,1) both;
}

.frame-rule {
  position: absolute;
  z-index: 3;
  left: 24px;
  right: 24px;
  bottom: 88px;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}

.frame-rule span {
  display: block;
  width: 28%;
  height: 100%;
  background: var(--accent);
  animation: progress 3.2s linear infinite;
}

/* ===================== FOOTER ===================== */
.site-footer {
  padding-inline: var(--page-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.5;
  text-transform: uppercase;
}

/* ===================== KEYFRAMES ===================== */
@keyframes sweep {
  0%, 20% { transform: translateX(-72%); }
  62%, 100% { transform: translateX(72%); }
}
@keyframes progress {
  from { transform: translateX(-110%); }
  to { transform: translateX(460%); }
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(132,204,210,0.4); }
  70% { box-shadow: 0 0 0 7px rgba(132,204,210,0); }
  100% { box-shadow: 0 0 0 0 rgba(132,204,210,0); }
}
@keyframes grain {
  0% { transform: translate(0,0); }
  25% { transform: translate(2%,-1%); }
  50% { transform: translate(-1%,2%); }
  75% { transform: translate(1%,1%); }
  100% { transform: translate(-2%,-1%); }
}
@keyframes word-in {
  from { opacity: 0; transform: translateY(16px); filter: blur(6px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* ============ TABLET (≥600px): mismo apilado, más grande ============ */
@media (min-width: 600px) {
  :root { --page-x: 40px; }

  .hero { gap: 30px; padding: 48px var(--page-x); }

  .hl-1 { font-size: 58px; }
  .hl-2 { font-size: 62px; }
  .hl-3 { font-size: 30px; letter-spacing: 0.14em; }
  .hero-logo { width: 360px; }
  .intro { font-size: 17px; max-width: 620px; }

  .actions { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 20px 30px; }
  .primary-button { width: auto; min-width: 320px; }

  .visual-frame { aspect-ratio: 16 / 9; max-height: none; }
  .discipline-word { font-size: 56px; }
}

/* ============ DESKTOP (≥1100px): composición fija, una vista ============ */
@media (min-width: 1100px) {
  body { height: 100svh; overflow: hidden; }

  .hero {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 52px;
    align-items: center;
    justify-items: start;
    min-height: 0;
    overflow: hidden;
    max-width: 1200px;
    width: 100%;
    margin-inline: auto;
    padding: 40px 56px;
  }

  .eyebrow { margin-bottom: 18px; }

  /* Titular escalonado — medidas fijas (no se reacomoda con el ancho) */
  h1 { white-space: nowrap; line-height: 0.98; }
  .hl-1 { font-size: 48px; }
  .hl-2 { font-size: 55px; margin-left: 58px; }

  .hero-brand { display: inline-block; margin-top: 8px; }
  .hl-3 { font-size: 39px; letter-spacing: 0.16em; white-space: nowrap; }

  /* El logo se alinea a la derecha del ancho de la frase (la sigue) */
  .hero-logo {
    width: 440px;
    max-height: 24svh;
    margin-top: 14px;
    margin-left: auto;
    margin-right: 0;
  }

  .intro { max-width: 600px; margin-top: 26px; font-size: 17px; }
  .actions { margin-top: 26px; }
  .primary-button { min-width: 320px; }

  .visual-frame {
    z-index: 1;
    justify-self: end;
    width: 100%;
    aspect-ratio: 4 / 5;
    max-height: min(560px, 74svh);
    /* corre el recuadro hacia el texto; valor fijo, estable */
    margin-left: -78px;
  }

  .discipline-word { font-size: 50px; }
}

/* ===================== REDUCED MOTION ===================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .cursor-glow { display: none; }
}
