:root {
  --paper: #ecebe3;
  --paper-2: #dad8cf;
  --ink: #171712;
  --muted: #5f6157;
  --lime: #c8ff1a;
  --forest: #262922;
  --line: rgba(23, 23, 18, .25);
  --sans: "Inter Tight", "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --serif: "Playfair Display", Georgia, serif;
  --label: "Manrope", system-ui, sans-serif;
  --pad: clamp(20px, 4.2vw, 61px);
  --header: 88px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header); }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }

h1, h2, h3 { font-family: var(--sans); font-weight: 500; letter-spacing: -0.045em; line-height: .98; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em; color: var(--muted); }

.label, .kicker, .card-meta, .ep-meta, .time, .stamp, .side-tag, .foot, small {
  font-family: var(--label); font-weight: 600; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
}
.label b { font-weight: 400; opacity: .5; margin-right: 14px; }
.label.light { color: #f3f1e8; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  height: var(--header);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding-inline: var(--pad);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-name { font-family: var(--sans); font-weight: 600; font-size: 19px; letter-spacing: -0.03em; line-height: 1; white-space: nowrap; transition: color .2s; }
.brand:hover .brand-name { color: var(--muted); }
.nav { display: flex; gap: 38px; font-size: 15px; font-weight: 500; }
.nav a { position: relative; }
.nav a::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 1.5px; background: var(--ink); transition: width .25s; }
.nav a:hover::after { width: 100%; }
.location { justify-self: end; font-family: var(--label); font-weight: 600; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.25fr 1fr; min-height: calc(100vh - var(--header)); }
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: 48px var(--pad) 40px; gap: 40px; }
.kicker { display: flex; align-items: center; gap: 12px; }
.kicker-line { width: 28px; height: 1px; background: var(--ink); }
.hero h1 { font-size: clamp(44px, 6.6vw, 104px); }
.hero h1 em { display: inline-block; margin-top: .04em; }
.hero-foot { display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: 640px; }
.hero-foot p { max-width: 390px; color: var(--muted); font-size: 15px; }
.circle-btn {
  flex: none; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%;
  border: 1px solid var(--ink); transition: background .2s, color .2s, transform .2s;
}
.circle-btn:hover { background: var(--ink); color: var(--paper); transform: translateY(4px); }

.hero-media { position: relative; overflow: hidden; background: #1c1a18; }
.hero-media img { position: absolute; inset: 0; object-position: 34% 60%; transition: transform 1.2s ease; }
.hero-media::after { content: ""; position: absolute; inset: auto 0 0 0; height: 32%; background: linear-gradient(to top, rgba(10,10,8,.7), transparent); pointer-events: none; }
.hero-media:hover img { transform: scale(1.03); }
.stamp { position: absolute; top: 34px; right: 34px; background: var(--lime); color: var(--ink); padding: 9px 12px; }
.hero-cap { position: absolute; z-index: 1; left: 44px; bottom: 36px; display: flex; align-items: center; gap: 14px; color: #fff; font-size: 14px; font-weight: 500; }

/* Cartel animado */
.marquee { background: var(--ink); color: var(--paper); overflow: hidden; padding: 17px 0; white-space: nowrap; }
.marquee-track { display: inline-flex; align-items: center; gap: 34px; padding-right: 34px; animation: marquee 34s linear infinite; will-change: transform; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-family: var(--label); font-weight: 600; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; }
.marquee i { width: 6px; height: 6px; background: var(--lime); transform: rotate(45deg); flex: none; }
@keyframes marquee { to { transform: translateX(-25%); } }

/* Trabajo */
.work { padding: clamp(64px, 9vw, 120px) var(--pad); }
.work-head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 24px;
  padding-bottom: 36px; border-bottom: 1px solid var(--ink);
}
.work-head h2 { font-size: clamp(44px, 5.4vw, 80px); }
.work-head .label { align-self: end; padding-bottom: 12px; }
.work-toggle {
  justify-self: end; align-self: end; display: inline-flex; align-items: center; gap: 12px;
  padding: 13px 22px; border: 1px solid var(--ink); border-radius: 999px;
  font-family: var(--label); font-weight: 600; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  transition: background .2s, color .2s;
}
.work-toggle[hidden] { display: none; }
.work-toggle svg { transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.work-toggle:hover { background: var(--ink); color: var(--paper); }
.work-toggle:hover svg { transform: translateX(4px); }
.work[data-mode="todas"] .work-toggle svg { transform: rotate(180deg); }
.work[data-mode="todas"] .work-toggle:hover svg { transform: rotate(180deg) translateX(4px); }
#workLabel, #workTitle { transition: opacity .25s ease, transform .35s ease; }
#workLabel.swap-out, #workTitle.swap-out { opacity: 0; transform: translateY(10px); }

/* Paneles: las destacadas se deslizan hacia un lado y entra la lista completa */
.panels { position: relative; overflow-x: clip; }
.panel { min-height: var(--panels-h, 0px); transition: opacity .38s ease, transform .5s cubic-bezier(.2,.7,.2,1); }
.panel[hidden] { display: none; }
#panelTodas:not([hidden]) { display: flex; flex-direction: column; }
.panel.out-left { opacity: 0; transform: translateX(-80px); }
.panel.out-right { opacity: 0; transform: translateX(80px); }
.panel.pre-left { opacity: 0; transform: translateX(-80px); transition: none; }
.panel.pre-right { opacity: 0; transform: translateX(80px); transition: none; }

/* Menú de páginas (aparece solo cuando hay más de 8 notas) */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pager[hidden] { display: none; }
.pager-top { justify-content: flex-end; padding-top: 22px; }
.pager-bottom { justify-content: center; margin-top: auto; padding-top: 40px; }
.pager a, .pager .pager-gap {
  display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 12px; border-radius: 999px;
  font-family: var(--label); font-weight: 600; font-size: 12px; letter-spacing: .08em;
}
.pager a { border: 1px solid var(--line); transition: background .2s, color .2s, border-color .2s, transform .2s; }
.pager a:hover { border-color: var(--ink); transform: translateY(-2px); }
.pager a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); pointer-events: none; }
.pager .pager-gap { color: var(--muted); }

