/* arte.abraham-reyes.lat
   Tres superficies: noche (fotografía), vino (poesía) y papel (ternura).
   Paleta del portafolio principal: crema #FBFAF6, borgoña #60213C, óxido #813413,
   vino #811344, verde #138134. La firma es el "edge print": los datos de cada toma
   en monoespaciada, como las marcas impresas en el borde de la película. */

:root {
  --noche: #0e0c0c;
  --papel: #fbfaf6;
  --borgona: #60213c;
  --oxido: #813413;
  --vino: #811344;
  --verde: #138134;

  --display: 'Bodoni Moda', 'Didot', 'Bodoni 72', Georgia, serif;
  --text: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --band: clamp(72px, 11vw, 160px);
}

[data-theme='noche'] { --bg: var(--noche); --fg: var(--papel); --muted: rgba(251, 250, 246, 0.64); --edge: #e0855c; --line: rgba(251, 250, 246, 0.16); }
[data-theme='vino'] { --bg: var(--borgona); --fg: var(--papel); --muted: rgba(251, 250, 246, 0.74); --edge: #f4b896; --line: rgba(251, 250, 246, 0.22); }
[data-theme='papel'] { --bg: var(--papel); --fg: #1d1515; --muted: #5c5852; --edge: var(--oxido); --line: rgba(29, 21, 21, 0.16); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--text);
  font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.2rem);
  line-height: 1.55;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}
[data-theme] { background: var(--bg); color: var(--fg); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: 400; }
:focus-visible { outline: 2px solid var(--edge); outline-offset: 3px; }
::selection { background: var(--edge); color: var(--noche); }

.skip { position: absolute; left: -999px; top: 8px; z-index: 50; padding: 8px 14px; background: var(--papel); color: var(--noche); font-family: var(--mono); }
.skip:focus { left: 8px; }

/* — Edge print — */
.edge {
  display: flex; flex-wrap: wrap; gap: 0.2em 1.3em;
  margin: 0;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.6;
  color: var(--edge);
}
.edge-n { color: var(--papel); }

/* — Cabecera — */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo {
  display: block; width: 52px; aspect-ratio: 480 / 254;
  background: currentColor;
  -webkit-mask: url(/img/logo.png) center / contain no-repeat;
  mask: url(/img/logo.png) center / contain no-repeat;
}
.brand-name { font-family: var(--display); font-style: italic; font-size: 1.15rem; }
.nav { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 36px); }
.nav ul { display: flex; gap: clamp(16px, 2.4vw, 36px); margin: 0; padding: 0; list-style: none; }
.nav a, .menu-btn {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
  text-decoration: none; color: var(--fg);
}
.nav a:hover, .nav a[aria-current='page'] { color: var(--edge); }
.nav a[aria-current='page'] { text-decoration: underline; }
.lang { border: 1px solid var(--line); padding: 4px 8px; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); padding: 8px 12px; cursor: pointer; }

/* — Encabezados de página — */
.page-head { padding: clamp(56px, 9vw, 128px) var(--gutter) clamp(32px, 5vw, 64px); }
.page-title {
  font-family: var(--display); font-style: italic; font-weight: 400;
  font-size: clamp(3.4rem, 11vw, 10rem); line-height: 0.9; letter-spacing: -0.02em;
}
.page-lede { max-width: 38rem; margin-top: 1.2em; color: var(--muted); font-size: 1.15em; }
.sub-title { font-family: var(--display); font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1; margin-bottom: 0.6em; }
.sec-title { font-family: var(--display); font-style: italic; font-size: clamp(2.6rem, 7vw, 6rem); line-height: 0.95; }
.sec-lede { color: var(--muted); max-width: 30rem; margin: 0; }
.fine { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em; color: var(--muted); }
.fine a { color: inherit; }
.more { margin: 2.4em 0 0; font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; }
.more a { color: var(--edge); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.band { padding: var(--band) var(--gutter); }
.band-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 48px; margin-bottom: clamp(32px, 5vw, 64px); }

