/* Kamidraw
   Papel de animación: boceto en lápiz azul, línea final en tinta.
   Un acento (azul lápiz), esquinas rectas, tema claro y oscuro.
   Reglas de taste-skill: una sección por pantalla en escritorio, entrada del hero al cargar,
   nada aparece con el scroll, hover que levanta 2px y acerca la foto. */

:root {
  color-scheme: light dark;

  --paper: oklch(0.975 0.004 255);
  --paper-2: oklch(0.955 0.005 255);
  --ink: oklch(0.22 0.014 262);
  --ink-soft: oklch(0.43 0.014 262);
  --line: oklch(0.88 0.007 255);
  --line-strong: oklch(0.76 0.009 255);
  --accent: oklch(0.52 0.17 258);
  --dot: oklch(0.86 0.008 255);
  --hole: oklch(0.915 0.006 255);
  --danger: oklch(0.53 0.19 27);

  --font-sans: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-kanji: "Yuji Boku", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;

  --pad-x: clamp(1.25rem, 5vw, 5rem);
  --footer-h: 9.5rem;
  --maxw: 90rem;
  --nav-h: 4.5rem;
  --sec-pad: clamp(3.5rem, 8vh, 5.5rem);
  --gap: clamp(1rem, 1.8vw, 1.5rem);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  /* Capas */
  --z-content: 1;
  --z-nav: 10;
  --z-skip: 20;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: oklch(0.19 0.012 262);
    --paper-2: oklch(0.215 0.012 262);
    --ink: oklch(0.94 0.006 255);
    --ink-soft: oklch(0.75 0.01 255);
    --line: oklch(0.31 0.012 262);
    --line-strong: oklch(0.44 0.012 262);
    --accent: oklch(0.74 0.12 255);
    --dot: oklch(0.3 0.012 262);
    --hole: oklch(0.15 0.01 262);
    --danger: oklch(0.74 0.14 27);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
img, video { max-width: 100%; height: auto; display: block; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

::selection { background: var(--accent); color: var(--paper); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--pad-x);
  top: -10rem;
  z-index: var(--z-skip);
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--paper);
}
.skip:focus { top: 1rem; }

/* Escala de títulos: una por nivel */
h1 {
  font-size: clamp(2.75rem, 1.2rem + 3.2vw, 4.25rem);
  font-weight: 700;
  font-stretch: 88%;
  line-height: 1.04;
  letter-spacing: -0.035em;
}
h2 {
  font-size: clamp(2rem, 1.4rem + 2vw, 3rem);
  font-weight: 700;
  font-stretch: 90%;
  line-height: 1.08;
  letter-spacing: -0.03em;
}
h3 {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
h4 {
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* Botones: un par, un tamaño, esquinas rectas */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.25rem;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  font: 600 1rem/1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 160ms var(--ease-out),
    border-color 160ms var(--ease-out),
    color 160ms var(--ease-out),
    opacity 160ms var(--ease-out),
    transform 120ms var(--ease-out);
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }
.btn[aria-busy="true"] { opacity: 1; cursor: progress; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-ghost { background: var(--paper); color: var(--ink); }

@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { transform: translateY(-1px); }
  .btn-primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); }
  .btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
}

.tag {
  justify-self: end;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.2;
  color: var(--ink-soft);
  white-space: nowrap;
}
.tag-ai { border-color: currentColor; color: var(--accent); }

/* Navegación */
.nav {
  position: absolute;
  inset: 0 0 auto;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  height: var(--nav-h);
  margin-inline: auto;
  padding: 0 var(--pad-x);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  text-decoration: none;
}
.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  font-stretch: 90%;
  letter-spacing: -0.02em;
}
.seal {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-kanji);
  font-size: 1.15rem;
  line-height: 1;
}
.nav ul { display: flex; gap: clamp(0.5rem, 2vw, 1.5rem); }
.nav li a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.25rem;
  font-size: 0.975rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-soft);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 calc(100% - 0.6rem);
  background-repeat: no-repeat;
  transition: color 160ms var(--ease-out), background-size 220ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .nav li a:hover { color: var(--ink); background-size: 100% 1px; }
}
@media (max-width: 560px) {
  .nav-hide-sm { display: none; }
}

/* Secciones: un contenedor, los mismos bordes en todas */
.hero,
.disc,
.kami,
.services,
.contact {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: var(--sec-pad) var(--pad-x);
}
.disc,
.kami,
.services,
.contact { border-top: 1px solid var(--line); }

