/* =============================================================
   José María Santos Figueroa — portfolio de trayectoria
   Archetype: Editorial Dark Green & Cobalt
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #0c1512;
  --bg-2: #142019;
  --bg-3: #1a2921;
  --cream: #eef2ee;
  --text: #eef2ee;
  --text-mute: #a6b3ac;
  --text-faint: #74847b;
  --accent: #56707c;
  --accent-2: #8fa3ad;
  --line: rgba(238, 242, 238, 0.14);
  --line-strong: rgba(238, 242, 238, 0.28);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:   cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --container: 1180px;
  --gutter: 1.25rem;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
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; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.05; letter-spacing: -0.02em; font-family: var(--serif); font-weight: 500; }
ul { list-style: none; padding: 0; }
::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

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

.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 0.9rem;
}

/* =============================================================
   4. Typography
   ============================================================= */
h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); margin-bottom: 1.4rem; }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); margin-bottom: 0.5rem; }
.section-lede { color: var(--text-mute); max-width: 62ch; font-size: 1.05rem; margin-bottom: 2.4rem; }

/* =============================================================
   5. Components
   ============================================================= */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.9rem 1.7rem;
  border-radius: 999px;
  font-weight: 600; font-size: 0.95rem;
  transition: transform .45s var(--ease-soft), box-shadow .45s var(--ease-soft), background .35s, color .35s;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 4px 14px rgba(86, 112, 124, 0.25), 0 1px 3px rgba(0,0,0,0.2);
}
.btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 50px rgba(86, 112, 124, 0.3), 0 10px 22px rgba(0,0,0,0.3);
}
.btn-primary:active { transform: translateY(-1px); transition-duration: .12s; }
.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent-2); color: var(--accent-2); transform: translateY(-2px); }

.link-arrow {
  display: inline-block; margin-top: 1.6rem;
  color: var(--accent-2); font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color .35s var(--ease-out);
}
.link-arrow:hover { border-color: var(--accent-2); }

/* Cards with tilt */
.has-tilt {
  --rx: 0deg; --ry: 0deg;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .55s var(--ease-soft), border-color .35s, box-shadow .35s;
}
.has-tilt:hover { transition-duration: .15s; }

/* =============================================================
   6. Sections
   ============================================================= */

/* --- Splash --- */
.splash {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--bg);
  display: grid; place-items: center;
  pointer-events: auto;
  transition: opacity .8s, clip-path 1s;
  animation: splashSafety .01s 3.5s forwards;
}
.splash.is-out { opacity: 0; pointer-events: none; clip-path: inset(0 0 100% 0); }
@keyframes splashSafety { to { opacity: 0; pointer-events: none; clip-path: inset(0 0 100% 0); } }
.splash-mark {
  font-family: var(--serif); font-size: 1.6rem; letter-spacing: 0.3em;
  color: var(--accent-2);
}

/* --- Nav --- */
.nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 100;
  transition: background-color .4s var(--ease-out), backdrop-filter .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(12, 21, 18, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 1.1rem;
}
.nav-brand { font-family: var(--serif); font-weight: 600; letter-spacing: 0.1em; font-size: 1.05rem; }
.nav-links { display: none; align-items: center; gap: 2rem; }
@media (min-width: 720px) { .nav-links { display: flex; } }
.nav-link {
  position: relative; padding: 0.25rem 0;
  font-size: 0.92rem; color: var(--text-mute);
  transition: color .3s;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 1px; background: var(--accent-2);
  transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease-out);
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-link--cta { color: var(--accent-2); font-weight: 600; }

.nav-burger {
  display: flex; flex-direction: column; gap: 5px; padding: 0.5rem;
}
@media (min-width: 720px) { .nav-burger { display: none; } }
.nav-burger span { width: 22px; height: 1.5px; background: var(--cream); transition: transform .3s, opacity .3s; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-mobile {
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg); color: var(--cream);
  display: grid; place-items: center; gap: 1.6rem;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .6s var(--ease-soft);
}
.nav-mobile[data-open="true"] { clip-path: inset(0); }
.nav-mobile-link { font-family: var(--serif); font-size: 1.6rem; }
@media (min-width: 720px) { .nav-mobile { display: none; } }

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: flex-end;
  overflow: clip;
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; }
.hero-bg img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%;
  transform: scale(1.06);
}
.hero-bg img.ambient-on { animation: ambientZoom 30s ease-in-out infinite; }
@keyframes ambientZoom {
  0%, 100% { transform: scale(1.06) translate3d(0,0,0); }
  50% { transform: scale(1.13) translate3d(-1%, -1%, 0); }
}
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(12,21,18,0.35) 0%, rgba(12,21,18,0.55) 45%, rgba(12,21,18,0.96) 92%),
    linear-gradient(90deg, rgba(12,21,18,0.55) 0%, rgba(12,21,18,0.05) 55%);
}
.hero-content { position: relative; padding-block: 8rem 4.5rem; max-width: 46rem; }
.hero-title {
  font-size: clamp(2.4rem, 6.6vw, 4.6rem);
  margin-bottom: 1.1rem;
  max-width: 16ch;
}
.hero-tagline {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--cream);
  max-width: 34ch;
  margin-bottom: 0.9rem;
}
.hero-roles {
  color: var(--text-mute);
  font-size: 0.92rem;
  margin-bottom: 2.2rem;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; }

