/* ==========================================================================
   Adrián García Juárez — personal site
   Tokens → base → layout → components → sections → motion → themes
   ========================================================================== */

@font-face {
  font-family: 'Geist';
  src: url('/assets/fonts/geist-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/assets/fonts/geist-mono-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  color-scheme: light;

  /* neutrals (cool, slightly blue) */
  --bg: oklch(0.984 0.003 250);
  --bg-sunk: oklch(0.962 0.006 255);
  --surface: oklch(1 0 0);
  --ink: oklch(0.2 0.03 264);
  --ink-2: oklch(0.43 0.025 262);
  --ink-3: oklch(0.55 0.02 262);
  --line: oklch(0.9 0.008 258);
  --line-strong: oklch(0.82 0.012 258);

  /* accent: cobalt */
  --accent: oklch(0.5 0.19 263);
  --accent-hover: oklch(0.44 0.19 263);
  --accent-ink: oklch(0.99 0 0);
  --accent-soft: oklch(0.95 0.028 263);
  --accent-line: oklch(0.83 0.08 263);

  /* badge-derived highlights */
  --gold: oklch(0.8 0.15 82);
  --gold-soft: oklch(0.96 0.045 90);
  --gold-ink: oklch(0.45 0.09 75);
  --assoc: oklch(0.6 0.16 255);

  /* closing panel */
  --panel: oklch(0.24 0.06 264);
  --panel-ink: oklch(0.97 0.01 260);
  --panel-ink-2: oklch(0.82 0.03 262);

  --shadow-sm: 0 1px 2px oklch(0.2 0.03 264 / 0.06), 0 2px 6px oklch(0.2 0.03 264 / 0.05);
  --shadow-md: 0 4px 10px oklch(0.2 0.03 264 / 0.06), 0 14px 32px oklch(0.2 0.03 264 / 0.08);
  --shadow-lg: 0 8px 16px oklch(0.2 0.05 264 / 0.1), 0 18px 30px oklch(0.2 0.05 264 / 0.13);

  /* type */
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.25rem;
  --fs-lg: clamp(1.35rem, 1.1rem + 0.9vw, 1.7rem);
  --fs-xl: clamp(2rem, 1.4rem + 2.4vw, 3.1rem);
  --fs-display: clamp(3rem, 1.6rem + 6vw, 6rem);

  /* space (8pt) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --section-y: clamp(4.5rem, 3rem + 6vw, 8.5rem);
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 30px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 68px;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: oklch(0.17 0.02 264);
  --bg-sunk: oklch(0.145 0.02 264);
  --surface: oklch(0.21 0.024 264);
  --ink: oklch(0.955 0.008 260);
  --ink-2: oklch(0.78 0.018 260);
  --ink-3: oklch(0.66 0.02 260);
  --line: oklch(0.3 0.024 264);
  --line-strong: oklch(0.38 0.028 264);
  --accent: oklch(0.74 0.13 262);
  --accent-hover: oklch(0.8 0.11 262);
  --accent-ink: oklch(0.17 0.03 264);
  --accent-soft: oklch(0.28 0.06 263);
  --accent-line: oklch(0.45 0.1 263);
  --gold-soft: oklch(0.3 0.05 85);
  --gold-ink: oklch(0.86 0.12 85);
  --panel: oklch(0.26 0.07 264);
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3), 0 2px 6px oklch(0 0 0 / 0.25);
  --shadow-md: 0 4px 10px oklch(0 0 0 / 0.3), 0 14px 32px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 8px 16px oklch(0 0 0 / 0.35), 0 18px 30px oklch(0 0 0 / 0.45);
}

/* ---------- base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  scrollbar-color: var(--line-strong) var(--bg);
}
body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img,
picture,
svg {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.22em;
}
ul[role='list'],
ol {
  list-style: none;
  padding: 0;
}
h1,
h2,
h3 {
  line-height: 1.1;
  text-wrap: balance;
  font-weight: 650;
  letter-spacing: -0.025em;
}
p {
  text-wrap: pretty;
}
strong {
  font-weight: 620;
  color: var(--ink);
}
time,
.tabular {
  font-variant-numeric: tabular-nums;
}
::selection {
  background: var(--accent);
  color: var(--accent-ink);
}
:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
input,
textarea {
  caret-color: var(--accent);
}
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--bg);
  border-radius: 99px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm {
  width: 1em;
  height: 1em;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  left: var(--s-4);
  top: var(--s-3);
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-sm);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease-out);
}
.skip-link:focus {
  transform: none;
}
main:focus {
  outline: none;
}

/* ---------- layout ---------- */
.container {
  width: min(100% - 2 * var(--gutter), 1200px);
  margin-inline: auto;
}
.section {
  padding-block: var(--section-y);
}
.section-head {
  display: grid;
  gap: var(--s-4);
  max-width: 44rem;
  margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem);
}
.section-title {
  font-size: var(--fs-xl);
  letter-spacing: -0.035em;
}
.section-intro {
  color: var(--ink-2);
  font-size: var(--fs-md);
  line-height: 1.55;
  max-width: 38rem;
}

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-ink: var(--ink);
  --btn-line: var(--line-strong);
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  min-height: 48px;
  padding: 0 1.3rem;
  border: 1px solid var(--btn-line);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-weight: 560;
  font-size: var(--fs-sm);
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out),
    transform 0.35s var(--ease-spring),
    box-shadow 0.25s var(--ease-out);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}
