/* ═══════════════════════════════════════════════
   VARIABLES & RESET
════════════════════════════════════════════════ */
:root {
  --bg:      oklch(0.10 0.012 260);
  --bg2:     oklch(0.13 0.012 260);
  --bg3:     oklch(0.16 0.012 260);
  --border:  oklch(0.22 0.01  260);
  --text:    oklch(0.95 0.008  80);
  --muted:   oklch(0.55 0.01  260);
  --muted2:  oklch(0.62 0.01  260);
  --muted3:  oklch(0.73 0.01  260);
  --fox:     oklch(0.72 0.18   45);
  --fox-dim: oklch(0.72 0.18 45 / 0.1);
  --fox-glow:oklch(0.72 0.18 45 / 0.4);

  --max-w: 1440px;
  --px:    20px;   /* base horizontal padding */

  --radius-sm:  8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-head); }

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

ul, ol { list-style: none; }

/* no-js fallback: keep reveals visible when JS hasn't run */
.no-js .reveal,
.no-js .tl-item {
  opacity: 1 !important;
  transform: none !important;
}

/* ═══════════════════════════════════════════════
   LAYOUT UTILITIES
════════════════════════════════════════════════ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--px);
}

section { padding: 64px 0; }

.section-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fox);
  margin-bottom: 14px;
  font-family: var(--font-head);
  font-weight: 700;
}

.section-title {
  font-size: clamp(28px, 7vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 15px;
  color: var(--muted2);
  line-height: 1.75;
}

.section-header { margin-bottom: 48px; }

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

/* ═══════════════════════════════════════════════
   SCROLL REVEAL
════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.rd1 { transition-delay: 0.1s; }
.rd2 { transition-delay: 0.2s; }
.rd3 { transition-delay: 0.3s; }

/* ═══════════════════════════════════════════════
   NAVIGATION — mobile first
════════════════════════════════════════════════ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  transition: background 0.4s, backdrop-filter 0.4s;
}
#navbar.scrolled {
  background: oklch(0.1 0.012 260 / 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px var(--px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}
.nav-logo span { color: var(--fox); }

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

/* Desktop nav links (hidden on mobile) */
.nav-links {
  display: none;
  gap: 28px;
  align-items: center;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.04em;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a:focus-visible { color: var(--text); }
.nav-links a.nav-active { color: var(--fox); }

/* Mobile dropdown */
.nav-links.mobile-open {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 57px; left: 0; right: 0;
  background: oklch(0.1 0.012 260 / 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px var(--px) 24px;
  gap: 0;
  z-index: 190;
}
.nav-links.mobile-open li { border-bottom: 1px solid var(--border); }
.nav-links.mobile-open a {
  display: block;
  padding: 14px 0;
  font-size: 16px;
}

/* Lang switcher */
.lang-switcher {
  display: flex;
  gap: 2px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  flex-shrink: 0;
}
.lang-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.lang-btn.active {
  background: var(--fox);
  color: oklch(0.1 0.01 45);
}

/* Hamburger button */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 9px;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
}
.hamburger:hover { border-color: var(--fox); }
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.2s, width 0.3s var(--ease-out);
  transform-origin: center;
}
.hamburger span:nth-child(2) { width: 75%; }
.hamburger.open span:nth-child(2) { width: 100%; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  background: var(--fox);
  color: oklch(0.1 0.01 45);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--fox-glow);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: var(--fox);
  color: var(--fox);
}

/* ═══════════════════════════════════════════════
   HERO — mobile first
════════════════════════════════════════════════ */
#hero {
  position: relative;
  min-height: 100svh;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
}

#neural-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 1.2s;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.25;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  pointer-events: none;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, oklch(0.72 0.18 45 / 0.08) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.12s ease-out;
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 120px var(--px) 80px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}

/* hero animations */
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--fox);
  border-radius: 100px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fox);
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.8s 0.2s var(--ease-out) forwards;
}
.hero-tag::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--fox);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(1.4); }
}

.hero-name {
  font-size: clamp(48px, 12vw, 92px);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.8s 0.4s var(--ease-out) forwards;
}

.hero-title {
  font-size: clamp(12px, 3vw, 16px);
  color: var(--muted);
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.8s 0.6s var(--ease-out) forwards;
}

