@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Inter:wght@400;500;600;700;800&display=swap');

/* VERDE: pistacho claro #a4be5c (oscuro #8aa446), con texto NEGRO encima.
   Historial: oliva original #4a5320 / #3d431c → prueba #5b6b1a / #48541a → pistacho.
   Volver a la oliva no es solo cambiar el color: también el texto encima (negro → crema). */
:root {
  --bg: #ec6ea0;
  --bg-soft: #f082ae;
  --text: #17140f;
  --text-soft: #3a3530;
  --card: #f2ede2;
  --card-text: #17140f;
  --sidebar-icon: #f2ede2;
  --sidebar-icon-line: #17140f;
  --border: #17140f;
  --accent: #17140f;
  --link-underline: #17140f;
  --shadow: rgba(23, 20, 15, 0.25);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html[data-theme="dark"] {
  --bg: #0c0c0a;
  --bg-soft: #161611;
  --text: #ec6ea0;
  --text-soft: #f4a8c6;
  --card: #8aa446;
  --card-text: #17140f;
  --sidebar-icon: #f2ede2;
  --sidebar-icon-line: #ec6ea0;
  --border: #ec6ea0;
  --accent: #ec6ea0;
  --link-underline: #ec6ea0;
  --shadow: rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

a { color: inherit; }
button { font-family: inherit; }

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  gap: 12px;
  z-index: 50;
}

.sidebar-top { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; }
/* Contacto en la barra: teclas pequeñas, siempre a mano (correo, LinkedIn, GitHub, itch.io) */
.sidebar-contact { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 10px; }
.sidebar-contact .nav-label { margin-bottom: 2px; }
.icon-box.icon-sm { width: 40px; height: 40px; }
.icon-box.icon-sm svg { width: 18px; height: 18px; }
.icon-box svg.svg-fill { fill: var(--sidebar-icon-line); stroke: none; }
.icon-box svg.svg-fill .hole { fill: var(--sidebar-icon); }
button.contact-icon { background: none; border: none; padding: 0; cursor: pointer; font: inherit; }
/* Zona de toque de 48px aunque la tecla mida 40 (regla de Appllama: objetivos táctiles ≥ 44) */
.sidebar-contact .contact-icon { padding: 4px; margin: -4px 0; }

.nav-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: none;
  background: none;
  text-decoration: none;
  padding: 0;
}

/* Botones tipo tecla: mismo borde y sombra dura que tarjetas y pills */
.icon-box {
  width: 52px;
  height: 52px;
  background: var(--sidebar-icon);
  border: 2px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -3px 0 rgba(23, 20, 15, 0.1), 0 3px 0 var(--shadow);
  transition: transform 0.25s var(--spring), box-shadow 0.2s ease, background 0.25s ease;
}
.nav-icon:hover .icon-box { transform: translateY(-2px); box-shadow: inset 0 -3px 0 rgba(23, 20, 15, 0.1), 0 5px 0 var(--shadow); }
.nav-icon:active .icon-box { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(23, 20, 15, 0.15), 0 1px 0 var(--shadow); }

/* Sección actual = botón hundido */
.nav-icon.is-active .icon-box,
.nav-icon.is-active:hover .icon-box {
  background: var(--accent);
  transform: translateY(2px);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.2), 0 1px 0 var(--shadow);
}
.nav-icon.is-active .icon-box svg { stroke: var(--card); fill: none; }
.nav-icon.is-active .nav-label { color: var(--accent); }
.icon-box svg { width: 22px; height: 22px; stroke: var(--sidebar-icon-line); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.3s ease, transform 0.5s var(--spring); transform-origin: 50% 85%; }

.nav-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text);
  text-align: center;
  line-height: 1.1;
  /* tapa el camino por detrás del texto */
  background: var(--bg);
  padding: 2px 4px;
  border-radius: 6px;
}

.theme-toggle .icon-box svg { transform-origin: 50% 50%; }
html[data-theme="dark"] .theme-toggle .icon-box svg { fill: var(--sidebar-icon-line); stroke: none; }

/* ---------- Selector de niveles: camino + cursor ---------- */
.sidebar-top { position: relative; }
.sidebar-top .nav-icon { position: relative; z-index: 1; }

.nav-path {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle, var(--text) 1.5px, transparent 2px) center top / 3px 8px repeat-y;
  opacity: 0.4;
}
.nav-path-fill {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  background: var(--accent);
  border-radius: 3px;
  transition: height 0.12s linear, width 0.12s linear;
}
.is-horizontal .nav-path { background-image: radial-gradient(circle, var(--text) 1.5px, transparent 2px); background-size: 8px 3px; background-repeat: repeat-x; background-position: left center; }

.nav-cursor {
  position: absolute;
  z-index: 2;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid var(--text);
  margin-top: -6px;
  pointer-events: none;
  opacity: 0;
  transition: top 0.9s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  animation: cursor-bob 2.4s ease-in-out infinite;
}
.nav-cursor.is-on { opacity: 1; }
.is-horizontal .nav-cursor { display: none; }
@keyframes cursor-bob { 0%, 100% { translate: 0 0; } 50% { translate: 2px 0; } }

/* ---------- Microanimaciones de cada icono ---------- */
.sidebar-top .nav-icon:nth-of-type(3) rect { transform-box: fill-box; transform-origin: center; transition: transform 0.45s var(--spring); }
.sidebar-top .nav-icon:nth-of-type(4) circle { transform-box: fill-box; transform-origin: center; }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .sidebar-top .nav-icon:nth-of-type(1):hover svg { animation: nav-hop 0.6s ease; }
  .sidebar-top .nav-icon:nth-of-type(2):hover svg { animation: nav-rumble 0.5s linear; }
  .sidebar-top .nav-icon:nth-of-type(3):hover rect:nth-child(1) { transform: translate(-1.5px, -1.5px); }
  .sidebar-top .nav-icon:nth-of-type(3):hover rect:nth-child(2) { transform: translate(1.5px, -1.5px) rotate(45deg) scale(0.8); }
  .sidebar-top .nav-icon:nth-of-type(3):hover rect:nth-child(3) { transform: translate(-1.5px, 1.5px); }
  .sidebar-top .nav-icon:nth-of-type(3):hover rect:nth-child(4) { transform: translate(1.5px, 1.5px); }
  .sidebar-top .nav-icon:nth-of-type(4):hover circle { animation: nav-nod 0.7s ease; }
  .theme-toggle:hover .icon-box svg { transform: rotate(45deg); }
}

