/* ============================================================================
   EDEN REVERIE — sitio oficial
   Design system. Estilo "web de juego japonesa": key art a sangre, tipografía
   mincho (serif) en oro sobre azul noche, acentos verticales en kana, feed de
   noticias. La paleta hereda de la pantalla de acceso del juego (oro #ffe659,
   cian del casco VR #4c99ff, fondo #0b0d12) para que web y juego se reconozcan.

   El HTML lo ensambla web/build.mjs a partir de web/templates/*.html y de
   web/content/<lang>.json. Este CSS es la referencia estética BLOQUEADA: las
   traducciones y el resto de páginas se montan contra estas clases.
   ========================================================================== */

:root {
  --bg: #05060c;
  --bg-2: #0b0d12;
  --panel: #0d1017;
  --panel-2: #121826;
  --ink: #e8e6e3;
  --ink-dim: #cfd6e4;
  --muted: #8b93a3;
  --gold: #ffe659;
  --gold-warm: #e8c65a;
  --gold-deep: #9a7d2e;
  --cyan: #4c99ff;
  --cyan-glow: rgba(76, 153, 255, 0.55);
  --line: #2a3040;
  --line-soft: rgba(232, 230, 227, 0.09);
  --danger: #ff9a9a;

  /* Tipografía. build.mjs sobreescribe --font-display/--font-body por idioma
     (ver clases .lang-* más abajo) para servir la fuente CJK correcta. */
  --font-display: "Shippori Mincho", "Noto Serif JP", Georgia, "Times New Roman", serif;
  --font-body: "Zen Kaku Gothic New", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 4px;

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

/* Fuentes por idioma. El <html> lleva class="lang-xx" que pone build.mjs. */
.lang-ko { --font-display: "Noto Serif KR", serif; --font-body: "Noto Sans KR", sans-serif; }
.lang-zh { --font-display: "Noto Serif SC", serif; --font-body: "Noto Sans SC", sans-serif; }
.lang-ja { --font-display: "Shippori Mincho", "Noto Serif JP", serif; --font-body: "Zen Kaku Gothic New", "Noto Sans JP", sans-serif; }

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  /* Trama sutil de fondo: partículas/estrellas tenues. */
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.06), transparent),
    radial-gradient(1px 1px at 70% 60%, rgba(255, 255, 255, 0.05), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(76, 153, 255, 0.05), transparent);
  background-attachment: fixed;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* Textura de grano/scanlines muy tenue sobre todo el documento. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.35;
  background-image: repeating-linear-gradient(
    0deg, rgba(0, 0, 0, 0.14) 0px, rgba(0, 0, 0, 0.14) 1px, transparent 2px, transparent 3px
  );
  mix-blend-mode: overlay;
}

/* ---- Tipografía ---- */
.display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: 0.02em;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.14; margin: 0; }