.hero-scroll-cue {
  position: absolute; bottom: 1.6rem; left: 50%; transform: translateX(-50%);
  display: none;
}
@media (min-width: 720px) { .hero-scroll-cue { display: block; } }
.hero-scroll-cue span {
  display: block; width: 1px; height: 42px;
  background: linear-gradient(180deg, var(--accent-2), transparent);
  animation: scrollCue 2.2s ease-in-out infinite;
}
@keyframes scrollCue { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }

/* Split words */
.split-word { display: inline-block; }

/* --- Stats band --- */
.stats-band { background: var(--bg-2); border-block: 1px solid var(--line); padding-block: 3.4rem; }
.stats-grid {
  display: grid; gap: 2.2rem;
}
@media (min-width: 720px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
.stat { text-align: left; }
.stat-num {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  color: var(--accent-2);
  line-height: 1;
  margin-bottom: 0.6rem;
}
.stat-label { font-size: 1rem; color: var(--cream); margin-bottom: 0.2rem; }
.stat-note { font-size: 0.85rem; color: var(--text-faint); }

/* --- Story --- */
.story { padding-block: 6.5rem; }
.story-grid { display: grid; gap: 3rem; }
@media (min-width: 960px) {
  .story-grid { grid-template-columns: 0.85fr 1.15fr; gap: 4.5rem; align-items: start; }
}
.story-figure {
  border-radius: 18px; overflow: clip;
  border: 1px solid var(--line);
}
.story-figure img { width: 100%; object-fit: cover; aspect-ratio: 4/5; }
.story-text p { color: var(--text-mute); margin-bottom: 1.3rem; max-width: 62ch; }
.story-lede { color: var(--cream) !important; font-size: 1.1rem; }
.story-personal {
  font-family: var(--serif); font-style: italic; font-size: 1.15rem;
  color: var(--accent-2) !important; margin-top: 1.8rem;
}

/* --- Timeline --- */
.timeline-section { padding-block: 6.5rem; background: var(--bg-2); border-block: 1px solid var(--line); position: relative; }
.timeline { position: relative; margin-top: 3rem; padding-left: 1.6rem; border-left: 1px solid var(--line-strong); }
@media (min-width: 720px) { .timeline { padding-left: 2.4rem; } }
.tl-item { position: relative; padding-bottom: 2.6rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -1.68rem; top: 0.35rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px var(--bg-2), 0 0 0 5px var(--line-strong);
}
@media (min-width: 720px) { .tl-item::before { left: -2.48rem; } }
.tl-year {
  font-family: var(--serif); color: var(--accent-2);
  font-size: 1rem; font-weight: 600; margin-bottom: 0.35rem;
}
.tl-body h3 { font-size: 1.15rem; margin-bottom: 0.3rem; }
.tl-body p { color: var(--text-mute); max-width: 56ch; font-size: 0.96rem; }

.timeline-side-photo {
  display: none;
}
@media (min-width: 1280px) {
  .timeline-side-photo {
    display: block;
    position: absolute; top: 8rem; right: calc((100vw - var(--container)) / 2 - 2rem);
    width: 220px; border-radius: 16px; overflow: clip; border: 1px solid var(--line);
    box-shadow: 0 30px 60px rgba(0,0,0,0.35);
  }
  .timeline-side-photo img { aspect-ratio: 4/5; object-fit: cover; }
}

/* --- Talks: infografía por categorías --- */
.talks-section { padding-block: 6.5rem; }
.talk-categories { display: grid; gap: 1.4rem; margin-top: 2.8rem; }
@media (min-width: 720px) { .talk-categories { grid-template-columns: repeat(2, 1fr); } }
.talk-category {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2rem;
  transition: border-color .35s;
}
.talk-category:hover { border-color: var(--accent-2); }
.talk-cat-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.talk-cat-icon {
  width: 46px; height: 46px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--accent-2);
}
.talk-cat-icon svg { width: 24px; height: 24px; }
.talk-cat-count {
  font-family: var(--serif); font-weight: 500;
  font-size: 2rem; line-height: 1;
  color: var(--accent-2);
}
.talk-category h3 { font-size: 1.2rem; margin-bottom: 1.1rem; max-width: 26ch; }
.talk-cat-examples { display: flex; flex-direction: column; gap: 0.7rem; border-top: 1px solid var(--line); padding-top: 1.1rem; }
.talk-cat-examples li { color: var(--text-mute); font-size: 0.9rem; line-height: 1.5; }
.talk-cat-examples strong { color: var(--cream); font-weight: 600; }

