/* =============================================================
   Agustín Osilio — Interactive CV
   Stylesheet · GitHub Dark Dimmed + Cascadia Code
   -------------------------------------------------------------
   Architecture
   1. Design tokens (CSS custom properties)
   2. Reset / base
   3. Flat card primitive
   4. Navigation (sticky top bar)
   5. Hero
   6. Sections (summary, experience, skills, education)
   7. Footer
   8. Utilities + reveal animations
   9. Responsive
   10. Accessibility (reduced motion, focus rings)
   ============================================================= */


/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* Canvas stack — github dark dimmed */
  --c-bg-0: oklch(0.21 0.012 245);   /* canvas.default  #22272e */
  --c-bg-1: oklch(0.25 0.012 240);   /* canvas.subtle   #2d333b */
  --c-bg-2: oklch(0.18 0.013 245);   /* canvas.inset    #1c2128 */

  /* Foreground */
  --c-text:       oklch(0.77 0.016 228);  /* fg.default  #adbac7 */
  --c-text-muted: oklch(0.58 0.016 230);  /* fg.muted    #768390 */

  /* Borders */
  --c-border:       oklch(0.35 0.015 240); /* border.default #444c56 */
  --c-border-muted: oklch(0.30 0.013 240); /* border.muted   #373e47 */

  /* Semantic accents */
  --c-accent:        oklch(0.65 0.175 255); /* blue      #539bf5 */
  --c-accent-bright: oklch(0.70 0.17 255);  /* blue+     #6cb6ff */
  --c-green:         oklch(0.73 0.17 148);  /* green     #6bc46d */
  --c-green-dim:     oklch(0.67 0.16 148);  /* ansi grn  #57ab5a */
  --c-purple:        oklch(0.72 0.16 300);  /* purple    #b083f0 */
  --c-yellow:        oklch(0.73 0.12 76);   /* yellow    #daaa3f */
  --c-yellow-dim:    oklch(0.63 0.12 76);   /* ansi yel  #c69026 */
  --c-cyan:          oklch(0.75 0.11 204);  /* cyan      #39c5cf */
  --c-red:           oklch(0.62 0.18 23);   /* red       #f47067 */

  /* Typography */
  --font-mono: "Cascadia Code", ui-monospace, monospace;
  --font-body: "Figtree", system-ui, sans-serif;
  --font-feat: "calt" 1;                    /* ligatures on */

  /* Type scale */
  --fs-xs:   0.75rem;
  --fs-sm:   0.875rem;
  --fs-base: 1rem;
  --fs-md:   1.125rem;
  --fs-lg:   1.375rem;
  --fs-xl:   1.75rem;
  --fs-2xl:  2.25rem;
  --fs-3xl:  3rem;
  --fs-4xl:  clamp(2.75rem, 8vw, 6rem);

  /* Space scale */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 24px;  --s-6: 32px;  --s-7: 48px;  --s-8: 64px;
  --s-9: 96px;  --s-10: 128px;

  /* Radius */
  --r-sm:   4px;
  --r-md:   6px;
  --r-lg:   12px;
  --r-pill: 9999px;

  /* Motion */
  --d-fast: 180ms;
  --d-base: 320ms;
  --d-slow: 700ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* Layout */
  --container: 1120px;
}


/* ============================================================
   2. RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--c-border) var(--c-bg-0);
}

::selection {
  background: oklch(0.65 0.175 255 / 0.35);
  color: var(--c-text);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.75;
  color: var(--c-text);
  background: var(--c-bg-0);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

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

ul, ol { padding: 0; margin: 0; list-style: none; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-weight: 600;
  letter-spacing: -0.02em;
}

p { margin: 0; }

em { font-style: normal; color: var(--c-text); font-weight: 600; }


/* ============================================================
   3. FLAT CARD PRIMITIVE
   Base for all raised surfaces. No blur, no glass.
   canvas.subtle background + 1px border.default.
   ============================================================ */
.glass {
  background: var(--c-bg-1);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}

.glass--card {
  padding: var(--s-6);
  transition: border-color var(--d-fast) var(--ease-out);
}

/* Hover highlight lives on interactive cards only (.exp, .project),
   so the accent border keeps signaling "you can act here". */