@keyframes nav-hop {
  0%   { transform: none; }
  22%  { transform: translateY(1px) scale(1.14, 0.84); }
  50%  { transform: translateY(-5px) scale(0.92, 1.1); }
  75%  { transform: translateY(0) scale(1.06, 0.94); }
  100% { transform: none; }
}
@keyframes nav-rumble {
  0%, 100% { transform: none; }
  15% { transform: translateX(-1.5px) rotate(-7deg); }
  30% { transform: translateX(1.5px) rotate(7deg); }
  45% { transform: translateX(-1px) rotate(-5deg); }
  60% { transform: translateX(1px) rotate(5deg); }
  78% { transform: rotate(-2deg); }
}
@keyframes nav-nod {
  0%, 100% { transform: none; }
  30% { transform: translateY(-2.5px); }
  55% { transform: translateY(0.5px); }
  75% { transform: translateY(-1px); }
}

@media (prefers-reduced-motion: reduce) {
  .nav-cursor { animation: none; transition: opacity 0.3s ease; }
  .nav-path-fill { transition: none; }
}

/* Cambio de tema directo, sin fundidos */
.theme-switching, .theme-switching * { transition: none !important; }

.lang-icon {
  font-family: 'Archivo Black', sans-serif;
  font-size: 15px;
  color: var(--sidebar-icon-line);
  letter-spacing: 0.02em;
}

/* ---------- Main ---------- */
.main {
  margin-left: 96px;
  width: calc(100% - 96px);
}

section { padding: 90px 64px; position: relative; }

/* ---------- Personajes del fondo (deco.js, diseño original) ---------- */
:root {
  --d-body: #f2ede2;   /* lana, queso, cuerpo */
  --d-mass: #17140f;   /* caras, patas, zapatos */
  --d-acc: #a4be5c;    /* corteza, palo */
  --d-ground: #a4be5c; /* tierra del topo */
  --d-pink: #c93f7c;   /* nariz, pepperoni, zarpas */
  --d-eye: #f2ede2;
  --d-ink: #17140f;
}
/* Baldosas (mismo sistema que los iconos de Offline Working Sheep) */
:root {
  --tile-olive: #7f9a3a;
  --tile-deep: #cf4e86;
  --tile-ink: #17140f;
  --tile-github: #24292f;
  --tile-linkedin: #0a66c2;
  --tile-itch: #fa5c5c;
  --c-body: #f2ede2;
  --c-soft: #f7b6cf;
  --c-accent: #ec6ea0;
  --c-crust: #ec6ea0;
  --c-ink: #17140f;
}
/* En oscuro la paleta se invierte: criaturas rosas, detalles negros, baldosas vino/oliva/carbón */
html[data-theme="dark"] {
  --tile-olive: #5a2140;
  --tile-deep: #3f5226;
  --tile-ink: #2a2622;
  --tile-github: #24292f;
  --tile-linkedin: #0a66c2;
  --c-crust: #f2ede2;
  --c-body: #ec6ea0;
  --c-soft: #f2ede2;
  --c-accent: #17140f;
  --c-ink: #17140f;
}
html[data-theme="dark"] {
  --d-body: #ec6ea0;
  --d-mass: #3f5226;
  --d-acc: #f2ede2;
  --d-ground: #262a12;
  --d-pink: #f2ede2;
}

