/* ==========================================================================
   Fran Olivares — person surface of Olivares AI
   One house with the product: Matte Black, warm white, one scarce orange.
   Space Grotesk (display) + Inter (body) + JetBrains Mono (record keys).
   Palette mirrors olivares.ai tokens (brand-brief/BRAND-MANUAL.md; AA pairs
   #f08000-on-dark / #b45500-on-light are measured there, not invented here).
   Signature: the audit ledger — rows of record, exactly one row flagged orange.
   ========================================================================== */

/* ---------- Self-hosted fonts ---------- */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/space-grotesk-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/space-grotesk-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/space-grotesk-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-700.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-400-700.woff2') format('woff2');
}

/* ---------- Tokens — dark first (brand default), light overrides ---------- */
:root {
  /* Surfaces — depth from layers, not shadows */
  --bg:         #28282b;
  --surface:    #303033;
  --card:       #343437;
  --well:       #1f1f22;

  /* Ink — warm neutrals (ink-3 holds AA >= 4.5:1 on every dark surface) */
  --ink:        #fafaf9;
  --ink-2:      #b5b0ab;
  --ink-3:      #a19c97;

  /* Hairlines */
  --line:        rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.16);
  --line-soft:   rgba(255, 255, 255, 0.06);
  --tint:        rgba(255, 255, 255, 0.03);

  /* The one orange — scarce by rule */
  --accent:      #f08000;
  --accent-ink:  #f0913d;  /* text-safe on dark surfaces */
  --accent-wash: rgba(240, 128, 0, 0.10);
  --on-accent:   #1a1206;
  --selection:   rgba(240, 128, 0, 0.28);

  --header-bg:   rgba(40, 40, 43, 0.72);
  --shadow:      0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 40px -22px rgba(0, 0, 0, 0.7);

  /* Type */
  --display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* Measure */
  --max:    1120px;
  --pad-x:  clamp(1.25rem, 5vw, 3rem);
  --sec-y:  clamp(4.5rem, 11vh, 8rem);
  --radius: 6px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="light"] {
  --bg:         #fafaf9;
  --surface:    #ffffff;
  --card:       #ffffff;
  --well:       #f1f1f0;

  --ink:        #28282b;
  --ink-2:      #57575c;
  --ink-3:      #6b6b71; /* AA >= 4.5:1 on every light surface, including --well */

  --line:        rgba(28, 28, 31, 0.12);
  --line-strong: rgba(28, 28, 31, 0.2);
  --line-soft:   rgba(28, 28, 31, 0.07);
  --tint:        rgba(28, 28, 31, 0.03);

  --accent:      #b45500;  /* AA-deepened orange for light surfaces */
  --accent-ink:  #9a4800;
  --accent-wash: rgba(180, 85, 0, 0.08);
  --on-accent:   #fff8f0;
  --selection:   rgba(180, 85, 0, 0.18);

  --header-bg:   rgba(250, 250, 249, 0.78);
  --shadow:      0 1px 2px rgba(28, 28, 31, 0.05), 0 14px 34px -22px rgba(28, 28, 31, 0.25);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--sans);
  font-weight: 400;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: clamp(1rem, 0.97rem + 0.18vw, 1.0625rem);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}

::selection { background: var(--selection); }

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

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

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.section { padding-block: var(--sec-y); position: relative; border-top: 1px solid var(--line-soft); }
.section--well { background: var(--well); }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--bg);
  padding: 0.6rem 1rem; z-index: 200; border-radius: var(--radius);
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Header / nav ---------- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.header.is-scrolled { border-bottom-color: var(--line); }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 4.5rem; gap: 1rem;
}
.nav-logo {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 0.55rem;
}
/* The mark: one short ledger row, orange — the signature at its smallest */
.nav-logo::before {
  content: ""; width: 0.95rem; height: 3px; border-radius: 2px;
  background: var(--accent);
}

