/* ==========================================================================
   Marcelo Oviedo — CV site (dark / tech)
   Mobile-first. Sections: tokens · base · utilities · buttons · nav · hero · visual
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg: #06080C;
  --bg-2: #0B0F16;
  --surface: #10151F;
  --text: #ECF1F8;
  --text-70: rgba(236, 241, 248, 0.72);
  --text-50: rgba(236, 241, 248, 0.52);
  --line: rgba(236, 241, 248, 0.10);
  --line-strong: rgba(236, 241, 248, 0.18);
  --accent: #22D3EE;          /* electric cyan */
  --accent-2: #3B82F6;        /* deep blue for gradients */
  --accent-glow: rgba(34, 211, 238, 0.35);
  --on-accent: #031015;
  --plate: #EEF2F7;           /* light plate behind brand logos */
  --ok: #34D399;

  --font-display: "Chakra Petch", "Space Grotesk", system-ui, sans-serif;
  --font-sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --radius: 10px;
  --nav-h: 72px;
  --cut: 12px;                /* chamfered-corner size */
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
p { margin: 0; }

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

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

/* ---------- Utilities ---------- */
.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: absolute;
  left: 1rem; top: -100px;
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.accent { color: var(--accent); }

.eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-70);
}
.eyebrow span { color: var(--accent); }
.eyebrow::before {
  content: "";
  display: inline-block;
  vertical-align: middle;
  margin: -2px .6rem 0 0;
  width: 18px; height: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ---------- Buttons & links ---------- */
.btn {
  --clip: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 50px;
  padding: .8rem 1.5rem;
  font-family: var(--font-display);
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  clip-path: var(--clip);
  transition: transform .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease), filter .2s var(--ease);
}
.btn--accent {
  background: var(--accent);
  color: var(--on-accent);
}
.btn--accent:hover {
  transform: translateY(-1px);
  filter: brightness(1.08) drop-shadow(0 0 14px var(--accent-glow));
}
.btn--ghost {
  background: var(--line-strong);
  color: var(--text);
  position: relative;
}
.btn--ghost:hover { background: var(--accent); color: var(--on-accent); }
.btn--sm {
  --cut: 8px;
  min-height: 40px;
  padding: .45rem 1.05rem;
  font-size: .76rem;
}
.btn__icon { width: 16px; height: 16px; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 50px;
  font-family: var(--font-display);
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
}
.link-arrow span { color: var(--accent); transition: transform .2s var(--ease); }
.link-arrow:hover { color: var(--accent); }
.link-arrow:hover span { transform: translateX(4px); }

/* ==========================================================================
   NAV
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding: .9rem var(--gutter) 0;
  transition: padding .25s var(--ease);
}
/* Once the page scrolls, the bar gets a more solid background */
.site-header.is-scrolled { padding-top: .6rem; }
.site-header.is-scrolled .nav {
  background: rgba(8, 11, 17, .88);
  border-color: var(--line-strong);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.nav { transition: background-color .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease); }

/* Anchored sections stop below the fixed bar */
section[id] { scroll-margin-top: 84px; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 58px;
  padding: .45rem .55rem .45rem .7rem;
  background: rgba(10, 14, 21, .62);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-family: var(--font-display);
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.nav__mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--on-accent);
  background: var(--accent);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