.mascot {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  display: block;
}
.mascot svg { width: 100%; height: 100%; display: block; overflow: visible; }
.d-b { fill: var(--d-body); }
.d-m { fill: var(--d-mass); }
.d-a { fill: var(--d-acc); }
.d-g { fill: var(--d-ground); }
.d-p { fill: var(--d-pink); }
.d-e { fill: var(--d-eye); }
.d-k { fill: var(--d-ink); }
.d-dirt { fill: var(--d-mass); opacity: 0.5; }
.d-line-e, .d-line-m, .d-line-k { fill: none; stroke-width: 4; stroke-linecap: round; }
.d-line-e { stroke: var(--d-eye); }
.d-line-m { stroke: var(--d-mass); stroke-width: 6; }
.d-line-k { stroke: var(--d-ink); stroke-width: 3; }
.t-bg, .t-hole { fill: var(--tile); }
.t-line { fill: none; stroke: var(--tile); stroke-width: 3; stroke-linecap: round; }
.t-line-sm { stroke-width: 2.5; }
.c-body { fill: var(--c-body); }
.c-soft { fill: var(--c-soft); }
.c-accent { fill: var(--c-accent); }
.c-crust { fill: var(--c-crust); }
.c-white { fill: #fff; }
.c-ink { fill: var(--c-ink); }
.c-round { stroke: var(--c-accent); stroke-width: 3; stroke-linejoin: round; }
.c-round-lg { stroke: var(--c-body); stroke-width: 6; stroke-linejoin: round; }
.c-line-soft, .c-line-body { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.c-line-soft { stroke: var(--c-soft); }
.c-line-body { stroke: var(--c-body); stroke-width: 3; }

.hero > *:not(.mascot) { position: relative; z-index: 1; }
.section-head, #featured-game, #games-grid, #other-grid, .other-grid, .about-wrap { position: relative; z-index: 1; }

.deco-games  { width: 96px; height: 96px; top: 64px; right: 64px; }
.deco-other  { width: 150px; height: 90px; top: 70px; right: 64px; }
.deco-about  { width: 96px; height: 96px; top: 64px; right: 64px; }
.deco-detail { width: 84px; height: 84px; right: 0; bottom: 0; }
.deco-detail[data-deco="tileFish"] { width: 130px; height: 78px; }
.mascot.deco-side { position: relative; width: 100%; margin-top: 12px; }
.deco-side svg { height: auto; }
/* Bloque de baldosas en el pie: GitHub, LinkedIn y la oveja */
.footer-home { position: relative; padding-top: 170px; }
.footer-tiles {
  position: absolute;
  right: 64px;
  top: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 2;
}
.footer-tile {
  display: block;
  position: relative;
  flex-shrink: 0;
}
.footer-tile svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.footer-sheep {
  width: 116px;
  height: 116px;
}
.footer-link {
  width: 54px;
  height: 54px;
  text-decoration: none;
  cursor: pointer;
  border-radius: 14px;
  transition: transform 0.25s var(--spring), filter 0.2s ease;
}
.footer-link:hover {
  transform: translateY(-4px);
  filter: drop-shadow(0 6px 0 var(--shadow));
}
.footer-link:active {
  transform: translateY(2px);
  filter: drop-shadow(0 2px 0 var(--shadow));
}
.footer-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
.deco-footer { width: 116px; height: 116px; }
.deco-404    { width: 260px; height: 260px; right: 10%; top: 50%; margin-top: -130px; }
@media (max-width: 1250px) { .deco-404 { display: none; } }

@media (max-width: 860px) {
  .mascot { display: none; }
  .footer-home { padding-top: 30px; }
  .footer-tiles {
    position: static;
    width: 100%;
    justify-content: center;
    order: -1;
    margin-bottom: 20px;
    gap: 10px;
  }
  .footer-sheep {
    width: 80px;
    height: 80px;
  }
  .footer-link {
    width: 42px;
    height: 42px;
    border-radius: 11px;
  }
}

/* Vida propia: parpadeo, asomarse, balanceo */
@media (prefers-reduced-motion: no-preference) {
  .deco-blink { transform-box: fill-box; transform-origin: center; animation: deco-blink 5.5s infinite; }
  .deco-peek { animation: deco-peek 4.5s ease-in-out infinite; }
  .deco-sway { transform-box: fill-box; transform-origin: center; animation: deco-sway 3.6s ease-in-out infinite; }
  .deco-bob { animation: deco-bounce 2.4s ease-in-out infinite; }
}
@keyframes deco-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes deco-peek { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(10px); } }
@keyframes deco-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes deco-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ---------- Página 404 ---------- */
.page-404 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}
.page-404 > *:not(.mascot) { position: relative; z-index: 1; max-width: 640px; }
.code-404 {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(60px, 10vw, 120px);
  color: var(--text-soft);
  margin: 0;
  opacity: 0.5;
}
.title-404 {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  margin: 6px 0 18px;
  text-transform: none;
}
.body-404 {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-soft);
  font-weight: 500;
  margin-bottom: 30px;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 40px;
}

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-soft);
  margin: 0 0 18px;
}

h1.name {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(44px, 9vw, 108px);
  line-height: 0.98;
  margin: 0;
  letter-spacing: -0.01em;
}

h2.role {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(22px, 4vw, 40px);
  margin: 6px 0 28px;
  color: var(--text);
}

.hero-lede {
  max-width: 560px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-soft);
  font-weight: 500;
}

.hero-links {
  display: flex;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--card);
  color: var(--card-text);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border: 2px solid var(--border);
  box-shadow: 0 4px 0 var(--shadow);
  transition: transform 0.15s ease;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.pill:hover { transform: translateY(-2px); }
.pill:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--shadow); }
.pill-accent { background: var(--accent); color: var(--card); }
.pill-disabled { background: transparent; color: var(--text-soft); border-style: dashed; box-shadow: none; cursor: default; }

/* ---------- Section headings ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 44px;
}

.section-num {
  font-family: 'Archivo Black', sans-serif;
  font-size: 15px;
  color: var(--text-soft);
}

h3.section-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(30px, 5vw, 52px);
  margin: 0;
  text-transform: uppercase;
}

/* ---------- Project grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 34px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
}

.card-thumb {
  aspect-ratio: 4 / 3.2;
  border-radius: 18px;
  background: var(--card);
  border: 2px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 6px 0 var(--shadow);
  transition: transform 0.18s ease;
}
.card:hover .card-thumb { transform: translateY(-4px); }

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.card:hover .card-thumb img { transform: scale(1.06); }

.card-thumb.placeholder {
  border-style: dashed;
  color: var(--card-text);
  font-weight: 700;
  text-align: center;
  padding: 20px;
  font-size: 13px;
  line-height: 1.5;
}
.card-thumb.placeholder .ph-icon { font-size: 30px; margin-bottom: 8px; display: block; }
.card-thumb.placeholder.tint-blue { background: #dde4f7; }
.card-thumb.placeholder.tint-red { background: #ece2da; }
html[data-theme="dark"] .card-thumb.placeholder.tint-blue { background: #23283f; }
html[data-theme="dark"] .card-thumb.placeholder.tint-red { background: #3a2a26; }

/* Two-tone brand cover (used when there's no real screenshot yet) */
.card-thumb.brand-cover { padding: 0; flex-direction: column; }
.brand-top, .brand-bottom {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 14px;
}
.brand-top { flex: 0 0 30%; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.brand-bottom { flex: 1; flex-direction: column; gap: 8px; }
.brand-title { font-family: 'Archivo Black', sans-serif; font-size: 24px; line-height: 1.1; }
.brand-tagline { font-size: 12px; font-weight: 700; opacity: 0.85; }

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: var(--card);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  border-radius: 999px;
  z-index: 2;
}

.card-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 20px;
  color: var(--card-text);
  margin: 0;
}

.card-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-soft);
  margin: 0;
  font-weight: 500;
}

.card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tag {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
}