.nav-links {
  display: flex; gap: clamp(0.9rem, 2.2vw, 2rem); list-style: none;
  margin-inline: auto;
}
.nav-links a {
  font-family: var(--mono);
  font-size: 0.71rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-block: 0.4rem;
  position: relative;
  transition: color 0.2s var(--ease);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.3s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-actions { display: flex; align-items: center; gap: 0.4rem; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 2.3rem; height: 2.3rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: transparent; color: var(--ink-2); cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); background: var(--tint); }
.icon-btn svg { width: 17px; height: 17px; }

.lang-toggle {
  font-family: var(--mono);
  font-size: 0.71rem; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: transparent; color: var(--ink-2); cursor: pointer;
  height: 2.3rem; padding-inline: 0.8rem;
  display: inline-flex; align-items: center; gap: 0.3rem;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.lang-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
.lang-toggle .on { color: var(--accent-ink); }
.lang-toggle .sep { color: var(--ink-3); font-weight: 400; }

.menu-toggle {
  display: none;
  width: 2.3rem; height: 2.3rem; place-items: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: transparent; color: var(--ink); cursor: pointer;
}
.menu-toggle svg { width: 18px; height: 18px; }

.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(4rem, 10vh, 7rem) clamp(3.5rem, 9vh, 6rem);
  border-bottom: 1px solid var(--line-soft);
}
.hero-kicker {
  font-family: var(--mono);
  font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 1.7rem;
  display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap;
}
.hero-kicker::before {
  content: ""; width: 1.8rem; height: 3px; border-radius: 2px; background: var(--accent);
}
.hero-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.9rem, 8.5vw, 5.75rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}
.hero-lead {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.25rem, 1.05rem + 1vw, 1.85rem);
  line-height: 1.35;
  color: var(--ink);
  max-width: 30ch;
  margin-bottom: 1.4rem;
  letter-spacing: -0.015em;
}
.hero-lead .accent-brand { color: var(--accent-ink); }
.hero-sub {
  font-size: 1.05rem;
  color: var(--ink-2);
  max-width: 60ch;
  margin-bottom: 2.4rem;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* ---------- The record (signature) — audit rows, one flagged orange ---------- */
.record {
  margin-top: 3.2rem;
  max-width: 640px;
  border-top: 1px solid var(--line);
}
.rec-row {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  align-items: baseline;
  gap: 1.2rem;
  padding-block: 0.72rem;
  border-bottom: 1px solid var(--line-soft);
}
.rec-row dt {
  font-family: var(--mono);
  font-size: 0.71rem; letter-spacing: 0.08em; text-transform: lowercase;
  color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 0.55rem;
  white-space: nowrap;
}
.rec-row dt::before {
  content: ""; width: 0.85rem; height: 2px; border-radius: 1px;
  background: var(--ink-3); flex-shrink: 0;
}
.rec-row dd {
  font-size: 0.94rem; color: var(--ink); font-weight: 500; line-height: 1.5;
}
.rec-row dd .dim { color: var(--ink-2); font-weight: 400; }
/* The flagged row — longest, thickest, orange (the write the ledger catches) */
.rec-row--flag dt { color: var(--accent-ink); font-weight: 600; }
.rec-row--flag dt::before { width: 1.25rem; height: 3px; background: var(--accent); }
.rec-row--flag dd { font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 0.78rem 1.25rem; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn svg { width: 15px; height: 15px; }
.btn-brand { background: var(--accent); color: var(--on-accent); }
.btn-brand:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn-outline { border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn-ghost { color: var(--ink-2); padding-inline: 0.4rem; }
.btn-ghost:hover { color: var(--accent-ink); }

/* ---------- Section head — ledger key, not a number ---------- */
.sec-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 1.1rem;
  margin-bottom: clamp(2.2rem, 5vh, 3.5rem);
  padding-bottom: 1.3rem;
  border-bottom: 1px solid var(--line);
}
.sec-key {
  font-family: var(--mono);
  font-size: 0.74rem; font-weight: 500; letter-spacing: 0.08em; text-transform: lowercase;
  color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 0.55rem;
}
.sec-key::before {
  content: ""; width: 0.85rem; height: 2px; border-radius: 1px; background: var(--accent);
}
.sec-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.8rem, 1.3rem + 2.2vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.sec-intro {
  grid-column: 2;
  margin-top: 0.6rem;
  color: var(--ink-2);
  font-size: 1.03rem;
  max-width: 62ch;
}

/* ---------- About / product shared grid ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}
.about-prose p { margin-bottom: 1.2rem; max-width: 64ch; color: var(--ink-2); }
.about-prose p:last-child { margin-bottom: 0; }
.about-prose strong { font-weight: 600; color: var(--ink); }
.about-prose .lead-line {
  font-family: var(--display);
  font-size: clamp(1.3rem, 1.1rem + 1vw, 1.7rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 1.6rem;
}
.about-prose a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.about-prose a:hover { color: var(--accent); }

.about-aside { display: flex; flex-direction: column; gap: 1.4rem; }
.aside-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 1.4rem 1.5rem;
}
.aside-card h3 {
  font-family: var(--mono);
  font-size: 0.69rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 0.9rem;
}
.aside-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-block: 0.5rem; border-top: 1px solid var(--line-soft);
  font-size: 0.9rem;
}
.aside-row:first-of-type { border-top: none; }
.aside-row .k { color: var(--ink-3); flex-shrink: 0; }
.aside-row .v { color: var(--ink); font-weight: 500; text-align: right; }
.aside-row--flag .k { color: var(--accent-ink); font-weight: 600; }
.aside-row--flag .v { color: var(--ink); font-weight: 600; }

/* ---------- Capabilities (product pillars) ---------- */
.cap-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.cap {
  background: var(--bg);
  padding: clamp(1.5rem, 3vw, 2.1rem);
  display: flex; flex-direction: column;
  transition: background 0.25s var(--ease);
}
.cap:hover { background: var(--tint); }
.cap-ico {
  width: 2.4rem; height: 2.4rem; border-radius: var(--radius);
  display: grid; place-items: center; margin-bottom: 1.2rem;
  color: var(--ink-2); background: var(--tint); border: 1px solid var(--line-soft);
}
.cap--flag .cap-ico { color: var(--accent-ink); background: var(--accent-wash); border-color: transparent; }
.cap-ico svg { width: 19px; height: 19px; }
.cap h3 {
  font-family: var(--display);
  font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
}
.cap p { color: var(--ink-2); font-size: 0.95rem; }

.oai-close {
  font-family: var(--mono);
  font-size: 0.77rem; letter-spacing: 0.02em;
  color: var(--ink-2);
  border-top: 1px solid var(--line-soft);
  padding-top: 1.3rem; margin-top: 1.7rem;
  display: flex; flex-wrap: wrap; gap: 0.9rem 1.6rem; align-items: center;
}

/* ---------- Systems (capability ledger) ---------- */
.sys-list { border-top: 1px solid var(--line); }
.sys-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem 2.5rem;
  padding-block: clamp(1.2rem, 2.6vh, 1.7rem);
  border-bottom: 1px solid var(--line-soft);
}
.sys-key {
  font-family: var(--mono);
  font-size: 0.71rem; letter-spacing: 0.08em; text-transform: lowercase;
  color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding-top: 0.3rem; white-space: nowrap;
}
.sys-key::before {
  content: ""; width: 0.85rem; height: 2px; border-radius: 1px;
  background: var(--ink-3); flex-shrink: 0;
}
.sys-row--flag .sys-key { color: var(--accent-ink); font-weight: 600; }
.sys-row--flag .sys-key::before { width: 1.25rem; height: 3px; background: var(--accent); }
.sys-body h3 {
  font-family: var(--display);
  font-size: 1.18rem; font-weight: 600; letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}
.sys-body p { color: var(--ink-2); font-size: 0.95rem; max-width: 72ch; }

/* ---------- Work ---------- */
.feat-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.proj-feat {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: clamp(1.6rem, 3.5vw, 2.5rem);
  overflow: hidden;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.proj-feat:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.proj-eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.proj-title {
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.1rem);
  font-weight: 600; letter-spacing: -0.02em; line-height: 1;
  margin-bottom: 0.85rem;
}
.proj-desc { color: var(--ink-2); max-width: 68ch; margin-bottom: 1.4rem; }
.proj-meta { display: flex; flex-wrap: wrap; gap: 1.6rem; margin-bottom: 1.4rem; }
.proj-stat { display: flex; flex-direction: column; }
.proj-stat .n {
  font-family: var(--display); font-size: 1.45rem; font-weight: 600; color: var(--ink);
  letter-spacing: -0.01em; line-height: 1;
}
.proj-stat .l {
  font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 0.3rem;
}
.proj-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.3rem; }