/* ============================================================
   4. NAVIGATION
   Sticky flat top bar with bottom border. Not a floating pill.
   ============================================================ */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--c-bg-0);
  border-bottom: 1px solid var(--c-border);
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-6);
  padding: 0 var(--s-5);
  height: 56px;
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-weight: 500;
  font-size: var(--fs-sm);
  color: var(--c-text);
}

.nav__brand-mark {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: var(--r-md);
  background: var(--c-bg-1);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  margin-left: auto;
}

.nav__links {
  display: flex;
  gap: var(--s-5);
  font-size: var(--fs-xs);
}

.nav__links a {
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  color: var(--c-text-muted);
  transition: color var(--d-fast) var(--ease-out);
  position: relative;
  padding-bottom: 2px;
}
.nav__links a:hover { color: var(--c-text); }
.nav__links a.is-active { color: var(--c-accent); }

.nav__links a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -19px;
  height: 2px;
  background: var(--c-accent);
}

/* Hamburger toggle — hidden on desktop */
.nav__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  margin-left: auto;
  padding: 0;
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text);
  cursor: pointer;
  transition: background var(--d-fast) var(--ease-out);
}
.nav__toggle:hover { background: var(--c-bg-1); }

.nav__icon { display: block; }
.nav__icon--close { display: none; }
.nav.is-open .nav__icon--menu { display: none; }
.nav.is-open .nav__icon--close { display: block; }


/* ============================================================
   5. HERO
   ============================================================ */
.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-9) var(--s-5) var(--s-9);
  text-align: left;
  position: relative;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 6px 14px;
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  letter-spacing: 0.04em;
  color: var(--c-yellow);
  border: 1px solid oklch(0.73 0.12 76 / 0.35);
  border-radius: var(--r-pill);
  background: oklch(0.73 0.12 76 / 0.10);
  margin-bottom: var(--s-5);
}

.hero__eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-yellow);
  animation: pulse 2.4s ease-in-out infinite;
}

.hero__name {
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-4xl);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--c-text);
  margin-bottom: var(--s-5);
}

.hero__role {
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: clamp(1.25rem, 3.2vw, 2rem);
  font-weight: 500;
  color: var(--c-text);
  line-height: 1.2;
  margin-bottom: var(--s-5);
  display: flex;
  flex-wrap: wrap;
  gap: 1ch;
  align-items: baseline;
}
.hero__role-static { color: var(--c-text-muted); letter-spacing: 0; }

.hero__role-rotator {
  display: inline-grid;
  grid-template-areas: "stack";
  vertical-align: baseline;
}

.hero__role-item {
  grid-area: stack;
  padding-bottom: 0.18em;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--c-accent);
  opacity: 0;
  transition: opacity var(--d-base) var(--ease-out);
  white-space: nowrap;
}
.hero__role-item.is-active {
  opacity: 1;
}

/* Terminal block caret after the rotating phrase. Lives on every item so it
   crossfades together with the text; only the active one is visible. */
.hero__role-item::after {
  content: "";
  display: inline-block;
  width: 0.5ch;
  height: 1em;
  margin-left: 0.18ch;
  vertical-align: text-bottom;
  background: var(--c-accent);
  animation: caret-blink 1.1s step-end infinite;
}

@keyframes caret-blink {
  50% { opacity: 0; }
}

.hero__intro {
  max-width: 56ch;
  color: var(--c-text-muted);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.75;
  margin-bottom: var(--s-6);
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-bottom: var(--s-7);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-xs);
  color: var(--c-text);
  background: var(--c-bg-1);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  transition: border-color var(--d-fast) var(--ease-out);
}
.chip:hover { border-color: var(--c-accent); }
.chip--muted { color: var(--c-text-muted); cursor: default; }
.chip--muted:hover { border-color: var(--c-border); }

.hero__scroll {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  transition: color var(--d-fast) var(--ease-out);
}
.hero__scroll:hover { color: var(--c-text); }


/* ============================================================
   6. SECTIONS
   ============================================================ */

/* --- Section scaffold --- */
.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-7) var(--s-5);
}

.section__head {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-bottom: var(--s-7);
}

.section__index {
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-xs);
  color: var(--c-accent);
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.section__title {
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--c-text);
}

.section__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, oklch(0.65 0.175 255 / 0.35), transparent);
}


/* --- Summary --- */
.summary {
  font-size: var(--fs-md);
  line-height: 1.75;
}