/* ---------- Other projects (github card) ---------- */
.other-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}
.other-card {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 26px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100px;
  justify-content: space-between;
}
.other-card.filled { border-style: solid; background: var(--card); color: var(--card-text); }
.other-card h4 { font-family: 'Archivo Black', sans-serif; font-size: 17px; margin: 0; }
.other-card p { margin: 0; font-size: 13px; font-weight: 500; opacity: 0.85; }
.other-card .arrow { font-size: 20px; font-weight: 800; }

/* ---------- About ---------- */
.about-wrap {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 60px;
}

.about-photo {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 3px solid var(--border);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Archivo Black', sans-serif;
  font-size: 64px;
  color: var(--card-text);
  box-shadow: 0 6px 0 var(--shadow);
}

/* Avatar: gato robot azul (deco.js) */
.about-photo { overflow: hidden; }
.about-photo svg { width: 100%; height: 100%; display: block; }
.r-blue { fill: #7076fb; }
.r-dark { fill: #3f43b8; }
.r-light { fill: #f2ede2; }
.r-pink { fill: #ec6ea0; }
.r-join { stroke: #7076fb; stroke-width: 10; stroke-linejoin: round; }
.r-stroke { fill: none; stroke: #3f43b8; stroke-width: 6; stroke-linecap: round; }
.r-mouth { fill: none; stroke: #3f43b8; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.r-whisker { fill: none; stroke: #3f43b8; stroke-width: 3.5; stroke-linecap: round; }

.about-side h4 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 26px 0 10px;
  color: var(--text-soft);
}
.about-side h4:first-child { margin-top: 0; }
.about-side ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.about-side li {
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
}
.about-side .contact-line { font-size: 14px; font-weight: 600; margin: 4px 0; }
.about-side .contact-line { display: flex; align-items: center; gap: 9px; margin: 7px 0; }
.about-side .contact-line a { text-decoration: underline; text-decoration-color: var(--link-underline); overflow-wrap: anywhere; }
.about-side .contact-line button { background: none; border: none; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline dotted; text-decoration-color: var(--link-underline); overflow-wrap: anywhere; text-align: left; }
.ci { width: 17px; height: 17px; flex-shrink: 0; }
.ci-cur { fill: currentColor; }
.ci-gh { fill: #17140f; }
html[data-theme="dark"] .ci-gh { fill: #f2ede2; }
a.contact-line { text-decoration: underline; text-decoration-color: var(--link-underline); }
button.contact-line {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  text-decoration: underline dotted;
  text-decoration-color: var(--link-underline);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.about-body p.lede {
  font-size: 18px;
  line-height: 1.65;
  font-weight: 500;
  max-width: 640px;
  margin-top: 0;
}

.timeline { display: flex; flex-direction: column; gap: 26px; margin-top: 10px; }
.timeline-item { display: grid; grid-template-columns: 170px 1fr; column-gap: 24px; padding-top: 14px; border-top: 1px solid var(--border); }
.timeline-item .when { grid-row: 1 / span 2; margin: 3px 0 0; }
.timeline-item h5, .timeline-item p:not(.when) { grid-column: 2; }
.timeline-item .when { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-soft); }
.timeline-item h5 { font-family: 'Archivo Black', sans-serif; font-size: 17px; margin: 4px 0 6px; }
.timeline-item p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-soft); font-weight: 500; }

footer {
  padding: 40px 64px 60px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Project detail page ---------- */
.detail-section { padding-top: 56px; }

.back-link {
  display: inline-block;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--text-soft);
  margin-bottom: 26px;
}
.back-link:hover { color: var(--text); }

.detail-cover .card-thumb { aspect-ratio: 16 / 9; height: auto; max-height: 70vh; box-shadow: none; }

.detail-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 56px;
  margin-top: 10px;
}

.detail-main p { font-size: 16px; line-height: 1.7; color: var(--text-soft); font-weight: 500; }
.detail-main h4 { font-family: 'Archivo Black', sans-serif; font-size: 15px; text-transform: uppercase; letter-spacing: 0.05em; margin: 30px 0 10px; }
.detail-role p { margin-top: 0; }
.role-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.role-list li { position: relative; padding-left: 24px; font-size: 16px; line-height: 1.5; color: var(--text-soft); font-weight: 500; }
.role-list li::before { content: ''; position: absolute; left: 2px; top: 0.55em; width: 8px; height: 8px; background: var(--accent); }

.plain-list, .credits-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plain-list li { font-size: 14px; color: var(--text-soft); font-weight: 500; }
.credits-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.credit-role { color: var(--text-soft); font-weight: 500; }

.detail-side { display: flex; flex-direction: column; gap: 24px; }
.detail-meta { display: flex; flex-direction: column; gap: 14px; background: var(--card); border: 2px solid var(--border); border-radius: 16px; padding: 18px 20px; }
.detail-meta > div { display: flex; flex-direction: column; gap: 2px; }
.meta-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--card-text); opacity: 0.7; }
.meta-value { font-size: 14px; font-weight: 700; color: var(--card-text); }
.detail-external .pill { width: 100%; justify-content: center; }

/* ---------- Proyecto destacado ---------- */
#featured-game { margin-bottom: 48px; }
.featured {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  border: 2px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 8px 0 var(--shadow);
}
.featured-media {
  position: relative;
  display: block;
  min-height: 380px;
  overflow: hidden;
  border-right: 2px solid var(--border);
}
.featured-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.featured-media:hover .featured-art { transform: scale(1.04); }
.featured-logo {
  position: absolute;
  left: 24px;
  bottom: 18px;
  width: min(46%, 300px);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}
.featured-body {
  padding: 34px 34px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--card-text);
}
.featured-label {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.75;
}
.featured-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1;
  margin: 0;
}
.featured-summary { margin: 0; font-size: 15.5px; line-height: 1.6; font-weight: 500; }
.featured-highlights {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
}
.featured-highlights li { position: relative; padding-left: 18px; }
.featured-highlights li::before { content: ''; position: absolute; left: 0; top: 0.5em; width: 7px; height: 7px; background: currentColor; }
.featured .tag { border-color: var(--card-text); }
.featured-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; padding-top: 8px; }