.tag {
  font-family: var(--mono);
  font-size: 0.69rem; letter-spacing: 0.01em;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
  background: transparent;
  white-space: nowrap;
}
.link-row { display: flex; flex-wrap: wrap; gap: 1.3rem; }
.ext-link {
  font-family: var(--mono);
  font-size: 0.76rem; font-weight: 600; letter-spacing: 0.01em;
  color: var(--ink); display: inline-flex; align-items: center; gap: 0.45rem;
  position: relative;
}
.ext-link svg { width: 14px; height: 14px; color: var(--ink-3); transition: transform 0.2s var(--ease), color 0.2s var(--ease); }
.ext-link::after {
  content: ""; position: absolute; left: 0; bottom: -3px; height: 1px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: right;
  transition: transform 0.28s var(--ease);
}
.ext-link:hover { color: var(--accent-ink); }
.ext-link:hover svg { color: var(--accent-ink); transform: translate(2px, -2px); }
.ext-link:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- Credentials ---------- */
.cert-groups { display: flex; flex-direction: column; gap: clamp(2rem, 4vh, 3rem); }
.cert-group > h3 {
  font-family: var(--mono);
  font-size: 0.71rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.8rem;
}
.cert-group > h3 .c { color: var(--ink-3); }
.cert-group > h3::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.cert-list { display: grid; grid-template-columns: 1fr; }
.cert {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem;
  padding: 0.85rem 0; border-top: 1px solid var(--line-soft);
  transition: padding-left 0.2s var(--ease);
}
.cert:first-child { border-top: none; }
.cert:hover { padding-left: 0.4rem; }
.cert-name { font-weight: 500; color: var(--ink); font-size: 0.97rem; }
.cert-name .detail { color: var(--ink-2); font-weight: 400; }
.cert-name .verify {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent-ink); margin-left: 0.6rem; opacity: 0; transition: opacity 0.2s var(--ease);
  white-space: nowrap;
}
.cert:hover .verify { opacity: 1; }
.cert-meta { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); text-align: right; white-space: nowrap; }
.cert-meta .yr { color: var(--ink-2); }