/* Lista de todas las notas: foto chica a la izquierda y solo el título */
.all-list { list-style: none; padding-top: 8px; }
.all-item a {
  display: grid; grid-template-columns: clamp(96px, 12vw, 150px) 1fr auto; align-items: center;
  gap: clamp(18px, 3vw, 40px); padding: 22px 0; border-bottom: 1px solid var(--line);
}
/* Fila vacía: misma altura que una nota, solo con la línea */
.all-empty { display: grid; grid-template-columns: clamp(96px, 12vw, 150px) 1fr; padding: 22px 0; border-bottom: 1px solid var(--line); }
.all-empty::before { content: ""; aspect-ratio: 4 / 3; }
.all-img { position: relative; z-index: 1; aspect-ratio: 4 / 3; overflow: hidden; background: #000; transition: transform .5s cubic-bezier(.2,.7,.2,1), box-shadow .5s ease; }
.all-img img { filter: grayscale(1) contrast(1.05); transition: filter .5s ease; }
.all-title { font-family: var(--sans); font-weight: 500; font-size: clamp(22px, 3.2vw, 44px); letter-spacing: -0.045em; line-height: 1.05; transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.all-arrow { flex: none; opacity: .35; transition: transform .35s cubic-bezier(.2,.7,.2,1), opacity .25s, color .25s; }
.all-item a:hover .all-img, .all-item a:focus-visible .all-img { z-index: 2; transform: scale(1.08); box-shadow: 0 18px 36px -18px rgba(0,0,0,.55); }
.all-item a:hover .all-img img, .all-item a:focus-visible .all-img img { filter: none; }
.all-item a:hover .all-title { transform: translateX(8px); }
.all-item a:hover .all-arrow { opacity: 1; transform: translateX(8px); }
.panel:not([hidden]) .all-item { animation: rowIn .6s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 70ms + 120ms); }
@keyframes rowIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 80px clamp(40px, 5.5vw, 80px); padding-top: 48px; }
.card.offset { margin-top: 80px; }
.card a { display: block; }
.card-img { position: relative; z-index: 1; overflow: hidden; aspect-ratio: 4 / 3; background: #000; transition: transform .6s cubic-bezier(.2,.7,.2,1), box-shadow .6s ease; }
.card-img img { filter: grayscale(1) contrast(1.05); transition: filter .6s ease; }
/* Al pasar el cursor crece el recuadro completo (no hay zoom dentro de la foto) */
.card a:hover .card-img, .card a:focus-visible .card-img { z-index: 2; transform: scale(1.07); box-shadow: 0 24px 50px -22px rgba(0,0,0,.55); }
.card a:hover .card-img img, .card a:focus-visible .card-img img { filter: grayscale(0) contrast(1); }
.num {
  position: absolute; top: 18px; left: 18px; display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: 50%; background: var(--lime); font-family: var(--label); font-weight: 600; font-size: 11px;
}
.card-img figcaption, .note-img figcaption { position: absolute; right: 10px; bottom: 10px; padding: 3px 8px; border-radius: 3px; background: rgba(10,10,8,.6); font-size: 10px; color: rgba(255,255,255,.92); font-family: var(--body); }
.note-img figcaption a { text-decoration: underline; text-underline-offset: 2px; }
.card-date {
  display: block; margin-top: 14px;
  font-family: var(--label); font-weight: 600; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink);
}
.card-date::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 10px; background: var(--lime); border: 1px solid var(--ink); transform: rotate(45deg); }
.card-date + .card-meta { margin-top: 10px; }
.card-meta { display: flex; justify-content: space-between; gap: 12px; margin: 22px 0 18px; color: var(--muted); font-size: 10.5px; }
.card h3 { font-size: clamp(30px, 3.5vw, 48px); margin-bottom: 14px; }
.card p { color: var(--muted); font-size: 15px; max-width: 520px; }
.more { display: inline-flex; align-items: center; gap: 12px; margin-top: 24px; padding-bottom: 6px; border-bottom: 1px solid var(--ink); font-family: var(--label); font-weight: 600; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.more svg { transition: transform .25s; }
.card a:hover .more svg { transform: translateX(6px); }

/* Perfil */
.about { display: grid; grid-template-columns: 1fr 1fr; background: var(--forest); color: #f3f1e8; min-height: 82vh; }
.about-photo { position: relative; background: #cfcfca; overflow: hidden; }
.about-photo img { filter: grayscale(1); }
.side-tag {
  position: absolute; top: 50%; right: 0; transform: translateY(-50%); background: var(--lime); color: var(--ink);
  writing-mode: vertical-rl; padding: 18px 8px; font-size: 9px; white-space: nowrap;
}
.about-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(40px, 6vw, 100px) clamp(28px, 6vw, 120px); background: #171712; }
.quote-mark { color: var(--lime); margin: 56px 0 24px; }
blockquote { font-family: var(--serif); font-style: italic; font-size: clamp(30px, 3.6vw, 54px); line-height: 1.12; letter-spacing: -0.01em; }
.about-text { margin-top: 40px; max-width: 580px; color: #bdbbae; font-size: 14.5px; }

.education { margin-top: 64px; padding-top: 32px; border-top: 1px solid rgba(255,255,255,.18); }
.education span { display: block; margin-bottom: 12px; font-family: var(--label); font-weight: 600; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #a6a496; }
.education strong { display: block; max-width: 520px; font-family: var(--sans); font-weight: 500; font-size: clamp(24px, 2.6vw, 36px); letter-spacing: -0.03em; line-height: 1.15; }

/* Contacto */
.contact { background: var(--forest); color: #f3f1e8; padding: clamp(64px, 9vw, 120px) var(--pad) 0; }
.big { font-size: clamp(72px, 17vw, 260px); letter-spacing: -0.06em; line-height: .9; margin: 32px 0 56px; font-weight: 500; }
.sq { display: inline-block; width: .13em; height: .13em; background: var(--lime); margin-left: .04em; }
.mail { display: inline-flex; align-items: center; gap: 18px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.5); font-family: var(--label); font-weight: 600; font-size: 14px; transition: color .2s, gap .2s; }
.mail:hover { color: var(--lime); gap: 26px; }
.foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: clamp(80px, 12vw, 170px); padding: 26px 0; border-top: 1px solid rgba(255,255,255,.18); color: #a6a496; font-size: 10px; }
.foot span:last-child { justify-self: end; }
.icons { display: flex; gap: 22px; }
.icons a { color: #f3f1e8; transition: color .2s, transform .2s; }
.icons a:hover { color: var(--lime); transform: translateY(-2px); }

/* Página de nota */
.note { max-width: 760px; margin: 0 auto; padding: clamp(40px, 6vw, 72px) var(--pad) clamp(56px, 8vw, 96px); }
.back { display: inline-block; margin-bottom: 40px; font-family: var(--label); font-weight: 600; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; border-bottom: 1px solid transparent; transition: border-color .2s, transform .2s; }
.back:hover { border-color: var(--ink); transform: translateX(-4px); }
.note .label { margin-bottom: 20px; }
.note .label b { font-weight: 500; opacity: 1; color: var(--ink); background: var(--lime); padding: 3px 8px; margin-right: 10px; }
.note h1 { font-size: clamp(38px, 6.4vw, 76px); letter-spacing: -0.05em; line-height: .98; }
.dek { margin-top: 24px; font-family: var(--serif); font-style: italic; font-size: clamp(19px, 2.2vw, 25px); line-height: 1.4; color: var(--muted); }
.byline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 32px; padding: 16px 0; border-block: 1px solid var(--line); font-family: var(--label); font-weight: 600; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.note-img { margin: 40px 0 48px; position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: #000; }
.prose p { font-size: 18px; line-height: 1.78; margin-bottom: 1.3em; color: #25251f; }
.prose p:first-child::first-letter { font-family: var(--serif); font-size: 3.6em; float: left; line-height: .85; margin: .06em .1em 0 0; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose em { font-family: inherit; font-style: italic; color: inherit; letter-spacing: 0; }
.note-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--ink); }
.btn { display: inline-block; padding: 14px 26px; border-radius: 999px; border: 1.5px solid var(--ink); font-weight: 600; font-size: 15px; transition: transform .15s, background .15s, color .15s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--lime); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.next { background: var(--paper-2); }
.next a { display: block; max-width: 1120px; margin: 0 auto; padding: clamp(36px, 5vw, 64px) var(--pad); }
.next small { display: block; margin-bottom: 14px; color: var(--muted); }
.next-title { display: block; font-family: var(--sans); font-weight: 500; font-size: clamp(30px, 4.6vw, 64px); letter-spacing: -0.045em; line-height: 1; transition: transform .3s; }
.next a:hover .next-title { transform: translateX(10px); }
.next-meta { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; font-family: var(--label); font-weight: 600; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* Reveal */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }

/* Táctil: sin hover, mostrar a color */
@media (hover: none) { .card-img img, .all-img img { filter: none; } }

/* Responsive */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-media { height: clamp(460px, 78vh, 760px); order: -1; }
  .hero-copy { padding-block: 40px 56px; }
  .work-head { grid-template-columns: 1fr; align-items: start; }
  .work-head .label { padding: 0; }
  .work-toggle { justify-self: start; }
  .about { grid-template-columns: 1fr; }
  .about-photo { min-height: 420px; }
}
@media (max-width: 720px) {
  :root { --header: 120px; }
  .site-header { grid-template-columns: 1fr auto; grid-template-rows: 1fr 1fr; padding-block: 12px 4px; height: auto; min-height: 84px; }
  .nav { grid-column: 1 / -1; grid-row: 2; gap: 22px; font-size: 14px; }
  .location { display: none; }
  .grid { grid-template-columns: 1fr; gap: 56px; }
  .card.offset { margin-top: 0; }
  .all-item a { grid-template-columns: 88px 1fr auto; padding: 16px 0; }
  .all-empty { grid-template-columns: 88px 1fr; padding: 16px 0; }
  .all-title { font-size: 21px; }
  .all-arrow { width: 18px; height: 18px; }
  .foot { grid-template-columns: 1fr; gap: 14px; justify-items: start; }
  .foot span:last-child { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none !important; }
  .panel, .all-item { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* Botón para copiar el mail */
.mail-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; }
.copy-mail { padding: 9px 18px; border: 1px solid rgba(255,255,255,.4); border-radius: 999px; color: #f3f1e8; font-family: var(--label); font-weight: 600; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; transition: background .2s, color .2s, border-color .2s; }
.copy-mail:hover { background: #f3f1e8; color: var(--ink); border-color: #f3f1e8; }
.copy-mail.done { background: var(--lime); color: var(--ink); border-color: var(--lime); }