.btn-primary {
  --btn-bg: var(--accent);
  --btn-ink: var(--accent-ink);
  --btn-line: var(--accent);
}
.btn-primary:hover {
  --btn-bg: var(--accent-hover);
  --btn-line: var(--accent-hover);
}
.btn-secondary:hover {
  --btn-line: var(--accent-line);
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  transition:
    background-color 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out),
    color 0.2s;
}
.icon-btn:hover {
  background: var(--bg-sunk);
  border-color: var(--line);
}
.icon-btn-lg {
  width: 48px;
  height: 48px;
  border-color: var(--line-strong);
  background: var(--surface);
}
.icon-btn-lg:hover {
  color: var(--accent);
  border-color: var(--accent-line);
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in oklch, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.3s,
    background-color 0.3s;
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--s-5);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  font-weight: 620;
  letter-spacing: -0.02em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: transform 0.45s var(--ease-spring);
}
.brand:hover .brand-mark {
  transform: rotate(-8deg) scale(1.06);
}
.site-nav {
  margin-left: auto;
}
.nav-list {
  display: flex;
  gap: var(--s-1);
  list-style: none;
  padding: 0;
}
.nav-link {
  position: relative;
  display: inline-block;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  transition:
    color 0.2s,
    background-color 0.2s;
}
.nav-link:hover {
  color: var(--ink);
  background: var(--bg-sunk);
}
.nav-link.is-active {
  color: var(--ink);
}
.nav-link.is-active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  translate: -50% 0;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}
.lang-switch {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 36px;
  padding: 0 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 650;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.lang-switch:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.theme-toggle .icon-sun {
  display: none;
}
:root[data-theme='dark'] .theme-toggle .icon-sun {
  display: block;
}
:root[data-theme='dark'] .theme-toggle .icon-moon {
  display: none;
}
.menu-toggle {
  display: none;
}

@media (max-width: 860px) {
  .menu-toggle {
    display: inline-grid;
  }
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    margin: 0;
    padding: var(--s-3) var(--gutter) var(--s-5);
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition:
      transform 0.3s var(--ease-out),
      opacity 0.2s,
      visibility 0s 0.3s;
  }
  .site-nav.is-open {
    transform: none;
    opacity: 1;
    visibility: visible;
    transition:
      transform 0.35s var(--ease-out),
      opacity 0.25s;
  }
  .nav-list {
    flex-direction: column;
  }
  .nav-link {
    display: block;
    padding: 0.85rem 0.5rem;
    font-size: var(--fs-md);
    border-radius: var(--r-sm);
  }
  .nav-link.is-active::after {
    left: auto;
    right: 0.5rem;
    top: 50%;
    bottom: auto;
    translate: 0 -50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
  }
  .header-actions {
    margin-left: auto;
  }
  .brand-name {
    display: none;
  }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(2.5rem, 1rem + 5vw, 6rem) var(--section-y);
  isolation: isolate;
}
.hero::before {
  /* one quiet field of the accent, anchored behind the portrait */
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 0 0 52%;
  background: var(--accent-soft);
  border-bottom-left-radius: 48px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(2rem, 1rem + 4vw, 5rem);
  align-items: center;
}
.hero-role {
  margin-top: var(--s-4);
  color: var(--ink);
  font-size: var(--fs-md);
  font-weight: 560;
  letter-spacing: -0.01em;
}
.hero-name {
  font-size: var(--fs-display);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: 680;
}
.hero-name .line {
  display: block;
}
.hero-name .line + .line {
  color: var(--ink-2);
  font-weight: 560;
}
.hero-tagline {
  margin-top: var(--s-6);
  font-size: var(--fs-lg);
  line-height: 1.3;
  font-weight: 560;
  letter-spacing: -0.02em;
  max-width: 30ch;
}
.hero-lede {
  margin-top: var(--s-4);
  color: var(--ink-2);
  max-width: 52ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-6);
}
.hero-proof {
  display: inline-flex;
  align-items: center;
  gap: var(--s-4);
  margin-top: var(--s-7);
  padding: var(--s-3) var(--s-5) var(--s-3) var(--s-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition:
    border-color 0.25s,
    box-shadow 0.3s var(--ease-out),
    transform 0.35s var(--ease-spring);
}
.hero-proof:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.proof-badges {
  display: flex;
}
.proof-badges img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--surface);
  transition: transform 0.4s var(--ease-spring);
}
.proof-badges img + img {
  margin-left: -14px;
}
.hero-proof:hover .proof-badges img {
  transform: translateX(calc(var(--i, 0) * 3px));
}
.proof-badges img:nth-child(2) { --i: 1; }
.proof-badges img:nth-child(3) { --i: 2; }
.proof-badges img:nth-child(4) { --i: 3; }
.proof-badges img:nth-child(5) { --i: 4; }
.proof-badges img:nth-child(6) { --i: 5; }
.proof-text {
  display: grid;
  line-height: 1.3;
}
.proof-text strong {
  font-size: var(--fs-sm);
}
.proof-text span {
  color: var(--ink-2);
  font-size: var(--fs-xs);
}
.proof-arrow {
  color: var(--accent);
  transition: transform 0.3s var(--ease-out);
}
.hero-proof:hover .proof-arrow {
  transform: translateX(4px);
}

.hero-portrait {
  position: relative;
  justify-self: end;
  width: min(100%, 460px);
}
.portrait-frame {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  background: var(--bg-sunk);
  transform: translate3d(0, var(--py, 0px), 0);
}
.portrait-frame picture,
.about-scene picture {
  height: 100%;
}
.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  scale: 1.04;
  transition: scale 1.2s var(--ease-out);
}
.hero-portrait:hover .portrait-frame img {
  scale: 1.08;
}
.portrait-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  font-size: var(--fs-sm);
  font-weight: 560;
  white-space: nowrap;
}
.portrait-chip .icon {
  color: var(--accent);
}
.chip-location {
  left: -1.25rem;
  bottom: 2.25rem;
}
.chip-company {
  right: -1rem;
  top: 1.75rem;
}
.chip-company img {
  width: 84px;
  height: auto;
}
.role-company {
  color: var(--ink);
  font-family: var(--font);
  font-weight: 600;
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero::before {
    inset: 0 0 auto 0;
    height: clamp(200px, 38vw, 360px);
    border-radius: 0 0 40px 40px;
  }
  .hero-portrait {
    justify-self: center;
    width: min(100%, 460px);
    order: -1;
  }
  .portrait-frame {
    aspect-ratio: 5 / 4;
  }
  .portrait-frame img {
    object-position: 50% 42%;
  }
  .hero-grid {
    gap: var(--s-6);
  }
  .hero-tagline {
    margin-top: var(--s-5);
  }
  .chip-location {
    left: 0.75rem;
  }
  .chip-company {
    right: 0.75rem;
  }
}
@media (max-width: 480px) {
  .hero-proof {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-3);
    border-radius: var(--r-lg);
    padding: var(--s-4);
  }
  .proof-badges img {
    width: 36px;
    height: 36px;
  }
  .proof-badges img + img {
    margin-left: -16px;
  }
  .proof-arrow {
    display: none;
  }
}