.cert-badges {
  display: flex; flex-wrap: wrap; gap: 1.1rem; align-items: center;
  margin-top: 2.4rem; padding-top: 2rem; border-top: 1px solid var(--line);
}
.cert-badges .lbl {
  font-family: var(--mono); font-size: 0.67rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); width: 100%; margin-bottom: 0.2rem;
}
.cert-badges img {
  height: 74px; width: auto; border-radius: var(--radius);
  transition: transform 0.25s var(--ease);
}
.cert-badges a:hover img { transform: translateY(-3px) scale(1.03); }

/* ---------- Contact ---------- */
.contact-wrap { display: grid; grid-template-columns: 1fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
.contact-lead {
  font-family: var(--display);
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.5rem);
  font-weight: 600; line-height: 1.15; letter-spacing: -0.02em;
}
.contact-lead em { font-style: normal; color: var(--accent-ink); }
.contact-sub { color: var(--ink-2); margin-top: 1.2rem; max-width: 46ch; }
.contact-list { display: flex; flex-direction: column; }
.contact-link {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.05rem 0; border-top: 1px solid var(--line);
  transition: padding-left 0.25s var(--ease);
}
.contact-list .contact-link:last-child { border-bottom: 1px solid var(--line); }
.contact-link:hover { padding-left: 0.5rem; }
.contact-link .ico {
  width: 2.4rem; height: 2.4rem; flex-shrink: 0; border-radius: var(--radius);
  border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-2);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.contact-link:hover .ico { color: var(--accent-ink); border-color: transparent; background: var(--accent-wash); }
