/* =========================================
   ISEKAI WEB — Estilos
   Cambia los colores aquí y se actualizan en todo el sitio
   ========================================= */
:root {
  --bg: #0E0920;
  --bg-band: #140D2C;
  --bg-card: #1A1238;
  --bg-contact: #1B1142;
  --line: #261B4A;
  --line-strong: #4A3A8A;
  --text: #F3F0FF;
  --muted: #C3BBE3;
  --accent: #3DA5FF;      /* azul eléctrico */
  --cyan: #9FD8FF;
  --gold: #E8B84A;        /* dorado */
  --purple: #6C5BC7;

  --font-display: 'Exo 2', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-jp: 'Noto Sans JP', sans-serif;

  --radius: 20px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* seguro extra: ningún efecto puede crear scroll hacia los lados */
}

img { max-width: 100%; display: block; }
a { color: var(--accent); }
a:hover { color: #9BDCFF; }

h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.1; }
p { margin: 0; }

.container { max-width: 1200px; margin: 0 auto; padding-inline: 24px; }
.section { padding-block: 96px; display: flex; flex-direction: column; gap: 48px; }
.band { background: var(--bg-band); border-block: 1px solid var(--line); }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.lead { font-size: 20px; max-width: 560px; }

.eyebrow {
  font-size: 14px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold);
}

.section__head { display: flex; flex-direction: column; gap: 14px; max-width: 680px; }
.section__head h2 { font-weight: 800; font-size: clamp(34px, 4vw, 52px); }
.section__head .muted { font-size: 18px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 14px 28px; border-radius: 12px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: var(--bg); }
.btn--primary:hover { background: #6BBBFF; color: var(--bg); }
.btn--ghost { color: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--accent); color: var(--text); }
.btn--sm { min-height: 44px; padding: 10px 20px; font-size: 15px; }

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