/* Kicker: etiqueta pequeña en oro con filete, encima de cada título de sección. */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
}
.kicker::before {
  content: "";
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* Texto vertical decorativo (kana/kanji), sello de web japonesa. */
.vtext {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: var(--font-display);
  letter-spacing: 0.35em;
  color: var(--line);
  user-select: none;
  pointer-events: none;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* Filete de oro reutilizable. */
.rule { height: 1px; border: 0; background: linear-gradient(90deg, transparent, var(--gold-deep), transparent); opacity: 0.5; }

/* ============================================================================
   Cabecera / navegación
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px var(--gutter);
  background: linear-gradient(180deg, rgba(5, 6, 12, 0.9), rgba(5, 6, 12, 0));
  backdrop-filter: blur(2px);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(6, 8, 14, 0.92);
  border-bottom-color: var(--line-soft);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand .mark {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: 0.24em;
  color: var(--ink);
}
.brand .mark b { color: var(--gold); font-weight: 600; }
.brand .kana { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.3em; color: var(--muted); }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a {
  position: relative;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 6px 0;
  transition: color 0.25s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width 0.3s var(--ease);
}
.nav a:hover { color: var(--gold); }
.nav a:hover::after { width: 100%; }

/* Selector de idioma */
.lang { display: flex; align-items: center; gap: 2px; }
.lang a {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 3px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.lang a:hover { color: var(--ink); }
.lang a[aria-current="true"] { color: var(--bg); background: var(--gold); font-weight: 700; }

.nav-toggle { display: none; background: none; border: 0; color: var(--ink); font-size: 26px; cursor: pointer; }

/* ============================================================================
   Botones
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 30px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 24, 38, 0.6);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease),
    color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); border-color: var(--cyan); box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5); }

.btn-gold {
  border-color: var(--gold);
  background: linear-gradient(180deg, var(--gold), var(--gold-warm));
  color: #12100a;
  box-shadow: 0 0 0 0 rgba(255, 230, 89, 0.4);
}
.btn-gold:hover {
  border-color: var(--gold);
  box-shadow: 0 10px 34px rgba(255, 230, 89, 0.28), 0 0 0 1px var(--gold);
  color: #12100a;
}
.btn-ghost { background: transparent; }

/* ============================================================================
   Hero — key art a sangre completa
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center 30%;
  /* Leve zoom lento: da vida al key art estático. */
  animation: heroDrift 28s ease-in-out infinite alternate;
  transform: scale(1.06);
}
@keyframes heroDrift { from { transform: scale(1.06) translateY(0); } to { transform: scale(1.14) translateY(-14px); } }
.hero::before {
  /* Viñeta + oscurecido para que el texto respire. */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(5, 6, 12, 0.55) 0%, rgba(5, 6, 12, 0.2) 35%, rgba(5, 6, 12, 0.75) 78%, var(--bg) 100%),
    radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(5, 6, 12, 0.7) 100%);
}
.hero-inner { position: relative; padding-top: 96px; }
.hero .kana-side {
  position: absolute;
  top: 12vh; right: clamp(12px, 4vw, 60px);
  height: 62vh;
  font-size: clamp(20px, 2.4vw, 34px);
  color: rgba(232, 230, 227, 0.16);
  letter-spacing: 0.5em;
}
.hero h1 {
  font-size: clamp(48px, 9vw, 128px);
  letter-spacing: 0.06em;
  color: var(--ink);
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.6);
  margin-bottom: 8px;
}
.hero h1 .light { color: var(--gold); text-shadow: 0 0 44px rgba(255, 230, 89, 0.35); }
.hero .subtitle {
  font-family: var(--font-display);
  font-size: clamp(15px, 2.2vw, 22px);
  letter-spacing: 0.28em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 26px;
}
.hero .lead {
  max-width: 46ch;
  font-size: clamp(15px, 1.5vw, 18px);
  color: var(--ink-dim);
  margin-bottom: 38px;
}
.hero .cta-row { display: flex; flex-wrap: wrap; gap: 14px; }

.scroll-cue {
  position: absolute;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}
.scroll-cue .line { width: 1px; height: 46px; background: linear-gradient(var(--gold), transparent); animation: cueSlide 2.2s var(--ease) infinite; transform-origin: top; }
@keyframes cueSlide { 0% { transform: scaleY(0); opacity: 0; } 40% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ============================================================================
   Secciones genéricas
   ========================================================================== */
.section { position: relative; padding: clamp(72px, 12vh, 140px) 0; }
.section.alt { background: linear-gradient(180deg, var(--bg), var(--bg-2)); }
.section-head { margin-bottom: 54px; max-width: 720px; }
.section-head .row { display: flex; align-items: baseline; gap: 18px; margin-top: 14px; }
.section-num {
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 64px);
  color: transparent;
  -webkit-text-stroke: 1px var(--gold-deep);
  line-height: 1;
}
.section-head h2 { font-size: clamp(28px, 4.4vw, 48px); color: var(--ink); }
.section-head .kanji { display: block; margin-top: 6px; font-size: 14px; letter-spacing: 0.3em; color: var(--muted); font-family: var(--font-display); }
.section-head p.intro { margin-top: 20px; color: var(--muted); font-size: 17px; }