/* Mobile toggle */
.nav__toggle {
  display: inline-grid;
  place-content: center;
  gap: 6px;
  width: 44px; height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.nav__toggle-bar {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  transition: transform .25s var(--ease);
}
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:first-of-type { transform: translateY(4px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:last-of-type  { transform: translateY(-4px) rotate(-45deg); }

/* Mobile menu (dropdown panel) */
.nav__menu {
  position: absolute;
  top: calc(100% + .5rem);
  left: 0; right: 0; /* .nav (backdrop-filter) is the containing block */
  display: none;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 50px rgba(0, 0, 0, .5);
}
.nav__menu.is-open { display: flex; }

.nav__links {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
}
.nav__links a {
  display: block;
  padding: .8rem .25rem;
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-70);
  border-bottom: 1px solid var(--line);
}
.nav__links a:hover { color: var(--accent); }

@media (min-width: 900px) {
  .site-header { padding-top: 1.1rem; }
  .nav__toggle { display: none; }
  .nav__menu {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .nav__links { flex-direction: row; gap: 1.9rem; }
  .nav__links a {
    position: relative;
    padding: .35rem 0;
    font-size: .82rem;
    border: 0;
  }
  .nav__links a::before {
    content: "";
    position: absolute;
    left: -.75rem; top: 50%;
    width: 4px; height: 4px;
    background: var(--accent);
    transform: translateY(-50%) scale(0);
    transition: transform .2s var(--ease);
  }
  .nav__links a:hover { color: var(--text); }
  .nav__links a:hover::before { transform: translateY(-50%) scale(1); }
  .nav__links a.is-active { color: var(--accent); }
  .nav__links a.is-active::before { transform: translateY(-50%) scale(1); }
}

/* Active section in the mobile dropdown too */
.nav__links a.is-active { color: var(--accent); }

/* ==========================================================================
   HERO
   Mobile: visual + photo on top, text below. Desktop (≥960px): split screen.
   ========================================================================== */
.hero {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(60% 50% at 75% 45%, rgba(34, 211, 238, .08), transparent 70%),
    var(--bg);
}

.hero__visual { order: 1; }
.hero__panel  { order: 2; }

.hero__panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.5rem;
  padding: 2.5rem var(--gutter) 2rem;
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  max-width: 38rem;
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 11vw, 5.4rem);
  font-weight: 600;
  line-height: .95;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.hero__line { display: block; }
.hero__line--indent { padding-left: 1.6em; }
.hero__title .accent { text-shadow: 0 0 28px var(--accent-glow); }

.hero__id { display: grid; gap: .35rem; }

.hero__name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: .04em;
}

.hero__role {
  font-family: var(--font-display);
  font-size: .86rem;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: .06em;
  color: var(--text-70);
}

.hero__intro {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-70);
  max-width: 33rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.8rem;
  margin-top: .3rem;
}

/* Credential strip */
.credentials {
  list-style: none;
  margin: 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1.5rem;
  font-family: var(--font-display);
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-50);
}
.credentials li { display: inline-flex; align-items: center; gap: .55rem; white-space: nowrap; }
.credentials li::before {
  content: "";
  width: 5px; height: 5px;
  background: var(--accent);
  opacity: .8;
}

/* ==========================================================================
   VISUAL PANEL (grid + network globe + portrait)
   ========================================================================== */
.hero__visual {
  position: relative;
  overflow: hidden;
  min-height: 540px;
  padding: calc(var(--nav-h) + 2.5rem) var(--gutter) 4.5rem;
  display: grid;
  place-items: center;
  isolation: isolate;
}

/* Fine blueprint grid that fades out at the edges */
.grid-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 50%, #000 30%, transparent 80%);
  mask-image: radial-gradient(70% 60% at 50% 50%, #000 30%, transparent 80%);
  opacity: .6;
}

.globe {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

/* Portrait card with HUD corner brackets */
.portrait {
  position: relative;
  z-index: 1;
  margin: 0;
  width: min(52vw, 280px);
  aspect-ratio: 4 / 5;
  padding: 8px;
  background: rgba(10, 14, 21, .55);
  border: 1px solid var(--line-strong);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8), 0 0 60px -20px var(--accent-glow);
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
  filter: saturate(.9) contrast(1.05);
}
.portrait__corner {
  position: absolute;
  width: 22px; height: 22px;
  border: 2px solid var(--accent);
  pointer-events: none;
}
.portrait__corner--tl { top: -6px; left: -6px; border-right: 0; border-bottom: 0; }
.portrait__corner--br { bottom: -6px; right: -6px; border-left: 0; border-top: 0; }

