/* ============================================================
   PREMIUM MOTION — Ultramarine on Ink
   Light: warm paper + blueprint grid. Dark: graphite cockpit.
   Type: Space Grotesk / Inter / JetBrains Mono.
   Motion: masked reveals, count-ups, magnetic CTAs — CSS + IO only.
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --bg:          #fbfaf7;
  --bg-alt:      #f4f2eb;
  --surface:     #ffffff;
  --grid-line:   #f0eee6;
  --ink:         #101010;
  --ink-2:       #55524a;
  --ink-3:       #8a857b;
  --line:        #e4e1d8;
  --line-strong: #d6d2c6;
  --accent:      #4f46e5;
  --accent-strong: #4338ca;
  --accent-soft: rgba(79, 70, 229, 0.10);
  --accent-glow: rgba(79, 70, 229, 0.28);

  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --ease-out: cubic-bezier(0.22, 0.61, 0.2, 1);
  --radius: 12px;

  --nav-h: 68px;
}

:root[data-theme="dark"] {
  --bg:          #101114;
  --bg-alt:      #15171b;
  --surface:     #1a1d22;
  --grid-line:   #16181c;
  --ink:         #f2f1ed;
  --ink-2:       #b3b0a8;
  --ink-3:       #807d76;
  --line:        #2a2d33;
  --line-strong: #383c44;
  --accent:      #818cf8;
  --accent-strong: #a5b0fc;
  --accent-soft: rgba(129, 140, 248, 0.14);
  --accent-glow: rgba(129, 140, 248, 0.32);
}

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

html { scroll-behavior: smooth; }

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

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-pad { padding: 110px 0; }
.alt-bg { background: var(--bg-alt); }

/* ── Scroll progress ────────────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 1000;
  pointer-events: none;
}

/* ── Section labels & titles ────────────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.section-label::before {
  content: "";
  width: 28px;
  height: 1.5px;
  background: var(--accent);
}

.section-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin-bottom: 28px;
}

/* ── Reveal / motion primitives ─────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }
.reveal.delay-4 { transition-delay: 0.32s; }
.reveal.delay-5 { transition-delay: 0.40s; }

/* Masked line reveals (hero entrance) */
.hl-line { display: block; overflow: hidden; }
.hl-inner {
  display: inline-block;
  transform: translateY(110%);
  animation: hl-up 0.9s var(--ease-out) forwards;
}
.hl-inner.d-1 { animation-delay: 0.10s; }
.hl-inner.d-2 { animation-delay: 0.22s; }
.hl-inner.d-3 { animation-delay: 0.34s; }
.hl-inner.d-4 { animation-delay: 0.48s; }
@keyframes hl-up { to { transform: translateY(0); } }

/* Highlight swipe under key word */
.hl-mark {
  font-style: normal;
  position: relative;
  white-space: nowrap;
}
.hl-mark::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0.08em;
  height: 0.32em;
  width: 0;
  background: var(--accent-glow);
  z-index: -1;
  animation: hl-swipe 0.7s var(--ease-out) 1.15s forwards;
}
@keyframes hl-swipe { to { width: 100%; } }

.arrow-nudge { display: inline-block; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }

