/* ============================================================
   Mohamed Aziz ESSID — Portfolio
   Premium dark-first design · warm paper light mode
   ============================================================ */

:root {
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --accent: #d9a441;
  --accent-soft: rgba(217, 164, 65, 0.14);
  --accent-glow: rgba(217, 164, 65, 0.35);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.44, 1);
  --dur: 0.7s;

  --nav-h: 74px;
  --radius: 18px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0f13;
  --bg-elev: #15171d;
  --bg-card: rgba(255, 255, 255, 0.035);
  --text: #f2efe9;
  --text-dim: #a7a49c;
  --line: rgba(255, 255, 255, 0.09);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.65);
  --blob-1: rgba(217, 164, 65, 0.16);
  --blob-2: rgba(84, 110, 160, 0.14);
  --grain-op: 0.05;
  --accent-ink: var(--accent);
  --watermark: rgba(242, 239, 233, 0.045);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f3ec;
  --bg-elev: #fffdf8;
  --bg-card: rgba(20, 22, 28, 0.035);
  --text: #1c1d21;
  --text-dim: #66655f;
  --line: rgba(20, 22, 28, 0.12);
  --shadow: 0 24px 55px -28px rgba(60, 50, 20, 0.35);
  --blob-1: rgba(217, 164, 65, 0.22);
  --blob-2: rgba(120, 145, 190, 0.18);
  --grain-op: 0.035;
  --accent-ink: #8a5f14;
  --watermark: rgba(28, 29, 33, 0.055);
  --accent-soft: rgba(138, 95, 20, 0.12);
}

/* paper / sepia — third theme, warmer than light mode */
html[data-theme="paper"] {
  color-scheme: light;
  --bg: #efe4d0;
  --bg-elev: #f7eee0;
  --bg-card: rgba(96, 62, 24, 0.055);
  --text: #2f2418;
  --text-dim: #6b5843;
  --line: rgba(74, 51, 26, 0.16);
  --shadow: 0 24px 55px -28px rgba(74, 51, 26, 0.45);
  --blob-1: rgba(196, 128, 52, 0.24);
  --blob-2: rgba(120, 108, 78, 0.2);
  --grain-op: 0.06;
  --accent: #b8712a;
  --accent-soft: rgba(184, 113, 42, 0.15);
  --accent-glow: rgba(184, 113, 42, 0.35);
  --accent-ink: #8c4a12;
  --watermark: rgba(47, 36, 24, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.6s var(--ease-out), color 0.6s var(--ease-out);
}

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

/* ---------- theme cross-fade helper ---------- */
html.theming, html.theming *, html.theming *::before, html.theming *::after {
  transition: background-color 0.55s var(--ease-out), color 0.55s var(--ease-out),
    border-color 0.55s var(--ease-out), fill 0.55s var(--ease-out), stroke 0.55s var(--ease-out),
    box-shadow 0.55s var(--ease-out) !important;
}

/* ---------- film grain + scroll progress ---------- */
.grain {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 2000; opacity: var(--grain-op);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  animation: grain 9s steps(6) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); } 20% { transform: translate(-4%,3%); }
  40% { transform: translate(3%,-4%); } 60% { transform: translate(-3%,-2%); } 80% { transform: translate(4%,2%); }
}

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1200;
  background: transparent; pointer-events: none;
}
.scroll-progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), #f3cf8a);
  transition: width 0.12s linear;
}

