/* Paleta sacada del logo de Pechicola y de Rally Drift 2D */
@font-face { font-family: 'Alfa Slab One'; src: url('../fonts/alfa-slab-one-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('../fonts/dm-sans-latin-wght-normal.woff2') format('woff2'); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url('../fonts/dm-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url('../fonts/dm-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --ink: #10272b;
  --ink-2: #16353a;
  --ink-3: #21474d;
  --cream: #f0e8d8;
  --cream-2: #e3d8c3;
  --paper-ink: #1d3236;
  --muted: #a9b7b0;
  --tomato: #d9533f;
  --tomato-d: #b63f2d;
  --mustard: #e6ae3e;
  --teal: #2f8f8c;
  --line: rgba(240, 232, 216, .16);
  --display: 'Alfa Slab One', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --checker: repeating-conic-gradient(var(--cream) 0 25%, var(--ink) 0 50%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { background: var(--ink); color: var(--cream); font-family: var(--sans); font-size: 17px; line-height: 1.6; overflow-x: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3 { line-height: 1.12; font-weight: 400; }
h2 { font-family: var(--display); font-size: clamp(2rem, 4.6vw, 3.25rem); letter-spacing: .005em; }
h3 { font-weight: 700; font-size: 1.15rem; line-height: 1.3; }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--cream); color: var(--ink); padding: .5rem 1rem; }
.skip-link:focus { left: 8px; }
.mono { font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }

.checker { height: 18px; background: var(--checker); background-size: 18px 18px; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 40; background: rgba(16, 39, 43, .94); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; }
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--display); letter-spacing: .04em; text-decoration: none; font-size: 1.05rem; }
.brand img { width: 36px; height: 36px; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a { text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--mustard); }
.nav-tools { display: flex; align-items: center; gap: .5rem; }
.lang-btn { font-family: var(--mono); font-size: .8rem; border: 1px solid var(--line); padding: .3rem .6rem; border-radius: 4px; }
.lang-btn:hover { border-color: var(--cream); }
.menu-btn { display: none; width: 40px; height: 40px; position: relative; }
.menu-btn span { position: absolute; left: 9px; right: 9px; height: 2px; background: var(--cream); }
.menu-btn span:first-child { top: 15px; }
.menu-btn span:last-child { top: 23px; }

/* ---------- hero ---------- */
.hero { min-height: calc(100svh - 79px); display: flex; align-items: center; padding: clamp(28px, 5vw, 60px) 0; }
.hero-grid { width: 100%; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 4.5vw, 64px); align-items: stretch; }
.hero-grid > div:first-child { align-self: center; }
#constelaciones { min-height: 440px; }
.eyebrow { color: var(--mustard); margin-bottom: .9rem; }
.hero h1 { font-family: var(--display); font-size: clamp(2.9rem, 5.5vw, 5rem); line-height: 1; letter-spacing: .01em; }
.tagline { font-size: clamp(1.3rem, 2.3vw, 1.7rem); line-height: 1.3; font-weight: 600; margin-top: 1.1rem; }
.tagline em { font-style: normal; color: var(--mustard); }
.hero-sub { color: var(--muted); margin-top: .9rem; max-width: 46ch; }
.ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }
.hero-hint { color: var(--mustard); margin-top: 1.1rem; font-size: .72rem; line-height: 1.5; text-transform: none; letter-spacing: .03em; }
.btn { display: inline-block; text-decoration: none; font-weight: 700; padding: .72rem 1.3rem; border-radius: 6px; border: 2px solid var(--cream); transition: transform .12s, background .12s, color .12s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--tomato); border-color: var(--tomato); color: #fff8ec; }
.btn-primary:hover { background: var(--tomato-d); border-color: var(--tomato-d); }
.btn-ghost:hover { background: var(--cream); color: var(--ink); }

/* ---------- juegos: capa sobre toda la web ---------- */
#capa-juego { position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none; }
html.modo-naves body { cursor: crosshair; }
html.sobre-nodo body { cursor: pointer; }
a, button { cursor: pointer; }
.hud { position: fixed; top: 70px; right: var(--gutter); z-index: 35; display: flex; align-items: center; gap: .55rem; background: var(--ink); color: var(--cream); border: 1px solid var(--cream); border-radius: 6px; padding: 3px 7px 3px 3px; font-family: var(--mono); font-size: .7rem; line-height: 1.15; }
.hud.jefe { border-color: var(--tomato); box-shadow: 0 0 0 2px var(--tomato); }
.hud-modos { display: flex; gap: 2px; }
.hud-modos button { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; padding: .22rem .42rem; border-radius: 3px; color: var(--cream); }
.hud-modos button:hover { background: var(--ink-3); }
.hud-modos button.on { background: var(--cream); color: var(--ink); }
.hud-datos { display: flex; gap: .55rem; white-space: nowrap; }
.hud-datos b { font-weight: 500; color: var(--mustard); }
.hud.apagado .hud-datos { display: none; }
.hud.apagado { padding-right: 3px; }