/* ---------- Header / Nav ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 9, 32, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-family: var(--font-display); font-weight: 900; font-size: 20px; letter-spacing: .04em; color: var(--text); }
.brand__jp { font-family: var(--font-jp); font-size: 11px; color: var(--cyan); letter-spacing: .3em; margin-top: 4px; }

.nav__menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 28px; }
.nav__menu a:not(.btn) { color: #D8D1F5; text-decoration: none; font-weight: 500; font-size: 15px; }
.nav__menu a:not(.btn):hover { color: var(--accent); }

.nav__toggle {
  display: none; width: 48px; height: 48px; border: 0; background: transparent;
  cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.nav__toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; padding-block: 88px 96px; }
.hero__text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.hero h1 { font-weight: 900; font-size: clamp(44px, 6vw, 80px); line-height: 1.02; }
.hero .lead { color: var(--muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.hero__visual {
  flex: 1 1 360px; min-width: 0; display: flex; justify-content: center;
  overflow: clip; overflow-clip-margin: 24px; /* el giro del logo no ensancha la página */
}
.hero .accent {
  background: linear-gradient(90deg, #3DA5FF, #7BE8FF, #B9A9FF, #3DA5FF);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: 300% 0; } }

/* =========================================
   LOGO ANIMADO — el portal
   Entra girando ("invocación"), luego flota mientras
   los anillos giran en sentidos opuestos y el centro late.
   ========================================= */
.portal {
  position: relative; width: 100%; max-width: 420px; aspect-ratio: 1;
  animation: summon 1.4s cubic-bezier(.2, .9, .3, 1.2) both,
             float 6s ease-in-out 1.4s infinite;
}
.portal__svg { position: relative; width: 100%; height: 100%; overflow: hidden; display: block; } /* lo que gira se queda dentro del logo */
/* Todas las piezas que giran o crecen lo hacen desde el centro del logo (100,100) */
.portal__ring, .portal__wave, .portal__core, .portal__code { transform-box: view-box; transform-origin: 100px 100px; }

.portal__ring--outer { animation: spin 40s linear infinite; }
.portal__ring--inner { animation: spin 22s linear infinite reverse; }
.portal__hexes use { animation: hex-blink 3s ease-in-out infinite; }
.portal__hexes use:nth-child(2n) { animation-delay: 1.5s; }
.portal__core { animation: core-pulse 3s ease-in-out infinite; }
.portal__wave { animation: wave 3s ease-out infinite; opacity: 0; }
.portal__wave--late { animation-delay: 1.5s; }
.portal__code { animation: code-glow 3s ease-in-out infinite; }

.portal__glow {
  position: absolute; inset: 12%; border-radius: 50%;
  background: radial-gradient(circle, rgba(92, 225, 255, .55), rgba(61, 165, 255, .25) 45%, transparent 70%);
  filter: blur(28px);
  animation: glow 3s ease-in-out infinite;
}

/* Partículas que orbitan el portal */
/* El eje de la órbita es un punto en el centro: al girar no ocupa espacio extra */
.portal__orbit { position: absolute; top: 50%; left: 50%; width: 0; height: 0; animation: spin 9s linear infinite; pointer-events: none; }
.portal__orbit span {
  position: absolute; top: 0; left: 0; width: 8px; height: 8px; margin: -4px;
  border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px 3px rgba(232, 184, 74, .7);
}
/* La distancia de la órbita depende del tamaño del logo (cqw = % del ancho del portal) */
.portal { container-type: inline-size; }
.portal__orbit span:nth-child(1) { transform: rotate(0deg) translateX(46cqw); }
.portal__orbit span:nth-child(2) { transform: rotate(130deg) translateX(43cqw); background: #7BE8FF; box-shadow: 0 0 12px 3px rgba(123, 232, 255, .7); width: 6px; height: 6px; margin: -3px; }
.portal__orbit span:nth-child(3) { transform: rotate(250deg) translateX(45cqw); background: #B9A9FF; box-shadow: 0 0 12px 3px rgba(185, 169, 255, .7); width: 5px; height: 5px; margin: -2.5px; }

.portal:hover .portal__ring--outer { animation-duration: 6s; }
.portal:hover .portal__ring--inner { animation-duration: 4s; }
.portal:hover .portal__orbit { animation-duration: 2.5s; }

@keyframes summon {
  0% { transform: scale(0) rotate(-200deg); opacity: 0; filter: brightness(3); }
  60% { opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; filter: brightness(1); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes core-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.35); }
}
@keyframes wave {
  0% { transform: scale(.6); opacity: .9; }
  100% { transform: scale(1.35); opacity: 0; }
}
@keyframes code-glow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(232, 184, 74, .5)); }
  50% { filter: drop-shadow(0 0 9px rgba(232, 184, 74, 1)); }
}
@keyframes glow {
  0%, 100% { opacity: .6; transform: scale(.95); }
  50% { opacity: 1; transform: scale(1.08); }
}
@keyframes hex-blink {
  0%, 100% { fill: #1A1240; }
  50% { fill: #3A2A8A; }
}

/* Logo pequeño del menú: gira al pasar el mouse */
.brand img { transition: transform .8s cubic-bezier(.2, .9, .3, 1.2); }
.brand:hover img { transform: rotate(360deg) scale(1.1); }

/* ---------- Fondo estrellado ---------- */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, rgba(185, 169, 255, .8), transparent),
    radial-gradient(1px 1px at 120px 80px, rgba(159, 216, 255, .7), transparent),
    radial-gradient(1.5px 1.5px at 200px 160px, rgba(232, 184, 74, .6), transparent),
    radial-gradient(1px 1px at 60px 220px, rgba(243, 240, 255, .6), transparent),
    radial-gradient(1px 1px at 260px 260px, rgba(159, 216, 255, .5), transparent);
  background-size: 300px 300px;
  animation: stars 90s linear infinite;
}
@keyframes stars { to { background-position: 0 -300px; } }

/* ---------- Aparición al hacer scroll (la activa js/main.js) ---------- */
.reveal { opacity: 0; }
.reveal.is-visible {
  opacity: 1;
  animation: reveal-in .8s cubic-bezier(.2, .8, .2, 1) var(--delay, 0s) backwards;
}
@keyframes reveal-in {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: none; }
}

/* Brillo que cruza los botones principales */
.btn--primary { position: relative; overflow: hidden; }
.btn--primary::after {
  content: ""; position: absolute; top: 0; left: -75%; width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg); pointer-events: none;
}
.btn--primary:hover::after { animation: shine .7s ease; }
@keyframes shine { to { left: 125%; } }