/* Dark frosted glass card */
.glass-card {
  position: absolute;
  z-index: 2;
  left: var(--gutter);
  bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .85rem;
  max-width: calc(100% - 2 * var(--gutter));
  padding: .85rem 1.15rem;
  background: rgba(16, 21, 31, .6);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}
.glass-card p {
  display: grid;
  gap: .1rem;
  font-family: var(--font-display);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1.45;
}
.glass-card strong { font-weight: 600; color: var(--text); }
.glass-card__meta { color: var(--text-50); }

.glass-card__dot {
  flex: none;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ok);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); }
  70%  { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ---------- Tablet ---------- */
@media (min-width: 600px) {
  .hero__visual { min-height: 620px; }
  .glass-card { left: auto; right: var(--gutter); bottom: 2rem; }
}

/* ---------- Desktop: split screen ---------- */
@media (min-width: 960px) {
  .hero {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
    min-height: 100svh;
  }
  .hero__panel {
    order: 1;
    padding: calc(var(--nav-h) + 4rem) var(--gutter) 2.25rem;
  }
  .hero__content { margin-block: auto; }
  .hero__title { font-size: clamp(3.6rem, 6.2vw, 6rem); }
  .hero__visual {
    order: 2;
    min-height: 100%;
    padding-top: calc(var(--nav-h) + 3rem);
    border-left: 1px solid var(--line);
  }
  .portrait { width: min(19vw, 280px); transform: translate(-48%, 22%); }
  .glass-card { left: auto; right: 7%; bottom: 8%; }
}

@media (min-width: 1280px) {
  .hero__panel { padding-left: max(var(--gutter), calc((100vw - 1440px) / 2 + 3.5rem)); }
}

/* ==========================================================================
   SHARED SECTION LAYOUT
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(4.5rem, 10vw, 8rem); }

.section__head {
  display: grid;
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.section__title .accent { text-shadow: 0 0 24px var(--accent-glow); }

/* Scroll reveal (JS adds .is-visible; without JS everything stays visible) */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: var(--delay, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   2. NUMBERS
   ========================================================================== */
.stats {
  border-block: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
.stats__list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1320px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}
.stat {
  padding: 2rem var(--gutter);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: .6rem;
  align-content: start;
}
.stat:nth-child(odd) { border-right: 1px solid var(--line); }
.stat:nth-last-child(-n+2) { border-bottom: 0; }

.stat__value {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 9vw, 4.4rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.stat__label {
  font-size: .92rem;
  line-height: 1.5;
  color: var(--text-50);
  max-width: 18rem;
}

@media (min-width: 900px) {
  .stats__list { grid-template-columns: repeat(4, 1fr); }
  .stat { padding-block: 3rem; border-bottom: 0; border-right: 1px solid var(--line); }
  .stat:last-child { border-right: 0; }
}

/* ==========================================================================
   3. SELECTED WORK
   ========================================================================== */
.work { background: var(--bg-2); }

.work__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 700px)  { .work__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .work__grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }

.card {
  --illo-bg: var(--surface);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  padding: 1.25rem 1.4rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.card::after { /* accent line on the cut corner */
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 26px; height: 1px;
  background: var(--line-strong);
  transform-origin: right top;
  transform: translate(0, 0) rotate(45deg) translate(1px, 0);
  transition: background-color .3s var(--ease);
}
.card:hover { border-color: rgba(34, 211, 238, .4); background: #121926; --illo-bg: #121926; }
.card:hover::after { background: var(--accent); }

.card__art {
  margin: -.25rem -.4rem .25rem;
  aspect-ratio: 3 / 2;
  display: grid;
  place-items: center;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 24px 24px;
  -webkit-mask-image: radial-gradient(80% 80% at 50% 50%, #000 55%, transparent 100%);
  mask-image: radial-gradient(80% 80% at 50% 50%, #000 55%, transparent 100%);
}

/* Line-art illustration */
.illo {
  width: 100%;
  height: 100%;
  stroke: rgba(236, 241, 248, .62);
  stroke-width: 1.1;
  stroke-linejoin: round;
  stroke-linecap: round;
  fill: none;
  overflow: visible;
}
.illo .f { fill: var(--illo-bg); transition: fill .3s var(--ease); }
.illo .a { stroke: var(--accent); }
.card:hover .illo { stroke: rgba(236, 241, 248, .85); }

.card__index {
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .2em;
  color: var(--accent);
}
.card__title {
  margin: -.4rem 0 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.card__text {
  font-size: .95rem;
  line-height: 1.6;
  color: var(--text-70);
}

/* ---------- Illustration motion ----------
   Subtle loops; the global reduced-motion rule at the end switches them off. */
.illo * { transform-box: fill-box; transform-origin: center; }

/* shared: dashed connectors flow, accent shapes breathe */
@keyframes flow    { to { stroke-dashoffset: -14; } }
@keyframes breathe { 0%, 100% { stroke-opacity: .55; } 50% { stroke-opacity: 1; } }

/* 01 pipeline: data flows into the stages, the active stage pulses */
.art--pipeline [stroke-dasharray] { animation: flow 1s linear infinite; }
.art--pipeline polygon.a          { animation: breathe 2.4s ease-in-out infinite; }

/* 02 shield + globe: the globe spins, the check mark re-draws */
@keyframes spin-a { 0%, 100% { rx: 14px; } 50% { rx: 36px; } }
@keyframes spin-b { 0%, 100% { rx: 28px; } 50% { rx: 6px; } }
.art--shield ellipse:nth-of-type(1) { animation: spin-a 5s ease-in-out infinite; }
.art--shield ellipse:nth-of-type(2) { animation: spin-b 5s ease-in-out infinite; }
@keyframes check {
  0%, 15%  { stroke-dashoffset: 40; }
  45%, 85% { stroke-dashoffset: 0; }
  100%     { stroke-dashoffset: -40; }
}
.art--shield polyline.a { stroke-dasharray: 40; animation: check 3.2s ease-in-out infinite; }

/* 03 nodes: messages travel to the hub, the hub pulses */
.art--nodes [stroke-dasharray] { animation: flow .9s linear infinite; }
.art--nodes polygon.a          { animation: breathe 1.8s ease-in-out infinite; }

/* 04 chart: the trend line draws itself, bars glow in sequence */
@keyframes draw {
  0%       { stroke-dashoffset: 220; }
  55%, 85% { stroke-dashoffset: 0; }
  100%     { stroke-dashoffset: 0; opacity: 0; }
}
.art--chart polyline.a:not([stroke-dasharray]) { stroke-dasharray: 220; animation: draw 3.6s ease-out infinite; }
.art--chart polygon.a { animation: breathe 3.6s ease-in-out infinite; }

/* 05 AI: sparkles twinkle and turn */
@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0deg);   opacity: 1; }
  50%      { transform: scale(.72) rotate(45deg); opacity: .55; }
}
@keyframes glow-star {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 0 rgba(34, 211, 238, 0)); }
  50%      { transform: scale(1.08); filter: drop-shadow(0 0 6px rgba(34, 211, 238, .7)); }
}
.art--ai polygon:nth-last-of-type(3) { animation: glow-star 3s ease-in-out infinite; }
.art--ai polygon:nth-last-of-type(2) { animation: twinkle 2.6s ease-in-out infinite; }
.art--ai polygon:nth-last-of-type(1) { animation: twinkle 2.6s ease-in-out -1.3s infinite; }
.art--ai [stroke-dasharray]          { animation: flow 1.2s linear infinite reverse; }

/* 06 tower: signal waves radiate outwards */
@keyframes wave {
  0%, 100% { opacity: .12; }
  20%      { opacity: 1; }
  50%      { opacity: .12; }
}
.art--tower path { animation: wave 2.4s ease-in-out infinite; }
.art--tower path:nth-of-type(3), .art--tower path:nth-of-type(4) { animation-delay: .3s; }
.art--tower path:nth-of-type(5), .art--tower path:nth-of-type(6) { animation-delay: .6s; }

/* Tool logos */
.tools {
  list-style: none;
  margin: auto 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
}
/* Logos always in their original colours, straight on the dark tile.
   On hover a light "plate" (like an app icon) fades in behind the logo. */
.tool {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 9px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease);
}
.tool img { grid-area: 1 / 1; width: 20px; height: 20px; object-fit: contain; }
.tool:hover {
  transform: translateY(-2px);
  background: var(--plate);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7), 0 0 0 2px var(--accent), 0 0 18px var(--accent-glow);
}