/* ---- Historia: viñetas cinematográficas alternadas ---- */
.story-block { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 5vw, 68px); align-items: center; margin-bottom: clamp(48px, 8vh, 96px); }
.story-block:nth-child(even) { direction: rtl; }
.story-block:nth-child(even) > * { direction: ltr; }
.story-media { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.story-media img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: transform 0.9s var(--ease); }
.story-media::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 90px rgba(5, 6, 12, 0.7); pointer-events: none; }
.story-block:hover .story-media img { transform: scale(1.05); }
.story-text .chapter { font-family: var(--font-display); color: var(--gold); letter-spacing: 0.3em; font-size: 13px; text-transform: uppercase; }
.story-text h3 { font-size: clamp(22px, 3vw, 34px); margin: 14px 0 16px; color: var(--ink); }
.story-text p { color: var(--ink-dim); margin: 0 0 14px; }
.story-text .aside { color: var(--muted); font-size: 15px; font-style: italic; border-left: 2px solid var(--gold-deep); padding-left: 16px; }

/* ---- Personajes: fichas con retrato pixel-art ---- */
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.char-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 0 0 22px;
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.char-card:hover { transform: translateY(-6px); border-color: var(--gold); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); }
.char-portrait {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background:
    radial-gradient(80% 70% at 50% 30%, rgba(76, 153, 255, 0.14), transparent),
    linear-gradient(180deg, #141b2b, #0b0f18);
  border-bottom: 1px solid var(--line);
}
.char-portrait img {
  width: 62%;
  image-rendering: pixelated; /* retratos pixel-art: escalar sin difuminar */
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.6));
}
.char-card .role { padding: 16px 18px 0; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); }
.char-card h3 { padding: 4px 18px 6px; font-size: 22px; color: var(--ink); }
.char-card p { padding: 0 18px; color: var(--muted); font-size: 14px; }