.disc-head p,
.kami-copy p:not(.meaning),
.contact-copy > p {
  max-width: 46ch;
  margin-top: 0.875rem;
  font-size: 1.125rem;
  color: var(--ink-soft);
}

/* Hero: el trabajo manda */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5.5fr) minmax(0, 6.5fr);
  align-items: center;
  gap: clamp(2rem, 4vw, 4rem);
  padding-top: calc(var(--nav-h) + 1rem);
  padding-bottom: 2rem;
}
.hero h1 span { display: block; }
.lede {
  max-width: 34ch;
  margin-top: 1.5rem;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  color: var(--ink-soft);
}
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.hero-art {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--hole);
}
.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
  transition: transform 500ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .hero-art:hover img { transform: scale(1.02); }
}

/* Entrada del hero, una vez al cargar */
@keyframes rise { from { opacity: 0; transform: translateY(0.875rem); } }
@keyframes settle { from { opacity: 0; transform: scale(1.04); } }
.js [data-enter] .hero-copy > * { animation: rise 700ms var(--ease-out) both; }
.js [data-enter] .hero-copy > :nth-child(2) { animation-delay: 90ms; }
.js [data-enter] .hero-copy > :nth-child(3) { animation-delay: 180ms; }
.js [data-enter] .hero-art img { animation: settle 1200ms var(--ease-out) both; }

/* Trabajo por disciplina */
.disc { display: flex; flex-direction: column; }
.work-grid {
  display: grid;
  gap: calc(var(--gap) * 1.5) var(--gap);
  margin-top: clamp(1.75rem, 4vh, 2.75rem);
}
.tile { display: flex; min-width: 0; min-height: 0; }
.tile-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 200ms var(--ease-out);
}
.tile-media {
  position: relative;
  flex: 1 1 auto;
  min-height: 10rem;
  overflow: hidden;
  background: var(--hole);
}
.tile-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms var(--ease-out);
}
.tile-cap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.875rem;
}
.tile-cap h3 { transition: color 160ms var(--ease-out); }
.tile-meta {
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.tile .tag { flex-shrink: 0; }
.tile-link:active { transform: translateY(0); }
.tile-link:focus-visible { outline-offset: 6px; }
@media (hover: hover) and (pointer: fine) {
  .tile-link:hover { transform: translateY(-2px); }
  .tile-link:hover .tile-media img { transform: scale(1.03); }
  .tile-link:hover h3 { color: var(--accent); }
}

/* Composiciones (pantalla de escritorio apaisada) */
.layout-feature { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-rows: 1fr 1fr; }
.layout-feature .tile:first-child,
.layout-feature .tile:nth-child(2):last-child { grid-row: 1 / span 2; }
.layout-feature.layout-flipped { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.layout-feature.layout-flipped .tile:first-child { grid-column: 2; }
.layout-feature.layout-flipped .tile:not(:first-child) { grid-column: 1; }
.layout-row { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }

/* Una sección por pantalla en escritorio apaisado */
@media (min-width: 1024px) and (orientation: landscape) {
  .hero { min-height: 100svh; }
  .hero-art { height: calc(100svh - var(--nav-h) - 3rem); min-height: 28rem; }
  .disc { min-height: 100svh; }
  .work-grid { flex: 1; min-height: 26rem; }
  .kami, .services, .contact { min-height: 100svh; }
  .services-art img { max-height: calc(100svh - 20rem); object-fit: contain; }
}

/* Tableta, vertical y móvil: la rejilla fluye */
@media not ((min-width: 1024px) and (orientation: landscape)) {
  .hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100svh;
    padding-top: calc(var(--nav-h) + 1.5rem);
  }
  .hero-art { flex: 1 1 auto; min-height: 15rem; }
  .hero-art img { position: absolute; inset: 0; }
  .work-grid,
  .layout-feature,
  .layout-feature.layout-flipped,
  .layout-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-flow: row;
  }
  .layout-feature .tile:first-child,
  .layout-feature.layout-flipped .tile:first-child,
  .layout-feature.layout-flipped .tile:not(:first-child) { grid-column: auto; grid-row: auto; }
  .layout-feature .tile:first-child { grid-column: 1 / -1; }
  .tile-media { flex: none; aspect-ratio: 4 / 3; }
  .layout-row .tile-media { aspect-ratio: 3 / 4; }
  .layout-feature .tile:first-child .tile-media { aspect-ratio: 16 / 9; }
}
@media (max-width: 640px) {
  .work-grid,
  .layout-feature,
  .layout-feature.layout-flipped,
  .layout-row { grid-template-columns: minmax(0, 1fr); }
  .layout-row .tile-media { aspect-ratio: 4 / 5; }
  .layout-feature .tile:first-child .tile-media { aspect-ratio: 4 / 3; }
}