/* ---------- Ficha de Tourist Trap: estrellas, personajes y carta (assets de la web de YaloséGames) ---------- */
.detail-stars { display: flex; gap: 6px; margin: -4px 0 14px; }
.detail-stars img { width: 34px; height: 34px; object-fit: contain; }
.cast-grid, .menu-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cast-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 200px)); }
.menu-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 700px) { .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cast-grid li, .menu-grid li {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px;
  background: var(--card); color: var(--card-text); border: 2px solid var(--border); border-radius: 14px; padding: 10px 8px 8px; text-align: center;
}
.cast-grid img { width: 100%; height: 190px; object-fit: contain; }
.menu-grid img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.cast-grid span, .menu-grid span { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.2; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .cast-grid li, .menu-grid li { transition: transform 0.15s ease; }
  .cast-grid li:nth-child(odd):hover, .menu-grid li:nth-child(odd):hover { transform: rotate(-2deg) translateY(-3px); }
  .cast-grid li:nth-child(even):hover, .menu-grid li:nth-child(even):hover { transform: rotate(2deg) translateY(-3px); }
}

/* ---------- Galería ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.gallery-thumb {
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: var(--card);
  aspect-ratio: 4 / 3;
  transition: transform 0.15s ease;
}
.gallery-thumb:hover { transform: translateY(-3px); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb.is-video { position: relative; }
.gallery-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(23, 20, 15, 0.75);
  color: #f2ede2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding-left: 3px;
}

.detail-cover .detail-video { background: #000; height: auto; aspect-ratio: 16 / 10; max-height: 78vh; }
.detail-video video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.detail-external { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 6, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.lightbox-open { opacity: 1; pointer-events: auto; }
.lightbox-img, .lightbox-video {
  max-width: min(90vw, 1100px);
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-video { width: min(90vw, 1100px); background: #000; }
.lightbox-img[hidden], .lightbox-video[hidden] { display: none; }
.lightbox-single .lightbox-nav { display: none; }
.lightbox-close, .lightbox-nav {
  position: absolute;
  background: none;
  border: none;
  color: #f2ede2;
  font-size: 28px;
  cursor: pointer;
  padding: 10px 16px;
  line-height: 1;
}
.lightbox-close { top: 18px; right: 24px; font-size: 22px; }
.lightbox-prev { left: 12px; top: 50%; transform: translateY(-50%); font-size: 48px; }
.lightbox-next { right: 12px; top: 50%; transform: translateY(-50%); font-size: 48px; }
.lightbox-close:hover, .lightbox-nav:hover { color: #ec6ea0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 14px 24px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 999;
  white-space: nowrap;
}
.toast-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: center;
    padding: 10px 0;
    gap: 10px;
    background: var(--bg);
  }
  .sidebar-top, .sidebar-bottom { flex-direction: row; margin: 0; gap: 10px; }
  .sidebar-contact { display: none; }
  .nav-icon { min-width: 48px; }
  .main { margin-left: 0; width: 100%; padding-bottom: 100px; }
  section { padding: 60px 26px; }
  .about-wrap { grid-template-columns: 1fr; }
  .about-photo { width: 140px; height: 140px; font-size: 40px; }
  .icon-box { width: 40px; height: 40px; }
  .icon-box svg { width: 19px; height: 19px; }
  .nav-label { font-size: 9px; }
  .detail-body { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .featured { grid-template-columns: 1fr; }
  .featured-media { min-height: 0; aspect-ratio: 16 / 9; border-right: none; border-bottom: 2px solid var(--border); }
  .featured-body { padding: 26px 24px 24px; }
}


/* =====================================================================
   Rediseño: lenguaje de póster (bloques de color, trama de puntos, texto partido)
   ===================================================================== */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:root {
  --pa-bg: #17140f; --pa-fg: #ec6ea0;
  --pc-bg: #f2ede2; --pc-fg: #17140f;
  --pd-bg: #a4be5c; --pd-fg: #17140f;
  --pe-bg: #17140f; --pe-fg: #f2ede2; --pe-accent: #ec6ea0;
  --pf-bg: #f2ede2; --pf-fg: #17140f;
  --dot: #17140f;
}
html[data-theme="dark"] {
  --pa-bg: #ec6ea0; --pa-fg: #17140f;
  --pc-bg: #a4be5c; --pc-fg: #17140f;
  --pd-bg: #f2ede2; --pd-fg: #17140f;
  --pe-bg: #1d1b17; --pe-fg: #f2ede2; --pe-accent: #ec6ea0;
  --pf-bg: #ec6ea0; --pf-fg: #17140f;
  --dot: #ec6ea0;
}

/* Portada: solo nombre, rol y botones a cada sección. Sin bloques ni trama grande:
   la misma paleta tranquila que el resto de la web, para no sobreestimular */
.hero.hero-simple { min-height: 100vh; padding: 90px 64px; justify-content: center; gap: 22px; }
.hero-name {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(64px, 11vw, 176px);
  line-height: 0.86;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.hero-dots {
  display: block;
  width: min(320px, 60%);
  height: 18px;
  background-image: radial-gradient(var(--accent) 30%, transparent 32%);
  background-size: 18px 18px;
  background-repeat: space;
}
.hero-simple h2.role { font-size: clamp(18px, 2vw, 28px); line-height: 1.15; margin: 0; color: var(--text-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }

/* Títulos de sección: sin números, con franja de trama */
/* La franja mide lo mismo que las mayúsculas del título y se apoya en su línea base */
.section-head { align-items: baseline; }
.head-dots {
  flex: 1;
  align-self: baseline;
  font-size: clamp(30px, 5vw, 52px);
  height: 0.72em;
  background-image: radial-gradient(var(--text) 30%, transparent 32%);
  background-size: 0.24em 0.24em;
  background-position: 0 100%;
  opacity: 0.55;
}
#juegos .section-head, #sobre-mi .section-head { padding-right: 130px; }
#otros-proyectos .section-head { padding-right: 190px; }
.detail-section .section-head .head-dots { display: none; }

/* Etiquetas y chips: texto con barras en vez de píldoras */
.tag, .about-side li { border: none; border-radius: 0; padding: 0; }
.card-tags, .about-side ul { gap: 6px 8px; }
.tag:not(:last-child)::after, .about-side li:not(:last-child)::after { content: '/'; margin-left: 8px; opacity: 0.45; }
.about-side li { font-size: 13px; }

/* Botones: rectángulos redondeados, como las teclas de la barra */
.pill { border-radius: 12px; }

@media (max-width: 860px) {
  .hero.hero-simple { padding: 60px 20px; min-height: 80vh; }
  #juegos .section-head, #sobre-mi .section-head, #otros-proyectos .section-head { padding-right: 0; }
  .timeline-item { grid-template-columns: 1fr; }
  .timeline-item .when { grid-row: auto; }
  .timeline-item h5, .timeline-item p:not(.when) { grid-column: 1; }
}


/* =====================================================================
   Tarjetas en modo póster: bloques de color planos, pegatina y sombra de trama
   ===================================================================== */
:root {
  --c0-bg: #17140f; --c0-fg: #f2ede2; --c0-soft: rgba(242, 237, 226, 0.75);
  --c1-bg: #a4be5c; --c1-fg: #17140f; --c1-soft: rgba(23, 20, 15, 0.75);
  --c2-bg: #f2ede2; --c2-fg: #17140f; --c2-soft: rgba(23, 20, 15, 0.72);
  --sticker-bg: #17140f; --sticker-fg: #f2ede2;
}
html[data-theme="dark"] {
  --c0-bg: #ec6ea0; --c0-fg: #17140f; --c0-soft: rgba(23, 20, 15, 0.75);
  --sticker-bg: #17140f; --sticker-fg: #ec6ea0;
}

.grid { gap: 30px; }
.card { position: relative; display: block; color: inherit; }
.card-c0 { --cb: var(--c0-bg); --cf: var(--c0-fg); --cs: var(--c0-soft); }
.card-c1 { --cb: var(--c1-bg); --cf: var(--c1-fg); --cs: var(--c1-soft); }
.card-c2 { --cb: var(--c2-bg); --cf: var(--c2-fg); --cs: var(--c2-soft); }

/* Sombra de trama que asoma al levantar la tarjeta */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  /* Los puntos se anclan a la esquina inferior derecha y la celda mide lo mismo que el desplazamiento de la tarjeta (8px):
     la franja visible lleva siempre una fila de puntos enteros, sea cual sea el tamaño de la tarjeta */
  background-image: radial-gradient(circle, var(--text) 2.2px, transparent 2.8px);
  background-size: 8px 8px;
  background-position: 100% 100%;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.card-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--cb);
  color: var(--cf);
  transition: transform 0.25s var(--spring);
}
.card:hover::after, .card:focus-visible::after { opacity: 0.6; }
.card:hover .card-inner, .card:focus-visible .card-inner { transform: translate(-8px, -8px); }
.card:hover .card-thumb, .card:hover .card-thumb img { transform: none; }
.card:hover .card-thumb img { transform: scale(1.05); }

.card .card-thumb { border: none; border-radius: 0; box-shadow: none; }
.card-body { position: relative; padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card .card-title { color: var(--cf); font-size: 22px; line-height: 1; text-transform: uppercase; letter-spacing: -0.01em; padding-right: 30px; }
.card .card-desc { color: var(--cs); }
.card .card-tags { margin-top: auto; color: var(--cf); }
.card-go { position: absolute; top: 14px; right: 18px; font-family: 'Archivo Black', sans-serif; font-size: 22px; line-height: 1; transition: transform 0.25s var(--spring); }
.card:hover .card-go { transform: translateX(4px); }

/* Pegatina en vez de etiqueta-píldora */
.badge {
  border-radius: 0;
  background: var(--sticker-bg);
  color: var(--sticker-fg);
  top: 14px;
  left: 14px;
  padding: 6px 10px;
  transform: rotate(-3deg);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.25);
}

/* Destacado: dos bloques planos */
.featured { border: none; border-radius: 0; box-shadow: none; }
.featured-media { border-right: none; }
.featured-label {
  align-self: flex-start;
  background: var(--sticker-bg);
  color: var(--sticker-fg);
  opacity: 1;
  padding: 5px 10px;
  transform: rotate(-2deg);
}
.featured-title { text-transform: uppercase; font-size: clamp(34px, 4vw, 56px); letter-spacing: -0.01em; }

/* Tarjeta de GitHub: bloque de trama con etiqueta */
.other-card.filled {
  border: none;
  border-radius: 0;
  background: var(--c1-bg);
  color: var(--c1-fg);
  position: relative;
  transition: transform 0.25s var(--spring);
}
.other-card.filled:hover { transform: translate(-6px, -6px); box-shadow: 6px 6px 0 var(--text); }

@media (max-width: 1100px) {
  .featured-media { border-bottom: none; }
}

/* Ajuste óptico de las fuentes de título: unas son más estrechas o anchas que otras */
.card-title[style*="Bangers"], .featured-title[style*="Bangers"] { font-size: 30px; letter-spacing: 0.02em; }
.section-title[style*="Bangers"] { font-size: clamp(40px, 6.5vw, 68px); letter-spacing: 0.02em; }
.card-title[style*="Press Start"] { font-size: 17px; line-height: 1.35; }
.section-title[style*="Press Start"] { font-size: clamp(22px, 3.6vw, 40px); line-height: 1.3; }




/* Franja de contacto al final: bloque de póster con el correo en grande */
section.contact-band, .contact-page .contact-band {
  margin: 20px 64px 0;
  padding: clamp(28px, 4vw, 56px);
  background: var(--pa-bg);
  color: var(--pa-fg);
  position: relative;
  z-index: 1;
}
.cb-label { margin: 0 0 8px; font-family: 'Archivo Black', sans-serif; font-size: clamp(16px, 1.6vw, 22px); text-transform: uppercase; letter-spacing: 0.08em; }
.cb-email {
  display: block;
  max-width: 100%;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(20px, 3.9vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.14em;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.2s ease;
}
.cb-email:hover, .cb-email:focus-visible { text-decoration-color: currentColor; }
.cb-hint { margin: 12px 0 0; font-size: 13px; font-weight: 700; opacity: 0.75; }
@media (max-width: 860px) {
  section.contact-band { margin: 10px 26px 0; }
}


/* «Ahora mismo»: pegatina + una línea, se edita en i18n.js → hero.now */
.now { margin: 0 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; font-weight: 600; color: var(--pe-fg); }
.now-label {
  font-family: 'Archivo Black', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--pe-accent);
  color: #17140f;
  padding: 4px 9px;
  transform: rotate(-2deg);
}


/* «Portfolio 2026» es el botón de reimprimir el póster */
.now-label { color: var(--pe-bg); }

/* La oveja del pie: se puede pulsar */
.footer-sheep { cursor: pointer; }
.bleat {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%) scale(0.6);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  font-family: 'Archivo Black', sans-serif;
  font-size: 18px;
  color: #17140f;
  background: #f2ede2;
  border: 3px solid #17140f;
  padding: 8px 14px;
  box-shadow: 4px 4px 0 var(--dot);
  transition: opacity 0.2s ease, transform 0.25s var(--spring);
  z-index: 5;
}
.bleat::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  margin-left: -8px;
  border: 8px solid transparent;
  border-top-color: #17140f;
}
.is-bleating .bleat { opacity: 1; transform: translateX(-50%) scale(1); }
@media (prefers-reduced-motion: no-preference) {
  .footer-sheep.is-bleating svg { animation: sheep-jump 0.6s var(--spring); }
}
@keyframes sheep-jump { 0% { transform: none; } 35% { transform: translateY(-22px) rotate(-6deg); } 70% { transform: translateY(0) scale(1.06, 0.94); } 100% { transform: none; } }