/* ── Navbar ─────────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}
#navbar.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.nav-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}
.brand-dot { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 28px;
}
.nav-links a {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-2);
  position: relative;
  padding: 4px 0;
  transition: color 0.2s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

#theme-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
#theme-toggle:hover { border-color: var(--accent); transform: rotate(15deg); }
#theme-toggle svg { width: 17px; height: 17px; }

.btn-resume {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-resume:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

/* Burger */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px; height: 38px;
  background: none;
  border: none;
}
.nav-burger span {
  display: block;
  height: 2px;
  width: 22px;
  margin: 0 auto;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-drawer {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px 24px 22px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.nav-drawer a {
  padding: 11px 4px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.nav-drawer a:last-child { border-bottom: none; }
.nav-drawer .drawer-cta { color: var(--accent); font-weight: 600; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary, .btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: 99px;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease,
              background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  will-change: transform;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border: 1.5px solid var(--ink);
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 10px 28px var(--accent-glow);
}

.btn-outline {
  border: 1.5px solid var(--line-strong);
  color: var(--ink);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-full { width: 100%; justify-content: center; }

/* ── Hero ───────────────────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: calc(var(--nav-h) + 48px);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
}

.hero-inner {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 24px;
  padding-bottom: 40px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 22px;
}
.hero-eyebrow .hl-inner { display: inline-flex; align-items: center; gap: 10px; }
.hero-eyebrow .hl-inner::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: dot-pulse 2s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.4; }
}

.hero-headline {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.hero-sub {
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  color: var(--ink-2);
  max-width: 56ch;
  margin-top: 26px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 38px;
  opacity: 0;
  animation: fade-up 0.8s var(--ease-out) 0.75s forwards;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-socials { display: flex; gap: 6px; }
.hero-socials a {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-3);
  border: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.hero-socials a:hover {
  color: var(--accent);
  border-color: var(--line);
  transform: translateY(-2px);
}

/* Stats strip */
.hero-stats-wrap {
  border-top: 1px solid var(--line);
  opacity: 0;
  animation: fade-up 0.8s var(--ease-out) 0.9s forwards;
}
.hero-stats-row {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.hero-stat {
  padding: 20px 20px 24px 0;
  border-right: 1px solid var(--line);
}
.hero-stat + .hero-stat { padding-left: 20px; }
.hero-stat:last-child { border-right: none; }
.hero-stat-val {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  letter-spacing: -0.03em;
  display: block;
  font-variant-numeric: tabular-nums;
}
.hero-stat-lbl {
  font-size: 0.78rem;
  color: var(--ink-3);
  margin-top: 2px;
  display: block;
}

/* Marquee */
.hero-marquee {
  border-top: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  white-space: nowrap;
  padding: 10px 0;
}
.marquee-track {
  display: inline-block;
  animation: marquee 36s linear infinite;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.hero-marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { margin: 0 10px; text-transform: uppercase; }
.marquee-track .mdot { color: var(--accent); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── About ──────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: start;
}

.about-bio {
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.75;
}

.award-callout {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
}
.award-icon {
  color: var(--accent);
  display: grid;
  place-items: center;
}
.award-title { font-weight: 600; font-size: 0.92rem; }
.award-sub { font-size: 0.8rem; color: var(--ink-3); }

.about-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.competency-card {
  display: flex;
  gap: 16px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.3s var(--ease-out), border-color 0.3s ease, box-shadow 0.3s ease;
}
.competency-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}
.comp-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.comp-title { font-family: var(--font-head); font-weight: 600; font-size: 1rem; margin-bottom: 4px; }
.comp-desc { font-size: 0.86rem; color: var(--ink-2); line-height: 1.6; }

/* ── Quote stripe ───────────────────────────────────────────── */
.quote-stripe {
  background: var(--ink);
  color: var(--bg);
  padding: 56px 0;
}
:root[data-theme="dark"] .quote-stripe {
  background: var(--surface);
  color: var(--ink);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.quote-text {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  line-height: 1.4;
  letter-spacing: -0.02em;
  text-align: center;
  max-width: 56ch;
  margin: 0 auto;
}

/* ── Skills ─────────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.3s var(--ease-out), border-color 0.3s ease, box-shadow 0.3s ease;
}
.skill-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

.skill-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.skill-card-icon {
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}
.skill-card-titles { display: flex; flex-direction: column; }
.skill-card-name { font-family: var(--font-head); font-weight: 600; font-size: 1rem; }
.skill-card-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.skill-chiplist { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-chip {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-2);
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--bg);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.skill-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ── Projects ───────────────────────────────────────────────── */
.projects-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.projects-header .section-title { margin-bottom: 0; }

.project-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-btn {
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--font-mono);
  padding: 7px 15px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  transition: all 0.2s ease;
}
.pf-btn:hover { border-color: var(--accent); color: var(--accent); }
.pf-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.3s var(--ease-out), border-color 0.3s ease, box-shadow 0.3s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.07);
}
.project-card.hidden { display: none; }

.project-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.project-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.project-links { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.proj-link {
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ink-3);
  border: 1px solid var(--line);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.proj-link:hover { color: var(--accent); border-color: var(--accent); }

.metric-chip {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

.project-desc {
  font-size: 0.88rem;
  color: var(--ink-2);
  line-height: 1.65;
  flex: 1;
}

.case-study-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 14px;
  width: fit-content;
}
.case-study-link span { transition: transform 0.2s var(--ease-out); }
.case-study-link:hover span { transform: translateX(4px); }

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.proj-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-3);
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.role-pill {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 99px;
  white-space: nowrap;
}
.role-pill.ds    { background: var(--accent-soft); color: var(--accent-strong); }
.role-pill.de    { background: rgba(13, 148, 136, 0.12); color: #0d9488; }
.role-pill.mle   { background: rgba(217, 119, 6, 0.12);  color: #d97706; }
.role-pill.ai    { background: rgba(219, 39, 119, 0.1);  color: #db2777; }
.role-pill.genai { background: rgba(147, 51, 234, 0.1);  color: #9333ea; }
:root[data-theme="dark"] .role-pill.de    { color: #2dd4bf; }
:root[data-theme="dark"] .role-pill.mle   { color: #fbbf24; }
:root[data-theme="dark"] .role-pill.ai    { color: #f472b6; }
:root[data-theme="dark"] .role-pill.genai { color: #c084fc; }

/* ── Experience timeline ────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 8px; bottom: 8px;
  width: 1.5px;
  background: var(--line-strong);
}

.tl-item { position: relative; margin-bottom: 14px; }

.tl-dot {
  position: absolute;
  left: -28px;
  top: 26px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--line-strong);
  transform: translateX(0.5px);
  transition: border-color 0.3s ease, background 0.3s ease;
}
.tl-item.current .tl-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.tl-item.open .tl-dot { border-color: var(--accent); }

.tl-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.tl-item.open .tl-card {
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
}

.tl-toggle {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 20px 22px;
  color: inherit;
}

.tl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.tl-role {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.02rem;
  display: block;
}
.tl-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 3px;
}
.tl-company { font-size: 0.84rem; color: var(--accent); font-weight: 500; }
.current-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: #059669;
  background: rgba(5, 150, 105, 0.1);
  padding: 2px 9px;
  border-radius: 99px;
}
:root[data-theme="dark"] .current-tag { color: #34d399; background: rgba(52, 211, 153, 0.12); }

.tl-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.tl-period {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-3);
  white-space: nowrap;
}
.tl-chevron {
  color: var(--ink-3);
  display: grid;
  place-items: center;
  transition: transform 0.3s var(--ease-out);
}
.tl-item.open .tl-chevron { transform: rotate(180deg); color: var(--accent); }

.tl-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease-out);
}
.tl-item.open .tl-body { max-height: 600px; }

.tl-bullets {
  list-style: none;
  padding: 0 22px 22px;
}
.tl-bullet {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  font-size: 0.88rem;
  color: var(--ink-2);
  line-height: 1.6;
}
.tl-bullet::before {
  content: "";
  position: absolute;
  left: 2px; top: 0.55em;
  width: 6px; height: 6px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.7;
}
.tl-bullet b { color: var(--ink); font-weight: 600; }

/* ── Education ──────────────────────────────────────────────── */
.edu-grid { display: flex; flex-direction: column; gap: 36px; }

.edu-section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}

.edu-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.edu-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.3s var(--ease-out), border-color 0.3s ease;
}
.edu-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.edu-card-icon {
  width: 42px; height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.edu-card-title { font-family: var(--font-head); font-weight: 600; font-size: 0.98rem; }
.edu-card-sub { font-size: 0.84rem; color: var(--ink-2); }
.edu-card-meta {
  font-size: 0.76rem;
  color: var(--ink-3);
  display: flex;
  gap: 6px;
  margin-top: 2px;
}
.edu-dot { color: var(--line-strong); }

.cert-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.cert-chip {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: transform 0.25s var(--ease-out), border-color 0.25s ease;
}
.cert-chip:hover { transform: translateY(-2px); border-color: var(--accent); }
.cert-chip-logo {
  width: 26px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  filter: grayscale(1) opacity(0.75);
}
:root[data-theme="dark"] .cert-chip-logo:not(.cert-chip-logo--svg) { filter: grayscale(1) invert(1) opacity(0.8); }
.cert-chip-logo--svg {
  display: grid;
  place-items: center;
  color: var(--ink-2);
  filter: none;
}
.cert-chip-logo--svg svg { width: 100%; height: 100%; }
.cert-chip-name { font-size: 0.8rem; font-weight: 500; color: var(--ink-2); }
.cert-code-badge {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: 4px;
}

/* ── Contact ────────────────────────────────────────────────── */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 56px;
  align-items: start;
}

.contact-sub {
  color: var(--ink-2);
  margin-bottom: 30px;
  max-width: 44ch;
}

.contact-socials { display: flex; flex-direction: column; gap: 6px; }
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  padding: 9px 12px;
  margin-left: -12px;
  border-radius: 10px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  width: fit-content;
}
.social-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(4px);
}
.social-link--whatsapp:hover { color: #16a34a; background: rgba(22, 163, 74, 0.08); }

.contact-right {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--ink-2);
}
.form-optional { font-weight: 400; color: var(--ink-3); font-size: 0.7rem; }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
}
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}
.form-group ::placeholder { color: var(--ink-3); }

.form-success {
  display: none;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 500;
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
  text-align: center;
}
.form-success.show { display: block; }
:root[data-theme="dark"] .form-success { color: #34d399; background: rgba(52, 211, 153, 0.1); }

/* ── Footer ─────────────────────────────────────────────────── */
#site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0;
  background: var(--bg);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-brand { font-family: var(--font-head); font-weight: 700; font-size: 0.95rem; }
.footer-copy { font-size: 0.76rem; color: var(--ink-3); font-family: var(--font-mono); }
.footer-socials { display: flex; gap: 4px; }
.footer-socials a {
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ink-3);
  transition: color 0.2s ease;
}
.footer-socials a:hover { color: var(--accent); }

/* ── Custom cursor ──────────────────────────────────────────── */
.c-dot, .c-ring {
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2000;
  transform: translate(-50%, -50%);
}
.c-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  transition: width 0.2s ease, height 0.2s ease;
}
.c-ring {
  width: 34px; height: 34px;
  border: 1.5px solid var(--accent-glow);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease;
}
.c-dot.c-hover { width: 10px; height: 10px; }
.c-ring.c-hover {
  width: 48px; height: 48px;
  border-color: var(--accent);
}

/* ── Case-study page ────────────────────────────────────────── */
.case-page {
  padding-top: calc(var(--nav-h) + 48px);
  padding-bottom: 90px;
  min-height: 100vh;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-3);
  margin-bottom: 40px;
  transition: color 0.2s ease, transform 0.2s ease;
}
.back-link:hover { color: var(--accent); transform: translateX(-3px); }

.cs-header { margin-bottom: 56px; }
.cs-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.06;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
}
.cs-subtitle {
  font-size: 1.05rem;
  color: var(--ink-2);
  max-width: 62ch;
  line-height: 1.6;
  margin-bottom: 20px;
}
.cs-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-3);
  margin-bottom: 18px;
}
.cs-gh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-weight: 500;
}
.cs-gh:hover { text-decoration: underline; }