.hero-desc {
  font-size: clamp(15px, 2.5vw, 17px);
  color: var(--muted3);
  max-width: 480px;
  line-height: 1.75;
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeUp 0.8s 0.8s var(--ease-out) forwards;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s 1s var(--ease-out) forwards;
}

/* Hero globe (hidden on mobile, shown on desktop) */
.hero-right { display: none; }

.globe-wrap {
  position: relative;
  width: min(440px, 40vw);
  aspect-ratio: 1;
}

#globe-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* keep photo-frame stubs so old CSS rules don't error */
.photo-frame {
  position: relative;
  width: min(320px, 36vw);
  aspect-ratio: 3 / 4;
}
.photo-frame::before {
  content: '';
  position: absolute;
  inset: -12px;
  border: 1px solid var(--fox);
  border-radius: 20px;
  opacity: 0.4;
}
.photo-frame::after {
  content: '';
  position: absolute;
  inset: -24px;
  border: 1px solid var(--fox);
  border-radius: 28px;
  opacity: 0.15;
}
.photo-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 16px;
  filter: grayscale(15%);
}
.photo-badge {
  position: absolute;
  bottom: -16px;
  left: -28px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-family: var(--font-head);
}
.photo-badge .num {
  font-size: 30px;
  font-weight: 800;
  color: var(--fox);
  line-height: 1;
}
.badge-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ═══════════════════════════════════════════════
   BIO — mobile first
════════════════════════════════════════════════ */
#bio { background: var(--bg); }

.bio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
}

.bio-text {
  font-size: 16px;
  line-height: 1.85;
  color: oklch(0.75 0.01 260);
  margin-bottom: 20px;
}

.cert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.cert-item {
  padding: 10px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cert-name {
  color: var(--fox);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
}
.cert-tag {
  color: var(--muted);
  font-size: 12px;
}

/* ═══════════════════════════════════════════════
   EXPERT EDGE — mobile first
════════════════════════════════════════════════ */
#edge { background: var(--bg2); }

.edge-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.edge-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s;
}
.edge-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--fox), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.edge-card:hover { border-color: var(--fox); transform: translateY(-4px); }
.edge-card:hover::before { opacity: 1; }

.edge-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--fox-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 22px;
}
.edge-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}
.edge-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

/* ═══════════════════════════════════════════════
   EXPERIENCE TIMELINE — mobile first
════════════════════════════════════════════════ */
#experience { background: var(--bg); }

.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 1px;
  background: var(--border);
}

.tl-item {
  position: relative;
  margin-bottom: 44px;
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.tl-item.visible { opacity: 1; transform: translateX(0); }
.tl-item:last-child { margin-bottom: 0; }

.tl-dot {
  position: absolute;
  left: -33px; top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--fox);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 3px oklch(0.72 0.18 45 / 0.25);
}

.tl-period {
  display: block;
  font-size: 11px;
  color: var(--fox);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-family: var(--font-head);
  font-weight: 600;
}
.tl-role {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}
.tl-company {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.tl-desc {
  font-size: 14px;
  color: oklch(0.6 0.01 260);
  line-height: 1.7;
}
.tl-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* shared tag pill */
.tag {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--muted);
  letter-spacing: 0.05em;
}
.tag.hi {
  border-color: var(--fox);
  color: var(--fox);
}

/* ═══════════════════════════════════════════════
   PORTFOLIO — mobile first
════════════════════════════════════════════════ */
#portfolio { background: var(--bg2); }

.featured-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 40px;
}

.featured-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  isolation: isolate; /* ensures overflow clips correctly during 3D tilt transforms */
  transition: border-color 0.3s, transform 0.3s;
}
.featured-card:hover {
  border-color: oklch(0.72 0.18 45 / 0.55);
  transform: translateY(-4px);
}

.card-thumb {
  overflow: hidden;
  background: var(--bg);
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0; /* clips image to card corners */
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.4s var(--ease-out);
}
.featured-card:hover .card-thumb img { transform: scale(1.03); }

.card-body { padding: 22px; }

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.card-body h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}
.card-body p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.mini-label { margin-bottom: 16px; }