.summary__intro {
  display: flex;
  align-items: center;
  gap: var(--s-6);
}

.summary__photo {
  flex-shrink: 0;
  width: 150px;
  height: 150px;
  border-radius: var(--r-lg);
  object-fit: cover;
  border: 1px solid var(--c-border);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
}

.summary__intro p {
  font-family: var(--font-body);
  color: var(--c-text);
}

.summary p + p { margin-top: var(--s-4); }

.summary__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-4);
  margin-top: var(--s-6);
  padding-top: var(--s-6);
  border-top: 1px solid var(--c-border-muted);
}

.stat__num {
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-3xl);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--c-text);
  line-height: 1;
}

.stat__num--text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  font-size: var(--fs-2xl);
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
  /* Reserve two lines so all three titles occupy equal height and their
     labels line up, keeping uniform spacing across the three stats. */
  min-height: 2.2em;
}

/* Secondary word under a pillar title (e.g. "Builder" below "End-to-End") — same size/color, own line */
.stat__num-suffix {
  display: block;
}

@media (max-width: 460px) {
  .stat__num--text { font-size: var(--fs-xl); }
}

.stat__label {
  margin-top: var(--s-2);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  text-align: center;
  text-wrap: balance;
}

/* Stat label accent colors — Operations:purple(done/past), AI Dev:green(live/current) */
.summary__stats .stat:nth-child(1) .stat__num { color: var(--c-green); }
.summary__stats .stat:nth-child(2) .stat__num { color: var(--c-accent); }
.summary__stats .stat:nth-child(3) .stat__num { color: var(--c-accent); }

/* --- Experience timeline --- */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  padding-left: var(--s-6);
}

.timeline::before {
  content: "";
  position: absolute;
  top: 8px; bottom: 8px;
  left: 8px;
  width: 1px;
  background: linear-gradient(180deg,
    transparent,
    oklch(0.67 0.16 148 / 0.4) 15%,
    oklch(0.72 0.16 300 / 0.4) 50%,
    oklch(0.65 0.175 255 / 0.4) 85%,
    transparent);
}

.timeline__item { position: relative; }

.timeline__dot {
  position: absolute;
  top: 30px;
  left: calc(var(--s-6) * -1 + 2px);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--c-bg-0);
  border: 2px solid var(--c-border);
}

/* Current role dot — green */
.timeline__item:has(.badge--live) .timeline__dot {
  border-color: var(--c-green);
}

/* Current role card — green border at rest, green hover (live/current semantic) */
.timeline__item:has(.badge--live) .exp {
  border-color: oklch(0.67 0.16 148 / 0.22);
}
.timeline__item:has(.badge--live) .exp:hover {
  border-color: oklch(0.67 0.16 148 / 0.55);
}

.exp {
  background: var(--c-bg-1);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--s-6);
  transition: border-color var(--d-fast) var(--ease-out);
}
.exp:hover { border-color: oklch(0.65 0.175 255 / 0.4); }

/* Whole header toggles the card (JS) — far bigger touch target than the chevron */
.exp__head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--s-4);
  cursor: pointer;
}

.exp__role {
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--c-text);
}
.exp__company {
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  color: var(--c-text-muted);
  font-size: var(--fs-xs);
  margin-top: 2px;
}
.exp__company-meta { color: var(--c-text-muted); }

.exp__meta {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  letter-spacing: 0.04em;
}

/* Live badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.badge--live {
  background: oklch(0.73 0.17 148 / 0.15);
  color: var(--c-green);
  border: 1px solid oklch(0.73 0.17 148 / 0.4);
}
.badge__pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-green);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* Expand/collapse toggle */
.exp__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--c-text-muted);
  cursor: pointer;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  transition: color var(--d-fast) var(--ease-out);
}
.exp__toggle:hover { color: var(--c-text); }

.exp__chevron {
  display: block;
  transition: transform var(--d-base) var(--ease-out);
}

.exp.is-collapsed .exp__chevron {
  transform: rotate(-90deg);
}

.exp.is-collapsed .exp__bullets,
.exp.is-collapsed .exp__tags {
  display: none;
}