/* Logos with an official light + dark version (OpenAI Blossom): swap when the plate appears */
.on-plate { opacity: 0; }
.on-dark, .on-plate { transition: opacity .25s var(--ease); }
.tool:hover .on-dark, .logo:hover .on-dark { opacity: 0; }
.tool:hover .on-plate, .logo:hover .on-plate { opacity: 1; }

/* Tooltip with the tool name */
.tool[data-name]::after {
  content: attr(data-name);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  padding: .3rem .55rem;
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text);
  background: #1A2230;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  opacity: 0;
  transform: translate(-50%, 4px);
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.tool[data-name]:hover::after { opacity: 1; transform: translate(-50%, 0); }

/* Text chip for tools without a logo */
.tool--chip {
  width: auto;
  padding: 0 .75rem;
  font-family: var(--font-display);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8B95A7;
}
.tool--chip:hover { color: var(--text); }

/* ==========================================================================
   4. EXPERIENCE (timeline)
   ========================================================================== */
.experience { background: var(--bg); }

.timeline {
  --date-col: 0px;
  --rail: 0px;              /* x position of the vertical line */
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline::before {
  content: "";
  position: absolute;
  top: .6rem; bottom: .6rem;
  left: var(--rail);
  width: 1px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--line-strong) 18%, var(--line) 100%);
}