/* ============ NAV ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s, background-color 0.6s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  max-width: 1180px; margin: 0 auto; height: var(--nav-h);
  display: flex; align-items: center; gap: 28px; padding: 0 28px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-mark {
  min-width: 42px; height: 40px; padding: 0 10px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #b07f24);
  color: #171207; font-family: var(--font-display); font-weight: 600;
  font-size: 14px; letter-spacing: .7px;
  box-shadow: 0 6px 18px -6px var(--accent-glow);
  transition: transform 0.5s var(--ease-spring);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: 0.2px; }
.brand-name em { font-style: normal; color: var(--accent-ink); }

.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-link {
  position: relative; text-decoration: none; color: var(--text-dim);
  font-size: 14px; font-weight: 500; padding: 8px 13px; border-radius: 99px;
  transition: color 0.3s, background-color 0.3s;
}
.nav-link:hover { color: var(--text); background: var(--bg-card); }
.nav-link.active { color: var(--text); }
.nav-link.active::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  width: 16px; height: 2px; border-radius: 2px; background: var(--accent);
}

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

.lang-switch {
  display: flex; align-items: center; border: 1px solid var(--line);
  border-radius: 99px; padding: 3px; background: var(--bg-card);
}
.lang-btn {
  border: 0; background: transparent; color: var(--text-dim);
  font: 600 12.5px/1 var(--font-mono); letter-spacing: 0.6px;
  padding: 7px 12px; border-radius: 99px; cursor: pointer;
  transition: color 0.3s, background-color 0.35s var(--ease-out), transform 0.2s;
}
.lang-btn:hover { color: var(--text); }
.lang-btn[aria-pressed="true"] { background: var(--accent); color: #171207; }
.lang-btn:active { transform: scale(0.94); }
.lang-sep { width: 1px; height: 14px; background: var(--line); }

.theme-toggle {
  position: relative; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-card); color: var(--text);
  cursor: pointer; display: grid; place-items: center; overflow: hidden;
  transition: border-color 0.3s, transform 0.4s var(--ease-spring);
}
.theme-toggle:hover { transform: rotate(18deg) scale(1.06); border-color: var(--accent); }
.theme-toggle svg { width: 19px; height: 19px; position: absolute; transition: transform 0.55s var(--ease-spring), opacity 0.3s; }
html[data-theme="dark"] .icon-moon, html[data-theme="dark"] .icon-paper { transform: translateY(150%) rotate(90deg); opacity: 0; }
html[data-theme="light"] .icon-sun, html[data-theme="light"] .icon-paper { transform: translateY(-150%) rotate(-90deg); opacity: 0; }
html[data-theme="paper"] .icon-sun, html[data-theme="paper"] .icon-moon { transform: translateY(-150%) rotate(-90deg); opacity: 0; }
html[data-theme="paper"] .icon-paper { transform: none; opacity: 1; }

/* keyboard / focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; top: 8px; left: 50%; transform: translate(-50%, -160%);
  z-index: 2000; padding: 12px 22px; border-radius: 99px;
  background: var(--accent); color: #171207; font-weight: 600; text-decoration: none;
  transition: transform 0.3s var(--ease-out);
}
.skip-link:focus { transform: translate(-50%, 0); }

.burger {
  display: none; width: 42px; height: 42px; flex-direction: column; align-items: center;
  justify-content: center; gap: 5px; padding: 0; border: 1px solid var(--line);
  border-radius: 50%; background: var(--bg-card); cursor: pointer;
  transition: border-color 0.3s, transform 0.4s var(--ease-spring), background-color 0.3s;
}
.burger:hover { border-color: var(--accent); transform: scale(1.05); }
.burger span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.4s var(--ease-out), opacity 0.24s, width 0.3s; }
.burger.open { border-color: var(--accent); }
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { width: 0; opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-overlay {
  position: fixed; inset: var(--nav-h) 0 0; z-index: 900;
  background: color-mix(in srgb, #000 48%, transparent); backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px); opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}
.nav-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
body.nav-open { overflow: hidden; }

/* ============ HERO ============ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--nav-h) + 40px) 28px 60px; overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); }
.blob-1 { width: 560px; height: 560px; top: -160px; right: -80px; background: var(--blob-1); animation: drift 14s ease-in-out infinite alternate; }
.blob-2 { width: 460px; height: 460px; bottom: -180px; left: -120px; background: var(--blob-2); animation: drift 18s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translate(0,0) scale(1); } to { transform: translate(40px, 30px) scale(1.08); } }
.grid-lines {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, black 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, black 0%, transparent 78%);
  opacity: 0.4;
}

.hero-inner {
  position: relative; max-width: 1180px; margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); background: var(--bg-card);
  padding: 8px 16px; border-radius: 99px;
  font: 500 13px/1 var(--font-mono); letter-spacing: 0.3px; color: var(--text-dim);
  backdrop-filter: blur(6px);
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #5ec98a; position: relative; }
.pulse-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid #5ec98a; animation: pulse 2s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }

.hero-name {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(46px, 7.2vw, 92px); line-height: 1.02;
  letter-spacing: -0.015em; margin: 22px 0 18px;
}
.hero-name .accent-serif { color: var(--accent); font-style: italic; font-weight: 600; }

.role-rotator { display: flex; align-items: center; gap: 12px; font-size: clamp(19px, 2.4vw, 27px); font-weight: 600; }
.role-label { color: var(--text-dim); font-weight: 500; }
.role-window { display: inline-block; height: 1.35em; overflow: hidden; }
.role-list { display: flex; flex-direction: column; transition: transform 0.65s var(--ease-out); }
.role-list span { height: 1.35em; display: flex; align-items: center; white-space: nowrap; color: var(--accent); }

.hero-tag { max-width: 520px; color: var(--text-dim); margin: 20px 0 30px; font-size: 16.5px; }

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 99px; text-decoration: none;
  font-weight: 600; font-size: 15px; border: 1px solid transparent; cursor: pointer;
  overflow: hidden; transition: transform 0.35s var(--ease-spring), box-shadow 0.35s, border-color 0.3s, background-color 0.3s, color 0.3s;
}
.btn svg { width: 17px; height: 17px; transition: transform 0.35s var(--ease-out); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #c08c2e); color: #171207;
  box-shadow: 0 14px 32px -14px var(--accent-glow);
}
.btn-primary::before {
  content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.5), transparent);
  transform: skewX(-20deg); transition: left 0.7s var(--ease-out);
}
.btn-primary:hover::before { left: 130%; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -14px var(--accent-glow); }
.btn-primary:hover svg { transform: translateX(4px); }
.btn-primary:active { transform: translateY(-1px) scale(0.98); }
.btn-ghost { border-color: var(--line); color: var(--text); background: var(--bg-card); }
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--accent-ink); }

.hero-social { display: flex; gap: 10px; margin-top: 34px; }
.hero-social a {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--text-dim); background: var(--bg-card);
  transition: transform 0.35s var(--ease-spring), color 0.3s, border-color 0.3s;
}
.hero-social a:hover { transform: translateY(-4px) rotate(-6deg); color: var(--accent); border-color: var(--accent); }
.hero-social svg { width: 19px; height: 19px; }

/* --- portrait --- */
.hero-visual { display: flex; justify-content: center; }
.portrait-pic { display: contents; }
.portrait-frame {
  position: relative; width: min(460px, 42vw, 62svh); aspect-ratio: 688 / 819;
  display: flex; align-items: flex-end; justify-content: center;
  transform-style: preserve-3d; will-change: transform;
}
.portrait-glow {
  position: absolute; inset: 6% 2% 0; border-radius: 46% 54% 52% 48% / 44% 46% 54% 56%;
  background: radial-gradient(circle at 50% 38%, var(--blob-1), transparent 68%);
  filter: blur(28px); animation: morph 10s ease-in-out infinite alternate;
}
@keyframes morph {
  0% { border-radius: 46% 54% 52% 48% / 44% 46% 54% 56%; }
  100% { border-radius: 54% 46% 48% 52% / 52% 56% 44% 48%; }
}
.portrait {
  position: relative; z-index: 2; max-height: 100%; max-width: 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 80%, rgba(0, 0, 0, 0) 99%);
  mask-image: linear-gradient(to bottom, #000 80%, rgba(0, 0, 0, 0) 99%);
  filter: drop-shadow(0 34px 44px rgba(0, 0, 0, 0.45));
  animation: floaty 7s ease-in-out infinite;
  transform: translate3d(calc(var(--px, 0) * 14px), calc(var(--py, 0) * 10px), 0);
}
@keyframes floaty { 0%,100% { margin-bottom: 0; } 50% { margin-bottom: 14px; } }

