/* ============================================================
   adrian.parragalara.org — refined minimal editorial
   Instrument Serif (display) · Instrument Sans (body) · Spline Sans Mono (meta)
   ============================================================ */

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/InstrumentSerif-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/InstrumentSerif-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Spline Sans Mono";
  src: url("fonts/SplineSansMono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Spline Sans Mono";
  src: url("fonts/SplineSansMono-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ---------- tokens ---------- */

:root {
  --bg: #f6f7f4;
  --bg-raised: #eef0ec;
  --ink: #14171a;
  --ink-soft: #5b6763;
  --hairline: rgba(20, 23, 26, 0.14);
  --hairline-strong: rgba(20, 23, 26, 0.34);
  --accent: #0b6e4f;
  --accent-ink: #ffffff;
  --grain-opacity: 0.04;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", "Avenir Next", "Segoe UI", sans-serif;
  --mono: "Spline Sans Mono", "SFMono-Regular", Menlo, monospace;

  --w: min(1120px, calc(100vw - clamp(2.5rem, 8vw, 8rem)));
}

:root[data-theme="dark"] {
  --bg: #0e1512;
  --bg-raised: #14201b;
  --ink: #e8ede9;
  --ink-soft: #8ea097;
  --hairline: rgba(232, 237, 233, 0.15);
  --hairline-strong: rgba(232, 237, 233, 0.40);
  --accent: #4cc38a;
  --accent-ink: #0e1512;
  --grain-opacity: 0.06;
}

/* ---------- base ---------- */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.1875rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
  overflow-x: clip;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; }

em { font-family: var(--serif); font-style: italic; font-size: 1.06em; }

/* film-grain overlay */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: 999;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- top bar ---------- */

.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; gap: 2rem;
  width: 100%;
  padding: 1.1rem clamp(1.25rem, 4vw, 4rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}

.monogram {
  font-family: var(--serif);
  font-size: 1.35rem;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.monogram-dot { color: var(--accent); }

.topnav {
  margin-left: auto;
  display: flex; gap: clamp(1rem, 3vw, 2.25rem);
}
.topnav a {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
.topnav a:hover { color: var(--accent); }

/* theme toggle */
.theme-toggle {
  background: none; border: none; cursor: pointer; padding: 0.25rem;
}
.theme-toggle-track {
  display: block; width: 38px; height: 20px;
  border: 1px solid var(--hairline-strong);
  border-radius: 20px;
  position: relative;
  transition: border-color 0.2s ease;
}
.theme-toggle-thumb {
  position: absolute; top: 3px; left: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ink);
  transition: transform 0.3s cubic-bezier(0.5, 0, 0.2, 1.4), background-color 0.35s ease;
}
:root[data-theme="dark"] .theme-toggle-thumb { transform: translateX(17px); }
.theme-toggle:hover .theme-toggle-track { border-color: var(--accent); }

/* ---------- interactive cv ---------- */

.cvbot {
  width: var(--w);
  margin: 0 auto;
  padding-top: clamp(5rem, 11vh, 7rem);
}
.cvbot-inner {
  border: 1px solid var(--hairline-strong);
  background: var(--bg-raised);
  padding: clamp(1.25rem, 3vw, 1.9rem);
  max-width: 46rem;
}
.cvbot-intro {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  margin-bottom: 1.1rem;
}
.cvbot-badge {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
}
.cvbot-hint {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink-soft);
  flex: 1 1 16rem;
}
.cvbot-form {
  display: flex;
  gap: 0.6rem;
}
.cvbot-input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--hairline-strong);
  padding: 0.7rem 0.85rem;
  transition: border-color 0.2s ease;
}
.cvbot-input::placeholder { color: var(--ink-soft); }
.cvbot-input:focus { outline: none; border-color: var(--accent); }
.cvbot-input:disabled { opacity: 0.6; }
.cvbot-send {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  padding: 0 1.3rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.cvbot-send:hover { opacity: 0.88; }
.cvbot-send:disabled { opacity: 0.5; cursor: default; }
.cvbot-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.9rem;
}
.cvbot-suggest button {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--hairline);
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.cvbot-suggest button:hover { color: var(--accent); border-color: var(--accent); }
.cvbot-log {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.1rem;
}
.cvbot-log:empty { display: none; }
.cvbot-msg {
  font-size: 0.95rem;
  line-height: 1.55;
  padding: 0.65rem 0.85rem;
  max-width: 90%;
  border: 1px solid var(--hairline);
  white-space: normal;
  overflow-wrap: anywhere;
}
.cvbot-msg p { margin: 0 0 0.5rem; }
.cvbot-msg p:last-child { margin-bottom: 0; }
.cvbot-msg ul { margin: 0.4rem 0; padding-left: 1.15rem; }
.cvbot-msg li { margin: 0.2rem 0; }
.cvbot-msg strong { font-weight: 600; color: var(--ink); }
.cvbot-you {
  align-self: flex-end;
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--ink);
}
.cvbot-bot {
  align-self: flex-start;
  background: var(--bg);
  color: var(--ink);
}
.cvbot-err { color: var(--ink-soft); font-style: italic; }
.cvbot-typing { letter-spacing: 0.15em; color: var(--ink-soft); animation: cvbotPulse 1.1s ease-in-out infinite; }
@keyframes cvbotPulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