.job {
  position: relative;
  display: grid;
  gap: .4rem;
  padding: 0 0 2.6rem 1.75rem;
}
.job:last-child { padding-bottom: 0; }

/* node on the rail */
.job::before {
  content: "";
  position: absolute;
  left: calc(var(--rail) - 4px);
  top: .45rem;
  width: 9px; height: 9px;
  background: var(--bg);
  border: 1px solid var(--text-50);
  transform: rotate(45deg);
}

.job__date {
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-50);
  font-variant-numeric: tabular-nums;
}
.job__body { display: grid; gap: .35rem; max-width: 46rem; }
.job__role {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .8rem;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: .04em;
}
.job__meta {
  font-family: var(--font-display);
  font-size: .86rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-70);
}
.job__company { color: var(--text); }
.job__text { color: var(--text-70); font-size: .97rem; line-height: 1.65; margin-top: .2rem; }

/* Current role in accent */
.job--current::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, .15), 0 0 16px var(--accent-glow);
}
.job--current .job__date,
.job--current .job__role { color: var(--accent); }
.job__now {
  padding: .2rem .55rem;
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--on-accent);
  background: var(--accent);
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
}

.job:not(.job--current):hover::before { border-color: var(--accent); }

@media (min-width: 760px) {
  .timeline { --date-col: 200px; --rail: 220px; }
  .job {
    grid-template-columns: var(--date-col) 1fr;
    column-gap: calc((var(--rail) - var(--date-col)) * 2 + 1.25rem);
    padding-left: 0;
  }
  .job__date { text-align: right; padding-top: .25rem; }
}

/* ==========================================================================
   5. TOOLBOX (logo grid)
   ========================================================================== */