/* «Ahora mismo» enlaza a la ficha */
.now-link { color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--pe-accent); font-weight: 700; }
.now-link:hover { color: var(--pe-accent); }
/* Sobre mí en dos párrafos */
.about-body p.lede-2 { margin-top: -6px; }
/* Pegatinas de dos líneas (ej. Figurines Please) */
.badge { line-height: 1.35; }

/* La etiqueta del póster se encaja por JS en la trama: su texto va centrado en la caja */

/* El h1 oculto (accesibilidad) no debe ocupar sitio: lo pisaba .hero > * { position: relative } */
.hero > .visually-hidden { position: absolute; margin: 0; }


/* =====================================================================
   Cuadrícula fija por tamaño de pantalla (antes auto-fill dejaba huecos en monitores anchos)
   ===================================================================== */
#games-grid, #other-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row dense; }
#games-grid .card, #other-grid .card { height: 100%; }
.card.span-2 { grid-column: span 2; }
/* La tarjeta ancha mantiene la misma altura de imagen que las de una columna */
.card.span-2 .card-thumb { aspect-ratio: 2.62 / 1; }

/* En monitores muy anchos el contenido no pasa de un ancho cómodo */
#juegos, #otros-proyectos, #sobre-mi { max-width: 1640px; margin-left: auto; margin-right: auto; }
section.contact-band { max-width: 1512px; margin-left: auto; margin-right: auto; }
footer { max-width: 1640px; margin-left: auto; margin-right: auto; }