@media (max-width: 560px) {
  .cvbot-form { flex-wrap: wrap; }
  .cvbot-send { flex-basis: 100%; padding: 0.65rem; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  width: var(--w);
  margin: 0 auto;
  padding-top: clamp(2rem, 6vh, 4rem);
  padding-bottom: clamp(4rem, 10vh, 8rem);
  min-height: 72vh;
  display: flex; flex-direction: column; justify-content: flex-end;
}

.hero-portrait {
  position: absolute;
  top: clamp(2rem, 5vh, 3.5rem);
  right: 0;
  width: clamp(240px, 26vw, 340px);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 25%;
  max-height: 60vh;
  border: 1px solid var(--hairline-strong);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}

.hero-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(4rem, 14vw, 11.5rem);
  line-height: 0.92;
  letter-spacing: -0.015em;
  display: flex; flex-direction: column;
}
.hero-name .accent { color: var(--accent); }

.hero-lede {
  margin-top: 2.25rem;
  max-width: 34ch;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  line-height: 1.45;
  color: var(--ink-soft);
}
.hero-lede em { color: var(--ink); }

.hero-links {
  margin-top: 2.5rem;
  display: flex; flex-wrap: wrap; gap: 0.6rem 0;
}
.hero-links a {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  padding: 0.35rem 1rem;
  border: 1px solid var(--hairline);
  border-right: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.hero-links a:last-child { border-right: 1px solid var(--hairline); }
.hero-links a:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.hero-follows {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}
.hero-follows a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline-strong);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.hero-follows a:hover { color: var(--accent); border-color: var(--accent); }

.hero-rule {
  margin-top: clamp(3rem, 8vh, 5.5rem);
  padding-top: 1rem;
  border-top: 1px solid var(--hairline-strong);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

/* ---------- sections ---------- */

.section {
  width: var(--w);
  margin: 0 auto;
  padding: clamp(3.5rem, 9vh, 6.5rem) 0;
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(0, 3.2fr);
  gap: 2rem clamp(2rem, 6vw, 6rem);
  /* scroll reveal */
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.section.visible { opacity: 1; transform: none; }

.section-label {
  display: flex; flex-direction: column; gap: 0.4rem;
  position: sticky; top: 5.5rem; align-self: start;
}
.section-num {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.section-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.05;
  font-weight: 400;
}

/* now */
.lede {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  line-height: 1.35;
  max-width: 26em;
}
.lede em { color: var(--accent); font-size: 1em; }
.inline-link {
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  transition: color 0.2s ease;
}
.inline-link:hover { color: var(--accent); }

.body-copy {
  margin-top: 1.5rem;
  max-width: 58ch;
  color: var(--ink-soft);
}

.section-photo {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--hairline-strong);
  margin: 2rem 0 0.5rem;
}
.section-photo.workshop { object-position: center 42%; }
.section-photo.talk { aspect-ratio: 2 / 1; object-position: center; }
.talk-figure { margin: 2rem 0 0.5rem; }
.talk-figure .section-photo { margin: 0; }
.talk-figure figcaption {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-top: 1.1rem;
}

.now-photo {
  display: block;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--hairline-strong);
  margin-top: 2.5rem;
}
.clients { margin-top: 2.75rem; }
.clients-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
}
.clients-logos {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.8rem 3.2rem;
}
.brand-logo {
  height: 42px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  filter: brightness(0);
  opacity: 0.72;
  transition: opacity 0.2s ease;
}
:root[data-theme="dark"] .brand-logo { filter: brightness(0) invert(1); opacity: 0.74; }
.brand-logo:hover { opacity: 1; }