/* Kami: papel o espíritu, y la hoja para dibujar */
.kami {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}
.glyph {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 1.3em;
  height: 1.3em;
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--font-kanji);
  font-size: clamp(4.5rem, 7vw, 6.5rem);
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.glyph > span:not(.visually-hidden) {
  grid-area: 1 / 1;
  transition:
    opacity 140ms var(--ease-out),
    transform 220ms var(--ease-out),
    filter 140ms var(--ease-out);
}
.glyph-sketch {
  color: var(--accent);
  opacity: 0.34;
  transform: translate(-0.05em, 0.04em);
}
.glyph.ink-out .glyph-ink { opacity: 0; transform: scale(0.96); filter: blur(4px); }
.glyph.sketch-out .glyph-sketch { opacity: 0; transform: translate(-0.05em, 0.04em) scale(0.96); }
.glyph:active .glyph-ink { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .glyph:hover .glyph-sketch { opacity: 0.5; }
}
.meaning {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--accent);
}
.meaning-kanji { font-family: var(--font-kanji); font-size: 1.375rem; }
.kami-copy em { font-style: italic; color: var(--ink); }

.sheet-block { min-width: 0; }
.sheet-wrap {
  position: relative;
  height: clamp(20rem, calc(100svh - 15rem), 44rem);
  border: 1px solid var(--line-strong);
  background-color: var(--paper-2);
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.3px);
  background-size: 1.5rem 1.5rem;
  background-position: center;
}
.sheet {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}
/* Agujeros de registro, como el papel de animación */
.pegs {
  position: absolute;
  left: 50%;
  bottom: 0.875rem;
  display: flex;
  align-items: center;
  gap: 2.25rem;
  transform: translateX(-50%);
  pointer-events: none;
}
.pegs i {
  display: block;
  width: 2.25rem;
  height: 0.6rem;
  border-radius: 0.3rem;
  background: var(--hole);
  box-shadow: inset 0 1px 1px oklch(0.2 0.02 262 / 0.12);
}
.pegs i:nth-child(2) { width: 0.75rem; height: 0.75rem; border-radius: 50%; }

.tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.875rem;
}
.tool-buttons { display: flex; gap: 0.5rem; }
#ink { min-width: 9.5rem; }
.hint {
  max-width: 30ch;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

@media not ((min-width: 1024px) and (orientation: landscape)) {
  .kami { grid-template-columns: minmax(0, 1fr); }
  .sheet-wrap { height: 56svh; min-height: 18rem; }
}
@media (max-width: 560px) {
  .tools { flex-direction: column; align-items: stretch; }
  .tool-buttons { flex-wrap: wrap; }
  .tool-buttons .btn { flex: 1 1 auto; }
}

/* Comisiones */
.services-body {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: start;
  gap: clamp(2rem, 4vw, 4rem);
  margin-top: clamp(2rem, 5vh, 3rem);
}
.service-list { border-bottom: 1px solid var(--line); }
.service {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  padding: clamp(1.25rem, 3vh, 1.75rem) 0;
  border-top: 1px solid var(--line);
}
.service p { grid-column: 1; max-width: 48ch; color: var(--ink-soft); }
.service .tag { grid-column: 2; grid-row: 1; }
.services-art {
  border: 1px solid var(--line);
  background: oklch(0.975 0.004 255);
}
.services-art img { width: 100%; }

.steps-title { margin-top: clamp(2rem, 5vh, 3rem); }
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 1rem;
  counter-reset: step;
}
.steps li {
  padding-top: 1.25rem;
  border-top: 1.5px solid var(--ink);
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
}
.steps p { margin-top: 0.5rem; color: var(--ink-soft); }