/* ---------- about ---------- */
.about {
  background: var(--surface);
  border-block: 1px solid var(--line);
}
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(2rem, 1rem + 5vw, 6rem);
  align-items: center;
}
.about-copy {
  display: grid;
  gap: var(--s-5);
}
.about-copy > p {
  color: var(--ink-2);
  font-size: var(--fs-md);
  line-height: 1.6;
  max-width: 62ch;
}
.about-copy > .section-title {
  margin-bottom: var(--s-2);
}
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: var(--s-4);
  border-top: 1px solid var(--line);
}
.fact {
  padding: var(--s-4) var(--s-4) var(--s-4) 0;
  border-bottom: 1px solid var(--line);
}
.fact dt {
  color: var(--ink-3);
  font-size: var(--fs-xs);
  font-weight: 500;
}
.fact dd {
  margin: var(--s-1) 0 0;
  font-weight: 540;
}
.about-scene {
  overflow: hidden;
  border-radius: var(--r-xl);
  aspect-ratio: 3 / 4;
  box-shadow: var(--shadow-md);
}
.about-scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
}
@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-scene {
    aspect-ratio: 4 / 3;
  }
  .about-scene img {
    object-position: 50% 38%;
  }
}
@media (max-width: 480px) {
  .facts {
    grid-template-columns: 1fr;
  }
}
.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 0.5rem + 1.5vw, 1.75rem);
  margin: clamp(3rem, 2rem + 3vw, 5rem) 0 0;
  padding: 0;
  list-style: none;
}
.pillar {
  position: relative;
  display: grid;
  align-content: start;
  gap: var(--s-3);
  padding: var(--s-6) var(--s-5) var(--s-5);
  border: 1px solid var(--line);
  border-top: 3px solid var(--c);
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: 0 -6px 16px -12px var(--c);
  transition:
    transform 0.4s var(--ease-out),
    box-shadow 0.4s var(--ease-out);
}
.pillar:hover {
  transform: translateY(-4px);
  box-shadow:
    0 -6px 16px -12px var(--c),
    0 14px 32px color-mix(in oklch, var(--c) 22%, transparent);
}
.pillar-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--c) 16%, var(--surface));
  color: color-mix(in srgb, var(--c) 72%, var(--ink));
}
.pillar-icon .icon {
  width: 26px;
  height: 26px;
}
.pillar-title {
  font-size: var(--fs-md);
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.pillar-body {
  color: var(--ink-2);
  line-height: 1.55;
}
.pillar-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-1);
  padding: 0;
  list-style: none;
}
.pillar-chips li {
  padding: 0.2rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--c) 45%, var(--line));
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: 500;
}
@media (max-width: 1000px) {
  .pillars {
    grid-template-columns: 1fr;
  }
}

/* ---------- timeline ---------- */
.timeline {
  --rail-x: 11px;
  --ruler-w: 128px;
  --company-w: 200px;
  position: relative;
}
.tl-rail {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: calc(var(--ruler-w) + var(--company-w) + var(--rail-x));
  width: 2px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.tl-rail-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--neon-green) 0%, var(--neon-blue) 30%, var(--neon-blue) 55%, var(--neon-green) 72%, var(--neon-orange) 100%);
  transform-origin: top;
  transform: scaleY(var(--progress, 1));
}
.tl-groups {
  display: grid;
  gap: var(--s-7);
}
.tl-group {
  display: grid;
  grid-template-columns: var(--ruler-w) var(--company-w) minmax(0, 1fr);
}
.tl-company {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  display: grid;
  gap: var(--s-3);
  justify-items: start;
  padding: var(--s-3) var(--s-5) 0 0;
}
.tl-logo {
  width: auto;
  height: 28px;
  max-width: 180px;
  object-fit: contain;
}
.tl-logo-ipn {
  height: 64px;
}
.tl-logo-servinformacion {
  height: 52px;
  max-width: 100%;
}
.tl-range {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
}
.tl-roles {
  display: grid;
  gap: var(--s-5);
}
.tl-role {
  position: relative;
  padding-left: calc(var(--rail-x) * 2 + 28px);
}
.tl-node {
  position: absolute;
  left: calc(var(--rail-x) - 8px);
  top: 26px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--line-strong);
  transition:
    border-color 0.4s var(--ease-out),
    background-color 0.4s var(--ease-out),
    box-shadow 0.4s var(--ease-out),
    transform 0.5s var(--ease-spring);
}
.tl-role.is-lit .tl-node {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.tl-node-edu {
  border-radius: 5px;
  rotate: 45deg;
  width: 16px;
  height: 16px;
  left: calc(var(--rail-x) - 7px);
}
.role-card {
  position: relative;
  padding: var(--s-5) var(--s-5) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.3s,
    box-shadow 0.4s var(--ease-out),
    transform 0.45s var(--ease-out);
}
.role-card:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.role-card.is-current {
  border-color: var(--accent-line);
}
.role-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-1) var(--s-4);
}
.role-title {
  font-size: var(--fs-lg);
  letter-spacing: -0.025em;
}
.role-meta {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.01em;
}
.role-dur {
  color: var(--ink-3);
}
.is-present {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
:root[data-theme='dark'] .is-present {
  color: var(--accent-hover);
}
.role-summary {
  margin-top: var(--s-3);
  color: var(--ink-2);
  max-width: 62ch;
}
.role-scope {
  display: grid;
  gap: var(--s-1);
  margin-top: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--bg-sunk);
  font-size: var(--fs-sm);
}
.role-scope > div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: var(--s-3);
}
.role-scope dt {
  color: var(--ink-3);
  font-size: var(--fs-xs);
  font-weight: 500;
  padding-top: 0.15em;
}
.role-scope dd {
  margin: 0;
  color: var(--ink);
  font-weight: 520;
}
@media (max-width: 480px) {
  .role-scope > div {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
.role-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-4);
  padding: 0;
  list-style: none;
}
.role-tags li {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--bg-sunk);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: 500;
}
.role-points {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.5s var(--ease-out);
}
.role-points > ul {
  overflow: hidden;
  display: grid;
  gap: var(--s-3);
  margin: 0;
  padding: var(--s-5) 0 var(--s-2);
  list-style: none;
}
.role-points li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--ink-2);
  max-width: 68ch;
}
.role-points li::before {
  content: '';
  position: absolute;
  left: 0.2rem;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  rotate: 45deg;
}
.role-points strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.role-card[data-collapsed] .role-points {
  grid-template-rows: 0fr;
}
.role-card[data-collapsed] .role-points > ul {
  padding-block: 0;
}
.role-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-3);
  min-height: 40px;
  padding: 0 0.9rem 0 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  font-size: var(--fs-sm);
  font-weight: 560;
  transition:
    border-color 0.2s,
    color 0.2s,
    background-color 0.2s;
}
.role-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.role-toggle .icon {
  transition: rotate 0.4s var(--ease-out);
  rotate: 180deg;
}
.role-card[data-collapsed] .role-toggle .icon {
  rotate: 0deg;
}
.role-card-edu {
  background: var(--bg-sunk);
  box-shadow: none;
}