.toolbox { background: var(--bg-2); border-top: 1px solid var(--line); }

.toolbox__groups { display: grid; gap: 2.5rem; }

.toolgroup { display: grid; gap: 1rem; }
.toolgroup__title {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: .8rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.toolgroup__num { font-size: .75rem; color: var(--accent); letter-spacing: .2em; }

.toolgroup__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: .6rem;
}
@media (min-width: 600px) {
  .toolgroup__grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .75rem; }
}

.logo {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  align-items: center;
  gap: .6rem;
  min-height: 100px;
  padding: .9rem .4rem .8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  transition: border-color .25s var(--ease), background-color .25s var(--ease), transform .25s var(--ease);
}
/* Hover: the whole tile "window" lights up (inner glow + accent edge),
   and the logo plate glows. clip-path cuts outer shadows, so the tile glow is inset. */
.logo:hover {
  border-color: rgba(34, 211, 238, .6);
  background: #121926;
  transform: translateY(-2px);
  box-shadow: inset 0 0 28px rgba(34, 211, 238, .18), inset 0 1px 0 rgba(34, 211, 238, .5);
}

.logo__mark {
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 12px;
  background: transparent;
  transition: box-shadow .25s var(--ease), transform .25s var(--ease), background-color .25s var(--ease);
}
.logo__mark img { grid-area: 1 / 1; width: 28px; height: 28px; object-fit: contain; }
.logo:hover .logo__mark {
  transform: scale(1.06);
  background: var(--plate);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7), 0 0 22px var(--accent-glow);
}

.logo__name {
  font-family: var(--font-display);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.3;
  color: var(--text-50);
  transition: color .25s var(--ease);
}
.logo:hover .logo__name { color: var(--text); }

/* The Blossom SVG ships with its required clear space built in, so it is drawn larger */
.tool.tool--blossom img { width: 30px; height: 30px; max-width: none; }
.logo.logo--blossom .logo__mark img { width: 46px; height: 46px; max-width: none; }