/* ---------- cifras ---------- */
.stats { background: var(--cream); color: var(--paper-ink); }
.stats ul { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding-block: clamp(20px, 3vw, 30px); }
.stats strong { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(1.7rem, 3.6vw, 2.5rem); line-height: 1.1; color: var(--tomato-d); }
.stats span { font-size: .93rem; line-height: 1.3; display: block; }

/* ---------- secciones ---------- */
.section { padding: clamp(52px, 8vw, 96px) 0; }
.section-head { margin-bottom: clamp(24px, 3.5vw, 40px); }


.proyectos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px); }
.proyecto .media { display: block; position: relative; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; overflow: hidden; margin-bottom: 1rem; background: var(--ink-2); }
.proyecto .media img { width: 100%; height: 100%; object-fit: cover; }
.proyecto .mono { color: var(--mustard); margin-bottom: .35rem; }
.proyecto > p:not(.mono) { color: var(--muted); font-size: .97rem; }
.proyecto h3 { font-size: 1.3rem; }
.play { position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%; background: var(--tomato); transition: transform .12s; }
.play::after { content: ''; position: absolute; left: 27px; top: 21px; border-style: solid; border-width: 13px 0 13px 21px; border-color: transparent transparent transparent #fff8ec; }
.video:hover .play { transform: scale(1.1); }
.making { display: flex; align-items: center; gap: .8rem; margin-top: .9rem; font-weight: 600; font-size: .95rem; text-decoration: none; }
.making img { width: 112px; height: 63px; object-fit: cover; border-radius: 6px; flex: none; }
.making:hover { color: var(--mustard); }
.game-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border-block: 1px solid var(--line); margin-top: clamp(24px, 3.5vw, 40px); }
.game-list article { background: var(--ink); padding: 1.4rem 1.4rem 1.4rem 0; }
.game-list article:nth-child(even) { padding-left: 1.4rem; padding-right: 0; }
.game-list .mono { color: var(--mustard); margin-bottom: .35rem; }
.game-list p:last-of-type { color: var(--muted); font-size: .97rem; }
.facts { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin-top: .6rem; font-size: .93rem; }
.facts strong { color: var(--mustard); }

.in-dev { margin-top: 1.1rem; color: var(--muted); font-size: .95rem; }
.in-dev .mono { margin-right: .5rem; color: var(--mustard); }
.in-dev a:hover { color: var(--mustard); }

.about { background: var(--ink-2); }
.about-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
.about-grid p + p { margin-top: 1rem; }
.about-grid h2 { margin-bottom: 1.2rem; }
.about-logo { width: min(260px, 70%); margin: 0 auto; }

.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem clamp(24px, 4vw, 56px); }
.skills svg { width: 30px; height: 30px; fill: none; stroke: var(--mustard); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: .55rem; }
.skills p { color: var(--muted); }
.stack { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.stack-label { color: var(--mustard); }
.stack ul { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-family: var(--mono); font-size: .86rem; }

.timeline li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 1.2rem; padding: 1.3rem 0; border-top: 1px solid var(--line); }
.timeline .mono { color: var(--mustard); padding-top: .2rem; }
.tl-role { display: block; font-weight: 400; color: var(--muted); font-size: .96rem; }
.timeline p { color: var(--muted); margin-top: .35rem; max-width: 70ch; }

