:root {
  --paper: #f4f0e8;
  --paper-dark: #e3dccf;
  --ink: #161412;
  --muted: #5e574f;
  --rule: #c9c1b3;
  --accent: #a8291a;
  --accent-light: #f08a73;
  --on-ink-muted: #c9c1b3;
  --max: 1280px;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Manrope", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
a:hover { color: var(--ink); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
em { font-style: italic; }

.wrap { width: min(var(--max), 100% - 48px); margin-inline: auto; }
.section { padding-block: 96px; }
.muted { color: var(--muted); }
.kicker { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 10px 16px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 16px 28px; font-weight: 700; font-size: 15px; text-decoration: none;
  transition: transform .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--accent); color: #fff; }
.btn--outline { color: var(--ink); border: 1px solid var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--paper); }
.btn--accent { background: var(--accent); color: #fff; }
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.btn--accent:hover { background: var(--ink); color: var(--paper); }

/* Cabecera */
.masthead {
  --gutter: max(24px, (100% - var(--max)) / 2);
  position: sticky; top: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 18px var(--gutter);
  background: var(--paper);
  font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
}
/* Línea inferior alineada con el contenido */
.masthead::after { content: ""; position: absolute; left: var(--gutter); right: var(--gutter); bottom: 0; border-bottom: 1px solid var(--ink); }
.masthead__brand { grid-column: 2; font-family: var(--serif); font-size: 26px; letter-spacing: 0; text-transform: none; color: var(--ink); text-decoration: none; opacity: 0; transition: opacity .3s; }
.masthead.is-scrolled .masthead__brand { opacity: 1; }
.masthead__nav { grid-column: 3; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 28px; }
.masthead__nav a { color: var(--ink); text-decoration: none; }
.masthead__nav a:hover, .masthead__nav a.is-accent { color: var(--accent); }
.masthead__nav a.is-accent { font-weight: 700; }

/* Portada */
.cover { display: flex; flex-wrap: wrap; gap: 48px; padding-block: 48px 72px; }
.cover__text { flex: 1 1 620px; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.cover__title { font-size: clamp(76px, 13vw, 200px); line-height: .86; letter-spacing: -0.03em; }
.cover__title em { color: var(--accent); }
.cover__foot { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 32px; }
.cover__lead { font-family: var(--serif); font-size: 30px; line-height: 1.2; max-width: 20ch; }
.cover__social { display: flex; flex-wrap: wrap; gap: 12px; }
.cover__figure { flex: 1 1 340px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.cover__photo { position: relative; flex: 1; min-height: 460px; background: var(--paper-dark); overflow: hidden; }
.cover__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover__placeholder { position: absolute; inset: 0; display: none; place-items: center; color: var(--muted); font-size: 14px; }
.cover__photo.is-empty img { display: none; }
.cover__photo.is-empty .cover__placeholder { display: grid; }
.cover__figure figcaption { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* Sobre mí */
.about { padding-top: 24px; }
.about__head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--ink); padding-top: 20px; margin-bottom: 48px;
  font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
}
.about__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px 80px; align-items: start; }
.about__title { font-size: clamp(40px, 4.8vw, 68px); line-height: 1.04; max-width: 15ch; }
.about__title em { color: var(--accent); }
.about__body { padding-top: 10px; }
.about__body p { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.7; color: #3a352f; }
@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__title { max-width: 18ch; }
}

/* Números */
.section#numeros { padding-top: 0; }
.figures { border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); padding-block: 28px; }
.figures__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 24px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.figures__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.figure { padding: 8px 24px; border-left: 1px solid var(--rule); }
.figure:first-child { border-left: 0; padding-left: 0; }
.figure__value { font-variant-numeric: tabular-nums; font-family: var(--serif); font-size: clamp(56px, 8vw, 112px); line-height: 1; }
.figure__label { margin-top: 10px; font-size: 14px; color: var(--muted); }

/* Trabajo */
.work { display: flex; flex-wrap: wrap; gap: 48px; padding-top: 0; }
.work__index { flex: 1 1 280px; min-width: 0; }
/* En escritorio el índice queda fijo mientras se recorren los videos */
@media (min-width: 1024px) {
  .work__index { position: sticky; top: 96px; align-self: flex-start; }
}
.work__title { font-size: 56px; line-height: 1; margin-bottom: 32px; }
.topics { display: flex; flex-direction: column; }
.topic {
  display: flex; align-items: baseline; gap: 20px; width: 100%; min-height: 56px; padding: 14px 0;
  background: none; border: 0; border-bottom: 1px solid var(--rule); cursor: pointer; text-align: left;
  font-family: var(--serif); font-size: 30px; color: var(--ink); transition: color .2s, padding .2s;
}
.topic:hover { color: var(--accent); padding-left: 6px; }
.topic[aria-selected="true"] { color: var(--accent); font-style: italic; }
.topic__num { font-family: var(--sans); font-size: 13px; font-style: normal; letter-spacing: .1em; color: var(--muted); }
.work__body { flex: 999 1 640px; min-width: 0; }
.work__quote { font-family: var(--serif); font-style: italic; font-size: 30px; line-height: 1.25; max-width: 32ch; margin-bottom: 32px; }
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; align-items: start; }
.video { display: flex; flex-direction: column; gap: 12px; }
.video__player { aspect-ratio: 9 / 16; background: var(--ink); border: 1px solid var(--ink); overflow: hidden; }
.video__player iframe { width: 100%; height: 100%; border: 0; display: block; }
.video__slot {
  aspect-ratio: 9 / 16; background: var(--paper-dark); border: 1px solid var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: var(--muted); text-decoration: none; transition: background .2s;
}
.video__slot:hover { background: #d9d0c0; color: var(--ink); }
.video__slot svg { width: 44px; height: 44px; }
.video__slot span { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.video__meta { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }

/* Servicios */
.services { background: var(--ink); color: var(--paper); }
.services__title { font-size: clamp(44px, 6vw, 80px); line-height: 1; margin-bottom: 48px; }
.services__title em { color: var(--accent-light); }
.services__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); border-top: 1px solid #4a443e; }
.service { padding: 28px 24px 28px 0; border-bottom: 1px solid #4a443e; }
.service h3 { font-size: 28px; margin-bottom: 8px; }
.service p { color: var(--on-ink-muted); }

/* Contacto */
.contact { text-align: center; padding-block: 112px 64px; }
.contact__title { font-size: clamp(48px, 8vw, 120px); line-height: .95; max-width: 12ch; margin: 0 auto 36px; }
.contact__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; margin-top: 28px; }
.contact__links a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 0; }

/* Footer */
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding: 20px 0 40px; border-top: 1px solid var(--ink);
  font-size: 13px; letter-spacing: .1em; text-transform: uppercase;
}
.footer { align-items: center; }
.footer a { color: var(--ink); }
.footer a:hover { color: var(--accent); }
.footer__social { display: flex; gap: 4px; }
.footer__social a { display: grid; place-items: center; width: 44px; height: 44px; }

/* Animación */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .8s ease, transform .8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .masthead { grid-template-columns: auto 1fr; }
  .masthead__brand { grid-column: 1; opacity: 1; }
  .masthead__nav { grid-column: 2; gap: 18px; }
  .section { padding-block: 72px; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 32px); }
  .masthead { --gutter: 16px; grid-template-columns: 1fr; justify-items: center; gap: 8px; padding-block: 12px; }
  .masthead__brand, .masthead__nav { grid-column: 1; }
  .masthead__nav { justify-content: center; font-size: 11px; letter-spacing: .06em; gap: 14px; }
  .cover__photo { min-height: 380px; }
  .cover__lead, .work__quote { font-size: 24px; }
  .topic { font-size: 26px; }
  .videos--embeds { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
