:root {
  --bg: #0e0e0f;
  --bg-2: #161617;
  --fg: #ecebe8;
  --muted: #9a9892;
  --line: #2a2a2c;
  --accent: #e8c9a0;
  --max: 1280px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
}
body.noscroll { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #000; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* Cabecera */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(14,14,15,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { font-family: var(--serif); font-size: 1.25rem; letter-spacing: .02em; }
.brand small { font: .7rem var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-left: 10px; }
nav ul { display: flex; gap: clamp(14px, 3vw, 28px); list-style: none; margin: 0; padding: 0; font-size: .9rem; }
nav a { color: var(--muted); }
nav a:hover, nav a[aria-current] { color: var(--fg); }

/* Portada */
.hero { padding: clamp(48px, 10vw, 120px) 0 clamp(24px, 5vw, 56px); }
.hero h1 { font: 400 clamp(2.2rem, 6vw, 4.4rem)/1.05 var(--serif); margin: 0 0 18px; max-width: 14em; letter-spacing: -.01em; }
.hero p { color: var(--muted); max-width: 36em; margin: 0; font-size: 1.05rem; }
.hero .links { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-block; border: 1px solid var(--line); padding: 9px 18px; border-radius: 999px; font-size: .9rem; color: var(--fg); transition: border-color .2s, color .2s; }
.btn:hover { border-color: var(--accent); color: var(--accent); }

section { padding: clamp(32px, 6vw, 72px) 0; }
h2 { font: 400 1.6rem var(--serif); margin: 0 0 24px; }
.section-label { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }

/* Cuadrícula tipo mosaico */
.grid { list-style: none; margin: 0; padding: 0; columns: 3 280px; column-gap: 14px; }
.grid li { break-inside: avoid; margin: 0 0 14px; }
.tile { position: relative; display: block; width: 100%; padding: 0; border: 0; background: var(--bg-2); cursor: zoom-in; overflow: hidden; border-radius: 3px; }
.tile img { width: 100%; transition: transform .6s ease, opacity .3s; }
.tile:hover img { transform: scale(1.025); }
.tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 12px; font-size: .85rem; text-align: left; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); opacity: 0; transition: opacity .25s; }
.tile:hover .cap, .tile:focus-visible .cap { opacity: 1; }

/* Series */
.series { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.serie { display: block; }
.serie img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; transition: opacity .25s; }
.serie:hover img { opacity: .85; }
.serie-meta h3 { font: 400 1.25rem var(--serif); margin: 14px 0 4px; }
.serie-meta p { margin: 0 0 6px; color: var(--muted); font-size: .92rem; }
.count { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* Sobre mí */
.about { border-top: 1px solid var(--line); }
.about p { max-width: 38em; color: var(--muted); }
.page-head { padding: clamp(40px, 8vw, 90px) 0 8px; }
.page-head h1 { font: 400 clamp(2rem, 5vw, 3.4rem)/1.1 var(--serif); margin: 0 0 12px; }
.page-head p { color: var(--muted); max-width: 36em; margin: 0; }
.back { font-size: .85rem; color: var(--muted); display: inline-block; margin-bottom: 18px; }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: .85rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(8,8,9,.96); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 16px 20px; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; text-align: center; max-width: 100%; }
.lightbox img { max-height: calc(100vh - 150px); max-width: min(100%, 1600px); width: auto; margin: 0 auto; object-fit: contain; }
.lightbox figcaption { margin-top: 14px; font-size: .9rem; }
.lightbox figcaption span { display: block; color: var(--muted); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; margin-top: 2px; }
.lb-btn { position: absolute; background: none; border: 0; color: var(--fg); cursor: pointer; font-size: 2rem; line-height: 1; padding: 14px 18px; opacity: .75; }
.lb-btn:hover { opacity: 1; color: var(--accent); }
#lb-close { top: 8px; right: 8px; }
#lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
#lb-next { right: 4px; top: 50%; transform: translateY(-50%); }

@media (max-width: 600px) {
  .brand small { display: none; }
  .grid { column-gap: 8px; columns: 2 140px; }
  .grid li { margin-bottom: 8px; }
  .tile .cap { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