.projects-mini {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.project-chip {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s;
  cursor: default;
}
.project-chip:hover { border-color: var(--fox); }
.chip-num {
  font-size: 11px;
  color: var(--fox);
  font-family: var(--font-head);
  font-weight: 700;
}
.chip-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}
.chip-tags { font-size: 11px; color: var(--muted); }

/* ═══════════════════════════════════════════════
   STACK — mobile first
════════════════════════════════════════════════ */
#stack { background: var(--bg); }

.stack-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 24px;
}
.stack-group h4 {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fox);
  margin-bottom: 16px;
  font-family: var(--font-head);
}
.stack-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.stack-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--fox);
  flex-shrink: 0;
}
.stack-item .level {
  margin-left: auto;
  font-size: 11px;
  color: var(--fox);
  font-family: var(--font-head);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════
   STATS — mobile first
════════════════════════════════════════════════ */
#stats {
  background: var(--fox);
  padding: 64px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 16px;
}
.stat-item { text-align: center; }
.stat-num {
  font-family: var(--font-head);
  font-size: clamp(40px, 10vw, 70px);
  font-weight: 800;
  color: oklch(0.1 0.01 45);
  line-height: 1;
  margin-bottom: 8px;
  display: block;
}
.stat-label {
  font-size: 11px;
  color: oklch(0.25 0.05 45);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════
   TESTIMONIALS — mobile first
════════════════════════════════════════════════ */
#testimonials { background: var(--bg2); }

.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.testimonial-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.3s;
}
.testimonial-card:hover { border-color: var(--fox); }

.t-stars {
  color: var(--fox);
  font-size: 16px;
  margin-bottom: 14px;
  letter-spacing: 2px;
}
.t-text {
  font-size: 14px;
  line-height: 1.75;
  color: oklch(0.78 0.01 260);
  margin-bottom: 20px;
  font-style: italic;
}
.t-author {
  display: flex;
  align-items: center;
  gap: 12px;
}
.t-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  color: var(--fox);
  flex-shrink: 0;
}
.t-name { font-weight: 600; font-size: 14px; }
.t-title { font-size: 12px; color: var(--muted); }

/* ═══════════════════════════════════════════════
   CONTACT — mobile first
════════════════════════════════════════════════ */
#contact { background: var(--bg); }

.contact-header {
  text-align: center;
  margin-bottom: 40px;
}
.contact-header .section-desc { margin: 0 auto 0; }

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.contact-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.contact-link:hover,
.contact-link:focus-visible {
  border-color: var(--fox);
  color: var(--fox);
  transform: translateY(-2px);
}
.contact-link svg {
  width: 18px; height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════════ */
footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}
.footer-location { color: var(--fox); }

/* ═══════════════════════════════════════════════
   BREAKPOINT: 480px — larger phones
════════════════════════════════════════════════ */
@media (min-width: 480px) {
  :root { --px: 24px; }

  .contact-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .contact-link {
    flex: 0 1 auto;
    min-width: 140px;
  }

  .projects-mini { grid-template-columns: repeat(3, 1fr); }
}

/* ═══════════════════════════════════════════════
   BREAKPOINT: 640px — tablets
════════════════════════════════════════════════ */
@media (min-width: 640px) {
  :root { --px: 32px; }

  section { padding: 80px 0; }
  .section-header { margin-bottom: 56px; }

  .bio-grid { grid-template-columns: 1fr 1fr; gap: 48px; }

  .edge-grid { grid-template-columns: 1fr 1fr; }

  .featured-grid { grid-template-columns: 1fr 1fr; }

  /* Wide card: horizontal layout — image left, text right */
  .featured-card.wide {
    grid-column: span 2;
    display: flex;
    flex-direction: row;
    align-items: stretch;
  }
  .featured-card.wide .card-thumb {
    width: 46%;
    flex-shrink: 0;
    aspect-ratio: unset;
    height: auto;
    min-height: 280px;
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
  }
  .featured-card.wide .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px;
  }

  .card-body { padding: 26px; }

  .stack-groups { grid-template-columns: repeat(4, 1fr); }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  #stats { padding: 80px 0; }

  .testimonials-grid { grid-template-columns: 1fr 1fr; }

  .projects-mini { grid-template-columns: repeat(4, 1fr); }

  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