@media (max-width: 1023px) {
  .services-body { grid-template-columns: minmax(0, 1fr); }
  .services-art { max-width: 36rem; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.25rem 2rem; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
}

/* Contacto: formulario que llega por Telegram */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: start;
  align-content: center;
  gap: clamp(2rem, 6vw, 6rem);
}
.contact-copy .steps-title { margin-top: clamp(1.75rem, 4vh, 2.5rem); }
.contact-copy .steps { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 0.75rem; }
.contact-copy .steps li {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  column-gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}
.contact-copy .steps li::before { grid-row: 1 / span 2; margin: 0.15rem 0 0; }
.contact-copy .steps p { margin-top: 0.125rem; font-size: 0.9375rem; }

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
}
.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: 0.9375rem; font-weight: 600; }
.field .optional { font-weight: 400; color: var(--ink-soft); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.4 var(--font-sans);
  transition: border-color 160ms var(--ease-out);
}
.field textarea { min-height: 8.5rem; resize: vertical; }
.field select {
  appearance: none;
  padding-right: 2.5rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 55%, calc(100% - 0.8rem) 55%;
  background-size: 0.35rem 0.35rem;
  background-repeat: no-repeat;
}
.field ::placeholder { color: var(--ink-soft); opacity: 1; }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .field input:hover,
  .field select:hover,
  .field textarea:hover { border-color: var(--ink-soft); }
}
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-help { font-size: 0.8125rem; color: var(--ink-soft); }
.field-error { font-size: 0.875rem; font-weight: 500; color: var(--danger); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.form-status { flex: 1 1 16rem; font-size: 0.9375rem; }
.form-status[data-kind="success"] { color: var(--accent); font-weight: 600; }
.form-status[data-kind="error"] { color: var(--danger); font-weight: 500; }
#f-submit { min-width: 11.5rem; }

.socials { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin-top: 1.25rem; }
.socials a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--ink-soft);
  text-decoration-color: var(--line-strong);
  transition: color 160ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .socials a:hover { color: var(--accent); }
}
@media (max-width: 1023px) {
  .contact { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .contact-form { grid-template-columns: minmax(0, 1fr); padding: 1rem; }
  #f-submit { width: 100%; }
}

/* Pie */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 1.5rem var(--pad-x) 2rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.footer a { display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  .footer a:hover { color: var(--ink); }
}
.footer .fan-note { flex: 1 0 100%; max-width: none; line-height: 1.5; }

/* Ficha de proyecto */
.project {
  width: min(64rem, 100% - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  overscroll-behavior: contain;
  opacity: 1;
  transform: none;
  transition:
    opacity 220ms var(--ease-out),
    transform 220ms var(--ease-out),
    overlay 220ms allow-discrete,
    display 220ms allow-discrete;
}
.project::backdrop {
  background: oklch(0.15 0.01 262 / 0.6);
  opacity: 1;
  transition:
    opacity 220ms var(--ease-out),
    overlay 220ms allow-discrete,
    display 220ms allow-discrete;
}
@starting-style {
  .project[open] { opacity: 0; transform: translateY(0.75rem) scale(0.985); }
  .project[open]::backdrop { opacity: 0; }
}
.project:not([open]) { opacity: 0; transform: translateY(0.5rem); transition-duration: 150ms; }
.project:not([open])::backdrop { opacity: 0; }

.project-inner { padding: clamp(1.25rem, 3vw, 2.5rem); }
.project-head {
  position: sticky;
  top: calc(-1 * clamp(1.25rem, 3vw, 2.5rem));
  z-index: var(--z-content);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: calc(-1 * clamp(1.25rem, 3vw, 2.5rem)) calc(-1 * clamp(1.25rem, 3vw, 2.5rem)) 0;
  padding: 0.875rem clamp(1.25rem, 3vw, 2.5rem);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.project h2 { margin-top: clamp(1.5rem, 4vh, 2.5rem); }
.project-desc {
  max-width: 60ch;
  margin-top: 1rem;
  font-size: 1.125rem;
  color: var(--ink-soft);
}
.project-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.project-links:empty { display: none; }
.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: clamp(1.75rem, 4vh, 2.5rem);
}
.project-gallery figure { grid-column: 1 / -1; margin: 0; min-width: 0; }
.project-gallery figure.is-loop { grid-column: auto; }
.project-gallery img {
  width: 100%;
  max-height: 85dvh;
  object-fit: contain;
  background: var(--hole);
}
.project-gallery video {
  max-width: 100%;
  height: auto;
  max-height: 80dvh;
  margin-inline: auto;
  background: var(--hole);
}
.project-gallery .is-loop video { width: 100%; max-height: none; }
.pano-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-color: var(--line-strong) transparent;
}
.project-gallery .pano-scroll img {
  width: auto;
  max-width: none;
  height: min(70dvh, 38rem);
  max-height: none;
}
body:has(.project[open]) { overflow: hidden; }

/* Movimiento reducido: todo quieto, nada escondido */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-enter] .hero-copy > *,
  .js [data-enter] .hero-art img { animation: none; }
  .btn, .tile-link, .glyph > span:not(.visually-hidden) { transition: opacity 120ms linear; }
  .tile-media img, .hero-art img { transition: none; }
  .btn:active:not(:disabled), .btn:hover:not(:disabled), .tile-link:hover { transform: none; }
  .tile-link:hover .tile-media img, .hero-art:hover img { transform: none; }
  .project, .project::backdrop { transition: opacity 120ms linear, overlay 120ms allow-discrete, display 120ms allow-discrete; }
  .project:not([open]), .project[open] { transform: none; }
}