.contact-link .ico svg { width: 18px; height: 18px; }
.contact-link .meta { display: flex; flex-direction: column; min-width: 0; }
.contact-link .meta .k { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.contact-link .meta .v { font-size: 0.97rem; color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.contact-link .arr { margin-left: auto; color: var(--ink-3); transition: transform 0.2s var(--ease), color 0.2s var(--ease); }
.contact-link:hover .arr { color: var(--accent-ink); transform: translateX(3px); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding-block: 2.4rem;
}
.footer .row { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.footer p { font-family: var(--mono); font-size: 0.73rem; color: var(--ink-3); letter-spacing: 0.01em; }
.footer .colophon { max-width: 56ch; }
.footer a { color: var(--ink-2); }
.footer a:hover { color: var(--accent-ink); }

/* ---------- i18n visibility ---------- */
[data-lang-es], [data-lang-en] { display: none; }
html[lang="es"] [data-lang-es] { display: revert; }
html[lang="en"] [data-lang-en] { display: revert; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.07s; }

/* Hero load sequence — the record writes itself in, flagged row completes last */
.hero .anim { opacity: 0; transform: translateY(14px); animation: heroIn 0.7s var(--ease) forwards; }
@keyframes heroIn { to { opacity: 1; transform: none; } }
.record .rec-row { opacity: 0; transform: translateX(-10px); animation: rowIn 0.5s var(--ease) forwards; }
@keyframes rowIn { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .reveal, .hero .anim, .record .rec-row {
    opacity: 1 !important; transform: none !important;
    animation: none !important; transition: none !important;
  }
}

/* ---------- Responsive ---------- */
@media (min-width: 760px) {
  .sys-row { grid-template-columns: 9.5rem 1fr; }
  .cap-grid { grid-template-columns: repeat(3, 1fr); }
  .contact-wrap { grid-template-columns: 1.1fr 0.9fr; }
}
@media (min-width: 980px) {
  .about-grid { grid-template-columns: 1.55fr 1fr; }
}
@media (min-width: 760px) and (max-width: 979px) {
  #olivares .cap:last-child { grid-column: span 2; }
  .cap-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Compact menu on small screens */
@media (max-width: 720px) {
  .nav-links {
    position: fixed; inset: 4.5rem 0 auto 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    flex-direction: column; gap: 0; margin: 0; padding: 0.5rem var(--pad-x) 1.2rem;
    transform: translateY(-130%);
    /* visibility keeps the closed menu out of the tab order (WCAG 2.4.3/2.4.7) */
    visibility: hidden;
    transition: transform 0.35s var(--ease), visibility 0s 0.35s;
    box-shadow: var(--shadow);
  }
  .nav-links.is-open {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.35s var(--ease);
  }
  .nav-links a { padding-block: 0.85rem; border-bottom: 1px solid var(--line-soft); width: 100%; }
  .nav-links a::after { display: none; }
  .menu-toggle { display: inline-grid; }
}

/* ---------- Print ---------- */
@media print {
  /* Re-ground every token on paper — otherwise a dark-theme visitor prints
     near-white ink on a white page. */
  :root, [data-theme="dark"], [data-theme="light"] {
    --bg: #fff; --surface: #fff; --card: #fff; --well: #fff;
    --ink: #000; --ink-2: #333; --ink-3: #555;
    --line: rgba(0, 0, 0, 0.25); --line-strong: rgba(0, 0, 0, 0.4);
    --line-soft: rgba(0, 0, 0, 0.12); --tint: transparent;
    --accent: #b45500; --accent-ink: #9a4800; --accent-wash: transparent;
  }
  body { background: #fff; color: #000; font-size: 11pt; }
  .header, .nav-actions, .hero-cta, .menu-toggle { display: none !important; }
  .reveal, .hero .anim, .record .rec-row { opacity: 1 !important; transform: none !important; animation: none !important; }
  a { color: #000; text-decoration: none; }
  .section { padding-block: 1.2rem; }
  .proj-feat, .aside-card, .cap, .sys-row { break-inside: avoid; }
}
