/* isaac.camps.3d
   Tema oscuro fijo (cinematográfico), acento ámbar neón, esquinas rectas en todo. */

@font-face {
  font-family: 'Geist';
  src: url('../assets/fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('../assets/fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0d0d0f;
  --bg-2: #151518;
  --bg-3: #1d1d21;
  --line: rgb(255 255 255 / 0.1);
  --line-strong: rgb(255 255 255 / 0.22);
  --line-input: rgb(255 255 255 / 0.45); /* borde de controles: >= 3:1 (WCAG 1.4.11) */
  --text: #eeece8;
  --muted: #a3a09a;
  --accent: #f0a53a;
  --accent-ink: #1a1206;
  --danger: #ff8a7a;

  --font: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1440px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h: 68px;

  /* capas */
  --z-nav: 20;
  --z-menu: 30;
  --z-grain: 40;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* grano de película, fijo para no repintar al hacer scroll */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
main:focus { outline: none; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -100px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; }
.skip:focus { top: 12px; }
.icon { width: 1.15em; height: 1.15em; flex: none; }

.h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
  max-width: 18ch;
  text-wrap: balance;
}
.kicker {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  min-height: 48px;
  padding: 0 1.4rem;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .15s var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn .icon { transition: transform .35s var(--ease); }
.btn:hover .icon { transform: translateX(3px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #f7bb62; }
.btn--ghost { border-color: var(--line-input); color: var(--text); background: rgb(13 13 15 / 0.35); backdrop-filter: blur(8px); }
.btn--ghost:hover { border-color: var(--text); }
.btn--sm { min-height: 40px; padding: 0 1rem; font-size: 0.875rem; }
.btn[disabled] { opacity: .6; cursor: progress; }

.icon-btn {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  background: rgb(13 13 15 / 0.6);
  border: 1px solid var(--line-input);
  cursor: pointer;
  transition: border-color .25s, background-color .25s;
}
.icon-btn:hover { border-color: var(--text); }
.icon-btn .icon { width: 22px; height: 22px; }

/* Hueco pendiente: visible a propósito hasta que se complete el dato */
.pending {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .35em .7em;
  border: 1px dashed rgb(240 165 58 / 0.6);
  color: var(--accent);
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .04em;
}

/* ---------- Navegación ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0;
  z-index: var(--z-nav);
  height: var(--nav-h);
  transition: background-color .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-solid {
  background: rgb(13 13 15 / 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav__inner { height: 100%; display: flex; align-items: center; gap: 2rem; }
.wordmark {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark span { color: var(--accent); }
.nav__links { display: flex; gap: 2rem; margin-left: auto; }
.nav__links a {
  font-size: .9rem; color: #d9d6d0; text-decoration: none;
  transition: color .25s;
}
.nav__links a:hover { color: var(--text); }
.nav__end { display: flex; align-items: center; gap: 1rem; }
.lang { display: flex; border: 1px solid var(--line-input); }
.lang button {
  background: none; border: 0; cursor: pointer;
  font-family: var(--mono); font-size: .75rem;
  padding: .45rem .6rem; color: var(--muted);
  min-width: 40px; min-height: 36px;
}
.lang button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.nav__toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav__toggle .icon { width: 28px; height: 28px; }

.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 0 0;
  z-index: var(--z-menu);
  background: var(--bg);
  padding: 2rem var(--gutter);
  display: flex; flex-direction: column; justify-content: space-between;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu nav { display: flex; flex-direction: column; }
.mobile-menu nav a {
  font-size: 2rem; font-weight: 500; letter-spacing: -0.03em;
  padding: .6rem 0; text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.mobile-menu .btn { justify-content: center; }

@media (max-width: 900px) {
  .nav__links, .nav__cta { display: none; }
  .nav__end { margin-left: auto; }
  .nav__toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex; align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.hero__media { position: absolute; inset: 0; z-index: -1; background: var(--bg) url('../assets/video/plaza-italiana.jpg') center / cover no-repeat; }
/* el render es una escena nocturna: se aclara un poco para que se vea */
.hero__video { width: 100%; height: 100%; object-fit: cover; filter: brightness(1.18) saturate(1.06); }
.hero__media::after {
  content: ''; position: absolute; inset: 0;
  background:
    /* Oscurece solo donde hace falta: arriba (menú), la esquina del texto (contraste
       WCAG 1.4.3) y el fundido inferior. El resto del render queda limpio. */
    linear-gradient(to bottom, rgb(13 13 15 / 0.55) 0%, rgb(13 13 15 / 0) 16%),
    linear-gradient(to right, rgb(13 13 15 / 0.9) 0%, rgb(13 13 15 / 0.82) 44%, rgb(13 13 15 / 0.3) 55%, rgb(13 13 15 / 0) 66%),
    linear-gradient(to top, var(--bg) 0%, rgb(13 13 15 / 0) 14%);
}
.hero__pause { position: absolute; right: var(--gutter); bottom: clamp(3rem, 8vh, 6rem); z-index: 1; }
.hero__content { padding-block: calc(var(--nav-h) + 2rem) clamp(3rem, 8vh, 6rem); }
.hero__title {
  margin-top: 1rem;
  font-size: clamp(2.4rem, 5.6vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
  max-width: 17ch;
  text-wrap: balance;
}
.hero__sub {
  margin-top: 1.5rem;
  max-width: 44ch;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  color: #cfccc6;
}
.hero__ctas { margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Trabajos ---------- */
.work { padding-block: clamp(5rem, 10vw, 9rem) clamp(4rem, 8vw, 7rem); }
.work__grid {
  margin-top: clamp(2rem, 4vw, 3.5rem);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(12px, 1.6vw, 24px);
  row-gap: clamp(2.5rem, 4vw, 4rem);
}
.card { grid-column: span var(--span, 6); }
.card__link {
  display: block; width: 100%; padding: 0; text-align: left;
  background: none; border: 0; cursor: pointer; text-decoration: none;
}
.card__media {
  position: relative;
  height: var(--h, 32vw);
  max-height: var(--hmax, 620px);
  overflow: hidden;
  background: var(--bg-2);
}
.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.2s var(--ease), filter .6s var(--ease);
  filter: saturate(0.92);
}
.card__link:hover .card__media img,
.card__link:focus-visible .card__media img { transform: scale(1.035); filter: saturate(1.05); }
.card__meta {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  margin-top: 1rem;
}
.card__title {
  font-size: clamp(1.1rem, 1.5vw, 1.35rem); font-weight: 500; letter-spacing: -0.02em;
  display: inline-flex; align-items: center; gap: .4em;
}
.card__title .icon { color: var(--accent); opacity: 0; transform: translate(-4px, 4px); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.card__link:hover .card__title .icon,
.card__link:focus-visible .card__title .icon { opacity: 1; transform: none; }
.card__year { font-family: var(--mono); font-size: .8rem; color: var(--muted); white-space: nowrap; }
.card__year.pending { font-size: .7rem; }
.card__summary { margin-top: .35rem; color: var(--muted); font-size: .95rem; max-width: 52ch; }

/* tarjeta sin imágenes publicables */
.card__media--empty {
  display: grid; place-items: center; text-align: center;
  padding: 2rem;
  background:
    repeating-linear-gradient(135deg, rgb(240 165 58 / 0.05) 0 1px, transparent 1px 14px),
    var(--bg-2);
  outline: 1px dashed rgb(240 165 58 / 0.45);
  outline-offset: -1px;
}
.card__media--empty .empty__label { font-family: var(--mono); font-size: .75rem; color: var(--accent); letter-spacing: .06em; max-width: 26ch; }
.card__media--empty .empty__title { margin-top: .75rem; font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 500; letter-spacing: -0.03em; max-width: 14ch; margin-inline: auto; line-height: 1.1; }

/* filas: la altura de la imagen es común dentro de cada fila */
.card[data-row="lg"] { --h: 36vw; --hmax: 580px; }
.card[data-row="md"] { --h: 30vw; --hmax: 480px; }
.card[data-row="sm"] { --h: 22vw; --hmax: 360px; }

@media (max-width: 767px) {
  .work__grid { grid-template-columns: 1fr; row-gap: 2.75rem; }
  .card { grid-column: auto; }
  .card[data-row] { --h: auto; --hmax: none; }
  .card__media { aspect-ratio: 16 / 10; height: auto; }
  .card__media--empty { aspect-ratio: 4 / 3; }
}

/* ---------- Servicios ---------- */
.services {
  padding-block: clamp(4rem, 8vw, 7rem);
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.services__media { margin: 0; position: sticky; top: calc(var(--nav-h) + 2rem); background: var(--bg-2); }
.services__media img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.services__list { margin-top: clamp(2rem, 4vw, 3rem); }
.services__list li { padding-block: 1.6rem; border-top: 1px solid var(--line); }
.services__list h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); font-weight: 500; letter-spacing: -0.025em; }
.services__list p { margin-top: .5rem; color: var(--muted); max-width: 48ch; }
.services__price {
  margin-top: 1rem; padding: 1.75rem; background: var(--bg-2);
  display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem;
}
.services__price p { max-width: 44ch; }

@media (max-width: 899px) {
  .services { grid-template-columns: 1fr; }
  .services__media { position: static; }
}

/* ---------- Proceso ---------- */
.process { padding-block: clamp(4rem, 8vw, 7rem); }
.process__steps {
  margin-top: clamp(2rem, 4vw, 3.5rem);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  counter-reset: step;
}
.process__steps li {
  position: relative;
  padding: 2.25rem 1.5rem 0 0;
  border-top: 1px solid var(--line-strong);
}
.process__steps li::before {
  content: ''; position: absolute; top: -5px; left: 0;
  width: 9px; height: 9px; background: var(--bg); border: 1px solid var(--accent);
}
.process__steps li:last-child::before { background: var(--accent); }
.process__steps h3 { font-size: 1.1rem; font-weight: 500; letter-spacing: -0.015em; }
.process__steps p { margin-top: .5rem; font-size: .92rem; color: var(--muted); }
.process__note { margin-top: 2.5rem; font-family: var(--mono); font-size: .8rem; color: var(--muted); }

@media (max-width: 899px) {
  .process__steps { grid-template-columns: 1fr; }
  .process__steps li { border-top: 0; border-left: 1px solid var(--line-strong); padding: 0 0 2rem 1.75rem; }
  .process__steps li::before { top: 6px; left: -5px; }
  .process__steps li:last-child { padding-bottom: 0; }
}

/* ---------- Fab ---------- */
.fab {
  position: relative; isolation: isolate; overflow: hidden;
  margin-block: clamp(3rem, 6vw, 5rem);
  min-height: clamp(420px, 60vh, 640px);
  display: flex; align-items: center;
}
.fab__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.fab::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgb(13 13 15 / 0.95) 0%, rgb(13 13 15 / 0.88) 45%, rgb(13 13 15 / 0.35) 100%);
}
.fab .h2 { margin-top: 1rem; }
.fab__body { margin-top: 1.25rem; max-width: 42ch; color: #cfccc6; }
#fab-link { margin-top: 2rem; }

/* ---------- Sobre mí ---------- */
.about { padding-block: clamp(4rem, 8vw, 7rem); }
.about__top {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 6rem); align-items: end;
}
.about__photo { margin: 0; background: var(--bg-2); }
.about__photo img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; filter: saturate(0.9); }
.about__bio {
  margin-top: 2rem;
  font-size: clamp(1.3rem, 2.3vw, 2rem);
  line-height: 1.35; letter-spacing: -0.02em;
  max-width: 34ch; color: var(--text);
  text-wrap: pretty;
}
.about__facts {
  margin-top: clamp(3rem, 5vw, 4.5rem);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 2rem clamp(2rem, 6vw, 6rem);
  padding-top: 2rem; border-top: 1px solid var(--line);
}
.about__facts h3 { font-family: var(--mono); font-size: .75rem; font-weight: 400; color: var(--muted); letter-spacing: .06em; }
.tools { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.tools li { padding: .45rem .85rem; border: 1px solid var(--line-strong); font-size: .9rem; }
.focus { margin-top: 1rem; display: grid; gap: .75rem; }
.focus li { font-size: 1.05rem; max-width: 56ch; }

@media (max-width: 767px) {
  .about__facts { grid-template-columns: 1fr; }
  .about__top { grid-template-columns: 1fr; }
  .about__photo { max-width: 360px; }
}

/* ---------- Contacto ---------- */
.contact {
  padding-block: clamp(4rem, 8vw, 7rem) clamp(5rem, 10vw, 8rem);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
.contact__intro > p { margin-top: 1.25rem; color: var(--muted); max-width: 40ch; }
.contact__email { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.contact__label { margin-top: 2.5rem; font-family: var(--mono); font-size: .75rem; font-weight: 400; color: var(--muted); letter-spacing: .06em; }
.socials { margin-top: .75rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.socials a {
  display: inline-flex; align-items: center; gap: .35em;
  padding: .5rem .85rem; border: 1px solid var(--line-strong);
  font-size: .9rem; text-decoration: none; transition: border-color .25s;
}
.socials a:hover { border-color: var(--text); }
.socials a { gap: .5em; min-height: 44px; }
.socials .icon, .footer__social .icon { width: 18px; height: 18px; color: var(--accent); flex: none; }

.form { display: grid; gap: 1.5rem; padding: clamp(1.5rem, 3vw, 2.5rem); background: var(--bg-2); }
.field { display: grid; gap: .5rem; }
.field label { font-size: .9rem; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit; color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-input);
  border-radius: 0;
  padding: .8rem .9rem;
  min-height: 48px;
  transition: border-color .2s;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.5rem; }
.field textarea { resize: vertical; min-height: 140px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: rgb(255 255 255 / 0.7); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field__help { font-size: .82rem; color: var(--muted); }
.field__error { font-size: .82rem; color: var(--danger); min-height: 0; }
.field__error:empty { display: none; }
.form__submit { justify-self: start; }
.form__status { font-size: .95rem; }
.form__note { font-size: .85rem; color: var(--muted); }
.field--check .check { display: flex; align-items: flex-start; gap: .75rem; }
.check input {
  appearance: none; flex: none; margin: .15rem 0 0;
  width: 22px; height: 22px; min-height: 0; padding: 0; border: 1px solid var(--line-input); background: var(--bg);
  display: grid; place-items: center; cursor: pointer;
}
.check input::after { content: ''; width: 10px; height: 6px; border: solid var(--accent-ink); border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { opacity: 1; }
.check input[aria-invalid="true"] { border-color: var(--danger); }
.check label { font-size: .92rem; cursor: pointer; }
.check label a, .form__info a { color: var(--accent); text-underline-offset: 3px; }
.form__info { padding-top: 1.25rem; border-top: 1px solid var(--line); }
.form__info h3 { font-size: .8rem; font-weight: 500; color: var(--text); }
.form__info p { margin-top: .4rem; font-size: .8rem; line-height: 1.55; color: var(--muted); }
.form__status:empty { display: none; }
.form__status.is-ok { color: var(--accent); }
.form__status.is-error { color: var(--danger); }

@media (max-width: 899px) {
  .contact { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); }
.footer__inner { padding-block: 2.5rem; font-size: .85rem; color: var(--muted); }
.footer__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; }
.footer__legal ul { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.footer__legal a { display: inline-block; padding-block: .35rem; color: #d9d6d0; text-underline-offset: 3px; }
.footer__legal a:hover { color: var(--text); }
.footer__copy { margin-top: 1.5rem; max-width: 90ch; font-size: .8rem; line-height: 1.6; }

/* ---------- Visor de proyecto ---------- */
.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: #09090a; color: var(--text);
  display: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.viewer[open] { display: grid; }
.viewer::backdrop { background: rgb(0 0 0 / 0.85); }
.viewer__top { display: flex; justify-content: space-between; align-items: center; padding: 12px var(--gutter); }
.viewer__count { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.viewer__stage {
  position: relative; min-height: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 0 var(--gutter);
}
.viewer__stage img, .viewer__stage video {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; background: #000;
}
.viewer__stage video { width: min(100%, calc((100dvh - 260px) * 16 / 9)); aspect-ratio: 16 / 9; }
.viewer__nav { position: absolute; top: 50%; translate: 0 -50%; }
.viewer__nav--prev { left: max(8px, calc(var(--gutter) - 36px)); }
.viewer__nav--next { right: max(8px, calc(var(--gutter) - 36px)); }
.viewer__info {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem 3rem; align-items: end;
  padding: 1.25rem var(--gutter) 1.5rem;
}
.viewer__text h2 { font-size: 1.35rem; font-weight: 500; letter-spacing: -0.02em; }
.viewer__text p { margin-top: .4rem; color: var(--muted); font-size: .92rem; max-width: 72ch; }
.tags { margin-top: .75rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.tags li { font-family: var(--mono); font-size: .72rem; padding: .25rem .55rem; border: 1px solid var(--line-strong); color: #cfccc6; }
.viewer__thumbs { display: flex; gap: 6px; overflow-x: auto; max-width: 46vw; padding-bottom: 4px; scrollbar-width: thin; }
.thumb {
  position: relative; flex: none; width: 84px; height: 48px; padding: 0;
  border: 1px solid transparent; background: var(--bg-2); cursor: pointer; opacity: .55;
  transition: opacity .2s, border-color .2s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: .9; }
.thumb[aria-current="true"] { opacity: 1; border-color: var(--accent); }
.thumb__play { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / 0.35); }
.thumb__play .icon { width: 18px; height: 18px; color: #fff; }

@media (max-width: 767px) {
  .viewer__info { grid-template-columns: 1fr; padding-top: 1rem; }
  .viewer__thumbs { max-width: 100%; order: -1; }
  .viewer__text p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .viewer__stage video { width: 100%; }
  .viewer__nav { display: none; } /* en móvil: deslizar o miniaturas */
}

/* ---------- Movimiento ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero .kicker, .hero__title, .hero__sub, .hero__ctas {
    animation: rise 1.1s var(--ease) both;
  }
  .hero__title { animation-delay: .08s; }
  .hero__sub { animation-delay: .2s; }
  .hero__ctas { animation-delay: .32s; }
  .hero__media { animation: settle 2.4s var(--ease) both; }

  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
  .js .reveal.in { opacity: 1; transform: none; }

  .viewer[open] { animation: fade .35s var(--ease); }
  .viewer__stage > * { animation: fade .45s var(--ease); }
}
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
@keyframes settle { from { transform: scale(1.06); } }
@keyframes fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Páginas legales ---------- */
.legal-header { border-bottom: 1px solid var(--line); }
.legal-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--nav-h); }
.legal-header__lang { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .9rem; border: 1px solid var(--line-input); text-decoration: none; font-size: .9rem; }
.legal-header__lang:hover { border-color: var(--text); }
.legal { max-width: calc(78ch + 2 * var(--gutter)); padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(4rem, 8vw, 6rem); }
.legal__back a { color: var(--muted); font-size: .9rem; text-underline-offset: 3px; }
.legal__back a:hover { color: var(--text); }
.legal h1 { margin-top: 1.5rem; font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 500; letter-spacing: -0.035em; line-height: 1.1; }
.legal__updated { margin-top: .75rem; font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.legal h2 { margin-top: 2.75rem; font-size: 1.3rem; font-weight: 500; letter-spacing: -0.015em; }
.legal h3 { margin-top: 1.75rem; font-size: 1.05rem; font-weight: 500; }
.legal p, .legal ul { margin-top: .9rem; color: #d9d6d0; }
.legal ul { padding-left: 1.2rem; list-style: square; }
.legal li + li { margin-top: .45rem; }
.legal li::marker { color: var(--accent); }
.legal a { color: var(--accent); text-underline-offset: 3px; }
.legal strong { color: var(--text); font-weight: 500; }
.legal code { font-family: var(--mono); font-size: .88em; }
.legal__data { list-style: none !important; padding: 1.25rem !important; background: var(--bg-2); }
.legal__notice { padding: 1rem 1.25rem; border-left: 2px solid var(--accent); background: var(--bg-2); }
.legal__form { margin-top: 1rem; padding: 1.25rem; border: 1px dashed var(--line-input); }
.legal__form p:first-child { margin-top: 0; }
.legal__table { margin-top: 1.25rem; overflow-x: auto; }
.legal__table:focus-visible { outline-offset: 2px; }
.legal table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .9rem; }
.legal th, .legal td { padding: .8rem .9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-strong); }
.legal th { font-weight: 500; color: var(--text); background: var(--bg-2); }
.legal td { color: #d9d6d0; }
mark.pending {
  background: rgb(240 165 58 / 0.14);
  color: var(--accent);
  outline: 1px dashed rgb(240 165 58 / 0.7);
  padding: .05em .3em;
  font-family: var(--mono);
  font-size: .85em;
}
.footer__legal a[aria-current="page"] { color: var(--accent); }

/* Etiquetas pequeñas sobre vídeo o imagen: fondo propio para garantizar 4.5:1 */
.hero .kicker, .fab .kicker { display: inline-block; padding: .35em .6em; background: rgb(13 13 15 / 0.85); }

/* =====================================================================
   Móvil (< 768 px): diseño propio, no el de escritorio encogido.
   Los renders van a sangre (de borde a borde) y el texto va debajo,
   sobre fondo liso, en vez de encima del render oscurecido.
   ===================================================================== */
@media (max-width: 767px) {
  /* --- Rendimiento: sin grano a pantalla completa ni desenfoque del menú fijo */
  body::after { display: none; }
  .nav.is-solid { backdrop-filter: none; background: rgb(13 13 15 / 0.97); }

  /* --- Navegación: objetivos táctiles de 44 px */
  .wordmark { display: inline-flex; align-items: center; min-height: 44px; }
  .lang button { min-width: 44px; min-height: 44px; }
  .nav__toggle { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; }

  /* --- Portada: vídeo arriba y bien visible; texto debajo sobre fondo liso */
  .hero { min-height: 0; display: flex; flex-direction: column; align-items: stretch; }
  .hero__media { position: relative; inset: auto; z-index: 0; height: clamp(220px, 44svh, 480px); }
  .hero__media::after {
    /* solo una sombra arriba para el menú y un fundido abajo hacia el texto */
    background:
      linear-gradient(to bottom, rgb(13 13 15 / 0.6) 0%, rgb(13 13 15 / 0) 24%),
      linear-gradient(to top, var(--bg) 0%, rgb(13 13 15 / 0) 30%);
  }
  .hero__pause { top: calc(clamp(220px, 44svh, 480px) - 56px); bottom: auto; right: var(--gutter); }
  .hero__content { padding-block: .5rem 2.5rem; }
  .hero .kicker { display: none; }
  .hero__title { margin-top: 0; font-size: clamp(2rem, 9.2vw, 2.75rem); line-height: 1.04; max-width: none; }
  .hero__sub { margin-top: 1rem; font-size: 1rem; }
  .hero__ctas { margin-top: 1.5rem; display: grid; grid-template-columns: auto auto; justify-content: start; gap: .5rem; }
  .hero__ctas .btn { padding: 0 1.1rem; }

  /* --- Proyectos: entornos a sangre y props por parejas */
  .work { padding-top: 3.5rem; }
  .work__grid { grid-template-columns: 1fr 1fr; column-gap: 12px; row-gap: 2.25rem; margin-top: 1.5rem; }
  .card { grid-column: span 2; }
  .card[data-mobile="half"] { grid-column: span 1; }
  .card[data-mobile="full"] .card__media { margin-inline: calc(-1 * var(--gutter)); aspect-ratio: 4 / 3; }
  .card[data-mobile="half"] .card__media { aspect-ratio: 1 / 1; }
  .card[data-mobile="half"] .card__meta { flex-direction: column; align-items: flex-start; gap: .15rem; margin-top: .6rem; }
  .card[data-mobile="half"] .card__title { font-size: 1rem; }
  .card[data-mobile="half"] .card__summary { display: none; }
  .card__meta { margin-top: .85rem; }
  /* la flecha es una pista de hover; en táctil sobra y descoloca los títulos de dos líneas */
  .card__title .icon { display: none; }

  /* --- Visor: columna con scroll; imagen a todo el ancho y descripción completa */
  .viewer[open] { display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
  .viewer__top { position: sticky; top: 0; z-index: 2; background: #09090a; padding-block: 8px; }
  .viewer__stage { flex: none; display: block; padding: 0; overflow: visible; }
  .viewer__stage img, .viewer__stage video { width: 100%; height: auto; max-height: none; aspect-ratio: 16 / 9; object-fit: contain; }
  .viewer__info { display: flex; flex-direction: column; gap: 1.25rem; padding: 12px var(--gutter) 40px; }
  .viewer__thumbs { order: -1; max-width: none; scroll-snap-type: x mandatory; }
  .thumb { width: 88px; height: 50px; scroll-snap-align: start; }
  .viewer__text p { display: block; -webkit-line-clamp: none; overflow: visible; font-size: .95rem; }

  /* --- Servicios: primero el título, después la imagen (encuadrada en el edificio) */
  .services { display: flex; flex-direction: column; gap: 0; }
  .services__body { display: contents; }
  .services__body > .h2 { order: 1; }
  .services__media { order: 2; margin: 1.75rem calc(-1 * var(--gutter)) 0; }
  .services__media img { aspect-ratio: 1 / 1; object-fit: cover; object-position: 90% center; }
  .services__list { order: 3; margin-top: 1rem; }
  .services__price { order: 4; }

  /* --- Fab: el render como imagen a sangre, el texto debajo */
  .fab { display: block; min-height: 0; margin-block: 2rem; }
  .fab::before { display: none; }
  /* formato más panorámico y encuadre alto: deja fuera la franja inferior con el nombre */
  .fab__bg { position: static; display: block; height: auto; aspect-ratio: 2 / 1; object-position: center 20%; }
  .fab__content { padding-block: 1.75rem 0; }

  /* --- Sobre mí: la foto acompaña, no manda */
  .about__photo { width: min(58%, 240px); }
  .about__bio { font-size: 1.2rem; }

  /* --- Contacto: formulario a sangre para ganar ancho; objetivos de 44 px */
  .form { margin-inline: calc(-1 * var(--gutter)); padding: 1.5rem var(--gutter); }
  .socials a { min-height: 44px; }
  .contact__email .btn { width: 100%; justify-content: center; }
  .check input { width: 24px; height: 24px; }
  .check label { padding-block: .1rem; }

  /* --- Pie: enlaces legales en lista, 44 px de alto */
  .footer__top { flex-direction: column; align-items: flex-start; }
  .footer__legal ul { flex-direction: column; gap: 0; }
  .footer__legal a { display: flex; align-items: center; min-height: 44px; padding-block: 0; }
}

/* Botones de la portada apilados solo si de verdad no caben (pantallas muy estrechas) */
@media (max-width: 339px) {
  .hero__ctas { grid-template-columns: 1fr; }
  .hero__ctas .btn { justify-content: center; }
}

/* Tablet en vertical: titular a la altura de la pantalla */
@media (min-width: 600px) and (max-width: 1024px) {
  .hero__title { font-size: clamp(3rem, 7.4vw, 4.6rem); }
  .hero__sub { font-size: 1.15rem; max-width: 40ch; }
  .lang button { min-width: 44px; min-height: 44px; }
}

/* Páginas legales: las tablas se apilan en móvil en vez de desplazarse de lado */
@media (max-width: 600px) {
  .legal table { min-width: 0; }
  .legal thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .legal tr, .legal td { display: block; }
  .legal tr { padding: .9rem 1rem; border: 1px solid var(--line-strong); }
  .legal tr + tr { border-top: 0; }
  .legal td { padding: .2rem 0; border: 0; }
  .legal td::before { content: attr(data-label); display: block; font-family: var(--mono); font-size: .72rem; color: var(--muted); letter-spacing: .04em; }
  .legal td + td { margin-top: .5rem; }
  .legal-header__lang { min-height: 44px; }
  .footer__legal a { display: flex; align-items: center; min-height: 44px; }
}

/* Móviles bajos (iPhone SE y similares): el vídeo cede altura para que se vean los dos botones */
@media (max-width: 767px) and (max-height: 700px) {
  .hero__media { height: clamp(180px, 34svh, 300px); }
  .hero__pause { top: calc(clamp(180px, 34svh, 300px) - 56px); }
}

/* Tablet en vertical: mismo esquema que en móvil (render arriba y bien visible, texto debajo) */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .hero { min-height: 0; display: flex; flex-direction: column; align-items: stretch; }
  .hero__media { position: relative; inset: auto; z-index: 0; height: 48svh; }
  .hero__media::after {
    background:
      linear-gradient(to bottom, rgb(13 13 15 / 0.7) 0%, rgb(13 13 15 / 0) 22%),
      linear-gradient(to top, var(--bg) 0%, rgb(13 13 15 / 0) 28%);
  }
  .hero__pause { top: calc(48svh - 60px); bottom: auto; }
  .hero__content { padding-block: .5rem 4rem; }
  .hero__title { margin-top: 1rem; }
  /* objetivos táctiles de 44 px también en tablet */
  .socials a, .footer__legal a { min-height: 44px; display: inline-flex; align-items: center; }
  .footer__legal a { padding-block: 0; }
  .nav__toggle { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; }
  .wordmark { display: inline-flex; align-items: center; min-height: 44px; }
  .check input { width: 24px; height: 24px; }
}

/* Redes en el pie (web y páginas legales) */
.footer__social ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.footer__social a {
  display: inline-flex; align-items: center; gap: .5em; min-height: 44px;
  color: #d9d6d0; text-decoration: none; font-size: .85rem; transition: color .25s;
}
.footer__social a:hover { color: var(--text); }
.footer__social a:hover span:not(.sr-only) { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 767px) {
  .footer__social ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
}
