/* A Chess Way · portal. Paleta de la app: cielo lila, tinta ciruela, naranja del caballo, marfil y nogal. */
@font-face { font-family: "Inter"; src: url("assets/fonts/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("assets/fonts/Inter-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("assets/fonts/InterDisplay-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("assets/fonts/Caveat-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --sky: #e9e6f4;
  --sky-deep: #d9d4ec;
  --ink: #2b2540;
  --ink-soft: #5d5674;
  --orange: #f0872a;
  --orange-deep: #c9651a;
  --ivory: #fbf8f1;
  --walnut: #8d5a3b;
  --walnut-light: #e9d3b4;
  --good: #2f8a5f;
  --bad: #c0474b;
  --radius-l: 28px;
  --radius-s: 12px;
  --w: 1140px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0; background: var(--sky); color: var(--ink);
  font: 400 1.0625rem/1.6 "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration-color: color-mix(in srgb, var(--orange) 70%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--orange-deep); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: "Inter Display", "Inter", sans-serif; font-weight: 700; letter-spacing: -0.02em; line-height: 1.08; margin: 0; }
h2 { font-size: clamp(2rem, 4.2vw, 3rem); max-width: 18ch; }
h3 { font-size: 1.35rem; letter-spacing: -0.01em; }
p { margin: 0; }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 24px; }

/* ------------------------------------------------------------ cabecera */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--sky) 88%, transparent); backdrop-filter: blur(10px); }
.top .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.brand span { font: 700 1.9rem/1 "Caveat", cursive; color: var(--ink); }
.top nav { display: flex; gap: 22px; margin-left: auto; font-size: 0.95rem; }
.top nav a { text-decoration: none; color: var(--ink-soft); }
.top nav a:hover { color: var(--ink); }
.lang { font-size: 0.9rem; color: var(--ink-soft); }
@media (max-width: 900px) { .top nav { display: none; } .lang { margin-left: auto; } }