.float-card {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 10px;
  background: color-mix(in srgb, var(--bg-elev) 82%, transparent);
  border: 1px solid var(--line); border-radius: 14px; padding: 10px 15px;
  backdrop-filter: blur(10px); box-shadow: var(--shadow);
  animation: floaty 6s ease-in-out infinite;
}
.float-card svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }
.float-card strong { display: block; font-size: 13.5px; line-height: 1.2; }
.float-card span { font-size: 11.5px; color: var(--text-dim); }
.card-cert { top: 12%; left: -9%; animation-delay: 1.2s; }
.card-loc { bottom: 9%; right: -7%; animation-delay: 2.4s; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid var(--line); border-radius: 99px;
  display: flex; justify-content: center; padding-top: 7px;
}
.scroll-hint span { width: 4px; height: 9px; border-radius: 4px; background: var(--accent); animation: hint 1.8s ease-in-out infinite; }
@keyframes hint { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* ============ MARQUEE ============ */
.marquee {
  border-block: 1px solid var(--line); padding: 18px 0; overflow: hidden;
  background: var(--bg-card); position: relative;
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.marquee-track { display: flex; gap: 44px; width: max-content; animation: scroll-x 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font: 500 14px/1 var(--font-mono); letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-dim); display: flex; align-items: center; gap: 44px; white-space: nowrap;
}
.marquee-track span::after { content: "◆"; color: var(--accent); font-size: 9px; }
@keyframes scroll-x { to { transform: translateX(-50%); } }

/* ============ SECTIONS ============ */
.section { position: relative; max-width: 1180px; margin: 0 auto; padding: 110px 28px 30px; }
.section-head { margin-bottom: 46px; max-width: 640px; }

/* watermark section numerals */
.sec-num {
  position: absolute; z-index: -1; pointer-events: none; user-select: none;
  top: 78px; right: clamp(18px, 6vw, 72px);
  font-family: var(--font-display); font-weight: 600; font-size: clamp(108px, 17vw, 208px);
  line-height: 0.76; letter-spacing: -0.045em; color: var(--watermark);
  translate: 0 calc(var(--sy, 0) * -0.045px);
}
.section-head, .res-grid, .skills-grid, .timeline, .assistant-grid, .stats { position: relative; }
.kicker {
  font: 500 12.5px/1 var(--font-mono); letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--accent-ink); display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.kicker::before { content: ""; width: 26px; height: 1.5px; background: var(--accent); }
.section-head h2, .contact-card h2 {
  font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em;
  font-size: clamp(30px, 4.4vw, 46px); line-height: 1.12;
}
.section-sub { color: var(--text-dim); margin-top: 12px; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 44px; align-items: start; }
.about-text p { color: var(--text-dim); margin-bottom: 16px; font-size: 16.5px; }
.about-text p:first-child::first-letter {
  font-family: var(--font-display); font-size: 2.6em; float: left; line-height: 0.85;
  padding-right: 10px; color: var(--accent); font-weight: 600;
}
.about-facts { list-style: none; margin-top: 26px; display: grid; gap: 0; border-top: 1px solid var(--line); }
.about-facts li {
  display: flex; justify-content: space-between; gap: 18px; align-items: baseline;
  padding: 13px 2px; border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.about-facts span { color: var(--text-dim); }
.about-facts strong { font-weight: 600; text-align: right; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 22px; position: relative; overflow: hidden;
  transition: transform 0.4s var(--ease-out), border-color 0.3s;
}
.stat:hover { --lift: -5px; border-color: var(--accent); }
.stat::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2.5px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.stat:hover::after { opacity: 1; }
.stat-num {
  font-family: var(--font-display); font-size: 44px; font-weight: 600; color: var(--accent);
  display: block; line-height: 1; font-variant-numeric: tabular-nums;
}
.stat-label { color: var(--text-dim); font-size: 13.5px; margin-top: 8px; display: block; }

/* ---------- skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.skills-grid > .skill-card:nth-child(1) { grid-column: span 7; }
.skills-grid > .skill-card:nth-child(2) { grid-column: span 5; }
.skills-grid > .skill-card:nth-child(3) { grid-column: span 5; }
.skills-grid > .skill-card:nth-child(4) { grid-column: span 7; }
@media (max-width: 860px) { .skills-grid > .skill-card { grid-column: span 12; } }
.skill-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 28px; position: relative; overflow: hidden;
  transition: transform 0.45s var(--ease-out), border-color 0.35s, box-shadow 0.45s;
}
.skill-card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.45s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 65%);
  pointer-events: none;
}
.skill-card:hover::before { opacity: 1; }
.skill-card:hover { --lift: -6px; border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: var(--shadow); }
.skill-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 20px;
  transition: transform 0.45s var(--ease-spring);
}
.skill-card:hover .skill-icon { transform: scale(1.1) rotate(-6deg); }
.skill-icon svg { width: 25px; height: 25px; }
.skill-card h3 { font-size: 19px; font-weight: 600; margin-bottom: 16px; letter-spacing: 0.1px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span {
  font: 500 12.5px/1 var(--font-mono); letter-spacing: 0.2px;
  border: 1px solid var(--line); border-radius: 99px; padding: 7px 13px; color: var(--text-dim);
  transition: color 0.3s, border-color 0.3s, transform 0.3s var(--ease-out), background-color 0.3s;
}
.tags span:hover { color: var(--accent-ink); border-color: var(--accent); transform: translateY(-2px); background: var(--accent-soft); }

/* ---------- timeline ---------- */
.timeline { position: relative; padding-left: 34px; max-width: 780px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1.5px;
  background: linear-gradient(var(--accent), var(--line) 65%, transparent);
}
.tl-item { position: relative; padding-bottom: 40px; }
.tl-item:last-child { padding-bottom: 6px; }
.tl-dot {
  position: absolute; left: -34px; top: 5px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg); border: 2.5px solid var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent);
}
.tl-date { font: 500 12.5px/1 var(--font-mono); letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent-ink); }
.tl-body h3 { font-size: 19.5px; font-weight: 600; margin: 10px 0 8px; }
.tl-body p { color: var(--text-dim); font-size: 15.5px; max-width: 620px; }

