/* =============================================================
   Trayectoria — Archetype: Brutalist Grid
   Blanco/negro, sin sombras, sin bordes redondeados, líneas de
   1px como única decoración (técnica: gap 1px + fondo negro).
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #ffffff;
  --ink: #000000;
  --mute: #4a4a4a;
  --accent: #ff2b2b;
  --accent2: #1a4bff;
  --line: 1px;

  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --container: 1320px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 3px solid var(--accent2); outline-offset: 2px; }

h1, h2, h3 { text-transform: uppercase; line-height: 1.05; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.4vw, 3.6rem); font-weight: 800; }
h1 em, h2 em { font-style: normal; color: var(--accent); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; margin-block: 0.3em 0.5em; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { max-width: 62ch; }

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: var(--bg);
  z-index: 9999; font-weight: 700;
}
.skip-link:focus { top: 1rem; }

.n { color: var(--accent); font-weight: 700; letter-spacing: 0.04em; }
.accent { color: var(--accent); }
.accent2 { color: var(--accent2); }

/* =============================================================
   3. Grid engine
   The 1px "lines" are the grid's own background peeking through
   a 1px gap between cells — no borders, no shadows, no radius.
   ============================================================= */
.grid12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--line);
  background: var(--ink);
  border-top: var(--line) solid var(--ink);
  border-bottom: var(--line) solid var(--ink);
  margin-top: -1px; /* collapse consecutive section borders into one line */
}
.cell { background: var(--bg); padding: clamp(1.4rem, 2.4vw, 2.4rem); grid-column: span 12; }

@media (min-width: 861px) {
  .hero-lead   { grid-column: 1 / 8; }
  .hero-side   { grid-column: 1 / 8; }
  .hero-photo  { grid-column: 8 / 13; grid-row: 1 / 3; }
  .hero-scroll { grid-column: 1 / 13; }

  .about-text  { grid-column: 1 / 8; }
  .about-photo { grid-column: 8 / 13; }

  .timeline-wrap { grid-column: 1 / 9; }
  .tl-photo      { grid-column: 9 / 13; }
  .grid12:not(:has(.tl-photo)) .timeline-wrap { grid-column: 1 / 13; }
}

.section-head { grid-column: 1 / 13; }
.section-head p { color: var(--mute); margin-top: 0.6rem; max-width: 70ch; }
.section-head--inv { background: var(--ink); color: var(--bg); }
.section-head--inv .n { color: var(--accent); }

/* Nested sub-grids (stats-like layout inside a full-width cell) */
.cats, .edu-groups, .articles, .contact-cards {
  grid-column: 1 / 13;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--line);
  background: var(--ink);
}
.cat-cell, .edu-group, .article-cell, .contact-cell {
  background: var(--bg);
  padding: clamp(1.2rem, 2vw, 1.8rem);
}
.article-links, .collab-list, .press-quotes { grid-column: 1 / 13; }

/* =============================================================
   4. Splash
   ============================================================= */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink);
  transition: opacity .4s, visibility .4s;
}
.splash-mark { font-size: 2rem; font-weight: 800; color: var(--bg); letter-spacing: 0.08em; }
.splash.is-out { opacity: 0; visibility: hidden; pointer-events: none; }

/* =============================================================
   5. Nav
   ============================================================= */
.nav { position: sticky; top: 0; z-index: 500; background: var(--bg); border-bottom: var(--line) solid var(--ink); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 1rem clamp(1rem, 3vw, 2rem); }
.nav-brand { font-weight: 800; font-size: 1.1rem; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-link { font-size: 0.85rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.nav-link:hover { color: var(--accent); }
.nav-link--cta { background: var(--ink); color: var(--bg); padding: 0.5rem 1rem; }
.nav-link--cta:hover { background: var(--accent); color: var(--bg); }
.nav-burger { display: none; flex-direction: column; gap: 4px; padding: 0.5rem; }
.nav-burger span { width: 20px; height: 2px; background: var(--ink); }
.nav-mobile {
  display: none; flex-direction: column; border-top: var(--line) solid var(--ink);
}
.nav-mobile[data-open="true"] { display: flex; }
.nav-mobile-link { padding: 0.9rem clamp(1rem, 3vw, 2rem); border-bottom: var(--line) solid var(--ink); font-weight: 600; text-transform: uppercase; font-size: 0.85rem; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
}

/* =============================================================
   6. Hero
   ============================================================= */
.hero-lead h1 { margin-top: 0.4rem; }
.hero-side p { color: var(--mute); margin-bottom: 0.8rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1rem; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.15) contrast(1.05); min-height: 260px; }
.hero-scroll { display: block; font-weight: 700; text-transform: uppercase; font-size: 0.85rem; }
.hero-scroll:hover { color: var(--accent); }

.btn {
  display: inline-block; padding: 0.85rem 1.5rem;
  background: var(--ink); color: var(--bg);
  font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em;
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--accent); }
.btn-outline { background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--bg); box-shadow: none; }