.hero-clients {
  margin-top: clamp(2.75rem, 7vh, 4.5rem);
  text-align: center;
}
.hero-clients .clients-logos { justify-content: center; }

.now-figure { margin: 0 0 0.5rem; max-width: 560px; }
.now-figure .now-photo { margin-top: 2.5rem; }
.now-figure figcaption {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-top: 1.1rem;
}
.now-figure figcaption a,
.talk-figure figcaption a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline-strong);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.now-figure figcaption a:hover,
.talk-figure figcaption a:hover { color: var(--accent); border-color: var(--accent); }

.li-feature {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--hairline);
  max-width: 480px;
}
.li-feature .pub-kicker { display: block; margin-bottom: 0.6rem; }
.li-feature-text { color: var(--ink-soft); margin-bottom: 1.25rem; max-width: 42ch; }
.li-embed iframe {
  display: block;
  width: 100%;
  height: 399px;
  border: 1px solid var(--hairline);
  background: var(--bg-raised);
}

.stats {
  margin-top: 2.75rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}
.stat {
  padding: 1.25rem 1.25rem 1.1rem;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 0.2rem;
}
a.stat { text-decoration: none; transition: background-color 0.2s ease; }
a.stat:hover { background: var(--bg-raised); }
.stat-num {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1;
}
.stat-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.tags {
  margin-top: 2rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.tags span {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--ink-soft);
}

/* work timeline */
.timeline { list-style: none; }
.timeline-item {
  display: grid;
  grid-template-columns: minmax(90px, 120px) 1fr;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--hairline);
  transition: transform 0.25s ease;
}
.timeline-item:first-child { padding-top: 0.25rem; }
.timeline-item:hover { transform: translateX(6px); }
.timeline-when {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding-top: 0.35rem;
}
.timeline-what h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}
.timeline-what .org { font-weight: 400; color: var(--ink-soft); }
.org a, .edu-what a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--hairline-strong);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.org a:hover, .edu-what a:hover { color: var(--accent); border-color: var(--accent); }
.timeline-what p { color: var(--ink-soft); max-width: 62ch; }
.timeline-ref {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.ref-label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-right: 0.55rem;
}
.timeline-ref a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline-strong);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.timeline-ref a:hover { color: var(--accent); border-color: var(--accent); }

/* project cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}
.card {
  background: var(--bg);
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 1.6rem 1.5rem 1.75rem;
  text-decoration: none;
  display: flex; flex-direction: column; gap: 0.75rem;
  transition: background-color 0.25s ease;
}
.card:hover { background: var(--bg-raised); }
.card-top { display: flex; justify-content: space-between; align-items: baseline; }
.card-kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.card-arrow {
  color: var(--accent);
  font-size: 1.1rem;
  transition: transform 0.25s ease;
}
.card:hover .card-arrow { transform: translate(4px, -4px); }
.card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1.1;
}
.card p { color: var(--ink-soft); font-size: 1.0625rem; }

/* research */
.pub {
  display: block;
  text-decoration: none;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--hairline);
}
.pub:first-child { padding-top: 0.25rem; }
.pub-link { display: block; text-decoration: none; color: inherit; }
.pub-ref {
  margin-top: 0.85rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.pub-ref a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline-strong);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.pub-ref a:hover { color: var(--accent); border-color: var(--accent); }