/* Experience bullets — fg.default: this is the CV's primary content */
.exp__bullets {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--c-text);
  line-height: 1.75;
  position: relative;
}
.exp__bullets li {
  padding-left: var(--s-5);
  position: relative;
  max-width: 72ch;
}
.exp__bullets li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.75em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-border);
}

/* Per-card bullet dots — ANSI terminal palette mirrors skill category taxonomy */
.timeline__item:nth-child(1) .exp__bullets li::before { background: oklch(0.67 0.16 148 / 0.65); }
.timeline__item:nth-child(2) .exp__bullets li::before { background: oklch(0.72 0.16 300 / 0.55); }
.timeline__item:nth-child(3) .exp__bullets li::before { background: oklch(0.65 0.175 255 / 0.55); }
.timeline__item:nth-child(4) .exp__bullets li::before { background: oklch(0.65 0.175 255 / 0.55); }

/* Tags */
.exp__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--c-border-muted);
}
.tag {
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-xs);
  padding: 3px 8px;
  border-radius: var(--r-sm);
  background: var(--c-bg-2);
  border: 1px solid var(--c-border-muted);
  color: var(--c-text-muted);
  letter-spacing: 0.02em;
}

/* Per-card ANSI category tinting — tag borders + separator rule */
.timeline__item:nth-child(1) .exp__tags { border-top-color: oklch(0.67 0.16 148 / 0.22); }
.timeline__item:nth-child(1) .tag { border-color: oklch(0.67 0.16 148 / 0.4); }

.timeline__item:nth-child(2) .exp__tags { border-top-color: oklch(0.72 0.16 300 / 0.22); }
.timeline__item:nth-child(2) .tag { border-color: oklch(0.72 0.16 300 / 0.4); }

.timeline__item:nth-child(3) .exp__tags { border-top-color: oklch(0.65 0.175 255 / 0.22); }
.timeline__item:nth-child(3) .tag { border-color: oklch(0.65 0.175 255 / 0.4); }

.timeline__item:nth-child(4) .exp__tags { border-top-color: oklch(0.65 0.175 255 / 0.22); }
.timeline__item:nth-child(4) .tag { border-color: oklch(0.65 0.175 255 / 0.4); }


/* --- Skills --- */
.skills__filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-6);
}

.filter {
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-xs);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: transparent;
  border: 1px solid var(--c-border-muted);
  color: var(--c-text-muted);
  cursor: pointer;
  transition: all var(--d-fast) var(--ease-out);
  letter-spacing: 0.02em;
}
.filter:hover {
  color: var(--c-text);
  border-color: var(--c-border);
}
.filter.is-active { background: var(--c-bg-1); }

/* Active pill takes its category color (matches the chips it reveals) */
.filter[data-filter="all"].is-active        { border-color: var(--c-accent);          color: var(--c-accent); }
.filter[data-filter="ai"].is-active         { border-color: var(--c-green-dim);        color: var(--c-green); }
.filter[data-filter="tech"].is-active       { border-color: var(--c-accent);           color: var(--c-accent-bright); }
.filter[data-filter="frameworks"].is-active { border-color: var(--c-red);              color: oklch(0.72 0.18 23); }
.filter[data-filter="libs"].is-active       { border-color: oklch(0.72 0.15 55);       color: oklch(0.80 0.15 55); }
.filter[data-filter="infra"].is-active      { border-color: oklch(0.66 0.14 275);      color: oklch(0.74 0.14 275); }
.filter[data-filter="api"].is-active        { border-color: oklch(0.68 0.16 350);      color: oklch(0.76 0.16 350); }
.filter[data-filter="ops"].is-active        { border-color: var(--c-purple);           color: oklch(0.80 0.14 300); }
.filter[data-filter="lang"].is-active       { border-color: var(--c-cyan);             color: oklch(0.82 0.09 204); }

.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--s-3);
}

.skill {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  background: var(--c-bg-2);
  border: 1px solid var(--c-border-muted);
  border-radius: var(--r-sm);
  transition:
    border-color var(--d-fast) var(--ease-out),
    color var(--d-fast) var(--ease-out),
    opacity var(--d-fast) var(--ease-out),
    filter var(--d-fast) var(--ease-out);
}
.skill:hover {
  border-color: var(--c-border);
  color: var(--c-text);
}