.contact { background: var(--cream); color: var(--paper-ink); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); }
.form-group { margin-bottom: .9rem; }
.form-group label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .2rem; }
.form-group input, .form-group textarea { width: 100%; font: inherit; background: #fbf6ea; color: var(--paper-ink); border: 2px solid var(--paper-ink); border-radius: 6px; padding: .6rem .7rem; }
.form-group textarea { resize: vertical; }
.hp { position: absolute; left: -9999px; }
.contact .btn-primary:focus-visible { outline-color: var(--paper-ink); }
.form-note { font-size: .84rem; margin-top: .8rem; opacity: .85; }
.form-status { min-height: 1.4em; margin-top: .5rem; font-weight: 600; font-size: .95rem; }
.form-status.ok { color: #1c6e5f; }
.form-status.err { color: var(--tomato-d); }

/* ---------- pie ---------- */
.footer { padding: 1.5rem 0; font-size: .92rem; color: var(--muted); }
.footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; }
.footer nav { display: flex; flex-wrap: wrap; gap: .3rem 1.3rem; }
.footer a:hover { color: var(--cream); }

/* ---------- página del juego ---------- */
.r-head { padding: clamp(28px, 4vw, 48px) 0 clamp(20px, 3vw, 32px); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.4rem; align-items: center; }
.r-head img { width: 112px; height: 112px; border-radius: 22px; }
.r-head h1 { font-family: var(--display); font-size: clamp(2.2rem, 5.6vw, 3.7rem); line-height: 1.05; }
.r-lead { font-size: clamp(1.12rem, 1.9vw, 1.32rem); max-width: 62ch; }
.r-status { margin-top: 1rem; display: inline-block; background: var(--mustard); color: var(--ink); font-weight: 600; padding: .3rem .75rem; border-radius: 4px; font-size: .96rem; }
.r-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.r-links a { display: block; text-decoration: none; background: var(--cream); color: var(--paper-ink); border-radius: 10px; padding: 1.1rem 1.2rem; transition: transform .12s; }
.r-links a:hover { transform: translateY(-3px); }
.r-links span { display: block; font-size: .95rem; margin-top: .2rem; }

/* ---------- textos legales ---------- */
.legal { background: var(--cream); color: var(--paper-ink); min-height: 70vh; padding: clamp(32px, 5vw, 64px) 0 clamp(48px, 7vw, 88px); }
.legal-in { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter); }
.legal h1 { font-family: var(--display); font-size: clamp(2rem, 5vw, 3rem); margin-bottom: .4rem; }
.legal .app { font-weight: 700; color: var(--tomato-d); }
.legal .date { font-family: var(--mono); font-size: .82rem; margin-bottom: 1.6rem; }
.legal h2 { font-family: var(--sans); font-weight: 800; font-size: 1.26rem; line-height: 1.3; margin: 2rem 0 .5rem; letter-spacing: 0; }
.legal p, .legal ul, .legal ol, .legal table { margin-bottom: .8rem; }
.legal ul, .legal ol { padding-left: 1.3rem; }
.legal ul { list-style: disc; }
.legal ol { list-style: decimal; }
.legal li { margin-bottom: .35rem; }
.legal a { color: var(--tomato-d); font-weight: 600; overflow-wrap: anywhere; }
.legal .tbl { overflow-x: auto; margin-bottom: .8rem; }
.legal table { border-collapse: collapse; width: 100%; font-size: .94rem; margin: 0; min-width: 520px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: .5rem .6rem; border: 1px solid rgba(29, 50, 54, .28); }
.legal th { background: var(--cream-2); }
.callout { background: var(--ink); color: var(--cream); padding: 1.1rem 1.25rem; border-radius: 10px; margin: 1.2rem 0; }
.callout p:last-child { margin-bottom: 0; }
.callout .btn { margin-top: .3rem; color: #fff8ec; }
.legal .callout a { color: var(--mustard); }
.legal .callout a.btn { color: #fff8ec; }
.legal-lang { font-family: var(--mono); font-size: .82rem; margin-bottom: 1rem; }

/* ---------- aparición ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .5s; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- adaptación ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
      .about-grid { grid-template-columns: minmax(0, 1fr); }
  .about-logo { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .menu-btn { display: block; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--ink); border-bottom: 1px solid var(--line); flex-direction: column; align-items: flex-start; gap: 0; padding: .4rem var(--gutter) .8rem; }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; width: 100%; padding: .6rem 0; }
  .stats ul { grid-template-columns: repeat(2, 1fr); }
  .proyectos, .game-list, .skills, .contact-grid, .r-links { grid-template-columns: minmax(0, 1fr); }
  .game-list article, .game-list article:nth-child(even) { padding: 1.2rem 0; }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
  #constelaciones { min-height: 340px; }
  .hud { top: auto; bottom: 10px; right: 10px; }
  .r-head { grid-template-columns: minmax(0, 1fr); }
  .r-head img { width: 84px; height: 84px; border-radius: 18px; }
  }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .r-links a { transition: none; }
}