/* ═══════════════════════════════════════════════
   BREAKPOINT: 960px — desktop
════════════════════════════════════════════════ */
@media (min-width: 960px) {
  :root { --px: 48px; }

  section { padding: 100px 0; }

  /* Show desktop nav, hide hamburger */
  .nav-links { display: flex; }
  .hamburger { display: none; }
  .nav-inner { padding: 20px var(--px); }
  .nav-right { gap: 32px; }

  /* Hero: 2 columns, show photo */
  .hero-inner {
    grid-template-columns: 1fr 1fr;
    padding: 140px var(--px) 100px;
  }
  .hero-right {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: fadeIn 1.2s 0.5s var(--ease-out) forwards;
  }
  .globe-wrap { width: min(460px, 40vw); }

  .bio-grid { gap: 80px; }

  .edge-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .edge-card { padding: 36px; }

  .testimonials-grid { grid-template-columns: repeat(3, 1fr); }

  .featured-card.wide .card-thumb { min-height: 320px; }
  .card-body { padding: 28px; }
  .featured-card.wide .card-body { padding: 40px; }

  .projects-mini { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
}

/* ═══════════════════════════════════════════════
   BREAKPOINT: 1200px — large desktop
════════════════════════════════════════════════ */
@media (min-width: 1200px) {
  .hero-bg-grid { background-size: 60px 60px; }
  .hero-glow { width: 700px; height: 700px; }
  .section-title { font-size: 52px; }

  #contact .section-title { font-size: clamp(36px, 5vw, 64px); }
}

/* ═══════════════════════════════════════════════
   FOCUS STYLES (accessibility)
════════════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--fox);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════
   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; }
}

/* ═══════════════════════════════════════════════
   GRAIN TEXTURE OVERLAY
════════════════════════════════════════════════ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: 0.038;
  mix-blend-mode: overlay;
}

/* ═══════════════════════════════════════════════
   AURORA BLOBS (hero)
════════════════════════════════════════════════ */
.aurora-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.aurora-blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
  animation: aurora-drift ease-in-out infinite;
}
.aurora-blob-1 {
  width: min(60vw, 720px); height: min(60vw, 720px);
  background: radial-gradient(circle, oklch(0.72 0.18 45 / 0.2) 0%, transparent 70%);
  filter: blur(100px);
  top: -20%; left: -8%;
  animation-duration: 22s;
}
.aurora-blob-2 {
  width: min(45vw, 580px); height: min(45vw, 580px);
  background: radial-gradient(circle, oklch(0.72 0.18 195 / 0.14) 0%, transparent 70%);
  filter: blur(90px);
  bottom: -15%; right: 2%;
  animation-duration: 28s;
  animation-delay: -10s;
  animation-direction: reverse;
}
.aurora-blob-3 {
  width: min(38vw, 480px); height: min(38vw, 480px);
  background: radial-gradient(circle, oklch(0.58 0.16 280 / 0.1) 0%, transparent 70%);
  filter: blur(80px);
  top: 35%; left: 45%;
  animation-duration: 35s;
  animation-delay: -18s;
}
@keyframes aurora-drift {
  0%,100% { transform: translate(0,    0)    scale(1);    }
  25%      { transform: translate(5%,  -4%)  scale(1.08); }
  50%      { transform: translate(-3%,  6%)  scale(0.94); }
  75%      { transform: translate(-6%, -2%)  scale(1.04); }
}

/* ═══════════════════════════════════════════════
   CUSTOM CURSOR — fine pointer / desktop only
════════════════════════════════════════════════ */
@media (pointer: fine) {
  * { cursor: none !important; }

  .cursor-dot {
    position: fixed;
    top: 0; left: 0;
    width: 7px; height: 7px;
    background: var(--fox);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    will-change: transform;
    transition: width 0.25s, height 0.25s, background 0.25s, opacity 0.3s;
  }
  .cursor-dot.cursor-link { width: 10px; height: 10px; }

  .cursor-ring {
    position: fixed;
    top: 0; left: 0;
    width: 38px; height: 38px;
    border: 1.5px solid oklch(0.72 0.18 45 / 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    will-change: transform;
    transition:
      width  0.4s cubic-bezier(0.22,1,0.36,1),
      height 0.4s cubic-bezier(0.22,1,0.36,1),
      border-color 0.4s,
      background   0.4s,
      opacity 0.3s;
  }
  .cursor-ring.cursor-link {
    width: 54px; height: 54px;
    border-color: var(--fox);
    background: oklch(0.72 0.18 45 / 0.05);
  }
  .cursor-ring.cursor-btn {
    width: 62px; height: 62px;
    border-color: var(--fox);
    background: oklch(0.72 0.18 45 / 0.09);
  }
}

/* ═══════════════════════════════════════════════
   3D TILT — card setup
════════════════════════════════════════════════ */
.edge-card,
.testimonial-card,
.featured-card {
  will-change: transform;
  transform-origin: center center;
}
/* Shine overlay injected by JS */
.tilt-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 5;
}