@media (max-width: 1100px) {
  #games-grid, #other-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  #games-grid, #other-grid { grid-template-columns: 1fr; }
  .card.span-2 { grid-column: auto; }
  .card.span-2 .card-thumb { aspect-ratio: 4 / 3.2; }
}
@media (max-width: 860px) {
  section.contact-band { margin-left: 26px; margin-right: 26px; }
}

/* Tarjeta de GitHub */
:root { --gh-bg: #cf4e86; --gh-fg: #f2ede2; --gh-soft: rgba(242, 237, 226, 0.82); --gh-dots: #f2ede2; }
html[data-theme="dark"] { --gh-bg: #1d1b17; --gh-fg: #f2ede2; --gh-soft: rgba(242, 237, 226, 0.72); --gh-dots: #ec6ea0; }
.card-gh { --cb: var(--gh-bg); --cf: var(--gh-fg); --cs: var(--gh-soft); }
.gh-art {
  position: relative;
  flex: 1 1 auto;
  min-height: 200px;
  background-image: radial-gradient(var(--gh-dots) 30%, transparent 32%);
  background-size: 20px 20px;
  background-repeat: space;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gh-tile { width: clamp(90px, 9vw, 130px); aspect-ratio: 1; transform: rotate(-5deg); filter: drop-shadow(7px 7px 0 #17140f); transition: transform 0.3s var(--spring); }
.gh-tile svg { width: 100%; height: 100%; display: block; }
.card-gh:hover .gh-tile { transform: rotate(0deg) scale(1.05); }
.gh-handle {
  position: absolute;
  right: 22px;
  bottom: 20px;
  font-family: 'Archivo Black', sans-serif;
  font-size: 14px;
  background: #f2ede2;
  color: #17140f;
  border: 3px solid #17140f;
  padding: 6px 12px;
  transform: rotate(3deg);
  box-shadow: 4px 4px 0 #17140f;
}

/* Pantallas grandes (2K/4K): el bloque de texto del póster crece con la pantalla */
.hero-links a, .hero-links button { font-size: clamp(14px, 0.95vw, 27px); }
.now { font-size: clamp(14px, 0.9vw, 25px); }
.now-label { font-size: clamp(11px, 0.7vw, 20px); }
.scroll-label { font-size: clamp(13px, 0.8vw, 24px); }

/* En móvil la etiqueta «Portfolio 2026» no cabe en la franja de puntos: fuera */


/* Con el pistacho claro, lo que va encima de verde o de rosa va en negro */
html[data-theme="dark"] .nav-icon.is-active .icon-box svg { stroke: #17140f; }
html[data-theme="dark"] .pill-accent { color: #17140f; }

/* Botón del CV más discreto */


/* =====================================================================
   Formulario de contacto (franja «¿Hablamos?»)
   ===================================================================== */
.cb-form {
  margin-top: clamp(22px, 2.6vw, 36px);
  display: flex; flex-direction: column; gap: 14px;
  max-width: 900px;
}
.cb-form-title { margin: 0; font-family: 'Archivo Black', sans-serif; font-size: clamp(16px, 1.5vw, 26px); text-transform: uppercase; letter-spacing: 0.04em; }
.cb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cb-field { display: flex; flex-direction: column; gap: 6px; }
.cb-field span { font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.cb-field input, .cb-field select, .cb-field textarea {
  font: inherit; font-size: 15px; font-weight: 500;
  color: #17140f; background: #f2ede2;
  border: 2px solid #17140f; border-radius: 0;
  padding: 10px 12px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.25);
  color-scheme: light;
}
.cb-field textarea { resize: vertical; min-height: 120px; }
.cb-field input:focus, .cb-field select:focus, .cb-field textarea:focus { outline: 3px solid #17140f; outline-offset: 2px; }
.cb-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cb-send {
  font-family: 'Archivo Black', sans-serif; font-size: clamp(13px, 1vw, 18px); text-transform: uppercase;
  color: var(--pa-bg); background: var(--pa-fg); border: 2px solid var(--pa-fg);
  padding: 0.9em 1.4em; cursor: pointer;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cb-send:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.3); }
.cb-note { margin: 0; font-size: 13px; font-weight: 600; opacity: 0.8; }
.cb-honey { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 640px) { .cb-row { grid-template-columns: 1fr; } }


/* Botón bajo la franja «¿Hablamos?» */
.cb-more-wrap { max-width: 1512px; margin: 18px auto 0; padding: 0 64px; display: flex; justify-content: flex-end; }
.cb-more {
  font-family: 'Archivo Black', sans-serif; font-size: clamp(14px, 1.1vw, 20px); text-transform: uppercase;
  text-decoration: none; color: var(--text);
  border: 2px solid var(--text); padding: 0.8em 1.2em;
  box-shadow: 5px 5px 0 var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cb-more:hover, .cb-more:focus-visible { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--text); }

/* Página de contacto */
.contact-page { padding-top: 56px; }
.contact-page .contact-band { margin: 0; max-width: 1100px; }
.cb-page-title { margin: 0 0 6px; font-family: 'Archivo Black', sans-serif; font-size: clamp(36px, 5vw, 80px); line-height: 1; }
@media (max-width: 860px) {
  .cb-more-wrap { padding: 0 26px; justify-content: stretch; }
  .cb-more { flex: 1; text-align: center; }
}

/* Campos mal rellenados (al salir del campo o al intentar enviar) */
.cb-field input:user-invalid, .cb-field select:user-invalid, .cb-field textarea:user-invalid { border-color: #c4122f; box-shadow: 4px 4px 0 #c4122f; }
.cb-error { margin: 0; font-weight: 800; font-size: 14px; color: #17140f; background: #f2ede2; border: 2px solid #c4122f; padding: 8px 12px; align-self: flex-start; }

/* Vuelta desde un proyecto: su tarjeta se queda marcada unos segundos */
.card.is-selected, .featured.is-selected { outline: 4px solid var(--accent); outline-offset: 8px; }

/* Portada: un poco de dither de fondo (fondo-dither.js), detrás del nombre, el rol y los botones */
.hero.hero-simple { position: relative; overflow: hidden; }
.hero-simple > .hero-dither { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }

/* Ficha de Offline Working Sheep: la oveja en 3D con paleta + dither (oveja-dither.js). La luz sigue al ratón */
.oveja-dither { display: block; width: 100%; aspect-ratio: 1; margin-top: 12px; }

/* Portada: una pantalla con los «minigifs» de Tourist Trap (vídeos mudos, assets/video/portada; app.js los encadena).
   En ancho, dos columnas: texto a la izquierda, pantalla a la derecha. En estrecho, la pantalla va debajo de los botones.
   Familia B de DISEÑO.md §4: borde tinta y sombra dura desplazada. Sin giro: girar el vídeo lo emborrona */
.hero.hero-simple { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(32px, 4vw, 72px); row-gap: 22px; align-content: center; }
.hero-simple > :not(.hero-screen):not(.hero-dither) { grid-column: 1; }
.hero-simple .hero-name { font-size: clamp(64px, 8vw, 150px); }
.hero-simple h2.role { max-width: 15em; }
.hero.hero-simple > .hero-screen { grid-column: 2; grid-row: 1 / span 4; align-self: center; justify-self: end; width: 100%; max-width: 820px; margin: 0; }
.hero-clip { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--card); border: 3px solid var(--border); box-shadow: 10px 10px 0 var(--dot); }
@media (max-width: 1180px) {
  .hero.hero-simple { grid-template-columns: minmax(0, 1fr); }
  .hero.hero-simple > .hero-screen { grid-column: 1; grid-row: auto; justify-self: start; max-width: 560px; margin-top: 18px; }
  .hero-clip { box-shadow: 7px 7px 0 var(--dot); }
}

/* Barra lateral en pantallas bajas (portátiles con la barra del navegador): teclas y huecos más justos para que quepa todo */
@media (min-width: 861px) and (max-height: 860px) {
  .sidebar { padding: 12px 0; gap: 8px; }
  .sidebar-top, .sidebar-bottom { gap: 8px; }
  .sidebar-contact { gap: 4px; margin-bottom: 4px; }
  .icon-box { width: 44px; height: 44px; }
  .icon-box svg { width: 20px; height: 20px; }
  .icon-box.icon-sm { width: 34px; height: 34px; }
  .icon-box.icon-sm svg { width: 16px; height: 16px; }
  .nav-label { font-size: 9px; }
}