/* Tools without an icon: the name itself is the mark */
.logo--text { grid-template-rows: 1fr; }
.logo--text .logo__mark {
  width: auto; height: auto;
  border-radius: 0;
  background: none;
  box-shadow: none;
  max-width: 100%;
  padding: .35rem .5rem;
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.2;
  color: #8B95A7;
  border: 1px dashed var(--line-strong);
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.logo--text:hover .logo__mark { color: var(--accent); border-color: rgba(34, 211, 238, .5); }
.logo--text .logo__name {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

@media (min-width: 900px) {
  .toolgroup {
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
  }
  .toolgroup__title { padding-top: .5rem; flex-direction: column; gap: .4rem; }
  .toolbox__groups { gap: 2rem; }
}

/* ==========================================================================
   6. CERTIFICATIONS & EDUCATION
   ========================================================================== */
.certs { background: var(--bg); }

.certs__grid { display: grid; gap: 3rem; }
@media (min-width: 900px) { .certs__grid { grid-template-columns: 1.1fr 1fr; gap: 4rem; } }

.certs__heading {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}
.certs__heading--spaced { margin-top: 2.75rem; }

/* PMP® featured with its verifiable badge */
.pmp {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease);
}
.pmp:hover {
  border-color: rgba(34, 211, 238, .6);
  background: #121926;
  box-shadow: inset 0 0 28px rgba(34, 211, 238, .16);
}
.pmp__badge {
  flex: none;
  width: 88px; height: 88px;
  transition: transform .3s var(--ease);
}
.pmp:hover .pmp__badge { transform: rotate(-6deg) scale(1.05); }
.pmp__text { display: grid; gap: .25rem; }
.pmp__name {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .03em;
}
.pmp__meta, .credlist__meta {
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-50);
}
.pmp__verify {
  margin-top: .35rem;
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

.credlist { list-style: none; margin: 0; padding: 0; }
.credlist li {
  display: grid;
  gap: .2rem;
  padding: .85rem 0 .85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.credlist li::before {
  content: "";
  position: absolute;
  left: 0; top: 1.3rem;
  width: 5px; height: 5px;
  background: var(--accent);
  opacity: .8;
}
.credlist__name { font-weight: 500; line-height: 1.4; }
.credlist__meta { font-size: .74rem; }
.credlist__meta .accent { color: var(--accent); }

/* Languages with a level bar */
.langs { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.lang {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  grid-template-areas: "name bar" "name level";
  column-gap: 1rem;
  row-gap: .3rem;
  align-items: center;
}
.lang__name { grid-area: name; font-family: var(--font-display); font-weight: 600; letter-spacing: .06em; }
.lang__bar {
  grid-area: bar;
  height: 4px;
  background: var(--line);
  overflow: hidden;
}
.lang__bar span {
  display: block;
  height: 100%;
  width: calc(var(--level) * 100%);
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 10px var(--accent-glow);
  transform-origin: left;
  transition: transform 1.1s var(--ease) .2s;
}
.js .reveal:not(.is-visible) .lang__bar span { transform: scaleX(0); }
.lang__level {
  grid-area: level;
  font-family: var(--font-display);
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-50);
}

/* ==========================================================================
   7. BEYOND WORK
   ========================================================================== */
.beyond { background: var(--bg-2); border-top: 1px solid var(--line); }

.beyond__intro {
  display: grid;
  gap: 2rem;
  align-items: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
@media (min-width: 760px) {
  .beyond__intro { grid-template-columns: 220px 1fr; gap: 3rem; }
}
.beyond__portrait {
  position: relative;
  margin: 0;
  width: 180px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
@media (min-width: 760px) { .beyond__portrait { width: 220px; } }
.beyond__portrait::after { /* HUD corner like the hero portrait */
  content: "";
  position: absolute;
  right: -6px; bottom: -6px;
  width: 20px; height: 20px;
  border: 2px solid var(--accent);
  border-left: 0; border-top: 0;
}
.beyond__portrait img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.beyond__copy { display: grid; gap: 1rem; }
.beyond__lead { font-size: 1.1rem; line-height: 1.7; color: var(--text-70); max-width: 40rem; }

.hobbies {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 760px) { .hobbies { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }

.hobby {
  --illo-bg: var(--surface);
  display: flex;
  flex-direction: column;
  gap: .7rem;
  padding: 1rem 1rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.hobby:hover { border-color: rgba(34, 211, 238, .45); box-shadow: inset 0 0 28px rgba(34, 211, 238, .12); }

.hobby__media {
  position: relative;
  margin: 0 0 .5rem;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0d1219;
}
.hobby__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease), filter .4s var(--ease);
}
.hobby:hover .hobby__media img { transform: scale(1.04); }

/* Duotone at rest in the colours of the Bolivian flag (red · yellow · green);
   hovering the card reveals each photo's real colours. */
.tone--red    { --tone: rgba(213, 43, 30, .95); }
.tone--yellow { --tone: rgba(249, 227, 0, .9); }
.tone--green  { --tone: rgba(0, 150, 64, .95); }

.hobby__media--duotone img {
  filter: grayscale(1) contrast(1.15) brightness(.95);
}
.hobby__media--duotone::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--tone), rgba(11, 27, 58, .95));
  mix-blend-mode: color;
  pointer-events: none;
  transition: opacity .4s var(--ease);
}
.hobby:hover .hobby__media--duotone::after { opacity: 0; }
.hobby:hover .hobby__media--duotone img { filter: none; }

/* Framing per photo */
.tone--red img    { object-position: 50% 35%; }
.tone--yellow img { object-position: 30% 22%; }
/* Yellow turns olive on dark pixels, so this photo is lifted a little more at rest */
.tone--yellow.hobby__media--duotone img { filter: grayscale(1) contrast(1.1) brightness(1.2); }
.hobby:hover .tone--yellow img { filter: none; }

/* Gym photo: cropped around Marcelo; lifted a little since the original is dark */
.hobby__media--gym img { object-position: 40% 30%; }
.hobby__media--gym.hobby__media--duotone img { filter: grayscale(1) contrast(1.15) brightness(1.15); }
.hobby:hover .hobby__media--gym img { filter: brightness(1.12) contrast(1.06) saturate(1.05); }

.hobby__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.hobby__text { color: var(--text-70); font-size: .97rem; line-height: 1.6; }
.hobby .card__index { margin-top: .2rem; }

/* ==========================================================================
   8. CONTACT
   ========================================================================== */
.contact {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding-block: clamp(5rem, 12vw, 9rem);
  border-top: 1px solid var(--line);
  background:
    radial-gradient(60% 70% at 80% 50%, rgba(34, 211, 238, .08), transparent 70%),
    var(--bg);
}
.contact .grid-bg { -webkit-mask-image: radial-gradient(60% 60% at 50% 50%, #000 20%, transparent 80%); mask-image: radial-gradient(60% 60% at 50% 50%, #000 20%, transparent 80%); }

/* Cyan "cyber layer" data streams behind everything, fading out towards the centre */
.cyber {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 1;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,.6) 22%, transparent 40%, transparent 60%, rgba(0,0,0,.6) 78%, #000 100%);
  mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,.6) 22%, transparent 40%, transparent 60%, rgba(0,0,0,.6) 78%, #000 100%);
}

/* On phones the text spans the full width, so the streams stay quieter */
@media (max-width: 699px) { .cyber { opacity: .4; } }

/* Centered composition: headline · hands reaching across the full width · contact details */
.contact__inner {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 1.5rem;
}
.contact__inner--bottom { gap: 1.6rem; }

/* The dot-matrix hands band (drawn by main.js) */
.hands {
  display: block;
  width: 100%;
  height: clamp(240px, 34vw, 440px);
  margin-block: clamp(1rem, 3vw, 2.5rem);
  touch-action: pan-y;
}

.contact__title {
  margin: 0;
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 5.6rem);
  font-weight: 600;
  line-height: .95;
  letter-spacing: .01em;
  text-transform: uppercase;
  text-wrap: balance;
}
.contact__title .accent { text-shadow: 0 0 30px var(--accent-glow); }