@media (max-width: 860px) {
  .timeline {
    --company-w: 0px;
    --ruler-w: 0px;
  }
  .tl-group {
    grid-template-columns: 1fr;
    gap: var(--s-4);
  }
  .tl-company {
    position: static;
    padding: 0 0 0 calc(var(--rail-x) * 2 + 28px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
  }
  .tl-logo {
    height: 22px;
  }
  .tl-logo-ipn {
    height: 48px;
  }
  .tl-logo-servinformacion {
    height: 36px;
  }
}
@media (max-width: 480px) {
  .timeline {
    --rail-x: 7px;
  }
  .tl-role,
  .tl-company {
    padding-left: 28px;
  }
  .role-card {
    padding: var(--s-4);
  }
}

/* ---------- certifications ---------- */
.certs {
  background: var(--bg-sunk);
  border-block: 1px solid var(--line);
}
.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 0.5rem + 1.5vw, 1.75rem);
  perspective: 1200px;
}
.cert-card {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  --lift: 0px;
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto auto;
  justify-items: center;
  padding: var(--s-6) var(--s-5) var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
  transition:
    transform 0.6s var(--ease-out),
    box-shadow 0.45s var(--ease-out),
    border-color 0.3s;
  will-change: transform;
}
.cert-card.is-hovered,
.cert-card:hover,
.cert-card:focus-within {
  --lift: -6px;
  border-color: var(--accent-line);
  box-shadow: var(--shadow-lg);
}
.cert-card.is-tilting {
  transition:
    transform 0.12s linear,
    box-shadow 0.45s var(--ease-out),
    border-color 0.3s;
}
.cert-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--mx) var(--my), oklch(1 0 0 / 0.55), transparent 45%);
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}
:root[data-theme='dark'] .cert-glare {
  background: radial-gradient(420px circle at var(--mx) var(--my), oklch(1 0 0 / 0.12), transparent 45%);
  mix-blend-mode: normal;
}
.cert-card:hover .cert-glare,
.cert-card.is-hovered .cert-glare {
  opacity: 1;
}
.cert-badge {
  width: clamp(128px, 60%, 168px);
  aspect-ratio: 1;
  transform: translateZ(40px);
  transition:
    transform 0.7s var(--ease-spring),
    filter 0.5s;
  filter: drop-shadow(0 8px 14px oklch(0.2 0.05 264 / 0.12));
}
.cert-card:hover .cert-badge,
.cert-card.is-hovered .cert-badge {
  transform: translateZ(60px) scale(1.06) rotate(-4deg);
  filter: drop-shadow(0 16px 22px oklch(0.2 0.05 264 / 0.2));
}
.cert-badge img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.cert-level {
  margin-top: var(--s-5);
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--bg-sunk);
  color: var(--ink-2);
}
.level-professional .cert-level {
  background: var(--gold-soft);
  color: var(--gold-ink);
}
.level-associate .cert-level {
  background: var(--accent-soft);
  color: var(--accent);
}
:root[data-theme='dark'] .level-associate .cert-level {
  color: var(--accent-hover);
}
.cert-name {
  margin-top: var(--s-3);
  font-size: var(--fs-md);
  line-height: 1.3;
  letter-spacing: -0.02em;
  /* no transform here: it would become the containing block of the
     stretched link below and shrink it to the title */
}
/* decorative layers let clicks fall through to the stretched Credly link */
.cert-badge,
.cert-level,
.cert-desc,
.cert-dates,
.cert-actions {
  pointer-events: none;
}
.cert-desc {
  align-self: start;
  margin-top: var(--s-2);
  max-width: 34ch;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
  text-wrap: pretty;
}
.cert-view {
  pointer-events: auto;
}
.cert-link {
  text-decoration: none;
}
.cert-link::after {
  /* stretch the Credly link over the whole card */
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--r-lg);
}
.cert-link:focus-visible {
  outline: none;
}
.cert-link:focus-visible::after {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
}
.cert-dates {
  display: flex;
  justify-content: center;
  gap: var(--s-5);
  margin-top: var(--s-4);
  font-size: var(--fs-xs);
}
.cert-dates dt {
  color: var(--ink-3);
}
.cert-dates dd {
  margin: 0;
  font-family: var(--mono);
  font-weight: 500;
  color: var(--ink-2);
}
.cert-actions {
  position: relative;
  z-index: 2;
  transform: translateZ(32px); /* sit in front of the stretched link in 3D space */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--s-2) var(--s-4);
  width: 100%;
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}
.cert-verify {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: 600;
}
:root[data-theme='dark'] .cert-verify {
  color: var(--accent-hover);
}
.cert-verify .icon-sm {
  transition: transform 0.3s var(--ease-out);
}
.cert-card:hover .cert-verify .icon-sm {
  transform: translate(2px, -2px);
}
.cert-view {
  position: relative;
  z-index: 2; /* above the stretched link */
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 36px;
  padding: 0 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: 560;
  text-decoration: none;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.cert-view:hover {
  border-color: var(--ink-2);
  color: var(--ink);
}
@media (max-width: 1000px) {
  .cert-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .cert-grid {
    grid-template-columns: 1fr;
  }
  .cert-card {
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-rows: auto;
    justify-items: start;
    align-items: center;
    column-gap: var(--s-4);
    row-gap: var(--s-1);
    text-align: left;
    padding: var(--s-4);
  }
  .cert-badge {
    grid-row: 1 / span 3;
    width: 96px;
  }
  .cert-level {
    margin-top: 0;
  }
  .cert-name {
    margin-top: var(--s-2);
    font-size: var(--fs-base);
  }
  .cert-desc {
    grid-column: 2;
    margin-top: 0;
    font-size: var(--fs-xs);
  }
  .cert-badge {
    grid-row: 1 / span 4;
  }
  .cert-dates {
    justify-content: start;
    gap: var(--s-4);
    margin-top: var(--s-2);
  }
  .cert-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
    margin-top: var(--s-4);
  }
}