.cs-stack { display: flex; flex-wrap: wrap; gap: 8px; }
.stack-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-2);
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
}

.cs-section { margin-bottom: 52px; }
.cs-section h2 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.cs-section h2::before {
  content: "";
  width: 26px;
  height: 1.5px;
  background: var(--accent);
}
.cs-section p {
  color: var(--ink-2);
  line-height: 1.75;
  max-width: 72ch;
  margin-bottom: 16px;
}

.cs-steps {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cs-steps li {
  counter-increment: step;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.cs-steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 5px 8px;
  flex-shrink: 0;
  margin-top: 2px;
}
.cs-steps li span {
  color: var(--ink-2);
  line-height: 1.7;
  font-size: 0.94rem;
}

/* Architecture diagram */
.arch-diagram {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  overflow-x: auto;
}
.arch-diagram svg { width: 100%; height: auto; min-width: 560px; }
.arch-gnode rect {
  fill: var(--bg);
  stroke: var(--line-strong);
  stroke-width: 1.2;
}
.arch-gnode.arch-main rect {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.5;
}
.arch-t { fill: var(--ink); font-family: var(--font-head); font-size: 13px; font-weight: 600; }
.arch-s { fill: var(--ink-3); font-family: var(--font-mono); font-size: 10px; }
.arch-lbl { fill: var(--ink-3); font-family: var(--font-mono); font-size: 10px; }
.arch-line { stroke: var(--line-strong); stroke-width: 1.4; }
.arch-arrow-head { fill: var(--line-strong); }

.arch-flow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.arch-node {
  font-size: 0.82rem;
  font-weight: 500;
  padding: 10px 16px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}
.arch-arrow { color: var(--accent); font-weight: 700; }
.arch-caption {
  font-size: 0.82rem;
  color: var(--ink-3);
  margin-top: 14px;
  line-height: 1.6;
  max-width: 76ch;
}

.cs-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.result-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px;
}
.result-card b {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  display: block;
  margin-bottom: 4px;
}
.result-card span { font-size: 0.82rem; color: var(--ink-2); line-height: 1.5; }