/* ---------- resumes ---------- */
.res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
@media (max-width: 1020px) {
  .res-grid { grid-template-columns: 1fr; }
  .res-grid > .res-card { margin-top: 0; }
}
.res-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 30px; display: flex; flex-direction: column; align-items: flex-start;
  position: relative; overflow: hidden;
  transition: transform 0.45s var(--ease-out), border-color 0.35s, box-shadow 0.45s;
}
.res-card::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 190px; height: 190px;
  border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  opacity: 0; transition: opacity 0.5s, transform 0.6s var(--ease-out);
}
.res-card:hover::after { opacity: 1; transform: scale(1.35); }
.res-card:hover { --lift: -6px; border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: var(--shadow); }
.res-top { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 22px; }
.res-num { font-family: var(--font-display); font-size: 34px; font-weight: 600; color: var(--line); transition: color 0.35s; }
.res-card:hover .res-num { color: var(--accent-ink); }
.res-icon { width: 30px; height: 30px; color: var(--accent); }
.res-card h3 { font-size: 21px; font-weight: 600; margin-bottom: 10px; }
.res-card p { color: var(--text-dim); font-size: 15px; margin-bottom: 24px; flex-grow: 1; }
.btn-download { padding: 12px 22px; font-size: 14px; }

/* ---------- recruiter assistant ---------- */
.assistant-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 34px; align-items: start; }
.assistant-copy > p { color: var(--text-dim); font-size: 16px; }
.assistant-points { list-style: none; margin: 24px 0 30px; display: grid; gap: 12px; }
.assistant-points li { position: relative; padding-left: 30px; color: var(--text-dim); font-size: 15px; }
.assistant-points li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent-soft); border: 1.5px solid var(--accent);
}
.assistant-points li::after {
  content: ""; position: absolute; left: 5px; top: 11px; width: 6px; height: 3.5px;
  border-left: 1.8px solid var(--accent); border-bottom: 1.8px solid var(--accent);
  transform: rotate(-45deg);
}
.assistant-copy .btn svg { width: 18px; height: 18px; }