.pub-kicker {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.pub-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  line-height: 1.25;
  margin: 0.6rem 0 0.5rem;
  max-width: 30em;
  transition: color 0.2s ease;
}
.pub:hover .pub-title { color: var(--accent); }
.pub-meta { color: var(--ink-soft); font-size: 1.0625rem; max-width: 60ch; }

/* education */
.edu { list-style: none; }
.edu li {
  display: grid;
  grid-template-columns: minmax(90px, 120px) 1fr;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--hairline);
}
.edu li:first-child { padding-top: 0.25rem; }
.edu-year {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.edu-what { color: var(--ink-soft); }
.edu-what strong { font-weight: 600; color: var(--ink); }
.edu-ref { display: block; margin-top: 0.5rem; font-size: 0.9rem; }

.toolbox { margin-top: 2.25rem; }

/* ---------- footer ---------- */

.footer {
  margin-top: clamp(2rem, 6vh, 4rem);
  border-top: 1px solid var(--hairline-strong);
  padding: clamp(4rem, 10vh, 7rem) 0 2.5rem;
  width: var(--w);
  margin-left: auto; margin-right: auto;
  text-align: center;
}
.footer-big {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 2rem;
}
.footer-big em { color: var(--accent); font-size: 1em; }
.cta {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.9rem 2.2rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.cta:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.footer-links {
  margin-top: 3rem;
  display: flex; justify-content: center; flex-wrap: wrap; gap: 1.75rem;
}
.footer-links a {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--accent); }

.footer-small {
  margin-top: 2.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

/* ---------- load reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  animation: rise 0.9s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
}
.d1 { animation-delay: 0.08s; }
.d2 { animation-delay: 0.18s; }
.d3 { animation-delay: 0.32s; }
.d4 { animation-delay: 0.44s; }
.d5 { animation-delay: 0.56s; }

@keyframes rise {
  to { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .topnav { display: none; }
  .theme-toggle { margin-left: auto; }

  .hero { min-height: 78vh; }
  .hero-name { font-size: clamp(3.4rem, 17vw, 5.5rem); }
  .hero-portrait {
    position: static;
    width: 200px;
    margin-bottom: 1.75rem;
  }

  .section {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .section-label {
    position: static;
    flex-direction: row; align-items: baseline; gap: 0.9rem;
  }

  .stats { grid-template-columns: 1fr; border-left: 1px solid var(--hairline); }
  .timeline-item, .edu li { grid-template-columns: 1fr; gap: 0.35rem; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { animation: none; opacity: 1; transform: none; }
  .section { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- language toggle + bilingual ---------- */

.topbar-actions {
  margin-left: auto;
  display: flex; align-items: center; gap: 0.9rem;
}

.langtoggle {
  background: none;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  padding: 0.28rem 0.7rem;
  display: inline-flex; align-items: center; gap: 0.3rem;
  transition: border-color 0.2s ease;
}
.langtoggle:hover { border-color: var(--accent); }
.langtoggle [data-set] { transition: color 0.2s ease; }
.langtoggle [data-set].active { color: var(--accent); font-weight: 500; }
.langtoggle .langsep { opacity: 0.45; }

/* show only the active language */
html[lang="es"] [data-lang="en"] { display: none; }
html[lang="en"] [data-lang="es"] { display: none; }

/* experience bullets */
.tl-list {
  margin: 0.5rem 0 0;
  padding-left: 1.15em;
  color: var(--ink-soft);
  max-width: 62ch;
}
.tl-list li { margin: 0.3rem 0; }

/* contextual photo figure */
.ctx-figure { margin: 2.5rem 0 0.5rem; max-width: 380px; }
.ctx-photo {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--hairline-strong);
}
.ctx-figure figcaption {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-top: 1rem;
}

/* keep the fixed header from covering anchor targets */
.section, #contacto { scroll-margin-top: 5.5rem; }

/* footer contact: show real email + phone, not uppercased labels */
.footer-contact { gap: 2.5rem; }
.footer-contact a {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 1.15rem;
  color: var(--ink);
}

@media (max-width: 760px) {
  .theme-toggle { margin-left: 0; }
  .topbar-actions { margin-left: auto; }
}