/* --- Articles --- */
.articles-section { padding-block: 6.5rem; background: var(--bg-2); border-block: 1px solid var(--line); }
.articles-grid { display: grid; gap: 1.4rem; margin-top: 2.6rem; }
@media (min-width: 720px) { .articles-grid { grid-template-columns: repeat(3, 1fr); } }
.article-card {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.8rem;
}
.article-card:hover { border-color: var(--accent-2); }
.article-card p { color: var(--text-mute); font-size: 0.95rem; }
.link-arrow--substack { margin-left: 1.8rem; }
@media (max-width: 480px) { .link-arrow--substack { display: block; margin-left: 0; } }

/* --- Press --- */
.press-section { padding-block: 6.5rem; }
.press-text { max-width: 62rem; }
.press-quote {
  border-left: 2px solid var(--accent-2);
  padding-left: 1.4rem;
  margin: 1.6rem 0;
}
.press-quote p {
  font-family: var(--serif); font-style: italic;
  font-size: 1.2rem; color: var(--cream);
}
.press-source { color: var(--text-faint); font-size: 0.88rem; margin-top: 1.2rem; }

/* --- Collaborations marquee --- */
.collab-section { padding-block: 4rem 4.5rem; }
.collab-section .container { margin-bottom: 0.5rem; }
.marquee { overflow: hidden; position: relative; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-block: 1.3rem; }
.marquee::before, .marquee::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 90px; z-index: 2; pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.marquee::after { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }
.marquee-row {
  display: flex; width: max-content; will-change: transform;
  animation: marqueeScroll 38s linear infinite;
}
.marquee-track {
  display: inline-flex; gap: 1.4rem; white-space: nowrap; padding-right: 1.4rem;
  font-family: var(--serif); font-size: 1.15rem; color: var(--text-mute);
}
.marquee-track span:nth-child(odd) { color: var(--accent-2); }
@keyframes marqueeScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* --- Contact --- */
.contact-section { position: relative; padding-block: 7rem; overflow: clip; isolation: isolate; }
.contact-bg { position: absolute; inset: 0; z-index: -1; }
.contact-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.contact-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,21,18,0.9), rgba(12,21,18,0.97) 60%); }
.contact-content { max-width: 52rem; }
.contact-grid { display: grid; gap: 1.2rem; margin-top: 2.6rem; margin-bottom: 2.6rem; }
@media (min-width: 720px) { .contact-grid { grid-template-columns: repeat(3, 1fr); } }
.contact-card {
  display: block;
  background: rgba(26, 41, 33, 0.75);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.7rem;
  transition: border-color .35s, transform .45s var(--ease-soft);
}
.contact-card:hover { border-color: var(--accent-2); transform: translateY(-4px); }
.contact-card p { color: var(--text-mute); font-size: 0.92rem; margin-bottom: 1rem; }
.contact-card-cta { color: var(--accent-2); font-weight: 600; font-size: 0.9rem; }
.contact-direct { display: flex; flex-wrap: wrap; gap: 1rem; }

/* --- Footer --- */
.footer { padding-block: 2.4rem; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.footer p { color: var(--text-faint); font-size: 0.85rem; }
.footer-note { color: var(--text-faint); font-size: 0.85rem; }
.footer-top { color: var(--text-mute); font-size: 0.85rem; transition: color .3s; }
.footer-top:hover { color: var(--accent-2); }

/* =============================================================
   7. Effects (reveal / reduced-motion aware)
   ============================================================= */
/* Hidden only when JS is actually running (html.no-js removed by the tiny
   inline script right after <body>). No JS → everything stays visible. */
html:not(.no-js) [data-reveal] {
  opacity: 0; transform: translateY(36px);
  transition: opacity .8s var(--ease-soft), transform .8s var(--ease-soft);
}
html:not(.no-js) [data-reveal].is-revealed { opacity: 1; transform: none; }

/* =============================================================
   8. Responsive already inlined per component above
   ============================================================= */

/* =============================================================
   9. Reduced-motion — only the truly intrusive
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero-bg img.ambient-on { animation: none; }
  .hero-scroll-cue span { animation: none; }
  /* Marquee stays — it's a slow functional loop, not an intrusive one */
  /* Do NOT disable: tilt, hover, fades, count-up */
}