/* ---------- skills ---------- */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 0.5rem + 1.5vw, 1.75rem);
  align-items: stretch;
}
/* each group is a card, like the profile pillars: breathing room on every side */
.skill-group {
  padding: var(--s-6) clamp(1.25rem, 0.75rem + 1.5vw, 2rem);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.skill-title {
  font-size: var(--fs-md);
  letter-spacing: -0.02em;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-4);
  padding: 0;
  list-style: none;
}
.chips li {
  padding: 0.4rem 0.8rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  transition:
    border-color 0.2s,
    color 0.2s,
    transform 0.3s var(--ease-spring);
}
.chips li:hover {
  border-color: var(--accent-line);
  color: var(--ink);
  transform: translateY(-2px);
}
@media (max-width: 560px) {
  .skill-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- contact (closing panel) ---------- */
.contact {
  padding-top: 0;
}
.contact-inner {
  position: relative;
  overflow: hidden;
  display: grid;
  justify-items: start;
  gap: var(--s-5);
  padding: clamp(2.5rem, 1.5rem + 5vw, 6rem) clamp(1.5rem, 1rem + 4vw, 5rem);
  border-radius: var(--r-xl);
  background: var(--panel);
  color: var(--panel-ink);
  isolation: isolate;
}
.contact-inner::after {
  /* concentric rings, drawn once, very quiet */
  content: '';
  position: absolute;
  z-index: -1;
  right: -8%;
  bottom: -30%;
  width: 55%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid oklch(1 0 0 / 0.08);
  box-shadow:
    0 0 0 60px oklch(1 0 0 / 0.025),
    0 0 0 120px oklch(1 0 0 / 0.02);
}
.contact-title {
  font-size: var(--fs-xl);
  max-width: 18ch;
  color: var(--panel-ink);
  letter-spacing: -0.035em;
}
.contact-body {
  max-width: 52ch;
  color: var(--panel-ink-2);
  font-size: var(--fs-md);
}
.contact-email {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-3);
  max-width: 100%;
}
.email-link {
  font-size: clamp(1.25rem, 0.8rem + 2.4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--panel-ink);
  text-decoration-color: oklch(1 0 0 / 0.35);
  overflow-wrap: anywhere;
  transition: text-decoration-color 0.2s;
}
.email-link:hover {
  text-decoration-color: currentColor;
}
.copy-btn {
  color: var(--panel-ink);
  border-color: oklch(1 0 0 / 0.2);
}
.copy-btn:hover {
  background: oklch(1 0 0 / 0.1);
  border-color: oklch(1 0 0 / 0.35);
}
.copy-btn .icon-check {
  display: none;
}
.copy-btn.is-done .icon-check {
  display: block;
}
.copy-btn.is-done .icon-copy {
  display: none;
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-3);
}
.btn-on-dark.btn-primary {
  --btn-bg: var(--panel-ink);
  --btn-ink: var(--panel);
  --btn-line: var(--panel-ink);
}
.btn-on-dark.btn-primary:hover {
  --btn-bg: oklch(1 0 0);
  --btn-line: oklch(1 0 0);
}
.btn-on-dark.btn-secondary {
  --btn-bg: transparent;
  --btn-ink: var(--panel-ink);
  --btn-line: oklch(1 0 0 / 0.28);
}
.btn-on-dark.btn-secondary:hover {
  --btn-bg: oklch(1 0 0 / 0.08);
  --btn-line: oklch(1 0 0 / 0.5);
}
.contact :focus-visible {
  outline-color: var(--panel-ink);
}

/* ---------- footer ---------- */
.site-footer {
  padding-block: var(--s-6) var(--s-7);
  color: var(--ink-3);
  font-size: var(--fs-sm);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-5);
}
.footer-built {
  margin-right: auto;
}
.footer-top {
  color: var(--ink-2);
}