/* =============================================================
   7. Stats
   ============================================================= */
.stats { grid-column: 1 / 13; }
.stat-cell { grid-column: span 12; }
@media (min-width: 640px) { .stat-cell { grid-column: span 4; } }
.stat-cell b { display: block; font-size: clamp(2.4rem, 5vw, 3.4rem); font-weight: 800; }
.stat-note { display: block; color: var(--mute); font-size: 0.82rem; margin-top: 0.3rem; }

/* =============================================================
   8. About / timeline / talks / education / articles / press / collab
   ============================================================= */
.about-text p { color: var(--mute); margin-bottom: 1rem; }
.lede-box { border: var(--line) solid var(--ink); padding: 1.2rem; font-weight: 600; color: var(--ink) !important; margin-top: 1.2rem; }
.about-photo img { width: 100%; filter: grayscale(0.15) contrast(1.05); }

.tl-item { display: grid; grid-template-columns: 1fr; gap: 0.4rem; padding-block: 1.2rem; border-bottom: var(--line) dashed var(--mute); }
.tl-item:last-child { border-bottom: none; }
.tl-item--current .tl-year { color: var(--accent); }
@media (min-width: 640px) { .tl-item { grid-template-columns: 220px 1fr; gap: 1.4rem; } }
.tl-year { font-weight: 700; }
.tl-body p { color: var(--mute); margin-top: 0.4rem; }
.tl-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
.tl-tags li { font-size: 0.78rem; padding: 0.3rem 0.7rem; border: var(--line) solid var(--ink); }
.tl-photo img { width: 100%; filter: grayscale(0.15) contrast(1.05); }

.cat-cell b { display: block; margin: 0.5rem 0 0.8rem; }
.cat-examples li { font-size: 0.85rem; color: var(--mute); padding-block: 0.4rem; border-top: var(--line) dashed #ccc; }
.cat-examples li:first-child { border-top: none; }

.edu-group b { display: block; margin-bottom: 0.8rem; text-transform: uppercase; font-size: 0.9rem; }
.edu-list li { display: grid; grid-template-columns: 100px 1fr; gap: 0.8rem; padding-block: 0.7rem; border-top: var(--line) dashed #ccc; font-size: 0.88rem; }
.edu-list li:first-child { border-top: none; }
.edu-period { color: var(--mute); font-weight: 600; }

.article-cell p { color: var(--mute); font-size: 0.88rem; margin-top: 0.5rem; }
.article-links { display: flex; flex-wrap: wrap; gap: 1.6rem; }
.link-arrow { font-weight: 700; text-transform: uppercase; font-size: 0.85rem; }
.link-arrow:hover { color: var(--accent); }

.press-quotes blockquote { font-size: clamp(1.1rem, 2.2vw, 1.5rem); font-weight: 600; margin-bottom: 1rem; max-width: 70ch; }
.press-source { color: var(--mute); font-size: 0.85rem; }

.collab-list { font-size: 0.95rem; line-height: 2.2; }
.collab-list .sep { color: var(--accent); margin-inline: 0.5rem; }

/* =============================================================
   9. Contact
   ============================================================= */
.contact-cell b { display: block; margin-bottom: 0.5rem; }
.contact-cell p { color: var(--mute); font-size: 0.88rem; margin-bottom: 0.6rem; }
.contact-cell:hover { background: #f5f5f5; }
.contact-direct { display: flex; flex-wrap: wrap; gap: 1rem; }

/* =============================================================
   10. Footer
   ============================================================= */
.footer {
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; align-items: center; justify-content: space-between;
  padding: 1.4rem clamp(1rem, 3vw, 2rem);
  font-size: 0.8rem; color: var(--mute);
}
.footer a { font-weight: 700; color: var(--ink); }
.footer a:hover { color: var(--accent); }
.footer a.trayectoria-credit { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 400; color: var(--mute); opacity: 0.85; transition: opacity .2s, color .2s; }
.footer a.trayectoria-credit:hover { opacity: 1; color: var(--ink); }
.trayectoria-credit img { display: block; border-radius: 2px; }

/* =============================================================
   11. Reveal on scroll — instant snap, no easing (fits the raw aesthetic)
   ============================================================= */
[data-reveal] { opacity: 0; transition: opacity .25s linear; }
[data-reveal].is-revealed { opacity: 1; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transition: none; } }