/* Color only the active category's chips (driven by .skills__grid[data-active]) */
.skills__grid[data-active="ai"]         .skill[data-cat="ai"]         { border-color: var(--c-green-dim);   color: var(--c-green); }
.skills__grid[data-active="tech"]       .skill[data-cat="tech"]       { border-color: var(--c-accent);      color: var(--c-accent-bright); }
.skills__grid[data-active="frameworks"] .skill[data-cat="frameworks"] { border-color: var(--c-red);         color: oklch(0.72 0.18 23); }
.skills__grid[data-active="libs"]       .skill[data-cat="libs"]       { border-color: oklch(0.72 0.15 55);  color: oklch(0.80 0.15 55); }
.skills__grid[data-active="infra"]      .skill[data-cat="infra"]      { border-color: oklch(0.66 0.14 275); color: oklch(0.74 0.14 275); }
.skills__grid[data-active="api"]        .skill[data-cat="api"]        { border-color: oklch(0.68 0.16 350); color: oklch(0.76 0.16 350); }
.skills__grid[data-active="ops"]        .skill[data-cat="ops"]        { border-color: var(--c-purple);      color: oklch(0.80 0.14 300); }
.skills__grid[data-active="lang"]       .skill[data-cat="lang"]       { border-color: var(--c-cyan);        color: oklch(0.82 0.09 204); }

/* Non-matching chips dim back when a category is active */
.skill.is-hidden {
  opacity: 0.25;
  filter: grayscale(1);
}


/* --- Projects --- */
.projects-carousel {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.projects {
  display: flex;
  gap: var(--s-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.projects::-webkit-scrollbar { display: none; }

/* Click-and-drag to scroll (mouse). JS toggles .is-dragging while held. */
@media (hover: hover) and (pointer: fine) {
  .projects { cursor: grab; }
  .projects.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    scroll-behavior: auto;
    user-select: none;
  }
  .projects.is-dragging a { pointer-events: none; }
}

.project {
  flex: 0 0 min(380px, 100%);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}
.project:hover { border-color: oklch(0.65 0.175 255 / 0.4); }

.carousel-arrow {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-bg-1);
  border: 1px solid var(--c-border);
  color: var(--c-text-muted);
  cursor: pointer;
  transition: border-color var(--d-fast) var(--ease-out),
              color var(--d-fast) var(--ease-out),
              transform var(--d-fast) var(--ease-out);
}
.carousel-arrow:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
}
.carousel-arrow:active { transform: scale(0.92); }
.carousel-arrow:disabled {
  opacity: 0.35;
  cursor: default;
  border-color: var(--c-border-muted);
  color: var(--c-text-muted);
  transform: none;
}

.project__title {
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--c-text);
  margin-bottom: var(--s-3);
}

.project__desc {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  line-height: 1.7;
  margin-top: var(--s-4);
}

.project__media {
  width: 100%;
  border: 1px solid var(--c-border-muted);
  border-radius: var(--r-md);
}

.project__preview-link {
  display: block;
}

.project__preview-link .project__media {
  display: block;
  height: auto;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Hover = accent border lighting up, same as the rest of the site's language */
.project__preview-link:hover .project__media {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 1px var(--c-accent);
}

.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-4);
}

.project__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: auto;
  padding-top: var(--s-5);
}
.project__links .btn { padding: 8px 16px; }

/* Pagination dots — shown on all viewports */
.projects-dots {
  display: flex;
  justify-content: center;
  gap: var(--s-2);
  margin-top: var(--s-5);
}
.projects-dots__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--c-border);
  cursor: pointer;
  transition: background var(--d-fast) var(--ease-out),
              transform var(--d-fast) var(--ease-out);
}
.projects-dots__dot[aria-current="true"] {
  background: var(--c-accent);
  transform: scale(1.3);
}


/* --- Education --- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-4);
}

.edu {
  background: var(--c-bg-1);
  border: 1px solid oklch(0.72 0.16 300 / 0.22);
  border-radius: var(--r-md);
  padding: var(--s-6);
}

.edu__year {
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-xs);
  color: var(--c-purple);
  letter-spacing: 0.08em;
  margin-bottom: var(--s-3);
}
.edu__title {
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: var(--s-2);
}
.edu__school {
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-xs);
  color: var(--c-text);
  margin-bottom: var(--s-2);
}
.edu__note {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
}


/* ============================================================
   7. FOOTER
   ============================================================ */