/* ═══════════════════════════════════════════════
   MAGNETIC BUTTONS
════════════════════════════════════════════════ */
.btn-primary, .btn-outline, .contact-link {
  will-change: transform;
}

/* ═══════════════════════════════════════════════
   HERO IMPROVEMENTS
════════════════════════════════════════════════ */
.hero-name .accent {
  text-shadow: 0 0 70px oklch(0.72 0.18 45 / 0.4);
}
.hero-tag {
  box-shadow: 0 0 24px oklch(0.72 0.18 45 / 0.18);
}
/* Typewriter blink after title */
.hero-title::after {
  content: '_';
  color: var(--fox);
  animation: blink 1.1s step-end infinite;
  margin-left: 2px;
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50%      { opacity: 0; }
}
/* Floating photo frame on desktop */
@media (min-width: 960px) and (pointer: fine) {
  .photo-frame {
    animation: float 6s ease-in-out infinite;
  }
}
@keyframes float {
  0%,100% { transform: translateY(0);    }
  50%      { transform: translateY(-14px); }
}
/* Glowing photo ring */
.photo-frame::before {
  box-shadow: 0 0 40px oklch(0.72 0.18 45 / 0.2);
}

/* ═══════════════════════════════════════════════
   HOVER GLOW on cards
════════════════════════════════════════════════ */
.featured-card:hover    { box-shadow: 0 24px 60px oklch(0.72 0.18 45 / 0.14); }
.edge-card:hover        { box-shadow: 0 14px 40px oklch(0.72 0.18 45 / 0.12); }
.testimonial-card:hover { box-shadow: 0 10px 32px oklch(0.72 0.18 45 / 0.10); }

/* ═══════════════════════════════════════════════
   TIMELINE — line draws in on scroll
════════════════════════════════════════════════ */
.timeline::before {
  background: linear-gradient(to bottom, var(--fox), oklch(0.72 0.18 45 / 0.2));
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 1.6s cubic-bezier(0.22,1,0.36,1);
}
.timeline.line-active::before { transform: scaleY(1); }

/* ═══════════════════════════════════════════════
   PROJECT CHIPS — stagger reveal
════════════════════════════════════════════════ */
.project-chip {
  opacity: 0;
  transform: translateY(10px) scale(0.94);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out), border-color 0.2s;
}
.project-chip.chip-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ═══════════════════════════════════════════════
   STATS DEPTH
════════════════════════════════════════════════ */
#stats { position: relative; overflow: hidden; }
#stats::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 50%, oklch(0.9 0.22 50 / 0.15) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 50%, oklch(0.65 0.15 35 / 0.15) 0%, transparent 55%);
  pointer-events: none;
}
.stat-num { text-shadow: 0 2px 24px oklch(0.08 0.01 45 / 0.35); }

/* ═══════════════════════════════════════════════
   NAV — improved glassmorphism
════════════════════════════════════════════════ */
#navbar.scrolled {
  background: oklch(0.09 0.012 260 / 0.78) !important;
  box-shadow: 0 1px 48px oklch(0.05 0.01 260 / 0.7),
              inset 0 -1px 0 oklch(0.72 0.18 45 / 0.08);
}

/* ═══════════════════════════════════════════════
   SECTION LABEL — animated underline
════════════════════════════════════════════════ */
.section-label {
  position: relative;
  display: inline-block;
}
.section-label::after {
  content: '';
  display: block;
  height: 1px;
  background: var(--fox);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.55s var(--ease-out) 0.25s;
  margin-top: 4px;
}
.section-label.visible::after { transform: scaleX(1); }