.cs-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 70px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.cs-next a {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.25s ease, transform 0.25s var(--ease-out);
}
.cs-next a:hover { border-color: var(--accent); transform: translateY(-2px); }
.cs-next a:last-child { text-align: right; }
.next-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin-bottom: 5px;
}
.next-title { font-family: var(--font-head); font-weight: 600; font-size: 0.95rem; }

.cs-notfound {
  text-align: center;
  padding: 90px 0;
}
.cs-notfound h1 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 2.2rem;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.cs-notfound p { color: var(--ink-2); margin-bottom: 28px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .section-pad { padding: 80px 0; }

  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .nav-drawer.open { display: flex; }

  .about-grid,
  .contact-wrapper { grid-template-columns: 1fr; gap: 40px; }

  .skills-grid,
  .projects-grid { grid-template-columns: 1fr; }

  .cert-chips { grid-template-columns: repeat(2, 1fr); }

  .hero-stats-row { grid-template-columns: repeat(2, 1fr); }
  .hero-stat { padding-right: 16px; }
  .hero-stat + .hero-stat { padding-left: 0; }
  .hero-stat:nth-child(even) { padding-left: 20px; border-right: none; }
  .hero-stat:nth-child(n+3) { border-top: 1px solid var(--line); }

  .cs-results { grid-template-columns: 1fr; }
  .cs-next { grid-template-columns: 1fr; }
  .cs-next a:last-child { text-align: left; }
}

@media (max-width: 560px) {
  .btn-resume { display: none; }

  .hero-actions { flex-direction: column; align-items: flex-start; }

  .edu-cards { grid-template-columns: 1fr; }
  .cert-chips { grid-template-columns: 1fr; }

  .form-row { grid-template-columns: 1fr; }

  .projects-header { flex-direction: column; align-items: flex-start; }

  .timeline { padding-left: 22px; }
  .tl-dot { left: -22px; }
  .tl-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .tl-header-right { width: 100%; justify-content: space-between; }

  .footer-inner { flex-direction: column; text-align: center; }
}

/* ── Reduced motion ─────────────────────────────────────────── */
@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;
  }
  .hl-inner { transform: none; animation: none; }
  .hl-mark::after { width: 100%; animation: none; }
  .hero-actions, .hero-stats-wrap { opacity: 1; animation: none; }
  .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
  .c-dot, .c-ring { display: none; }
}