.chat {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.chat-head { display: flex; align-items: center; gap: 13px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.chat-avatar {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(150deg, var(--accent), color-mix(in srgb, #25d366 60%, var(--accent)));
  color: #0e0f13;
}
.chat-avatar svg { width: 23px; height: 23px; }
.chat-title { display: grid; gap: 3px; margin-right: auto; }
.chat-title strong { font-size: 15px; font-weight: 600; }
.chat-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); }
.chat-status i {
  width: 7px; height: 7px; border-radius: 50%; background: #25d366;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); animation: livePulse 2.2s infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
.chat-wa {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  color: #25d366; border: 1px solid var(--line); background: var(--bg);
  transition: transform 0.4s var(--ease-spring), border-color 0.3s, background-color 0.3s;
}
.chat-wa:hover { transform: scale(1.08) rotate(-8deg); border-color: #25d366; background: rgba(37, 211, 102, 0.12); }
.chat-wa svg { width: 20px; height: 20px; }
.chat-log { padding: 20px 18px; display: flex; flex-direction: column; gap: 11px; height: 340px; overflow-y: auto; scroll-behavior: smooth; }
.chat-log > .msg:first-child { margin-top: auto; }
.msg {
  max-width: 84%; padding: 12px 15px; border-radius: 16px; font-size: 14.5px; line-height: 1.6;
  animation: msgIn 0.5s var(--ease-out) both;
}
.msg.bot { align-self: flex-start; background: var(--bg-elev); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.me {
  align-self: flex-end; border-bottom-right-radius: 6px; color: #1c1d21;
  background: linear-gradient(135deg, var(--accent), #e9be6b); border-color: transparent; font-weight: 500;
}
.msg.typing { min-width: 26px; text-align: center; font-family: var(--font-mono); letter-spacing: 1px; color: var(--text-dim); }
@keyframes msgIn { from { opacity: 0; transform: translateY(12px) scale(0.97); } }
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 14px; }
.chip {
  font: 500 12.5px/1 var(--font-body); color: var(--text-dim); cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: 8px 13px;
  transition: color 0.3s, border-color 0.3s, transform 0.3s var(--ease-out), background-color 0.3s;
}
.chip:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.chat-form { display: flex; gap: 10px; padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.chat-input {
  flex: 1; min-width: 0; font: inherit; font-size: 14.5px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.chat-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.chat-input::placeholder { color: var(--text-dim); }
.chat-send {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 13px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, #25d366 35%, var(--accent)));
  color: #0e0f13; display: grid; place-items: center;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s;
}
.chat-send:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 12px 26px -10px var(--accent-glow); }
.chat-send svg { width: 19px; height: 19px; }

/* ---------- contact ---------- */
.contact { padding-bottom: 90px; }
.contact-card {
  position: relative; text-align: center; border: 1px solid var(--line);
  border-radius: 28px; padding: 74px 40px; overflow: hidden; background: var(--bg-card);
}
.contact-card::before {
  content: ""; position: absolute; left: 50%; top: -140px; transform: translateX(-50%);
  width: 480px; height: 280px; border-radius: 50%;
  background: radial-gradient(ellipse, var(--blob-1), transparent 70%); filter: blur(30px);
  pointer-events: none;
}
.contact-card .kicker { justify-content: center; }
.contact-card .kicker::before { display: none; }
.contact-card h2 { margin-bottom: 14px; }
.contact-card p { color: var(--text-dim); max-width: 480px; margin: 0 auto 32px; }
.contact-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.contact-note { font-size: 13.5px; color: var(--text-dim); opacity: 0.85; margin: 26px auto 0 !important; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line); padding: 26px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  max-width: 1180px; margin: 0 auto; flex-wrap: wrap;
}
.footer p { color: var(--text-dim); font-size: 13.5px; }
.to-top {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg-card); color: var(--text); cursor: pointer; display: grid; place-items: center;
  transition: transform 0.35s var(--ease-spring), color 0.3s, border-color 0.3s;
}
.to-top:hover { transform: translateY(-4px); color: var(--accent); border-color: var(--accent); }
.to-top svg { width: 18px; height: 18px; }

/* ============ REVEAL SYSTEM ============ */
.reveal {
  opacity: 0; translate: 0 28px;
  transition: opacity var(--dur) var(--ease-out), translate var(--dur) var(--ease-out);
  transition-delay: var(--d, 0s);
  will-change: opacity, translate;
}
.reveal.in-view { opacity: 1; translate: none; }

/* ---------- shared tilt / lift (micro-interactions) ---------- */
.stat, .skill-card, .res-card {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
}
.stat { transition: transform 0.5s var(--ease-out), border-color 0.3s; }
.skill-card, .res-card { transition: transform 0.5s var(--ease-out), border-color 0.35s, box-shadow 0.45s; }
.stat:hover { --lift: -5px; }
.skill-card:hover { --lift: -6px; }
.res-card:hover { --lift: -6px; }
@media (prefers-reduced-motion: reduce) { .stat, .skill-card, .res-card { transform: none; } }

/* ---------- pipeline diagram ---------- */
.infra-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 40px; align-items: center; }
.infra-copy p { color: var(--text-dim); font-size: 16px; }
.infra-legend { list-style: none; margin-top: 24px; display: grid; gap: 10px; }
.infra-legend li { display: flex; align-items: baseline; gap: 12px; font-size: 14.5px; color: var(--text-dim); }
.infra-legend b { font: 500 12px/1 var(--font-mono); letter-spacing: 1.2px; color: var(--accent-ink); min-width: 62px; }
.infra-figure {
  position: relative; border: 1px solid var(--line); border-radius: 24px; padding: 26px 22px;
  background: var(--bg-card); box-shadow: var(--shadow); overflow: hidden;
}
.infra-figure::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black, transparent 76%);
}
.infra-svg { position: relative; width: 100%; height: auto; display: block; }
.infra-svg text { font-family: var(--font-mono); fill: var(--text-dim); }
.infra-svg .node-box { fill: var(--bg-elev); stroke: var(--line); stroke-width: 1.2; }
.infra-svg .node-cap { fill: var(--text); font-size: 11px; font-family: var(--font-body); font-weight: 600; letter-spacing: 0.2px; }
.infra-svg .node-sub { font-size: 8.6px; letter-spacing: 0.9px; text-transform: uppercase; }
.infra-svg .node-key { fill: var(--accent-ink); font-size: 8.6px; letter-spacing: 1.4px; text-transform: uppercase; }
.infra-svg .edge { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 6; opacity: 0.55; }
.infra-svg .edge-run { animation: edgeFlow 1.4s linear infinite; }
@keyframes edgeFlow { to { stroke-dashoffset: -22; } }
.infra-svg .port { fill: var(--accent); opacity: 0.9; transform-box: fill-box; transform-origin: center; animation: portPulse 2.8s var(--ease-out) infinite; }
.infra-svg .port.p2 { animation-delay: 0.5s; } .infra-svg .port.p3 { animation-delay: 1s; }
.infra-svg .port.p4 { animation-delay: 1.5s; } .infra-svg .port.p5 { animation-delay: 2s; }
.infra-svg .port.p6 { animation-delay: 2.5s; }
@keyframes portPulse { 0%, 100% { opacity: 0.28; transform: scale(0.72); } 50% { opacity: 1; transform: scale(1.25); } }
.infra-svg .glyph { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.infra-svg .pod { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; }
.infra-svg .pod-live { animation: podBreathe 3.4s ease-in-out infinite; }
@keyframes podBreathe { 50% { opacity: 0.45; } }
.infra-tag {
  position: absolute; right: 18px; bottom: 14px; z-index: 2;
  font: 500 10px/1 var(--font-mono); letter-spacing: 1.6px; text-transform: uppercase; color: var(--text-dim);
}
@media (prefers-reduced-motion: reduce) { .infra-svg .edge-run, .infra-svg .port, .infra-svg .pod-live { animation: none; } }

/* ---------- portrait reveal (shine sweep, keeps the image painted at first frame) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .portrait-frame::after {
    content: ""; position: absolute; inset: -8% -12%; z-index: 6; pointer-events: none;
    background: linear-gradient(112deg, transparent 38%, var(--accent-soft) 47%, rgba(255, 255, 255, 0.34) 50%, var(--accent-soft) 53%, transparent 62%);
    translate: -130% 0;
    animation: portraitSweep 1.15s var(--ease-out) 0.15s 1 both;
  }
  @keyframes portraitSweep { from { translate: -130% 0; } to { translate: 130% 0; } }
}

/* ---------- magnetic buttons ---------- */
.btn {
  translate: var(--mag-x, 0px) var(--mag-y, 0px);
  transition: translate 0.45s var(--ease-spring), transform 0.18s var(--ease-out), box-shadow 0.35s, border-color 0.3s, background-color 0.3s, color 0.3s;
}
.btn:hover { transition: translate 0.16s ease-out, transform 0.18s var(--ease-out), box-shadow 0.35s, border-color 0.3s, background-color 0.3s, color 0.3s; }
.btn:active { transform: scale(0.97); }
@media (prefers-reduced-motion: reduce) { .btn { translate: none; } }

/* ---------- install / offline chip ---------- */
.offline-chip {
  position: fixed; left: 50%; bottom: 22px; z-index: 1300; translate: -50% 140%;
  display: flex; align-items: center; gap: 9px; padding: 10px 17px; border-radius: 99px;
  background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow);
  font: 500 12.5px/1 var(--font-mono); letter-spacing: 0.4px; color: var(--text-dim);
  transition: translate 0.6s var(--ease-out);
}
.offline-chip.show { translate: -50% 0; }
.offline-chip i { width: 7px; height: 7px; border-radius: 50%; background: #25d366; }

/* ---------- scroll-linked headline drift ---------- */
.hero-name { transform: translateY(calc(var(--sy, 0) * -0.055px)); }
.section-head h2 { transform: translateY(calc(var(--sy, 0) * -0.018px)); }

/* language swap fade */
main { transition: opacity 0.22s ease, translate 0.22s ease; }
body.lang-fading main { opacity: 0; translate: 0 8px; }

/* ============ PRELOADER ============ */
html.preloading { overflow: hidden; }
/* the hero name and portrait paint under the curtain, so LCP is measured on real content */
html.preloading .reveal:not(.reveal-solid) { opacity: 0; translate: 0 28px; }
.reveal.reveal-solid { opacity: 1; }
html.preloading .reveal-solid { translate: 0 22px; }

.preloader {
  position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; overflow: hidden;
}
.preloader.gone { visibility: hidden; pointer-events: none; }
.pre-bg { position: absolute; inset: 0; background: var(--bg); transition: opacity 0.55s var(--ease-out); }
.pre-bg::before {
  content: ""; position: absolute; inset: -22%;
  background:
    radial-gradient(42% 42% at 50% 46%, var(--blob-1), transparent 70%),
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 76px);
  animation: preBreath 6.5s ease-in-out infinite;
}
.pre-bg::after {
  content: ""; position: absolute; top: -40%; bottom: -40%; left: -46%; width: 42%;
  background: linear-gradient(100deg, transparent, var(--accent-soft), transparent);
  opacity: .55; animation: preScan 4.6s cubic-bezier(.5, 0, .5, 1) infinite;
}
@keyframes preBreath { 50% { opacity: .55; } }
@keyframes preScan { to { translate: 355% 0; } }

.pre-stage { position: relative; width: min(470px, 86vw); display: grid; gap: 26px; }

/* hand-drawn monogram */
.pre-mono {
  position: relative; width: min(232px, 62vw); margin: 0 auto;
  transition: transform 1.05s cubic-bezier(.62, .02, .24, 1) .16s, opacity .8s ease .45s;
}
.pre-mono::before {
  content: ""; position: absolute; inset: -30% -16%; border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-glow), transparent 72%);
  opacity: .3; animation: preBreath 3.4s ease-in-out 2.2s infinite;
}
.pre-mono svg { position: relative; display: block; width: 100%; height: auto; }
.pre-stroke {
  fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: preDraw .85s var(--ease-out) forwards;
}
.pre-stroke.s1 { animation-delay: .15s; }
.pre-stroke.s2 { animation-delay: .6s; }
.pre-stroke.s3 { animation-delay: 1.1s; }
.pre-stroke.s4 { animation-delay: 1.3s; }
.pre-stroke.s5 { animation-delay: 1.45s; }
.pre-stroke.s6 { animation-delay: 1.6s; }
.pre-stroke.s7 { animation-delay: 1.75s; }
@keyframes preDraw { to { stroke-dashoffset: 0; } }