/* ---------- Tarjetas de servicios ---------- */
.cards { display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; }
.card {
  flex: 1 1 300px; min-width: 0;
  background: var(--bg-card); border: 1px solid #33266A; border-radius: var(--radius);
  padding: 36px 32px; display: flex; flex-direction: column; gap: 20px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: 0 12px 40px rgba(61, 165, 255, .25); }
.card--featured { background: #221650; border: 2px solid var(--gold); }
.card--featured:hover { border-color: var(--gold); }
.card h3 { font-weight: 800; font-size: 30px; }
.card ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: #E4DFFA; }
.card__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card__level { font-family: var(--font-jp); font-size: 13px; color: var(--cyan); letter-spacing: .2em; }
.card__price { margin-top: auto; font-family: var(--font-display); font-weight: 700; font-size: 24px; }
.card__price span { font-size: 16px; font-weight: 500; color: var(--muted); }
.extras { font-size: 15px; text-align: center; max-width: 760px; margin-inline: auto; }
.badge { background: var(--gold); color: var(--bg-card); font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }

/* ---------- Beneficios ---------- */
.features { display: flex; flex-wrap: wrap; gap: 32px; }
.feature { flex: 1 1 230px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.feature svg { width: 40px; height: 40px; fill: none; stroke: #5CC8FF; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { font-weight: 700; font-size: 22px; }

/* ---------- Proceso ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 24px; }
.step { flex: 1 1 240px; min-width: 0; border-top: 3px solid var(--accent); padding-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.step h3 { font-weight: 700; font-size: 22px; }
.step__num { font-family: var(--font-display); font-weight: 900; font-size: 40px; color: var(--purple); line-height: 1; }
.step--final { border-color: var(--gold); }
.step--final .step__num { color: var(--gold); }

/* ---------- Portafolio ---------- */
.projects { display: flex; flex-wrap: wrap; gap: 24px; }
.project { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.project h3 { font-weight: 700; font-size: 20px; }
.project .muted { font-size: 15px; }
.project__img, .project img {
  aspect-ratio: 16 / 10; width: 100%; border-radius: 16px; object-fit: cover;
}
.project__link {
  position: relative; display: block; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line-strong); transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.project__link img { border-radius: 0; transition: transform .4s ease; height: auto; }
.project__link:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 12px 40px rgba(61, 165, 255, .25); }
.project__link:hover img { transform: scale(1.04); }
.project__badge {
  position: absolute; right: 12px; bottom: 12px; background: var(--accent); color: var(--bg);
  font-weight: 700; font-size: 14px; padding: 6px 14px; border-radius: 999px;
}
.project__title { color: var(--text); text-decoration: none; }
.project__title:hover { color: var(--accent); }
.project__img {
  border: 2px dashed var(--line-strong); background: #150E2E;
  display: flex; align-items: center; justify-content: center; color: #A79FCC; font-size: 15px;
}

/* ---------- Contacto ---------- */
.contact { background: var(--bg-contact); border-top: 1px solid #33266A; }
.contact__grid { flex-direction: row; flex-wrap: wrap; gap: 56px; }
.contact__info { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.contact__title { font-weight: 900; font-size: clamp(36px, 4.5vw, 60px); line-height: 1.05; }
.contact__list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 10px; }

.form {
  flex: 1 1 420px; min-width: 0;
  background: var(--bg); border: 1px solid #33266A; border-radius: var(--radius);
  padding: 32px; display: flex; flex-direction: column; gap: 18px;
}
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 15px; }
.form input, .form select, .form textarea {
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--bg-card); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 12px 14px; min-height: 48px; width: 100%;
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form input[aria-invalid="true"] { border-color: #FF8A8A; }
.form__error { color: #FF9C9C; font-size: 15px; min-height: 1em; }
.form .btn { width: 100%; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); }
.footer__inner {
  padding-block: 32px; display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: center; gap: 16px; font-size: 14px; color: #A79FCC;
}
.footer .brand__name { font-size: 18px; }
.footer .brand__jp { font-size: 12px; margin-left: 6px; }

/* ---------- Video promo en un celular ---------- */
.showcase { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 56px; }
.showcase__text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.showcase__text h2 { font-weight: 800; font-size: clamp(34px, 4vw, 52px); }
.phone { flex: 0 1 300px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.phone figcaption { font-size: 14px; }
.phone__frame {
  position: relative; width: 100%; max-width: 300px; aspect-ratio: 9 / 16;
  border-radius: 40px; padding: 10px; background: #1A1238;
  border: 2px solid var(--line-strong);
  box-shadow: 0 0 0 6px #120B2A, 0 24px 60px rgba(61, 165, 255, .25), 0 0 80px rgba(108, 91, 199, .3);
  animation: phone-glow 4s ease-in-out infinite;
}
.phone__frame::before { /* la "cámara" del celular */
  content: ""; position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  width: 70px; height: 18px; border-radius: 999px; background: #0A0618; z-index: 2;
}
.phone__video { width: 100%; height: 100%; object-fit: cover; border-radius: 30px; display: block; background: var(--bg); }
.phone__toggle {
  position: absolute; right: 22px; bottom: 22px; z-index: 2; width: 48px; height: 48px;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); cursor: pointer;
  background: rgba(14, 9, 32, .7); backdrop-filter: blur(6px); color: #fff;
  display: flex; align-items: center; justify-content: center; transition: transform .2s ease, background .2s ease;
}
.phone__toggle:hover { transform: scale(1.08); background: rgba(61, 165, 255, .85); }
.phone__toggle svg { width: 22px; height: 22px; fill: currentColor; }
.phone__toggle .icon-pause { display: none; }
.phone__toggle[aria-pressed="true"] .icon-pause { display: block; }
.phone__toggle[aria-pressed="true"] .icon-play { display: none; }
@keyframes phone-glow {
  50% { box-shadow: 0 0 0 6px #120B2A, 0 24px 60px rgba(61, 165, 255, .4), 0 0 110px rgba(108, 91, 199, .45); }
}

/* ---------- Proyecto destacado (demo con video) ---------- */
.featured { display: flex; flex-wrap: wrap; align-items: center; gap: 40px 56px; padding: 40px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(61,165,255,.08), rgba(108,91,199,.12)); border: 1px solid var(--line-strong); }
.phone--small { flex: 0 1 240px; margin: 0 auto; }
.phone--small .phone__frame { max-width: 240px; border-radius: 32px; padding: 8px; }
.phone--small .phone__video { border-radius: 25px; }
.phone--small .phone__frame::before { width: 56px; height: 15px; top: 15px; }
.featured__text { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.featured__text h3 { font-weight: 800; font-size: clamp(30px, 3.4vw, 42px); }
.featured__text strong { color: var(--gold); }
.featured__tag { align-self: flex-start; background: var(--gold); color: var(--bg-card); font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.featured__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; color: #E4DFFA; }
.featured__list li { position: relative; padding-left: 30px; }
.featured__list li::before { content: ""; position: absolute; left: 0; top: .35em; width: 14px; height: 14px; border-radius: 50%; border: 4px solid var(--accent); }
.featured + .projects { margin-top: 8px; }

/* ---------- Página 404 ---------- */
.error-page {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 20px; padding-block: 48px;
}
.error-page h1 { font-weight: 900; font-size: clamp(36px, 6vw, 64px); }
.error-page .lead { margin-inline: auto; }
.error-page__logo { animation: spin 30s linear infinite; }

/* ---------- Celular ---------- */
@media (max-width: 820px) {
  .nav__toggle { display: flex; }
  .nav__menu {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px 24px 24px;
    display: none;
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu li a:not(.btn) { display: block; padding: 14px 0; font-size: 17px; border-bottom: 1px solid var(--line); }
  .nav__menu .btn { margin-top: 16px; width: 100%; }

  .section { padding-block: 64px; }
  .hero { padding-block: 48px 64px; gap: 40px; }
  .hero__visual { order: -1; }
  .portal { max-width: 240px; }
  .showcase { gap: 36px; }
  .phone { flex-basis: 100%; }
  .phone__frame { max-width: 260px; }
  .lead { font-size: 18px; }
  .form { padding: 24px; }
  .featured { padding: 24px 20px; gap: 32px; }
}

/* Respeta a quien prefiere menos animación */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