/* ------------------------------------------------------------ portada */
.hero { padding: 48px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: 1fr minmax(320px, 520px); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); max-width: 11ch; }
.hero .lead { margin-top: 22px; font-size: 1.2rem; color: var(--ink-soft); max-width: 46ch; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.store { display: inline-flex; flex-direction: column; justify-content: center; padding: 12px 22px; border-radius: 16px; background: var(--ink); color: var(--ivory); text-decoration: none; min-width: 168px; }
.store b { font: 600 1.05rem/1.2 "Inter", sans-serif; }
.store small { font-size: 0.8rem; opacity: 0.75; }
.store:hover { color: var(--ivory); background: #3a3355; }
.store.soon { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.store.soon small { opacity: 0.7; }
.store.demo { background: var(--orange); color: #2a1503; }
.store.demo:hover { background: #f59a46; color: #2a1503; }
.hero-try { display: flex; flex-direction: column; gap: 14px; }
.hand { font: 700 1.75rem/1.15 "Caveat", cursive; color: var(--orange-deep); }
.hero-try .q { font-weight: 600; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; gap: 40px; } }

/* ------------------------------------------------------------ tablero */
.acw-board { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 1; width: 100%;
  border-radius: 18px; overflow: hidden; border: 10px solid var(--walnut); background: var(--walnut);
  box-shadow: 0 2px 0 #6e4329, 0 24px 48px -24px rgba(43, 37, 64, 0.55); }
.sq { position: relative; border: 0; padding: 0; margin: 0; aspect-ratio: 1; cursor: default; font: inherit; }
.sq.light { background: var(--walnut-light); }
.sq.dark { background: #b58461; }
.sq.playable { cursor: pointer; }
.sq.last::after { content: ""; position: absolute; inset: 0; background: rgba(240, 135, 42, 0.32); }
.sq.sel { box-shadow: inset 0 0 0 4px var(--orange); }
.sq.target::before { content: ""; position: absolute; inset: 36%; border-radius: 50%; background: rgba(43, 37, 64, 0.28); z-index: 2; }
.pc { position: absolute; inset: 2%; width: 96%; height: 96%; z-index: 1; object-fit: contain; user-select: none; }
.pc.hidden { visibility: hidden; }
/* Piezas en movimiento: viajan por encima del tablero y, al llegar, dejan sitio a la pieza de verdad. */
.glide { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.ghost { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; padding: 0.25%; object-fit: contain;
  transition: transform 320ms cubic-bezier(0.3, 0.7, 0.2, 1); will-change: transform; z-index: 2; }
.ghost.gone { z-index: 1; transition: opacity 260ms ease 120ms, scale 260ms ease 120ms; }
.ghost.gone.out { opacity: 0; scale: 0.6; }
.coord { position: absolute; font-size: 0.68rem; font-weight: 600; color: rgba(43, 37, 64, 0.55); z-index: 1; }
.coord.rank { top: 3px; left: 4px; }
.coord.file { bottom: 2px; right: 5px; }
.arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.arrows line { stroke: var(--orange); stroke-width: 22; stroke-linecap: round; opacity: 0.9; }
.arrows polygon { fill: var(--orange); opacity: 0.9; }
.note { min-height: 3.2em; padding: 14px 18px; border-radius: var(--radius-s); background: var(--ivory); color: var(--ink-soft); }
.note.good { color: var(--ink); box-shadow: inset 4px 0 0 var(--good); }
.note.bad { color: var(--ink); box-shadow: inset 4px 0 0 var(--bad); }
.note.ask { color: var(--ink); box-shadow: inset 4px 0 0 var(--orange); }
.note strong { color: var(--good); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { font: 600 0.95rem/1 "Inter", sans-serif; padding: 12px 18px; border-radius: 999px; border: 0; background: var(--ink); color: var(--ivory); cursor: pointer; }
.btn.go { background: var(--orange); color: #2a1503; }
.btn.quiet { background: var(--sky-deep); color: var(--ink); }
.btn:disabled { opacity: 0.4; cursor: default; }

/* ------------------------------------------------------------ secciones */
section.band { padding: 88px 0; }
section.band.paper { background: var(--ivory); }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: end; margin-bottom: 44px; }
.intro p { color: var(--ink-soft); font-size: 1.1rem; max-width: 52ch; }
@media (max-width: 900px) { .intro { grid-template-columns: 1fr; gap: 16px; } }

/* La app: capturas + lo que trae */
.shots { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; margin-bottom: 48px; }
.shots img { width: 100%; height: 100%; object-fit: cover; object-position: left top; aspect-ratio: 16 / 9; display: block; border-radius: var(--radius-s); box-shadow: 0 20px 40px -28px rgba(43, 37, 64, 0.6); }
.feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 40px; }
.feats h3 { font-size: 1.1rem; margin-bottom: 6px; }
.feats p { color: var(--ink-soft); font-size: 0.98rem; }
@media (max-width: 900px) { .shots { grid-template-columns: 1fr; } .feats { grid-template-columns: 1fr; } }

/* Problemas */
.puzzles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
.puzzle { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.puzzle header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.puzzle .theme { font: 700 1.75rem/1.1 "Caveat", cursive; color: var(--orange-deep); }
.puzzle .src { font-size: 0.82rem; color: var(--ink-soft); }
.note .hint { color: var(--ink-soft); }
@media (max-width: 900px) { .puzzles { grid-template-columns: 1fr; } }

/* Demo */
.demo-box { display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; padding: 28px 32px; border-radius: var(--radius-l); background: var(--ink); color: var(--ivory); }
.demo-box .hand { color: #ffb36b; font-size: 2.1rem; }
.demo-box p { color: #d8d2ea; max-width: 60ch; }
@media (max-width: 700px) { .demo-box { grid-template-columns: 1fr; } }

/* Línea del tiempo: es una secuencia, así que va con años a la izquierda */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 3px solid var(--sky-deep); }
.timeline li { position: relative; display: grid; grid-template-columns: 9.5rem 1fr; gap: 24px; padding: 0 0 36px 28px; }
.timeline li::before { content: ""; position: absolute; left: -9px; top: 0.55em; width: 15px; height: 15px; border-radius: 50%; background: var(--ivory); border: 3px solid var(--orange); }
.timeline .yr { font: 700 1.9rem/1 "Caveat", cursive; color: var(--orange-deep); padding-top: 0.15em; }
.timeline h3 { margin-bottom: 6px; }
.timeline p { color: var(--ink-soft); max-width: 62ch; }
.timeline .src { margin-top: 6px; font-size: 0.82rem; }
.timeline .src a { color: var(--ink-soft); margin-right: 10px; }
@media (max-width: 700px) { .timeline li { grid-template-columns: 1fr; gap: 4px; } }

/* Partidas */
#games .layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 40px; }
.tabs { display: flex; flex-direction: column; gap: 8px; }
.tabs button { text-align: left; border: 0; border-radius: var(--radius-s); padding: 14px 16px; background: transparent; color: var(--ink); cursor: pointer; font: inherit; }
.tabs button .y { display: block; font: 700 1.5rem/1 "Caveat", cursive; color: var(--orange-deep); }
.tabs button .t { font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--sky); }
.game { display: grid; grid-template-columns: minmax(280px, 480px) minmax(0, 1fr); gap: 32px; align-items: start; }
.game-side { display: flex; flex-direction: column; gap: 14px; }
.game-head .sub { color: var(--ink-soft); margin-top: 4px; font-size: 0.95rem; }
.moves { display: flex; flex-wrap: wrap; gap: 2px 4px; font-size: 0.92rem; line-height: 1.9; }
.moves .pair { white-space: nowrap; margin-right: 6px; }
.moves .num { color: var(--ink-soft); margin-right: 2px; }
.moves .mv { border: 0; background: none; font: inherit; padding: 0 4px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.moves .mv:disabled { color: var(--ink-soft); cursor: default; }
.moves .mv.key { box-shadow: inset 0 -2px 0 var(--orange); }
.moves .mv.now { background: var(--orange); color: #2a1503; }
.game .src { font-size: 0.82rem; color: var(--ink-soft); }
.game .src a { color: var(--ink-soft); }
@media (max-width: 1000px) { #games .layout, .game { grid-template-columns: 1fr; } .tabs { flex-direction: row; overflow-x: auto; } }

/* Cine */
.cine { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; }
@media (max-width: 700px) { .cine { grid-template-columns: 1fr; } }

/* Enlaces */
.links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.links li { padding: 18px 0; border-top: 1px solid var(--sky-deep); }
.links a { font-weight: 600; }
.links p { color: var(--ink-soft); font-size: 0.95rem; margin-top: 2px; }
@media (max-width: 700px) { .links { grid-template-columns: 1fr; } }

footer { padding: 40px 0 56px; color: var(--ink-soft); font-size: 0.88rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