.contact__email {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 4.6vw, 2.6rem);
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
  padding-bottom: .2rem;
  transition: color .25s var(--ease), background-size .35s var(--ease);
}
.contact__email:hover { color: var(--accent); background-size: 100% 2px; }

.contact__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.8rem; }

.contact__location {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-70);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  padding: 1.6rem var(--gutter);
  border-top: 1px solid var(--line);
  text-align: center;
  font-family: var(--font-display);
  font-size: .76rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-50);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Additions: master's in progress + Bolivian roots ---------- */
.credlist__current .credlist__name { color: var(--text); }
.credlist__focus { color: var(--text-70); font-weight: 400; }
.tag-now {
  display: inline-block;
  margin-left: .35rem;
  padding: .12rem .5rem;
  vertical-align: .1em;
  font-family: var(--font-display);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--on-accent);
  background: var(--accent);
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
}

.beyond__roots {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  max-width: 40rem;
  padding: .9rem 1.1rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-70);
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--line);
  border-left: 0;
}
/* tiny Bolivian flag: red · yellow · green bars */
.flag-bar { flex: none; display: grid; gap: 3px; width: 6px; align-self: stretch; }
.flag-bar span:nth-child(1) { background: #D52B1E; }
.flag-bar span:nth-child(2) { background: #F9E300; }
.flag-bar span:nth-child(3) { background: #007934; }
.c-red    { color: #FF5A4E; font-weight: 600; }
.c-yellow { color: #F9E300; font-weight: 600; }
.c-green  { color: #2FBF71; font-weight: 600; }