/* ---- Staff: el estudio de IAs (la sexta pared) ---- */
.staff-note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  background: rgba(18, 24, 38, 0.5);
  padding: 22px 26px;
  color: var(--ink-dim);
  margin-bottom: 44px;
  max-width: 760px;
}
.staff-note b { color: var(--cyan); }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.staff-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 26px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.staff-card:hover { transform: translateY(-5px); border-color: var(--cyan); }
.staff-card .avatar {
  width: 66px; height: 66px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 28px; color: var(--bg);
  background: linear-gradient(140deg, var(--gold), var(--gold-warm));
  margin-bottom: 18px;
}
.staff-card .studio-role { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.staff-card h3 { font-size: 24px; color: var(--ink); margin: 4px 0 12px; }
/* La revelación del nombre invertido dentro del juego. */
.name-flip { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.name-flip .arrow { color: var(--cyan); }
.name-flip .ingame { color: var(--cyan); font-family: var(--font-display); letter-spacing: 0.08em; }
.staff-card p { color: var(--ink-dim); font-size: 14px; margin: 0; }

/* ============================================================================
   Devblog / feed de noticias (estilo web de juego japonesa)
   ========================================================================== */
.news { border-top: 1px solid var(--line-soft); }
.news-item {
  display: grid;
  grid-template-columns: 128px 118px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 20px 6px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.25s var(--ease), padding-left 0.25s var(--ease);
}
.news-item:hover { background: rgba(255, 255, 255, 0.02); padding-left: 16px; }
.news-item time { font-family: var(--font-display); color: var(--muted); font-size: 14px; letter-spacing: 0.06em; }
.news-item .tag {
  justify-self: start;
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 2px;
  border: 1px solid var(--gold-deep); color: var(--gold);
}
.news-item .tag.dev { border-color: var(--cyan); color: var(--cyan); }
.news-item h3 { font-family: var(--font-body); font-weight: 600; font-size: 17px; color: var(--ink); }
.news-item:hover h3 { color: var(--gold); }
.news-item .go { color: var(--muted); transition: transform 0.25s var(--ease), color 0.25s var(--ease); }
.news-item:hover .go { color: var(--gold); transform: translateX(4px); }

/* Post individual del devblog */
.post { max-width: 760px; margin-inline: auto; padding: clamp(120px, 16vh, 180px) 0 100px; }
.post-head { margin-bottom: 40px; border-bottom: 1px solid var(--line-soft); padding-bottom: 28px; }
.post-head .meta { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.post-head h1 { font-size: clamp(30px, 5vw, 52px); color: var(--ink); line-height: 1.15; }
.post-body { font-size: 17px; color: var(--ink-dim); }
.post-body h2 { font-size: 26px; color: var(--gold); margin: 44px 0 16px; }
.post-body h3 { font-size: 21px; color: var(--ink); margin: 32px 0 12px; }
.post-body p { margin: 0 0 20px; }
.post-body a { color: var(--cyan); border-bottom: 1px solid rgba(76, 153, 255, 0.4); }
.post-body img { border: 1px solid var(--line); border-radius: var(--radius); margin: 28px 0; }
.post-body blockquote { margin: 28px 0; padding: 4px 22px; border-left: 2px solid var(--gold); color: var(--muted); font-style: italic; }
.post-body ul, .post-body ol { padding-left: 22px; margin: 0 0 20px; }
.post-body code { font-family: ui-monospace, monospace; background: var(--panel-2); padding: 2px 6px; border-radius: 3px; font-size: 0.9em; color: var(--gold-warm); }

/* ============================================================================
   CTA de cierre + Footer
   ========================================================================== */
.cta-final { position: relative; text-align: center; padding: clamp(80px, 14vh, 150px) 0; overflow: hidden; }
.cta-final::before { content: ""; position: absolute; inset: 0; z-index: -1; background-size: cover; background-position: center; opacity: 0.25; filter: saturate(0.8); }
.cta-final h2 { font-size: clamp(30px, 6vw, 64px); color: var(--ink); margin-bottom: 10px; }
.cta-final .sub { color: var(--gold); letter-spacing: 0.28em; text-transform: uppercase; font-size: 14px; margin-bottom: 34px; }

.site-footer { border-top: 1px solid var(--line-soft); padding: 54px 0 40px; background: var(--bg); }
.site-footer .cols { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 34px; margin-bottom: 40px; }
.site-footer .mark { font-family: var(--font-display); font-size: 20px; letter-spacing: 0.22em; color: var(--ink); }
.site-footer .mark b { color: var(--gold); font-weight: 600; }
.site-footer .tagline { color: var(--muted); font-size: 14px; margin-top: 10px; max-width: 34ch; }
.site-footer nav { display: flex; flex-direction: column; gap: 10px; }
.site-footer nav a { color: var(--muted); font-size: 14px; transition: color 0.2s var(--ease); }
.site-footer nav a:hover { color: var(--gold); }
.site-footer .foot-title { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.site-footer .legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 12px; }

/* ============================================================================
   Animación de aparición al hacer scroll (JS añade .in)
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-art, .scroll-cue .line { animation: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .nav, .lang { display: none; }
  .site-header.open .nav {
    display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
    position: absolute; top: 100%; left: 0; right: 0;
    padding: 24px var(--gutter); background: rgba(6, 8, 14, 0.98); border-bottom: 1px solid var(--line-soft);
  }
  .site-header.open .lang { display: flex; position: absolute; top: 100%; right: var(--gutter); transform: translateY(calc(100% + 8px)); }
  .nav-toggle { display: block; }
  .story-block, .story-block:nth-child(even) { grid-template-columns: 1fr; direction: ltr; }
  .story-media { max-width: 460px; }
  .news-item { grid-template-columns: 1fr auto; row-gap: 6px; }
  .news-item time { grid-column: 1; }
  .news-item .tag { grid-column: 2; grid-row: 1; justify-self: end; }
  .news-item h3 { grid-column: 1 / -1; }
  .news-item .go { display: none; }
  .hero .kana-side { display: none; }
}