/* ═══════════════════════════════════════════════
   STACK ITEMS — hover highlight
════════════════════════════════════════════════ */
.stack-item {
  transition: color 0.2s, padding-left 0.2s;
}
.stack-item:hover { color: var(--text); padding-left: 4px; }
.stack-item:hover .stack-dot { box-shadow: 0 0 8px var(--fox); }
.stack-dot { transition: box-shadow 0.2s; }

/* ═══════════════════════════════════════════════
   HERO SCROLL INDICATOR
════════════════════════════════════════════════ */
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 3;
  opacity: 0;
  animation: fadeIn 1s 2s forwards;
}
.scroll-indicator span {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-head);
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--fox), transparent);
  animation: scroll-pulse 2s ease-in-out infinite;
}
@keyframes scroll-pulse {
  0%,100% { transform: scaleY(1); opacity: 0.6; }
  50%      { transform: scaleY(0.6); opacity: 1; }
}

/* ═══════════════════════════════════════════════
   FIXES
════════════════════════════════════════════════ */
/* Override inline-block on section-label — keep block, use abs underline */
.section-label {
  display: block;
  position: relative;
}
.section-label::after {
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  margin-top: 0;
  display: block;
}
/* Chips: no-js fallback */
.no-js .project-chip {
  opacity: 1 !important;
  transform: none !important;
}
/* featured-card tilt: overflow-hidden clips the shine but preserves image zoom */
/* Allow overflow for 3D tilt, keep overflow on card-thumb */
.featured-card { overflow: visible; }
.featured-card .card-thumb { overflow: hidden; }

/* ═══════════════════════════════════════════════
   GLOBE TOOLTIP
════════════════════════════════════════════════ */
.globe-tooltip {
  position: absolute;
  background: rgba(6,13,26,0.96);
  border: 1px solid rgba(232,118,26,0.4);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 190px;
  max-width: 250px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 20;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.55), 0 0 18px rgba(232,118,26,0.1);
}
.globe-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
.gt-country {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 12px;
  color: var(--fox);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.gt-divider {
  height: 1px;
  background: rgba(232,118,26,0.22);
  margin-bottom: 8px;
}
.gt-project { margin-bottom: 6px; }
.gt-project:last-child { margin-bottom: 0; }
.gt-proj-name {
  font-size: 12px;
  font-weight: 600;
  color: #e6ecff;
  margin-bottom: 2px;
}
.gt-proj-meta {
  font-size: 11px;
  color: rgba(170,185,220,0.65);
}

/* ═══════════════════════════════════════════════
   MOBILE CENTERING
════════════════════════════════════════════════ */
@media (max-width: 639px) {
  .hero-ctas {
    justify-content: center;
  }
  .hero-tag {
    display: inline-flex;
    margin-left: auto;
    margin-right: auto;
  }
  .cert-list {
    flex-direction: column;
    align-items: stretch;
  }
  .cert-item {
    align-items: center;
    text-align: center;
    flex-direction: row;
    justify-content: space-between;
    padding: 14px 18px;
  }
}

/* ═══════════════════════════════════════════════
   TESTIMONIALS — cap width on large screens
════════════════════════════════════════════════ */
.testimonials-carousel {
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
}

/* ═══════════════════════════════════════════════
   TESTIMONIALS CAROUSEL
════════════════════════════════════════════════ */
#testimonials { overflow: hidden; }
#testimonials .container { margin-bottom: 2.5rem; }

.testimonials-carousel {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
  padding: 1rem 0 2rem;
}

.carousel-track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 1.5rem;
  width: max-content;
  will-change: transform;
  animation: carousel-scroll 30s linear infinite;
}

.carousel-track:hover {
  animation-play-state: paused;
}

@keyframes carousel-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.carousel-track .testimonial-card {
  flex: 0 0 340px;
  width: 340px;
  min-width: 340px;
  opacity: 1 !important;
  transform: none;
  animation: none !important;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  cursor: default;
}

.carousel-track .testimonial-card:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35), 0 0 24px rgba(232,118,26,0.12);
  border-color: var(--fox);
}

/* edge icon SVG styling */
.edge-icon svg {
  color: var(--fox);
}

/* project SVG thumbnails — fill the card thumb fully */
.card-thumb img[src$=".svg"] {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
