/* ============================================================================
   Joaquin Fenoy — hoja base. Usa SOLO tokens (var(--…)) definidos en themes.css,
   de modo que las tres direcciones de diseño comparten estructura y componentes.
   ============================================================================ */

/* ---------- 1. Reset y tipografía base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: var(--body-size); line-height: var(--line-height);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, picture, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--link); text-underline-offset: .15em; overflow-wrap: anywhere; }
a:hover { color: var(--link-hover); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; margin: 0 0 .5em; text-wrap: balance; overflow-wrap: break-word; }
h1 { font-size: var(--h1-size); font-weight: var(--h1-weight); letter-spacing: var(--h1-tracking); text-transform: var(--h1-transform); line-height: 1; }
h2 { font-size: var(--h2-size); font-weight: var(--h2-weight); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); font-weight: 600; }
p { margin: 0 0 1em; overflow-wrap: anywhere; }
code { font-family: var(--font-mono); font-size: .9em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-fg); }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 200; background: var(--accent); color: var(--accent-fg); padding: .6rem 1rem; border-radius: var(--radius); text-decoration: none; font-weight: 600; }
.container { width: min(100% - 2rem, 72rem); margin-inline: auto; }
@media (min-width: 640px) { .container { width: min(100% - 4rem, 72rem); } }

.eyebrow {
  display: flex; align-items: center; gap: .6em; margin: 0 0 .9rem;
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: var(--eyebrow-tracking); text-transform: var(--eyebrow-transform);
  color: var(--fg-muted); font-weight: 500;
}
.eyebrow__num { color: var(--accent); }

/* ---------- 2. Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 44px; padding: .55rem 1.15rem;
  border-radius: var(--radius-pill); border: var(--border-w) solid var(--border-strong); background: transparent; color: var(--fg);
  font-weight: 600; font-size: .95rem; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-fg); }
.btn--small { min-height: 40px; padding: .4rem .9rem; font-size: .875rem; }
.btn-copy {
  flex: none; min-height: 36px; padding: .3rem .7rem; border-radius: var(--radius); border: var(--border-w) solid var(--border-strong);
  background: var(--surface); color: var(--fg-muted); font-family: var(--font-mono); font-size: .75rem; letter-spacing: .04em; cursor: pointer;
}
.btn-copy:hover { color: var(--accent); border-color: var(--accent); }
.btn-copy.is-done { color: var(--secondary); border-color: var(--secondary); }

/* ---------- 3. Cabecera y navegación ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; position: relative; }
.wordmark { display: inline-flex; align-items: center; gap: .6rem; color: var(--fg); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; }
.wordmark__mark { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: var(--radius); background: var(--fg); color: var(--bg); font-size: .8rem; letter-spacing: -0.05em; }
.nav ul { display: flex; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.nav a { position: relative; display: inline-block; padding: .55rem .8rem; color: var(--fg-muted); text-decoration: none; font-weight: 500; font-size: .95rem; border-radius: var(--radius); }
.nav a:hover { color: var(--fg); }
.nav a[aria-current="true"] { color: var(--fg); }
.nav a[aria-current="true"]::after { content: ""; position: absolute; left: .8rem; right: .8rem; bottom: .25rem; height: 2px; background: var(--accent); }
.nav-toggle { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; border: var(--border-w) solid var(--border); border-radius: var(--radius); background: transparent; cursor: pointer; }
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; display: none; padding: .75rem 0 1rem; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; }
  .nav a { display: block; padding: .8rem 1rem; font-size: 1.05rem; }
  .nav a[aria-current="true"]::after { left: 0; right: auto; top: .9rem; bottom: .9rem; width: 3px; height: auto; }
}

/* ---------- 4. Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--hero-bg); color: var(--hero-fg); padding-block: clamp(3.5rem, 9vw, 7.5rem) clamp(4rem, 9vw, 8rem); }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.hero__title { margin: 0; color: var(--hero-fg); }
.hero__tagline { font-size: clamp(1.15rem, 2vw, 1.5rem); color: var(--hero-muted); max-width: 32ch; margin: 1.25rem 0 2.25rem; text-wrap: pretty; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero .btn--ghost { border-color: var(--border-strong); color: var(--hero-fg); }
.hero .btn--ghost:hover { border-color: var(--hero-accent, var(--accent)); color: var(--hero-accent, var(--accent)); }
.hero__art { position: relative; margin: 0; justify-self: center; width: min(100%, 440px); }
.hero__frame { position: relative; aspect-ratio: 1 / 1; overflow: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow); background: var(--surface); }
.hero__frame picture, .hero__frame img { width: 100%; height: 100%; }
.hero__frame img { object-fit: cover; object-position: var(--focus, 50% 50%); }
.hero__slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.hero__slide.is-active { opacity: 1; }
.hero__art--portrait img { width: 100%; }
.hero__art figcaption { margin-top: .9rem; font-size: .85rem; color: var(--hero-muted); }
.hero__art--portrait, .hero__seal { display: none; }
@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { width: min(100%, 360px); justify-self: start; }
}

/* ---------- 5. Secciones ---------- */
.section { padding-block: var(--section-pad); border-top: 1px solid var(--border); }
.section__head { margin-bottom: clamp(2rem, 4vw, 3.5rem); max-width: 60ch; }
.section__head h2 { margin-bottom: 0; }
.section__head--row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; max-width: none; }