.footer {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-9) var(--s-5) var(--s-7);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
  align-items: center;
  justify-content: space-between;
}

.footer__kicker {
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-xs);
  color: var(--c-accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--s-2);
}

.footer__title {
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--c-text);
}

.footer__actions { display: flex; gap: var(--s-3); flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all var(--d-fast) var(--ease-out);
}
.btn--primary {
  background: var(--c-accent);
  color: var(--c-bg-0);
  border: none;
}
.btn--primary:hover { background: var(--c-accent-bright); }
.btn--ghost {
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c-text);
}
.btn--ghost:hover { background: var(--c-bg-1); border-color: var(--c-accent); }

.footer__credit {
  text-align: center;
  margin-top: var(--s-6);
  font-family: var(--font-mono);
  font-feature-settings: var(--font-feat);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}


/* ============================================================
   8. UTILITIES + REVEAL ANIMATIONS
   Fade-only — no translate. Content is always at its final
   position; only opacity animates.
   ============================================================ */
.reveal {
  opacity: 0;
  transition: opacity var(--d-slow) var(--ease-out);
}
.reveal.is-visible { opacity: 1; }

/* Staggered stat reveals */
.summary__stats .stat {
  opacity: 0;
  transition: opacity 600ms var(--ease-out);
}
.summary.is-visible .stat:nth-child(1) { opacity: 1; transition-delay: 200ms; }
.summary.is-visible .stat:nth-child(2) { opacity: 1; transition-delay: 320ms; }
.summary.is-visible .stat:nth-child(3) { opacity: 1; transition-delay: 440ms; }

/* Focus rings */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}


/* ============================================================
   9. RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .nav { gap: var(--s-4); }
  .nav__menu { gap: var(--s-4); }
  .nav__links { gap: var(--s-4); }
  .summary__stats { grid-template-columns: 1fr; }
  .exp__head { flex-direction: column; }
}

@media (max-width: 720px) {
  .summary__stats { grid-template-columns: 1fr 1fr; gap: var(--s-5); }
  .summary__stats .stat:nth-child(3) { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .hero { padding-top: var(--s-8); padding-bottom: var(--s-7); }
  .section { padding: var(--s-6) var(--s-4); }

  /* Stack the portrait above the intro and center it */
  .summary__intro { flex-direction: column; align-items: center; gap: var(--s-4); }
  .summary__intro p { text-align: center; }

  /* Carousel: drop the arrows (swipe instead) so cards keep full width */
  .carousel-arrow { display: none; }
  .project { flex-basis: 90%; }

  .nav { padding: 0 var(--s-3); }
  .nav__brand-text { display: none; }
  .nav__toggle { display: inline-flex; }

  /* Dropdown panel */
  .nav__menu {
    position: absolute;
    top: calc(100% + var(--s-2));
    left: 0; right: 0;
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--s-3);
    padding: var(--s-4);
    background: var(--c-bg-1);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    visibility: hidden;
    transition:
      opacity 220ms var(--ease-out),
      transform 220ms var(--ease-out),
      visibility 220ms;
  }
  .nav.is-open .nav__menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
  }

  .nav__links {
    flex-direction: column;
    gap: 2px;
    font-size: var(--fs-base);
  }
  .nav__links a {
    display: block;
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    color: var(--c-text);
    font-weight: 500;
    transition: background var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out);
  }
  .nav__links a:hover { background: var(--c-bg-2); }
  .nav__links a.is-active::after { display: none; }
  .nav__links a.is-active {
    background: oklch(0.65 0.175 255 / 0.10);
    color: var(--c-accent);
  }

  .stat__num { font-size: var(--fs-2xl); }
  .summary__stats { grid-template-columns: 1fr; }
  .summary__stats .stat:nth-child(3) { grid-column: auto; }

  .hero__role {
    font-size: 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-2);
  }
  .hero__role-rotator { width: 100%; }
  .hero__role-item { white-space: normal; }

  .timeline { padding-left: var(--s-5); }
  .timeline__dot { left: calc(var(--s-5) * -1 + 2px); }

  .footer__inner { flex-direction: column; align-items: flex-start; }
  .footer__title { font-size: var(--fs-xl); }
}


/* ============================================================
   10. ACCESSIBILITY — prefers-reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; }
  .summary__stats .stat { opacity: 1; }
}