/* — Portada — */
.hero {
  position: relative;
  display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: auto auto 1fr;
  column-gap: 16px;
  min-height: calc(100svh - 64px);
  padding: clamp(24px, 4vw, 48px) var(--gutter) clamp(32px, 4vw, 48px);
  overflow: hidden;
}
.hero-name {
  grid-column: 1 / -1; grid-row: 1 / 3; z-index: 2;
  font-family: var(--display); font-weight: 500;
  font-size: clamp(4.2rem, 17.5vw, 19rem); line-height: 0.8; letter-spacing: -0.035em;
  mix-blend-mode: difference; color: var(--papel);
  pointer-events: none;
}
.hn-1, .hn-2 { display: block; }
.hn-2 { font-style: italic; font-weight: 400; padding-left: 30%; }
.hero-photo { grid-column: 6 / 12; grid-row: 1 / 4; z-index: 1; position: relative; aspect-ratio: 4 / 5; align-self: start; margin-top: clamp(40px, 7vw, 110px); }
.slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1.4s ease; }
.slide.is-on { opacity: 1; z-index: 1; }
.slide a, .slide img { display: block; width: 100%; height: 100%; }
.slide img { object-fit: cover; }
.slide figcaption { position: absolute; top: calc(100% + 10px); left: 0; right: 0; }
.hero-foot { grid-column: 1 / 6; grid-row: 3; align-self: end; display: grid; gap: 24px; padding-top: 48px; }
.hero-kicker { margin: 0; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--edge); }
.hero-line { margin: 0; }
.hero-line p { font-family: var(--text); font-style: italic; font-size: clamp(1.4rem, 2.6vw, 2.2rem); line-height: 1.2; margin: 0 0 0.4em; }
.hero-line cite { font-family: var(--mono); font-style: normal; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* — Retícula de series: celdas separadas por líneas finas, como un anuario — */
.cards {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0; padding: 0; list-style: none;
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.card { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.card a { display: grid; grid-template-rows: auto 1fr; height: 100%; text-decoration: none; }
/* Portada como cuadro de una tira de 35 mm: base de película, perforaciones a contraluz y edge print */
.neg { display: grid; grid-template-rows: auto 1fr auto; background: #19120f; }
.neg-frame { display: block; aspect-ratio: 4 / 5; overflow: hidden; margin: 0 10px; }
.neg-frame img { width: 100%; height: 100%; object-fit: cover; background-size: cover; transition: transform 0.8s ease; }
.card a:hover .neg-frame img { transform: scale(1.03); }
.neg-edge {
  display: flex; justify-content: space-between; height: 32px; padding: 0 14px;
  font-family: var(--mono); font-size: 0.6rem; font-weight: 500; letter-spacing: 0.16em; line-height: 1;
  color: #e0855c;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='9'%3E%3Crect x='4' width='10' height='9' rx='1.6' fill='%23ece6dc'/%3E%3C/svg%3E");
  background-repeat: repeat-x; background-size: 18px 9px;
}
.neg-top { align-items: flex-start; padding-top: 5px; background-position: 0 calc(100% - 6px); }
.neg-bot { align-items: flex-end; padding-bottom: 5px; background-position: 0 6px; }
.card-cap { display: grid; gap: 4px; padding: 16px 20px 22px; border-top: 1px solid var(--line); }
.card-n, .card-meta { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; }
.card-n { color: var(--edge); }
.card-meta { color: var(--muted); }
.card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-family: var(--display); font-size: clamp(1.4rem, 2vw, 1.9rem); line-height: 1.1; transition: color 0.3s; }
.card-year { flex: none; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; color: var(--muted); }
.card a:hover .card-title, .card a:focus-visible .card-title { color: var(--edge); }
.band-cards { padding-top: 0; }

/* — Bandas de la portada — */
.videos { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(24px, 4vw, 56px); }
.video { margin: 0; }
.yt { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; background: #000; cursor: pointer; overflow: hidden; }
.yt img { width: 100%; height: 100%; object-fit: cover; opacity: 0.82; transition: opacity 0.3s, transform 0.6s; }
.yt:hover img { opacity: 1; transform: scale(1.02); }
.yt-play { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; translate: -50% -50%; border: 1px solid var(--papel); border-radius: 50%; }
.yt-play::after { content: ''; position: absolute; left: 32px; top: 25px; border: 13px solid transparent; border-left: 20px solid var(--papel); border-right: 0; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video figcaption { display: grid; gap: 4px; margin-top: 16px; }
.video-kind { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--edge); }
.video-title { font-family: var(--display); font-style: italic; font-size: clamp(1.4rem, 2.4vw, 2rem); line-height: 1.1; }
.video-credit { color: var(--muted); font-size: 0.95em; }

.ternura-pull { position: relative; max-width: 58rem; margin: 0; font-style: italic; font-size: clamp(1.6rem, 3.6vw, 3.1rem); line-height: 1.18; }
.pull-n { display: block; font-family: var(--display); font-style: italic; font-size: 0.6em; color: var(--vino); margin-bottom: 0.3em; }

.band-sobre { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: clamp(24px, 5vw, 80px); align-items: end; }
.sobre-mini { width: 100%; max-width: 420px; }
.band-sobre .sec-lede { margin-top: 1em; }

/* — Serie — */
.serie-head { padding: clamp(48px, 8vw, 112px) var(--gutter) clamp(32px, 5vw, 64px); display: grid; gap: 20px; }
.crumb { margin: 0; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a::before { content: '← '; }
.serie-title { font-family: var(--display); font-weight: 500; font-size: clamp(3rem, 10vw, 9rem); line-height: 0.88; letter-spacing: -0.03em; }
.serie-text { max-width: 38rem; color: var(--muted); font-size: 1.12em; }
.serie-text p:last-child { margin: 0; }

.rows { display: flex; flex-wrap: wrap; gap: clamp(6px, 0.8vw, 12px); padding: 0 var(--gutter); }
.rows::after { content: ''; flex-grow: 1000; }
.ph { flex-grow: var(--r); flex-basis: calc(var(--r) * clamp(170px, 24vw, 340px)); display: block; overflow: hidden; cursor: zoom-in; }
.ph img { width: 100%; background-size: cover; transition: transform 0.6s ease, opacity 0.4s; }
.ph:hover img { transform: scale(1.015); }

.serie-next { padding: var(--band) var(--gutter); }
.serie-next a { display: grid; gap: 16px; text-decoration: none; border-top: 1px solid var(--line); padding-top: 24px; }
.next-title { font-family: var(--display); font-style: italic; font-size: clamp(2.6rem, 8vw, 7rem); line-height: 0.95; transition: color 0.3s; }
.serie-next a:hover .next-title { color: var(--edge); }

/* — Visor — */
.lb { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(8, 7, 7, 0.97); color: var(--papel); --edge: #e0855c; }
.lb::backdrop { background: rgba(0, 0, 0, 0.6); }
.lb[open] { display: grid; place-items: center; }
.lb-fig { margin: 0; display: grid; justify-items: center; gap: 14px; padding: 56px 72px 24px; }
.lb-img { max-width: 100%; max-height: calc(100dvh - 140px); width: auto; object-fit: contain; }
.lb-cap { justify-self: stretch; }
.lb-btn, .lb-close { position: absolute; background: none; border: 0; color: var(--papel); cursor: pointer; font-family: var(--mono); }
.lb-btn { top: 50%; translate: 0 -50%; font-size: 1.6rem; padding: 18px; }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
.lb-close { top: 14px; right: 20px; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; padding: 8px; }
.lb-btn:hover, .lb-close:hover { color: var(--edge); }

/* — Poesía — */
.poems { display: grid; gap: 0; }
.poem-toc { margin: 0 0 var(--band); padding: 0; list-style: none; border-top: 1px solid var(--line); }
.poem-toc li { border-bottom: 1px solid var(--line); }
.poem-toc a { display: block; padding: 14px 0; font-family: var(--display); font-style: italic; font-size: clamp(1.5rem, 3vw, 2.4rem); text-decoration: none; }
.poem-toc a:hover { color: var(--edge); }
.poem { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 24px clamp(24px, 6vw, 96px); padding: clamp(48px, 7vw, 96px) 0; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.poem > header { position: sticky; top: 96px; align-self: start; }
.poem-title { font-family: var(--display); font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1; margin-bottom: 0.5em; }
.poem-note { color: var(--muted); max-width: 22rem; }
.poem-prose { grid-column: 2; max-width: 36rem; font-style: italic; }
.poem-body { grid-column: 2; max-width: 40rem; font-size: 1.12em; line-height: 1.6; }
.stanza { margin-bottom: 1.4em; }
.ln { display: block; white-space: pre-wrap; padding-left: 2em; text-indent: -2em; }
.poem-part { margin: 2.2em 0 0.9em; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--edge); }
.poem-part:first-child { margin-top: 0; }
.poem-epi { margin: 0 0 2em; padding-left: 1.2em; border-left: 1px solid var(--line); font-style: italic; color: var(--muted); }
.poem-epi p { margin: 0 0 0.3em; }
.poem-epi cite, .epi cite { font-family: var(--mono); font-style: normal; font-size: 0.72rem; letter-spacing: 0.12em; }

/* — Ternura — */
.manifesto { padding: 0 var(--gutter) var(--band); display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 32px clamp(24px, 6vw, 96px); }
.epi { grid-column: 2; margin: 0 0 var(--band); font-style: italic; color: var(--muted); font-size: 1.1em; }
.epi p { margin: 0 0 0.5em; }
.manifesto .sub-title { grid-column: 1; position: sticky; top: 96px; align-self: start; font-style: italic; }
.manifesto-body { grid-column: 2; max-width: 38rem; font-size: 1.14em; }
.manifesto-body p:first-child::first-letter { float: left; font-family: var(--display); font-size: 4.4em; line-height: 0.82; padding: 0.06em 0.1em 0 0; color: var(--vino); }
.manifesto-close { grid-column: 1 / -1; margin: 0.6em 0 0; font-family: var(--display); font-style: italic; font-size: clamp(2.4rem, 7vw, 6.4rem); line-height: 1; letter-spacing: -0.02em; text-align: right; }
.deca { margin: 0; padding: 0; list-style: none; counter-reset: none; border-top: 1px solid var(--line); }
.deca li { display: grid; grid-template-columns: clamp(64px, 12vw, 180px) minmax(0, 1fr); gap: 16px; align-items: baseline; padding: clamp(18px, 2.6vw, 32px) 0; border-bottom: 1px solid var(--line); }
.deca-n { font-family: var(--display); font-style: italic; font-size: clamp(2rem, 4.4vw, 3.8rem); line-height: 1; }
.deca p { margin: 0; max-width: 46rem; font-size: clamp(1.15rem, 1.9vw, 1.55rem); line-height: 1.35; }
.deca-ternura .deca-n { color: var(--vino); }
.deca-poetica .deca-n { color: var(--verde); }
.p-ternura .band .page-lede { margin: -0.4em 0 2.4em; }

/* — Sobre mí — */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 80px); padding: clamp(32px, 5vw, 72px) var(--gutter) 0; align-items: start; }
.about-photo { margin: 0; position: sticky; top: 88px; }
.about-text .page-title { margin-bottom: 0.5em; }
.about-text p { max-width: 38rem; font-size: 1.1em; }
.cv { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 40px clamp(32px, 5vw, 80px); }
.cv .sub-title { grid-column: 1 / -1; }
.cv-group h3 { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--edge); margin-bottom: 12px; }
.cv-group dl { margin: 0; border-top: 1px solid var(--line); }
.cv-group dl > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cv-group dt { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); padding-top: 0.25em; }
.cv-group dd { margin: 0; }
.contact { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px clamp(32px, 6vw, 96px); border-top: 1px solid var(--line); }
.contact-links { margin: 1.6em 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-family: var(--mono); font-size: 0.85rem; }
.contact-links a { color: var(--edge); }
.form { display: grid; gap: 20px; }
.form label { display: grid; gap: 6px; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.form input, .form textarea { width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--fg); font: inherit; font-family: var(--text); font-size: 1.1rem; letter-spacing: 0; text-transform: none; border-radius: 0; }
.form input:focus, .form textarea:focus { outline: none; border-bottom-color: var(--edge); }
.form textarea { resize: vertical; }
.form button { justify-self: start; padding: 14px 28px; border: 1px solid var(--fg); background: var(--fg); color: var(--bg); font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; }
.form button:hover { background: transparent; color: var(--fg); }
.form button[disabled] { opacity: 0.6; cursor: progress; }
.form-status { margin: 0; min-height: 1.5em; }
.hp { position: absolute; left: -9999px; }

/* — Pie — */
.foot { --bg: var(--borgona); --fg: var(--papel); --muted: rgba(251, 250, 246, 0.74); --edge: #f4b896; --line: rgba(251, 250, 246, 0.22); background: var(--bg); color: var(--fg); padding: var(--band) var(--gutter) 32px; display: grid; gap: 32px; }
.foot-mark .logo { width: clamp(120px, 16vw, 220px); color: var(--papel); }
.foot-line { font-family: var(--display); font-style: italic; font-size: clamp(1.8rem, 4.4vw, 3.6rem); line-height: 1.05; max-width: 22ch; margin: 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 0; padding: 0; list-style: none; font-family: var(--mono); font-size: 0.8rem; }
.foot-links a { text-decoration: none; border-bottom: 1px solid var(--line); }
.foot-links a:hover { color: var(--edge); }
.foot-rights { margin: 0; padding-top: 24px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }

/* — Móvil — */
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav { position: fixed; inset: 61px 0 auto 0; display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 24px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .nav.is-open { display: flex; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav ul a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 0.85rem; }
  .lang { align-self: start; margin-top: 16px; }

  .hero { grid-template-columns: 1fr; grid-template-rows: auto auto auto; min-height: 0; }
  .hero-name { grid-row: 1; font-size: clamp(3.8rem, 23vw, 9rem); }
  .hero-photo { grid-column: 1; grid-row: 2; margin-top: -0.6em; width: 82%; justify-self: end; margin-bottom: 48px; }
  .hero-foot { grid-column: 1; grid-row: 3; }

  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .videos { grid-template-columns: 1fr; }
  .band-sobre, .about, .contact, .poem, .manifesto { grid-template-columns: 1fr; }
  .poem > header, .manifesto .sub-title, .about-photo { position: static; }
  .poem-prose, .poem-body, .epi, .manifesto-body { grid-column: 1; }
  .manifesto-close { text-align: left; }
  .deca li { grid-template-columns: 56px minmax(0, 1fr); }
  .lb-fig { padding: 56px 12px 16px; }
  .lb-btn { top: auto; bottom: 8px; translate: none; }
}

@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .neg-frame { aspect-ratio: 4 / 3; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