/* ---------- viewer dialog ---------- */
.viewer {
  margin: auto;
  width: min(100vw - 2rem, 1040px);
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  animation: viewer-in 0.45s var(--ease-out);
}
.viewer::backdrop {
  background: oklch(0.15 0.03 264 / 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade-in 0.3s var(--ease-out);
}
@keyframes viewer-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
.viewer-bar {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-3) var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--line);
}
.viewer-title {
  font-size: var(--fs-base);
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.viewer-tools {
  display: flex;
  gap: var(--s-1);
  margin-left: auto;
}
.viewer-stage {
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(0.75rem, 0.5rem + 2vw, 2rem);
  background: var(--bg-sunk);
}
.viewer-page-img {
  display: block;
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.viewer-page-img img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - 14rem);
  margin-inline: auto;
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow-md);
  transition: opacity 0.25s;
}
.viewer-page-img[aria-pressed='true'] {
  max-width: none;
  cursor: zoom-out;
}
.viewer-page-img[aria-pressed='true'] img {
  width: min(180%, 1800px);
  max-width: none;
  max-height: none;
}
.viewer-page-img.is-loading img {
  opacity: 0.2;
}
.viewer-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  padding: var(--s-2);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--ink-2);
}
.viewer-pager[hidden] {
  display: none;
}
.viewer-pager .icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
body.has-dialog {
  overflow: hidden;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  z-index: 90;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: var(--fs-sm);
  font-weight: 560;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, 140%);
  opacity: 0;
  transition:
    transform 0.45s var(--ease-spring),
    opacity 0.3s;
  pointer-events: none;
}
.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* ---------- 404 ---------- */
.not-found {
  position: relative;
  isolation: isolate;
  min-height: calc(100dvh - var(--header-h));
  display: grid;
  align-items: center;
  padding-block: var(--s-8);
  overflow: hidden;
}
.e404-inner {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: start;
  gap: var(--s-4);
  max-width: 44rem;
}
.nf-code {
  display: flex;
  font-family: var(--mono);
  font-size: clamp(5.5rem, 3rem + 12vw, 11rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.9;
}
.nf-code span {
  color: var(--c);
  text-shadow: 0 0 28px color-mix(in oklch, var(--c) 45%, transparent);
}
.e404-zero {
  display: inline-block;
  animation: e404-spin 9s linear infinite;
}
@keyframes e404-spin {
  to { rotate: 360deg; }
}
.not-found h1 {
  font-size: var(--fs-xl);
  letter-spacing: -0.03em;
}
.e404-body {
  color: var(--ink-2);
  font-size: var(--fs-md);
  max-width: 52ch;
}
.e404-links {
  display: grid;
  gap: var(--s-2);
  width: min(100%, 30rem);
  margin: var(--s-2) 0 var(--s-4);
  padding: 0;
  list-style: none;
}
.e404-link {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 52px;
  padding: 0 var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font-weight: 560;
  text-decoration: none;
  transition:
    border-color 0.2s,
    transform 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}
.e404-link > .icon:first-child {
  color: var(--accent);
}
.e404-link span {
  flex: 1;
}
.e404-arrow {
  color: var(--ink-3);
  transition: transform 0.3s var(--ease-out);
}
.e404-link:hover {
  border-color: var(--accent-line);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}
.e404-link:hover .e404-arrow {
  color: var(--accent);
  transform: translateX(3px);
}
.page-404 .header-actions {
  margin-left: auto;
}
@media (prefers-reduced-motion: reduce) {
  .e404-zero {
    animation: none;
  }
}

/* ---------- motion: reveal (JS-enabled only, content visible without JS) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(4px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out),
    filter 0.9s var(--ease-out);
  transition-delay: var(--delay, 0ms);
}
.js .reveal.is-in {
  opacity: 1;
  transform: none;
  filter: none;
}
.js .cert-card.reveal.is-in {
  transform: rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
}
.js .hero-copy > * {
  animation: rise 0.9s var(--ease-out) both;
}
.js .hero-copy > :nth-child(2) { animation-delay: 60ms; }
.js .hero-copy > :nth-child(3) { animation-delay: 140ms; }
.js .hero-copy > :nth-child(4) { animation-delay: 200ms; }
.js .hero-copy > :nth-child(5) { animation-delay: 260ms; }
.js .hero-copy > :nth-child(6) { animation-delay: 340ms; }
.js .portrait-frame {
  animation: portrait-in 1.2s var(--ease-out) both 120ms;
}
.js .portrait-chip {
  animation: rise 0.8s var(--ease-out) both 700ms;
}
.js .chip-company {
  animation-delay: 820ms;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}
@keyframes portrait-in {
  from {
    opacity: 0;
    clip-path: inset(12% 8% 12% 8% round 30px);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0 round var(--r-xl));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }
  .cert-card {
    transform: none !important;
  }
}

/* ---------- theme-dependent logos ---------- */
:root[data-theme='dark'] .logo-ink {
  filter: invert(1) brightness(1.1);
}
/* light/dark logo variants (Servinformación, IPN) */
.tl-logo.logo-dark {
  display: none;
}
:root[data-theme='dark'] .tl-logo.logo-light {
  display: none;
}
:root[data-theme='dark'] .tl-logo.logo-dark {
  display: block;
}

/* ---------- print ---------- */
@media print {
  .site-header,
  .hero-proof,
  .hero-actions,
  .role-toggle,
  .cert-actions,
  .contact-actions,
  .copy-btn,
  .viewer,
  .toast,
  .tl-rail {
    display: none !important;
  }
  .js .reveal {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .role-card[data-collapsed] .role-points {
    grid-template-rows: 1fr;
  }
  .contact-inner {
    background: none;
    color: #000;
  }
}

/* Small phones: keep the primary actions inside the first viewport. */
@media (max-width: 480px) {
  .hero-lede {
    display: none;
  }
}

/* ==========================================================================
   Neon layer — colour and motion (v2)
   Phosphorescent shapes in the Google Cloud palette, a career ruler in the
   timeline and per-company / per-level colour accents.
   ========================================================================== */
:root {
  --neon-green: oklch(0.72 0.2 150);
  --neon-blue: oklch(0.6 0.21 258);
  --neon-red: oklch(0.63 0.23 25);
  --neon-yellow: oklch(0.82 0.17 90);
  --neon-orange: oklch(0.72 0.19 55);
  --neon-pink: oklch(0.66 0.25 350);
  --neon-purple: oklch(0.58 0.24 295);
  --nf-opacity: 0.72;
  --nf-glow: 10px;
}
:root[data-theme='dark'] {
  --neon-green: oklch(0.84 0.22 150);
  --neon-blue: oklch(0.72 0.19 255);
  --neon-red: oklch(0.72 0.22 25);
  --neon-yellow: oklch(0.9 0.18 95);
  --neon-orange: oklch(0.8 0.18 60);
  --neon-pink: oklch(0.76 0.23 350);
  --neon-purple: oklch(0.72 0.21 295);
  --nf-opacity: 0.95;
  --nf-glow: 18px;
}
.c-green { --c: var(--neon-green); }
.c-blue { --c: var(--neon-blue); }
.c-red { --c: var(--neon-red); }
.c-yellow { --c: var(--neon-yellow); }
.c-orange { --c: var(--neon-orange); }
.c-pink { --c: var(--neon-pink); }
.c-purple { --c: var(--neon-purple); }

/* ---------- floating shapes ---------- */
[data-neon] {
  position: relative;
  isolation: isolate;
}
[data-neon] > .container,
.contact-inner > :not(.neon-field) {
  position: relative;
  z-index: 1;
}
.neon-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: inherit;
}
.nf {
  --s: 44px;
  --d: 1;
  position: absolute;
  width: var(--s);
  height: var(--s);
  opacity: var(--nf-opacity);
  color: var(--c);
  translate: calc(var(--px, 0) * var(--d) * 10px) calc(var(--py, 0) * var(--d) * 10px);
  transition: translate 0.9s var(--ease-out);
  animation: nf-float var(--dur, 9s) ease-in-out infinite alternate;
  animation-delay: var(--delay-nf, 0s);
}
.nf[data-depth='2'] { --d: 2; --dur: 11s; --delay-nf: -2s; }
.nf[data-depth='3'] { --d: 3; --dur: 13s; --delay-nf: -5s; }
.nf[data-depth='4'] { --d: 4; --dur: 8s; --delay-nf: -3s; }
@keyframes nf-float {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(8px, -14px, 0) rotate(12deg); }
  100% { transform: translate3d(-6px, 10px, 0) rotate(-8deg); }
}
.nf-ring {
  border: 3px solid currentColor;
  border-radius: 50%;
  box-shadow: 0 0 var(--nf-glow) currentColor, inset 0 0 calc(var(--nf-glow) * 0.6) currentColor;
}
.nf-dot {
  --s: 14px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 var(--nf-glow) calc(var(--nf-glow) * 0.2) currentColor;
}
.nf-square {
  --s: 34px;
  border: 3px solid currentColor;
  border-radius: 8px;
  rotate: 18deg;
  box-shadow: 0 0 var(--nf-glow) currentColor;
}
.nf-pill {
  width: calc(var(--s) * 1.8);
  height: calc(var(--s) * 0.55);
  border: 3px solid currentColor;
  border-radius: 999px;
  rotate: -24deg;
  box-shadow: 0 0 var(--nf-glow) currentColor;
}
.nf-plus {
  --s: 30px;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 3px no-repeat,
    linear-gradient(currentColor, currentColor) center / 3px 100% no-repeat;
  filter: drop-shadow(0 0 calc(var(--nf-glow) * 0.5) currentColor);
}
.nf-tri svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 calc(var(--nf-glow) * 0.5) currentColor);
}