.pre-meta { transition: opacity .42s ease, translate .6s var(--ease-out); }
.pre-gauge {
  position: relative; height: 2px; background: var(--line); overflow: hidden;
  opacity: 0; animation: preUp .8s var(--ease-out) 1.75s forwards;
}
.pre-fill {
  position: absolute; inset: 0; transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, transparent, var(--accent) 62%, #ffedc6);
}
.pre-gauge::after {
  content: ""; position: absolute; inset: -4px 0;
  background: linear-gradient(90deg, transparent 0 46%, var(--accent-glow) 50%, transparent 54% 100%);
  translate: -100% 0; animation: preSpark 2.4s cubic-bezier(.45, 0, .55, 1) 1.9s infinite;
}
@keyframes preSpark { to { translate: 100% 0; } }
@keyframes preUp { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: none; } }

.pre-foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 20px;
  opacity: 0; animation: preUp .85s var(--ease-out) 1.95s forwards;
}
.pre-id { text-align: left; }
.pre-name {
  font-family: var(--font-display); font-size: 15px; font-weight: 500;
  letter-spacing: 3.6px; text-transform: uppercase;
}
.pre-name em { font-style: normal; color: var(--accent-ink); }
.pre-role {
  margin-top: 8px; font: 400 9.5px/1.5 var(--font-mono);
  letter-spacing: 1.7px; text-transform: uppercase; color: var(--text-dim);
}
.pre-count { display: flex; align-items: baseline; gap: 1px; color: var(--text-dim); font: 500 11px/1 var(--font-mono); }
.pre-count b { font-size: 27px; font-weight: 500; color: var(--accent-ink); font-variant-numeric: tabular-nums; }