/* ---------- 6. Bloques de la bio (artículo EN y Crypto vivencias ES, seguidos) ---------- */
.eyebrow--section { margin-bottom: 1.5rem; }
.kicker { margin: 0 0 .5rem; font-family: var(--font-display); font-size: 1.1rem; font-weight: 500; color: var(--fg-muted); }
.prose { max-width: var(--measure); margin-top: 1.5rem; }
.prose > p:first-child { font-weight: 600; }
.bio-block--second { margin-top: clamp(3.5rem, 7vw, 5.5rem); padding-top: clamp(2.5rem, 5vw, 3.5rem); border-top: 1px dashed var(--border-strong); }

/* ---------- 7. Timeline (hitos derivados del año con que empieza cada párrafo; el texto no se toca) ---------- */
.timeline { position: relative; max-width: var(--measure); padding-left: 4.5rem; }
.timeline::before { content: ""; position: absolute; left: 1.05rem; top: .6rem; bottom: .6rem; width: 1px; background: var(--border-strong); }
.tl__item { position: relative; margin-bottom: .25rem; }
.tl__item--year { margin-top: 1.25rem; }
.tl__item--year::before { content: ""; position: absolute; left: -3.75rem; top: .5em; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg); }
.tl__year { position: absolute; left: -4.5rem; top: -1.35rem; font-family: var(--font-mono); font-size: .8rem; font-weight: 600; color: var(--accent); letter-spacing: .04em; }
@media (max-width: 640px) {
  .timeline { padding-left: 2rem; }
  .timeline::before { left: .25rem; }
  .tl__item--year::before { left: -2.05rem; }
  .tl__year { left: -2rem; top: -1.4rem; }
}
.article-en__head { max-width: var(--measure); margin-bottom: 1.5rem; }
.article-en__title { font-size: clamp(1.6rem, 3vw, 2.2rem); }

/* ---------- 8. Certificación y hashes ---------- */
.cert { max-width: var(--measure); margin: 1.5rem 0 2rem; padding: 1.25rem 1.4rem; background: var(--surface); border: var(--border-w) dashed var(--border-strong); border-radius: var(--radius-lg); }
.cert > :last-child { margin-bottom: 0; }
.cert__label { display: inline-flex; align-items: center; gap: .45rem; margin: 0 0 .9rem; font-family: var(--font-mono); font-size: .74rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--secondary); }
.hash { display: flex; align-items: flex-start; gap: .6rem; flex-wrap: wrap; margin: 0 0 .75rem; }
.hash__code { flex: 1 1 24ch; padding: .5rem .7rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); font-size: .8rem; line-height: 1.55; overflow-wrap: anywhere; }
.p-url a, .ep__link { font-family: var(--font-mono); font-size: .82rem; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; gap: .4rem; margin: 0 0 .9rem; padding: .25rem .6rem; border: 1px solid var(--secondary); border-radius: var(--radius-pill); color: var(--secondary); font-family: var(--font-mono); font-size: .66rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }

/* ---------- 9. Podcast ---------- */
.episodes { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.ep { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 1.4rem; padding: 1.4rem; background: var(--surface); border: var(--border-w) var(--border-style) var(--border); border-radius: var(--radius-lg); transition: border-color .15s ease; }
.ep__cover img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
.ep__body { min-width: 0; }
.ep__meta { display: flex; gap: 1rem; margin: 0 0 .4rem; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); }
.ep__title { display: flex; flex-direction: column; gap: .2rem; margin: 0 0 .8rem; }
.ep__title-line { display: block; }
.ep__title-line:not(:last-child) { font-family: var(--font-mono); font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.ep__body > p:last-child { margin-bottom: 0; }
.ep__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.1rem; margin: .4rem 0 .5rem; }
.ep__player { margin-top: .75rem; }
.ep__player iframe { width: 100%; height: 200px; border: 0; border-radius: var(--radius); background: var(--surface-2); }
@media (max-width: 700px) {
  .ep { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 1.1rem; }
  .ep__cover { width: 120px; }
}
.section__head--second { margin-top: clamp(3.5rem, 7vw, 5.5rem); }
.videos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1.5rem 1.25rem; }
.yt { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-lg); overflow: hidden; border: var(--border-w) solid var(--border); }
.yt__btn { all: unset; display: block; width: 100%; height: 100%; position: relative; cursor: pointer; }
.yt__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.yt__btn img { width: 100%; height: 100%; object-fit: cover; opacity: .92; transition: transform .3s ease, opacity .3s ease; }
.yt__btn:hover img { transform: scale(1.03); opacity: 1; }
.yt__play { position: absolute; inset: 0; display: grid; place-items: center; }
.yt__play svg { width: 68px; height: 48px; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .55)); }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__title { margin: .75rem 0 .2rem; font-weight: 600; font-size: .95rem; line-height: 1.35; }
.video__link { font-size: .85rem; }

/* ---------- 10. Galería ---------- */
.artworks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 1.5rem; }
.art { display: flex; flex-direction: column; background: var(--surface); border: var(--border-w) var(--border-style) var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: border-color .15s ease; }
.art__zoom { all: unset; display: block; width: 100%; cursor: zoom-in; }
.art__zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.art__zoom img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .35s ease; }
.art__zoom:hover img { transform: scale(1.03); }
.art__body { padding: 1.25rem 1.25rem 1.4rem; display: flex; flex-direction: column; align-items: flex-start; }
.art__body > p, .art__body > .hash { width: 100%; }
.art__body p { font-size: .92rem; }
.art__title { margin-bottom: .6rem; font-size: 1.15rem; }
.art__body .btn { margin-top: auto; }
.gallery__closing { margin: 2rem 0 0; color: var(--fg-muted); font-style: italic; }

/* ---------- 11. Contacto y pie ---------- */
.section--contact { text-align: center; }
.contact__inner .section__head { margin-inline: auto; text-align: center; }
.contact__inner .eyebrow { justify-content: center; }
.contact__line { font-size: clamp(1.15rem, 2.2vw, 1.5rem); margin-bottom: 1.75rem; }
.contact__links { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; }
.site-footer { border-top: 1px solid var(--border); padding-block: 1.75rem; color: var(--fg-muted); font-size: .9rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem 2rem; }
.site-footer__copy { margin: 0; }

/* ---------- 12. Lightbox ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(92vw, 1000px); max-height: 92vh; }
.lightbox::backdrop { background: rgba(5, 8, 12, .86); backdrop-filter: blur(6px); }
.lightbox__fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.lightbox__fig img { max-height: 82vh; width: auto; border-radius: var(--radius-lg); }
.lightbox__fig figcaption { color: #EEE9DF; font-size: .95rem; }
.lightbox__close { position: fixed; top: 1rem; right: 1rem; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; cursor: pointer; }

/* ---------- 14. Movimiento reducido e impresión ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .hero__cta, .btn, .btn-copy, .yt__play, .site-footer__top { display: none !important; }
  body { background: #fff; color: #000; }
}