/* hero positions (kept clear of the copy column) */
.neon-hero .nf:nth-child(1) { --s: 64px; top: 9%; left: 47%; }
.neon-hero .nf:nth-child(2) { top: 20%; right: 6%; }
.neon-hero .nf:nth-child(3) { --s: 40px; bottom: 16%; left: 50%; }
.neon-hero .nf:nth-child(4) { bottom: 8%; right: 12%; }
.neon-hero .nf:nth-child(5) { top: 4%; right: 30%; }
.neon-hero .nf:nth-child(6) { --s: 26px; bottom: 34%; right: 3%; }
.neon-hero .nf:nth-child(7) { top: 50%; left: 54%; }
.neon-hero .nf:nth-child(8) { --s: 36px; top: 6%; left: 3%; }
/* experience */
.neon-exp .nf:nth-child(1) { --s: 70px; top: 5%; right: 6%; }
.neon-exp .nf:nth-child(2) { top: 38%; right: 2%; }
.neon-exp .nf:nth-child(3) { top: 62%; left: 2%; }
.neon-exp .nf:nth-child(4) { --s: 38px; bottom: 6%; right: 9%; }
/* certifications */
.neon-certs .nf:nth-child(1) { top: 7%; right: 10%; }
.neon-certs .nf:nth-child(2) { --s: 58px; top: 14%; left: 55%; }
.neon-certs .nf:nth-child(3) { top: 50%; left: 1.5%; }
.neon-certs .nf:nth-child(4) { bottom: 10%; right: 3%; }
.neon-certs .nf:nth-child(5) { --s: 36px; bottom: 4%; left: 30%; }
/* contact panel */
.neon-contact .nf:nth-child(1) { --s: 90px; top: 12%; right: 8%; }
.neon-contact .nf:nth-child(2) { --s: 46px; bottom: 16%; right: 26%; }
.neon-contact .nf:nth-child(3) { top: 18%; right: 34%; }
.neon-contact .nf:nth-child(4) { bottom: 24%; right: 6%; }
.neon-contact .nf:nth-child(5) { top: 60%; right: 44%; }
.neon-contact .nf:nth-child(6) { --s: 30px; top: 8%; left: 58%; }
.contact-inner {
  --nf-opacity: 0.95;
  --nf-glow: 18px;
}