/* exit: the backdrop dissolves and the monogram hands off to the nav badge */
.preloader.done { pointer-events: none; }
.preloader.done .pre-bg { opacity: 0; }
.preloader.done .pre-meta { opacity: 0; translate: 0 -14px; }
.preloader.done .pre-mono {
  transform: translate(var(--fx, 0px), var(--fy, 0px)) scale(var(--fs, .24));
  opacity: 0;
}
@keyframes brandLand {
  0% { transform: scale(1); } 34% { transform: scale(1.24) rotate(-8deg); }
  68% { transform: scale(.95); } 100% { transform: scale(1); }
}
.brand-mark.land { animation: brandLand .9s var(--ease-out) .82s 1 both; }
@media (max-width: 480px) {
  .pre-stage { gap: 22px; }
  .pre-mono { width: min(214px, 66vw); }
  .pre-foot { flex-direction: column; align-items: center; gap: 14px; }
  .pre-id { text-align: center; }
  .pre-name { font-size: 13px; letter-spacing: 2.8px; }
}

/* ============ RESPONSIVE ============ */
/* short desktop windows: the portrait and the headline scale to the viewport height */
@media (min-width: 961px) and (max-height: 880px) {
  .hero { padding-top: calc(var(--nav-h) + 16px); padding-bottom: 28px; }
  .hero-name { font-size: clamp(44px, 5.8vw, 74px); margin: 14px 0 12px; }
  .hero-tag { margin: 14px 0 22px; font-size: 15.5px; }
  .hero-social { margin-top: 24px; }
  .portrait-frame { width: min(390px, 50svh); }
  .float-card { gap: 8px; padding: 8px 12px; }
  .float-card svg { width: 18px; height: 18px; }
  .float-card strong { font-size: 12.5px; }
  .float-card span { font-size: 10.5px; }
  .card-cert { top: 5%; left: -22%; }
  .card-loc { bottom: 5%; right: -18%; }
  .scroll-hint { bottom: 14px; }
}
@media (max-width: 960px) {
  .hero { min-height: 0; padding: calc(var(--nav-h) + 22px) 24px 46px; overflow-x: clip; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 26px; text-align: center; }
  .hero-copy { display: contents; }
  .hero-top, .hero-bot { display: flex; flex-direction: column; align-items: center; }
  .hero-top { order: 1; }
  .hero-visual { order: 2; margin-top: 2px; }
  .hero-bot { order: 3; }
  .hero-tag { margin-inline: auto; }
  .hero-cta, .hero-social { justify-content: center; }
  .portrait-frame { width: min(240px, 62vw, 54svh); aspect-ratio: auto; }
  .portrait { width: 100%; height: auto; }
  .portrait-glow { inset: 4% -4% -2%; }
  .card-cert {
    top: 2%;
    left: -15%;
    transform: scale(0.84);
    transform-origin: left top;
  }
  .card-loc { bottom: 5%; right: -6%; }
  .scroll-hint { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .nav-inner { padding: 0 18px; gap: 12px; }
  .nav-actions { margin-left: auto; gap: 10px; }
  .nav-links {
    position: fixed; top: calc(var(--nav-h) + 12px); right: 14px; left: auto;
    width: min(360px, calc(100vw - 28px)); max-height: calc(100dvh - var(--nav-h) - 24px);
    flex-direction: column; gap: 5px; margin-left: 0; padding: 14px; overflow-y: auto;
    background: color-mix(in srgb, var(--bg-elev) 94%, transparent);
    border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translate3d(22px, -10px, 0) scale(0.96); transform-origin: top right;
    transition: transform 0.48s var(--ease-out), opacity 0.28s ease, visibility 0s linear 0.48s;
  }
  .nav-links.open {
    opacity: 1; visibility: visible; pointer-events: auto; transform: translate3d(0, 0, 0) scale(1);
    transition-delay: 0s;
  }
  .nav-link {
    display: flex; align-items: center; min-height: 50px; padding: 13px 16px;
    font-size: 15.5px; border-radius: 14px; opacity: 0; transform: translateX(16px);
    transition: color 0.3s, background-color 0.3s, opacity 0.35s ease, transform 0.45s var(--ease-out);
  }
  .nav-links.open .nav-link { opacity: 1; transform: translateX(0); }
  .nav-links.open .nav-link:nth-child(1) { transition-delay: 0.08s; }
  .nav-links.open .nav-link:nth-child(2) { transition-delay: 0.12s; }
  .nav-links.open .nav-link:nth-child(3) { transition-delay: 0.16s; }
  .nav-links.open .nav-link:nth-child(4) { transition-delay: 0.20s; }
  .nav-links.open .nav-link:nth-child(5) { transition-delay: 0.24s; }
  .nav-links.open .nav-link:nth-child(6) { transition-delay: 0.28s; }
  .nav-link.active { background: var(--accent-soft); }
  .nav-link.active::after {
    left: auto; right: 16px; bottom: 50%; width: 6px; height: 6px;
    transform: translateY(50%); border-radius: 50%;
  }
  .burger { display: flex; }
  .brand-name { display: none; }
  .assistant-grid { grid-template-columns: 1fr; gap: 28px; }
  .chat { order: -1; }
}
@media (max-width: 680px) {
  .skills-grid, .res-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .role-rotator { flex-wrap: wrap; justify-content: center; row-gap: 4px; }
}
@media (max-width: 560px) {
  .section { padding: 88px 20px 26px; }
  .hero { padding-inline: 20px; }
  .hero-name { font-size: clamp(40px, 12.5vw, 54px); }
  .float-card { padding: 8px 12px; gap: 8px; border-radius: 12px; }
  .float-card strong { font-size: 12.5px; }
  .float-card span { font-size: 11px; }
  .card-cert {
    top: 2%;
    left: -6%;
    transform: scale(0.78);
    transform-origin: left top;
  }
  .card-loc { right: 0; }
  .contact-card { padding: 58px 22px; border-radius: 22px; }
  .chat-log { height: 300px; padding: 16px 14px; }
  .chat-chips { padding: 0 14px 12px; }
  .chat-form { padding: 12px 12px 14px; gap: 8px; }
  .msg { max-width: 90%; font-size: 14px; }
  .footer { flex-direction: column-reverse; text-align: center; }
}
@media (max-width: 430px) {
  .hero-name { font-size: clamp(34px, 11.5vw, 48px); }
  .hero-badge { font-size: 11.5px; padding: 7px 12px; }
  .hero-cta { flex-wrap: wrap; }
}

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