/* ------------------------------------------------------------------
   Página de minicómics
   ------------------------------------------------------------------ */
.nav-static { position: relative; }
.nav li a[aria-current="page"] { color: var(--ink); background-size: 100% 1px; }

.archive {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(1.5rem, 5vh, 3rem) var(--pad-x) var(--sec-pad);
}
.archive-head .lede { max-width: 46ch; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: clamp(2rem, 6vh, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font: 500 0.9375rem/1 var(--font-sans);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 160ms var(--ease-out),
    border-color 160ms var(--ease-out),
    color 160ms var(--ease-out),
    transform 120ms var(--ease-out);
}
.chip small { font-family: var(--font-mono); font-size: 0.75rem; opacity: 0.8; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip:active { transform: scale(0.97); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .chip:hover:not([aria-pressed="true"]) { border-color: var(--accent); color: var(--accent); }
}

.comic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem) clamp(0.875rem, 1.5vw, 1.25rem);
  margin-top: 1.75rem;
}
.comic { min-width: 0; }
.comic-link {
  display: block;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 200ms var(--ease-out);
}
.comic-media {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--hole);
}
.comic-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 400ms var(--ease-out);
}
.comic-cap { padding-top: 0.625rem; }
.comic-cap h3 {
  overflow: hidden;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 160ms var(--ease-out);
}
.comic-cap p {
  margin-top: 0.125rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.comic-link:focus-visible { outline-offset: 4px; }
@media (hover: hover) and (pointer: fine) {
  .comic-link:hover { transform: translateY(-2px); }
  .comic-link:hover .comic-media img { transform: scale(1.03); }
  .comic-link:hover h3 { color: var(--accent); }
}

.archive-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: clamp(2.5rem, 6vh, 3.5rem);
}
.archive-count {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

/* Visor */
.viewer {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  overscroll-behavior: contain;
}
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: var(--paper); }
@starting-style {
  .viewer[open] { opacity: 0; }
}
.viewer { transition: opacity 180ms var(--ease-out), overlay 180ms allow-discrete, display 180ms allow-discrete; }
.viewer:not([open]) { opacity: 0; transition-duration: 120ms; }

.viewer-bar,
.viewer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem var(--pad-x);
}
.viewer-bar { border-bottom: 1px solid var(--line); }
.viewer-nav { border-top: 1px solid var(--line); }
.viewer-bar h2 { font-size: 1.25rem; letter-spacing: -0.015em; }
.viewer-meta,
.viewer-pos {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.viewer-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0;
  touch-action: pan-y;
}
.viewer-stage img {
  position: absolute;
  top: 1rem;
  left: var(--pad-x);
  width: calc(100% - 2 * var(--pad-x));
  max-width: none;
  height: calc(100% - 2rem);
  object-fit: contain;
  opacity: 0;
  transition: opacity 160ms var(--ease-out);
}
.viewer-stage img.is-ready { opacity: 1; }
body:has(.viewer[open]) { overflow: hidden; }

@media (max-width: 560px) {
  .viewer-nav .btn { padding: 0 0.875rem; }
  .comic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .chip, .comic-link { transition: opacity 120ms linear; }
  .comic-media img, .viewer-stage img { transition: none; }
  .comic-link:hover, .chip:active { transform: none; }
  .comic-link:hover .comic-media img { transform: none; }
}

/* Enlace al archivo desde la portada */
.disc-head .disc-link { margin-top: 1.25rem; }