@media (max-width: 960px) {
  /* keep only edge shapes on small screens so nothing crosses the copy */
  .neon-hero .nf:not(:nth-child(1), :nth-child(5), :nth-child(8)),
  .neon-exp .nf:nth-child(1),
  .neon-exp .nf:nth-child(3),
  .neon-certs .nf:nth-child(2),
  .neon-certs .nf:nth-child(3),
  .neon-contact .nf:nth-child(3),
  .neon-contact .nf:nth-child(5),
  .neon-contact .nf:nth-child(2) {
    display: none;
  }
  .neon-hero .nf:nth-child(1) { --s: 48px; top: 1%; left: auto; right: 4%; }
  .neon-hero .nf:nth-child(5) { top: 1.5%; right: auto; left: 40%; }
  .neon-hero .nf:nth-child(8) { top: 1%; left: 4%; }
  .neon-contact .nf:nth-child(1) { --s: 60px; top: 4%; right: 4%; }
}

/* ---------- hero status ---------- */
.hero-role {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-4);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid color-mix(in oklch, var(--neon-green) 45%, transparent);
  background: color-mix(in oklch, var(--neon-green) 12%, var(--surface));
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 560;
}
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 10px var(--neon-green);
}
.chip-company .icon {
  color: var(--neon-blue);
}

/* ---------- career summary + ruler ---------- */
.career-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-6);
  margin-bottom: var(--s-7);
  padding: var(--s-5) var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.career-total {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
}
.career-total strong {
  font-size: clamp(2.5rem, 1.8rem + 2.5vw, 3.6rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.career-total span {
  font-size: var(--fs-md);
  font-weight: 560;
  max-width: 11ch;
  line-height: 1.2;
}
.career-range {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: var(--fs-sm);
}
.career-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.career-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.career-legend strong {
  color: var(--ink);
}
.legend-swatch {
  width: 22px;
  height: 6px;
  border-radius: 999px;
  background: var(--c);
  box-shadow: 0 0 8px var(--c);
}

.tl-ruler {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 2px;
  padding: var(--s-3) var(--s-5) 0 0;
  text-align: right;
}
.tl-ruler::before {
  /* the parallel, colour-coded career line */
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: calc(-1 * var(--s-7));
  width: 5px;
  border-radius: 999px;
  background: var(--c);
  box-shadow: 0 0 var(--nf-glow) var(--c);
}
.tl-edu .tl-ruler::before {
  bottom: 0;
}
.tl-ruler::after {
  content: '';
  position: absolute;
  top: calc(var(--s-3) + 0.55em);
  right: -4px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--c);
}
.ruler-year small {
  font-size: var(--fs-sm);
  font-weight: 560;
  letter-spacing: 0;
  color: var(--ink-2);
}
.tl-group .tl-company {
  padding-left: var(--s-5);
}
.ruler-year {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.ruler-tenure {
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: 500;
}

/* company colour on the timeline nodes */
.tl-group[class*='c-'] .tl-role.is-lit .tl-node {
  border-color: var(--c);
  background: var(--c);
  box-shadow:
    0 0 0 5px color-mix(in oklch, var(--c) 22%, transparent),
    0 0 14px var(--c);
}
.tl-group[class*='c-'] .role-card:hover {
  border-color: color-mix(in oklch, var(--c) 60%, var(--line));
}
.role-points li::before {
  background: var(--c, var(--accent));
}

@media (max-width: 860px) {
  .career-legend {
    margin-left: 0;
  }
  .tl-ruler {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: var(--s-3);
    padding: 0 0 0 calc(var(--rail-x) * 2 + 28px);
  }
  .tl-ruler::before {
    top: 0.35em;
    bottom: auto;
    left: 0;
    right: auto;
    width: calc(var(--rail-x) * 2 + 16px);
    height: 5px;
  }
  .tl-ruler::after {
    display: none;
  }
  .ruler-year {
    font-size: var(--fs-md);
  }
  .tl-group .tl-company {
    padding-left: calc(var(--rail-x) * 2 + 28px);
  }
}
@media (max-width: 480px) {
  .tl-ruler,
  .tl-group .tl-company {
    padding-left: 28px;
  }
  .tl-ruler::before {
    width: 18px;
  }
  .career-summary {
    padding: var(--s-4);
  }
}

/* ---------- certification + skills colour ---------- */
.level-professional { --c: var(--neon-yellow); }
.level-associate { --c: var(--neon-blue); }
.level-foundational { --c: var(--neon-purple); }
.cert-card:hover,
.cert-card.is-hovered,
.cert-card:focus-within {
  border-color: color-mix(in oklch, var(--c) 70%, var(--line));
  box-shadow:
    0 8px 16px oklch(0.2 0.05 264 / 0.08),
    0 0 0 1px color-mix(in oklch, var(--c) 40%, transparent),
    0 14px 32px color-mix(in oklch, var(--c) 28%, transparent);
}
.skill-group:nth-child(1) { --c: var(--neon-green); }
.skill-group:nth-child(2) { --c: var(--neon-blue); }
.skill-group:nth-child(3) { --c: var(--neon-pink); }
.skill-group:nth-child(4) { --c: var(--neon-orange); }
.skill-group {
  border-top-color: var(--c);
  box-shadow:
    0 -6px 16px -12px var(--c),
    var(--shadow-sm);
  transition:
    transform 0.4s var(--ease-out),
    box-shadow 0.4s var(--ease-out);
}
.skill-group:hover {
  transform: translateY(-3px);
  box-shadow:
    0 -6px 16px -12px var(--c),
    0 14px 32px color-mix(in srgb, var(--c) 18%, transparent);
}
.chips li:hover {
  border-color: var(--c);
  box-shadow: 0 0 10px color-mix(in oklch, var(--c) 45%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .nf {
    animation: none;
    translate: none;
  }
}
@media print {
  .neon-field,
  .tl-ruler::before {
    display: none;
  }
}
