/* Zeeshan Portfolio — template design system + responsive layer */

/* ── Accessibility utility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   CUSTOM CURSOR (dot + lagging ring — fine pointer only)
   ============================================================ */
.custom-cursor-dot,
.custom-cursor-ring {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 10050;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

body.custom-cursor-active .custom-cursor-dot,
body.custom-cursor-active .custom-cursor-ring {
  display: block;
}

.custom-cursor-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(230, 51, 42, 0.65);
  transition: transform 0.2s ease, opacity 0.25s ease;
}

.custom-cursor-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(230, 51, 42, 0.75);
  background: transparent;
  box-shadow: 0 0 20px rgba(230, 51, 42, 0.12);
  transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease, opacity 0.25s ease;
}

.custom-cursor-ring.is-hover {
  width: 48px;
  height: 48px;
  border-color: rgba(230, 51, 42, 0.95);
  background: rgba(230, 51, 42, 0.06);
}

.custom-cursor-dot.is-hover {
  transform: translate(-50%, -50%) scale(0.85);
}

@media (pointer: fine) {
  body.custom-cursor-active,
  body.custom-cursor-active * {
    cursor: none !important;
  }

  body.custom-cursor-active input[type="text"],
  body.custom-cursor-active input[type="email"],
  body.custom-cursor-active input[type="search"],
  body.custom-cursor-active input[type="tel"],
  body.custom-cursor-active input[type="url"],
  body.custom-cursor-active input[type="password"],
  body.custom-cursor-active textarea {
    cursor: text !important;
  }

  body.custom-cursor-active select {
    cursor: pointer !important;
  }
}

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  body.custom-cursor-active,
  body.custom-cursor-active * {
    cursor: revert !important;
  }

  body.custom-cursor-active .custom-cursor-dot,
  body.custom-cursor-active .custom-cursor-ring {
    display: none !important;
  }
}

/* ============================================================
   DESIGN TOKENS — QA CONSOLE / DAY (default)
   Cream paper + ink + brand red, mono everywhere.
   Note: --cyan kept as the *accent* token name so every existing
   component reskins without renaming 100s of rules. Accent = red.
   ============================================================ */
:root {
  --bg: #faf6ee;
  --bg-2: #f4eee2;
  --bg-3: #ece4d4;
  --surface: rgba(26, 22, 18, 0.035);
  --surface-hover: rgba(26, 22, 18, 0.07);
  --border: rgba(26, 22, 18, 0.14);
  --border-accent: rgba(230, 51, 42, 0.4);
  --cyan: #e6332a;          /* accent = brand red (was cyan) */
  --cyan-dim: rgba(230, 51, 42, 0.1);
  --cyan-glow: rgba(230, 51, 42, 0.22);
  --amber: #c2410c;
  --amber-dim: rgba(194, 65, 12, 0.1);
  --red: #e6332a;           /* FAIL / brand red */
  --green: #16a34a;         /* PASS */
  --text: #1f1b16;
  --text-2: #6b6155;
  --text-3: #a99e8d;
  --font-display: "JetBrains Mono", ui-monospace, monospace;
  --font-body: "JetBrains Mono", ui-monospace, monospace;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-cyan: 0 8px 30px rgba(31, 27, 22, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-h: 64px;
  --nav-bg: rgba(250, 246, 238, 0.82);
  --mobile-menu-bg: rgba(250, 246, 238, 0.98);
}

/* ============================================================
   DESIGN TOKENS — NIGHT TERMINAL (toggle target)
   Phosphor green on near-black. Stored key is still "light".
   ============================================================ */
[data-theme="light"] {
  --bg: #0d0f0c;
  --bg-2: #141713;
  --bg-3: #1b1f19;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(120, 255, 170, 0.16);
  --border-accent: rgba(120, 255, 170, 0.4);
  --cyan: #4ade80;          /* accent = phosphor green */
  --cyan-dim: rgba(74, 222, 128, 0.12);
  --cyan-glow: rgba(74, 222, 128, 0.3);
  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, 0.12);
  --red: #ff5a52;
  --green: #4ade80;
  --text: #e6f5ea;
  --text-2: #93b8a0;
  --text-3: #5a7164;
  --shadow-cyan: 0 8px 30px rgba(0, 0, 0, 0.5);
  --nav-bg: rgba(13, 15, 12, 0.82);
  --mobile-menu-bg: rgba(13, 15, 12, 0.98);
}

/* ─── Night terminal component overrides ─── */
[data-theme="light"] #navbar {
  background: var(--nav-bg);
  border-bottom-color: var(--border);
}

[data-theme="light"] .mobile-menu {
  background: var(--mobile-menu-bg);
}

[data-theme="light"] .mobile-menu a {
  border-color: var(--border);
  color: var(--text-2);
}

[data-theme="light"] .mobile-menu a:hover {
  background: var(--cyan-dim);
  border-color: var(--border-accent);
  color: var(--cyan);
}

[data-theme="light"] .btn-primary,
[data-theme="light"] .nav-cta {
  color: #0d0f0c;
}

[data-theme="light"] .nav-logo-mark {
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 2px solid var(--border-accent);
}

[data-theme="light"] .orb-1 { background: rgba(74, 222, 128, 0.06); }
[data-theme="light"] .orb-2 { background: rgba(251, 191, 36, 0.05); }
[data-theme="light"] .orb-3 { background: rgba(74, 222, 128, 0.04); }

[data-theme="light"] ::-webkit-scrollbar-track { background: var(--bg-2); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: var(--cyan); }

[data-theme="light"] .hero-tag {
  background: var(--cyan-dim);
  border-color: var(--border-accent);
}

[data-theme="light"] .freelance-banner {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.06) 0%, var(--bg-2) 60%, rgba(251, 191, 36, 0.04) 100%);
  border-color: var(--border-accent);
}

[data-theme="light"] .freelance-available-badge {
  background: var(--cyan-dim);
  border-color: var(--border-accent);
}

[data-theme="light"] .freelance-stat {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="light"] .mobile-freelance-link {
  color: var(--green) !important;
  border-color: var(--border-accent) !important;
  background: var(--cyan-dim) !important;
}

/* ─── Theme toggle button ─── */
.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  line-height: 1;
}

.theme-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--border-accent);
  color: var(--text);
}

.theme-icon-sun { display: none; }

[data-theme="light"] .theme-icon-moon { display: none; }
[data-theme="light"] .theme-icon-sun { display: block; }

/* ============================================================
   RESET & 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(--text);
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
}

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

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

ul {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   NOISE TEXTURE OVERLAY
   ============================================================ */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--cyan);
  border-radius: 2px;
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
  position: relative;
}

section[id] {
  scroll-margin-top: calc(var(--nav-h) + 12px);
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--cyan);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-tag::before {
  content: "";
  width: 20px;
  height: 1px;
  background: var(--cyan);
}

.section-title {
  font-family: var(--font-body);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 56px;
}

.section-title span {
  color: var(--cyan);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-mono);
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid var(--border-accent);
}

/* ============================================================
   ANIMATED BACKGROUND ORBS
   ============================================================ */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  width: min(600px, 90vw);
  height: min(600px, 90vw);
  background: rgba(230, 51, 42, 0.06);
  top: -200px;
  left: -200px;
}

.orb-2 {
  width: min(400px, 70vw);
  height: min(400px, 70vw);
  background: rgba(245, 158, 11, 0.05);
  top: 20%;
  right: -150px;
}

.orb-3 {
  width: min(500px, 80vw);
  height: min(500px, 80vw);
  background: rgba(230, 51, 42, 0.04);
  bottom: 10%;
  left: 30%;
}

/* ============================================================
   NAVBAR (scope to #navbar only — footer uses <div role="navigation">)
   ============================================================ */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  padding: 0 24px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

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

.nav-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
  z-index: 1;
}

.nav-logo > span {
  display: inline;
}

.nav-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), #b91c1c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #faf6ee;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.nav-logo-text {
  display: inline-block;
  color: var(--text);
  font-size: clamp(14px, 1.2vw, 17px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
  padding-top: 1px;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  flex-wrap: nowrap;
}

.nav-links li {
  display: inline-block;
}

.nav-links a {
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-links a.active {
  color: var(--cyan);
  background: var(--cyan-dim);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--border-accent);
}

.nav-cta {
  padding: 8px 18px;
  border-radius: 10px;
  background: var(--cyan);
  color: #faf6ee;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-cta:hover {
  background: #ff5147;
  transform: translateY(-1px);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--mobile-menu-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 999;
  padding: 32px 24px;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.mobile-menu a {
  display: block;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.mobile-menu a:hover {
  color: var(--cyan);
  border-color: var(--border-accent);
  background: var(--cyan-dim);
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a.mobile-resume-link {
  color: var(--cyan);
  border-color: var(--border-accent);
}

/* ============================================================
   HERO
   ============================================================ */
#home {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--nav-h) + 40px);
  padding-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  position: relative;
  z-index: 1;
  margin-top: 12px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border-accent);
  background: var(--cyan-dim);
  margin-bottom: 24px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--cyan);
}

.hero-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.hero-name {
  font-family: var(--font-body);
  font-size: clamp(40px, 5.5vw, 72px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero-name span {
  color: var(--cyan);
}

.hero-role {
  font-family: var(--font-mono);
  font-size: clamp(14px, 2vw, 18px);
  color: var(--text-2);
  margin-bottom: 24px;
  min-height: 28px;
}

.hero-role .typed-text {
  color: var(--cyan);
}

.hero-role .cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--cyan);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

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

.hero-bio {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 36px;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--cyan);
  color: #faf6ee;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-display);
  transition: var(--transition);
}

.btn-primary:hover {
  background: #ff5147;
  transform: translateY(-2px);
  box-shadow: var(--shadow-cyan);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-weight: 500;
  font-size: 14px;
  transition: var(--transition);
}

.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-dim);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.hero-stat {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
  transition: var(--transition);
}

.hero-stat:hover {
  border-color: var(--border-accent);
  background: var(--cyan-dim);
}

.hero-stat-number {
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 800;
  color: var(--cyan);
  line-height: 1;
}

.hero-stat-label {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 4px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero-photo-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  max-width: min(280px, 85vw);
  max-height: min(280px, 85vw);
}

.hero-photo-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px dashed var(--border-accent);
  animation: spin 20s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hero-photo-ring::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  transform: translateX(-50%);
  box-shadow: 0 0 12px var(--cyan);
}

.hero-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-3);
  filter: grayscale(20%);
}

.hero-photo.is-hidden {
  display: none;
}

.hero-photo-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-3), var(--bg-2));
  border: 3px solid var(--border);
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 800;
  color: var(--cyan);
}

.hero-photo-fallback.is-visible {
  display: flex;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  transition: var(--transition);
}

.hero-badge:hover {
  border-color: var(--border-accent);
  color: var(--cyan);
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.about-text p {
  color: var(--text-2);
  margin-bottom: 16px;
  font-size: 16px;
}

.about-text p strong {
  color: var(--text);
}

.about-links {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.about-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
  transition: var(--transition);
}

.about-link:hover {
  border-color: var(--border-accent);
  color: var(--cyan);
  background: var(--cyan-dim);
}

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

.about-stat-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.about-stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--cyan-dim), transparent);
  opacity: 0;
  transition: var(--transition);
}

.about-stat-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.about-stat-card:hover::before {
  opacity: 1;
}

.about-stat-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.about-stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--cyan);
}

.about-stat-desc {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
  line-height: 1.4;
}

.about-edu {
  margin-top: 24px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  grid-column: 1 / -1;
}

.about-edu-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.about-edu h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.about-edu p {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
}

.about-edu-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-3);
}

/* ============================================================
   EXPERIENCE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--cyan), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 48px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.timeline-item:hover {
  border-color: var(--border-accent);
  transform: translateX(4px);
}

.timeline-dot {
  position: absolute;
  left: -40px;
  top: 32px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cyan);
  border: 3px solid var(--bg);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.timeline-role {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.timeline-company {
  color: var(--cyan);
  font-weight: 600;
  margin-top: 2px;
  font-size: 15px;
}

.timeline-date {
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--cyan-dim);
  border: 1px solid var(--border-accent);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--cyan);
  white-space: nowrap;
}

.timeline-promo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--amber-dim);
  border: 1px solid rgba(245, 158, 11, 0.2);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--amber);
  margin-bottom: 12px;
}

.timeline-bullets {
  padding-left: 0;
}

.timeline-bullets li {
  color: var(--text-2);
  font-size: 14px;
  padding: 4px 0 4px 20px;
  position: relative;
}

.timeline-bullets li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--cyan);
  font-size: 12px;
}

.timeline-bullets li strong {
  color: var(--text);
}

/* ============================================================
   SKILLS
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.skill-group {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.skill-group:hover {
  border-color: var(--border-accent);
}

.skill-group-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-group-title .icon {
  font-size: 18px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-mono);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: var(--transition);
}

.skill-tag:hover {
  border-color: var(--border-accent);
  color: var(--cyan);
  background: var(--cyan-dim);
}

.skill-tag.featured {
  background: var(--cyan-dim);
  color: var(--cyan);
  border-color: var(--border-accent);
}

/* ============================================================
   PROJECTS CAROUSEL
   ============================================================ */
.carousel-wrap {
  position: relative;
}

.carousel {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 20px;
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.project-card {
  min-width: min(340px, calc(100vw - 48px));
  max-width: 340px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-snap-align: start;
  transition: var(--transition);
  flex-shrink: 0;
}

.project-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-cyan);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.project-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--cyan-dim);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.project-links {
  display: flex;
  gap: 8px;
}

.project-link {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 14px;
  transition: var(--transition);
}

.project-link:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-dim);
}

.project-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.project-type {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--amber);
  margin-top: 2px;
}

.project-section-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2px;
}

.project-text {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

.project-impact {
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  font-size: 12px;
  color: #10b981;
  font-family: var(--font-mono);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.project-tag {
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.carousel-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.carousel-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.carousel-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-dim);
}

.carousel-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: var(--transition);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.carousel-dot.active {
  background: var(--cyan);
  width: 20px;
  border-radius: 3px;
}

/* ============================================================
   AI & RESEARCH
   ============================================================ */
.research-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.article-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

a.article-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.article-pub {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.article-desc {
  font-size: 13px;
  color: var(--text-2);
  flex: 1;
}

.article-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--cyan);
  font-family: var(--font-mono);
  transition: var(--transition);
}

.article-link:hover {
  gap: 10px;
}

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

.oss-card {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: var(--transition);
}

a.oss-card:hover {
  border-color: var(--border-accent);
}

.oss-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--cyan);
  margin-bottom: 8px;
}

.oss-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

.article-card.placeholder {
  border-style: dashed;
  justify-content: center;
  align-items: center;
  text-align: center;
  opacity: 0.5;
}

.article-card.placeholder .article-title {
  font-size: 14px;
}

/* ============================================================
   BUG HUNT GAME
   ============================================================ */
#game-section {
  padding: 48px 0;
  background: linear-gradient(to bottom, transparent, var(--bg-2), transparent);
}

.game-header {
  text-align: center;
  margin-bottom: 32px;
}

.game-header h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 800;
  margin-bottom: 8px;
}

.game-header p {
  color: var(--text-2);
  font-size: 14px;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 8px;
}

.game-board {
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 32px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
}

.game-score-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.score-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
}

.score-badge .score-val {
  font-weight: 700;
  color: var(--cyan);
}

.game-arena {
  position: relative;
  min-height: 220px;
  min-height: max(220px, 28vh);
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: default;
  user-select: none;
}

.game-bug {
  position: absolute;
  font-size: 22px;
  cursor: pointer;
  transition: top 0.4s, left 0.4s;
  filter: drop-shadow(0 0 6px rgba(255, 77, 106, 0.5));
  animation: bugWiggle 2s ease-in-out infinite;
}

.game-bug.spider {
  filter: drop-shadow(0 0 6px rgba(80, 80, 80, 0.6));
  animation-duration: 1.5s;
}

@keyframes bugWiggle {
  0%,
  100% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

.game-bug:hover {
  transform: scale(1.2) !important;
}

.game-msg {
  text-align: center;
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-2);
  min-height: 20px;
}

.game-msg.success {
  color: var(--green);
}

.game-msg.fail {
  color: var(--red);
}

.game-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.game-btn {
  padding: 9px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-display);
  transition: var(--transition);
}

.game-btn-start {
  background: var(--cyan);
  color: #faf6ee;
}

.game-btn-start:hover {
  background: #ff5147;
  transform: translateY(-1px);
}

.game-btn-reset {
  border: 1px solid var(--border);
  color: var(--text-2);
}

.game-btn-reset:hover {
  border-color: var(--border-accent);
  color: var(--cyan);
  background: var(--cyan-dim);
}

.game-arena-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
  padding: 24px;
}

.game-arena-overlay .emoji {
  font-size: 36px;
}

.game-arena-overlay .hint {
  font-size: 12px;
  color: var(--text-3);
}

/* ============================================================
   CERTIFICATIONS
   ============================================================ */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.cert-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: var(--transition);
}

a.cert-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  background: var(--cyan-dim);
}

.cert-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.cert-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.cert-issuer {
  font-size: 12px;
  color: var(--cyan);
  margin-top: 3px;
  font-family: var(--font-mono);
}

.cert-year {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.cert-external {
  margin-left: auto;
  color: var(--text-3);
  font-size: 12px;
  flex-shrink: 0;
  align-self: center;
}

.cert-section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-2);
  margin: 32px 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cert-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.awards-heading {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  margin-bottom: 8px;
}

.awards-heading span {
  color: var(--cyan);
}

.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.award-card {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.award-card:hover {
  border-color: rgba(245, 158, 11, 0.3);
  transform: translateY(-2px);
}

.award-emoji {
  font-size: 28px;
  margin-bottom: 10px;
}

.award-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

.award-event {
  font-size: 12px;
  color: var(--amber);
  margin-top: 4px;
  font-family: var(--font-mono);
}

.award-desc {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 8px;
  line-height: 1.5;
}

.recognition-block {
  margin-top: 64px;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-2);
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  transition: var(--transition);
  width: 100%;
  resize: none;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--border-accent);
  background: var(--cyan-dim);
  box-shadow: 0 0 0 3px rgba(230, 51, 42, 0.08);
}

.form-group textarea {
  min-height: 130px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-info-header {
  margin-bottom: 8px;
}

.contact-info-header h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  margin: 0;
}

.contact-info-header p {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 8px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: var(--transition);
}

a.contact-item:hover {
  border-color: var(--border-accent);
  background: var(--cyan-dim);
}

.contact-item.is-static {
  cursor: default;
}

.contact-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--cyan-dim);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.contact-item-label {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-3);
}

.contact-item-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-top: 2px;
}

.social-links {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
  transition: var(--transition);
  font-weight: 500;
}

.social-link:hover {
  border-color: var(--border-accent);
  color: var(--cyan);
  background: var(--cyan-dim);
}

.contact-submit {
  align-self: flex-start;
  transition: all 0.5s ease;
}

/* ── LET'S CONNECT: TOOLTIP & CLICK-TO-FIX ALIGNMENT ── */
.connect-fix-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.connect-fix-wrap #letsConnectHeading {
  transition: color 0.2s ease;
}

.connect-fix-wrap:hover #letsConnectHeading {
  color: var(--cyan);
}

.connect-tooltip-text {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  min-width: 240px;
  max-width: min(300px, 90vw);
  padding: 10px 14px;
  border-radius: 10px;
  background: #1f1b16;
  border: 1px solid var(--border-accent);
  color: #faf6ee;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-mono);
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--cyan-dim);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 50;
  white-space: normal;
}

.connect-tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: var(--border-accent);
}

.connect-fix-wrap:hover .connect-tooltip-text {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Fixed confirmation message */
.connect-fixed-msg {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--cyan);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  transition: opacity 0.4s ease 0.4s, max-height 0.5s ease;
}

/* Alignment fixed state */
.contact-form-wrap {
  transition: padding-top 0.55s ease;
}

.contact-grid.alignment-fixed {
  align-items: stretch;
}

@media (min-width: 901px) {
  .contact-grid.alignment-fixed .contact-form-wrap {
    padding-top: 38px;
  }
}

.contact-grid.alignment-fixed .contact-info {
  justify-content: space-between;
}

.contact-grid.alignment-fixed .contact-submit {
  display: flex;
  width: 100%;
  box-sizing: border-box;
}

.contact-grid.alignment-fixed .social-links {
  margin-top: 0;
}

.contact-grid.alignment-fixed .connect-fixed-msg {
  opacity: 1;
  max-height: 40px;
  margin-top: 8px;
}

/* ============================================================
   FOOTER — quick links row (Home / Contact emphasis)
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  background: var(--bg-2);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
}

.footer-logo span {
  color: var(--cyan);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 14px;
}

.footer-links a {
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 8px;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--cyan);
  background: var(--cyan-dim);
}

/* Home & Contact: same color as other links; subtle intentional misalignment (QA alignment pass) */
.footer-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.footer-tooltip-wrap > a {
  position: relative;
  z-index: 2;
}

/* Deliberate sub-pixel / pixel-level drift — only obvious if you’re checking alignment */
.footer-tooltip-wrap.footer-qa--home > a {
  display: inline-block;
  transform: translateY(2.5px);
  padding-left: 11px;
  padding-right: 13px;
}

.footer-tooltip-wrap.footer-qa--contact > a {
  display: inline-block;
  transform: translateY(-2px);
  letter-spacing: 0.035em;
}

.footer-links .footer-sep--qa {
  height: 11px;
  align-self: center;
  transform: translateY(0.5px);
  opacity: 0.88;
}

.footer-links .footer-tooltip-wrap:hover > a {
  color: var(--amber);
  background: var(--amber-dim);
}

.footer-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  min-width: 220px;
  max-width: min(320px, 90vw);
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(12, 10, 6, 0.96);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fde68a;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(245, 158, 11, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 50;
}

.footer-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: rgba(251, 191, 36, 0.65);
}

/* Tooltip only on hover (no focus-within — keeps the joke for mouse users / QA) */
.footer-tooltip-wrap:hover .footer-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 900px) {
  .footer-tooltip {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(4px);
    text-align: left;
  }

  .footer-tooltip::after {
    left: auto;
    right: 14px;
    transform: none;
  }

  .footer-tooltip-wrap:hover .footer-tooltip {
    transform: translateX(0) translateY(0);
  }
}

.footer-sep {
  width: 1px;
  height: 14px;
  background: var(--border);
  margin: 0 4px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-tagline::before {
  content: "//";
  color: var(--cyan);
}

.footer-copy {
  font-size: 13px;
  color: var(--text-3);
}

/* ============================================================
   DIVIDER
   ============================================================ */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-delay-1 {
  transition-delay: 0.1s;
}

.fade-in-delay-2 {
  transition-delay: 0.2s;
}

.fade-in-delay-3 {
  transition-delay: 0.3s;
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 100;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--cyan);
  color: #faf6ee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  box-shadow: var(--shadow-cyan);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: all;
}

.back-to-top:hover {
  transform: translateY(-3px);
  background: #ff5147;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 80px;
  right: 28px;
  left: 24px;
  z-index: 200;
  margin-left: auto;
  max-width: min(340px, calc(100vw - 48px));
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--bg-3);
  border: 1px solid var(--border-accent);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  transform: translateY(10px);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
  box-shadow: var(--shadow-cyan);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ============================================================
   FOCUS (accessibility)
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 901px) {
  .hero-visual {
    padding-top: 20px;
  }
}

@media (max-width: 900px) {
  #navbar {
    padding: 0 16px;
  }

  .nav-left {
    gap: 14px;
  }

  .nav-logo {
    gap: 9px;
  }

  .nav-logo-mark {
    width: 34px;
    height: 34px;
    font-size: 13px;
    border-radius: 9px;
  }

  .nav-logo-text {
    font-size: 14px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero-visual {
    order: -1;
    padding-top: 8px;
  }

  .hero-bio {
    margin: 0 auto 36px;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-badges {
    justify-content: center;
  }

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

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

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

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .nav-links {
    display: none;
  }

  .nav-cta {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .hero-photo-wrap {
    width: 200px;
    height: 200px;
  }

  .hero-photo-fallback {
    font-size: 52px;
  }

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

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

/* collapse full nav to hamburger before links crowd the brand */
@media (max-width: 1160px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .hamburger { display: flex; }
}

@media (max-width: 460px) {
  .nav-logo-text {
    display: none;
  }
}

@media (max-width: 600px) {
  .section {
    padding: 64px 0;
  }

  .container {
    padding: 0 18px;
  }

  .about-stats {
    grid-template-columns: 1fr 1fr;
  }

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

  .hero-stats {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
  }

  .hero-stat {
    padding: 12px 8px;
  }

  .project-card {
    min-width: min(300px, calc(100vw - 36px));
    max-width: 300px;
    padding: 22px;
  }

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

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

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

  .timeline {
    padding-left: 24px;
  }

  .timeline-dot {
    left: -32px;
  }

  .game-score-row {
    gap: 12px;
  }

  .score-badge {
    font-size: 12px;
    padding: 8px 12px;
  }
}

@media (max-width: 400px) {
  .awards-grid {
    grid-template-columns: 1fr;
  }

  .about-stats {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   RESPONSIVE — TARGETED BREAKPOINTS (375 / 768 / 1024 / 1440)
   ============================================================ */

/* ── 1440px: large desktop — widen nav-inner for breathing room ── */
@media (min-width: 1440px) {
  .nav-inner {
    max-width: 1320px;
  }
}

/* ── 1024px: tablet landscape / small laptop ── */
@media (max-width: 1024px) {
  .project-panel {
    gap: 28px;
    padding: 22px;
  }

  .project-media--iframe {
    height: 420px;
  }

  .freelance-banner {
    gap: 36px;
    padding: 40px 40px;
  }

  .freelance-doc-stack {
    width: 180px;
    height: 200px;
  }
}

/* ── 768px: tablet portrait ── */
@media (max-width: 768px) {
  .hero-inner {
    gap: 36px;
  }

  .about-grid {
    gap: 36px;
  }

  .contact-grid {
    gap: 32px;
  }

  .project-panel {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .project-panel:nth-child(even) .project-media {
    order: 0;
  }

  .project-media--iframe {
    height: 340px;
  }

  .research-grid {
    gap: 14px;
  }

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

  .section-title {
    margin-bottom: 36px;
  }

  .timeline-item {
    padding: 22px;
  }

  .game-arena {
    min-height: 200px;
  }
}

/* ── 375px: small phones (iPhone SE / Mini / Galaxy S) ── */
@media (max-width: 375px) {
  .container {
    padding: 0 14px;
  }

  .section {
    padding: 48px 0;
  }

  .hero-inner {
    gap: 28px;
  }

  .hero-photo-wrap {
    width: 160px;
    height: 160px;
  }

  .hero-photo-fallback {
    font-size: 42px;
  }

  .hero-bio {
    font-size: 14px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 32px;
  }

  .hero-actions .btn-primary,
  .hero-actions .btn-ghost {
    justify-content: center;
    text-align: center;
  }

  .hero-badges {
    gap: 6px;
  }

  .hero-badge {
    font-size: 11px;
    padding: 5px 10px;
  }

  .timeline {
    padding-left: 18px;
  }

  .timeline-dot {
    left: -26px;
    width: 12px;
    height: 12px;
  }

  .timeline-item {
    padding: 16px;
    margin-bottom: 32px;
  }

  .timeline-role {
    font-size: 15px;
  }

  .timeline-bullets li {
    font-size: 13px;
  }

  .project-media--iframe {
    height: 260px;
  }

  .cert-card {
    padding: 14px;
    gap: 10px;
  }

  .award-card {
    padding: 16px;
  }

  .contact-item {
    padding: 12px;
    gap: 10px;
  }

  .social-links {
    gap: 6px;
  }

  .social-link {
    padding: 8px 12px;
    font-size: 12px;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 10px 14px;
    font-size: 13px;
  }

  .freelance-banner {
    padding: 22px 16px;
  }

  .freelance-stat {
    min-width: 0;
  }

  .freelance-stat-num {
    font-size: 1.3rem;
  }

  .intro-bar {
    padding: 16px 14px;
  }

  .intro-main {
    padding: 12px 14px;
  }

  .intro-sticker {
    width: min(300px, 92vw);
  }

  .footer-links {
    font-size: 12px;
  }

  .footer-links a {
    padding: 5px 8px;
  }

  .back-to-top {
    bottom: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .game-board {
    padding: 14px;
  }

  .score-badge {
    font-size: 11px;
    padding: 6px 10px;
  }

  .stack-item {
    width: 52px;
    height: 52px;
    border-radius: 12px;
  }

  .stack-icon {
    width: 26px;
    height: 26px;
  }
}

/* ============================================================
   FREELANCE TEASER
   ============================================================ */
.freelance-teaser {
  padding: 72px 0 60px;
}

.freelance-banner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 56px;
  align-items: center;
  background: linear-gradient(135deg, rgba(230, 51, 42, 0.06) 0%, var(--bg-2) 55%, rgba(194, 65, 12, 0.05) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 48px 56px;
  position: relative;
  overflow: hidden;
}

.freelance-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230, 51, 42, 0.5), rgba(245, 158, 11, 0.3), transparent);
}

.freelance-banner::after {
  content: '';
  position: absolute;
  bottom: -80px;
  right: -80px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(230, 51, 42, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.freelance-available-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.freelance-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1.8s ease-in-out infinite;
  flex-shrink: 0;
}

.freelance-title {
  font-family: var(--font-body);
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 14px;
}

.freelance-title span {
  color: var(--cyan);
}

.freelance-desc {
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.75;
  max-width: 500px;
  margin-bottom: 26px;
}

.freelance-stat-row {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.freelance-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 16px;
  background: rgba(230, 51, 42, 0.06);
  border: 1px solid rgba(230, 51, 42, 0.15);
  border-radius: 10px;
  flex: 1;
  min-width: 140px;
}

.freelance-stat-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--cyan);
  line-height: 1;
}

.freelance-stat-label {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.45;
}

.freelance-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.freelance-pill {
  background: rgba(230, 51, 42, 0.07);
  border: 1px solid rgba(230, 51, 42, 0.18);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 8px;
  letter-spacing: 0.04em;
  transition: var(--transition);
}

.freelance-pill:hover {
  background: rgba(230, 51, 42, 0.12);
  border-color: rgba(230, 51, 42, 0.35);
}

.freelance-banner-right {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.freelance-doc-stack {
  position: relative;
  width: 210px;
  height: 230px;
}

.freelance-doc {
  position: absolute;
  width: 168px;
  background: var(--bg-2);
  border: 1px solid rgba(230, 51, 42, 0.12);
  border-radius: var(--radius);
  padding: 16px;
  transition: box-shadow 0.35s ease;
}

.freelance-doc:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.freelance-doc-1 {
  top: 0;
  left: 22px;
  border-color: rgba(230, 51, 42, 0.2);
  z-index: 1;
  animation: floatDoc1 6s ease-in-out infinite;
}

.freelance-doc-2 {
  top: 45px;
  left: 28px;
  z-index: 2;
  border-color: rgba(16, 185, 129, 0.2);
  animation: floatDoc2 7s ease-in-out infinite;
}

.freelance-doc-3 {
  top: 90px;
  left: 8px;
  z-index: 3;
  border-color: rgba(245, 158, 11, 0.2);
  animation: floatDoc3 5.5s ease-in-out infinite;
}

@keyframes floatDoc1 {
  0%, 100% { transform: rotate(-4deg) translateY(0px); }
  50% { transform: rotate(-4deg) translateY(-6px); }
}

@keyframes floatDoc2 {
  0%, 100% { transform: rotate(1.5deg) translateY(0px); }
  50% { transform: rotate(1.5deg) translateY(-4px); }
}

@keyframes floatDoc3 {
  0%, 100% { transform: rotate(-1deg) translateY(0px); }
  50% { transform: rotate(-1deg) translateY(-8px); }
}

.freelance-doc-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.freelance-doc-lines > div {
  height: 3px;
  border-radius: 2px;
  background: rgba(138, 155, 187, 0.12);
  margin-bottom: 6px;
  transition: background 0.3s ease;
}

.freelance-doc:hover .freelance-doc-lines > div {
  background: rgba(230, 51, 42, 0.18);
}

.freelance-doc-lines > div:nth-child(1) { width: 88%; }
.freelance-doc-lines > div:nth-child(2) { width: 65%; }
.freelance-doc-lines > div:nth-child(3) { width: 77%; }

/* Bridge divider between freelance and experience */
.section-bridge-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 24px 24px;
  max-width: 1148px;
  margin: 0 auto;
}

.section-bridge-wrap::before,
.section-bridge-wrap::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74, 90, 122, 0.35));
}

.section-bridge-wrap::after {
  background: linear-gradient(270deg, transparent, rgba(74, 90, 122, 0.35));
}

.section-bridge-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  white-space: nowrap;
  padding: 0 18px;
}

/* Freelance nav link */
.nav-links a.nav-freelance {
  color: var(--green);
  position: relative;
}

.nav-links a.nav-freelance::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}

.nav-links a.nav-freelance:hover {
  color: var(--green);
  background: rgba(16, 185, 129, 0.08);
}

.mobile-freelance-link {
  color: var(--green) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  background: rgba(16, 185, 129, 0.06) !important;
}

.mobile-freelance-link:hover {
  color: var(--green) !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
  background: rgba(16, 185, 129, 0.12) !important;
}

@media (max-width: 900px) {
  .freelance-banner {
    grid-template-columns: 1fr;
    padding: 36px 28px;
    gap: 0;
  }

  .freelance-banner-right {
    display: none;
  }
}

@media (max-width: 600px) {
  .freelance-banner {
    padding: 28px 20px;
  }

  .freelance-teaser {
    padding: 56px 0 40px;
  }
}

@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;
  }

  .hero-photo-ring {
    animation: none;
  }

  .footer-tooltip-wrap.footer-qa--home > a,
  .footer-tooltip-wrap.footer-qa--contact > a {
    transform: none;
    letter-spacing: normal;
    padding-left: 12px;
    padding-right: 12px;
  }

  .footer-links .footer-sep--qa {
    height: 14px;
    transform: none;
    opacity: 1;
  }
}


/* ============================================================
   INTRO GATE — decode transition + name tag
   ============================================================ */
.intro-gate {
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  color: var(--text);
  opacity: 1;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  overflow: hidden;
}

.intro-gate.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.intro-locked { overflow: hidden; }

/* keep the custom cursor above the gate */
.custom-cursor-dot,
.custom-cursor-ring { z-index: 12000; }

/* QA background pattern — faint tiled check / cross marks */
.intro-grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Ctext x='10' y='26' font-family='monospace' font-size='17' fill='%231f1b16' fill-opacity='0.05'%3E%E2%9C%93%3C/text%3E%3Ctext x='40' y='54' font-family='monospace' font-size='17' fill='%231f1b16' fill-opacity='0.05'%3E%C3%97%3C/text%3E%3C/svg%3E");
  background-size: 64px 64px;
}

[data-theme="light"] .intro-grid-bg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Ctext x='10' y='26' font-family='monospace' font-size='17' fill='%234ade80' fill-opacity='0.09'%3E%E2%9C%93%3C/text%3E%3Ctext x='40' y='54' font-family='monospace' font-size='17' fill='%234ade80' fill-opacity='0.09'%3E%C3%97%3C/text%3E%3C/svg%3E");
}

.intro-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  flex-shrink: 0;
}

.intro-bar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.intro-skip {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text-2);
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  transition: var(--transition);
}

.intro-skip:hover {
  color: var(--text);
  border-color: var(--border-accent);
  background: var(--surface-hover);
}

.intro-brand {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text);
}

.intro-main {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px 24px;
  text-align: center;
}

/* ---- PHASE 1: decode ---- */
.intro-decode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.intro-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4em;
  color: var(--amber);
}

.intro-bigname {
  display: inline-flex;
  justify-content: center;
  flex-wrap: wrap;
  font-size: clamp(34px, 9vw, 92px);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: pre;
}

.intro-bigname .done { color: var(--text); }
.intro-bigname .scz { color: var(--text-3); }

.intro-underline {
  height: 2px;
  width: 0;
  max-width: 62%;
  background: linear-gradient(90deg, var(--red), var(--amber));
}

.intro-bigrole {
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--text-2);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.intro-bigrole.show { opacity: 1; }

.intro-decode-enter {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
  margin-top: 6px;
}

.intro-decode-enter.show {
  opacity: 1;
  pointer-events: auto;
}

/* ---- PHASE 2: name tag ---- */
.intro-stage {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: 540px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.intro-gate.phase2 .intro-decode { display: none; }
.intro-gate.phase2 .intro-stage { display: flex; }
.intro-stage.is-ready { opacity: 1; transform: none; }

.intro-welcome {
  font-size: clamp(15px, 2.5vw, 18px);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--text);
}

.intro-sub {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin-top: -8px;
}

.intro-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.intro-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text-2);
}

.intro-input {
  flex: 1;
  max-width: 320px;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  outline: none;
  transition: var(--transition);
}

.intro-input::placeholder { color: var(--text-3); }
.intro-input:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}

.intro-dice {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  font-size: 18px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: var(--transition);
}

.intro-dice:hover {
  color: var(--cyan);
  border-color: var(--border-accent);
  transform: rotate(90deg);
}

.intro-sticker {
  width: min(360px, 86vw);
  background: var(--red);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(31, 27, 22, 0.18);
  overflow: hidden;
  margin: 4px 0;
}

.intro-sticker-top {
  padding: 22px 24px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.intro-sticker-hello {
  font-size: clamp(34px, 7vw, 48px);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #faf6ee;
  line-height: 1;
}

.intro-sticker-mn {
  font-size: 13px;
  font-style: italic;
  color: rgba(250, 246, 238, 0.85);
}

.intro-sticker-name {
  background: #faf6ee;
  color: #1f1b16;
  font-size: clamp(20px, 4.5vw, 30px);
  font-weight: 700;
  font-style: italic;
  padding: 16px 18px;
  word-break: break-word;
}

.intro-enter {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--bg);
  background: var(--text);
  border-radius: 100px;
  padding: 14px 34px;
  transition: var(--transition);
}

.intro-enter:hover {
  background: var(--red);
  color: #faf6ee;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px var(--cyan-glow);
}

.intro-enter.is-pass {
  background: var(--green);
  color: #faf6ee;
}

.intro-note {
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.03em;
  min-height: 16px;
}

.intro-note.is-pass { color: var(--green); }

/* ---- status + progress ---- */
/* bottom block: percent → progress → status (always visible, never overlaps) */
.intro-bottom {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.intro-percent-row {
  display: flex;
  justify-content: flex-end;
  padding: 0 28px 6px;
  transition: opacity 0.4s ease;
}

.intro-percent {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.intro-progress {
  height: 2px;
  width: 100%;
  background: var(--border);
  transition: opacity 0.4s ease;
}

.intro-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--red), var(--amber));
}

.intro-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-2);
}

.intro-status-mid {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.intro-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}

.intro-gate.phase2 .intro-progress,
.intro-gate.phase2 .intro-percent-row { opacity: 0; }

/* helper line under the name input */
.intro-helper {
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.02em;
  margin-top: -6px;
}

@media (max-width: 560px) {
  .intro-input-row { flex-wrap: wrap; }
  .intro-label { width: 100%; }
  .intro-status-mid { display: none; }
}

/* ============================================================
   TECH STACK MARQUEE
   ============================================================ */
.stack-band {
  position: relative;
  z-index: 1;
  padding: 36px 0 44px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  overflow: hidden;
}

.stack-headline {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--text-2);
  margin-bottom: 28px;
}

.stack-headline span { color: var(--cyan); }

.marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  /* fade edges */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 18px;
  width: max-content;
  padding: 4px 9px;
  animation: marquee 42s linear infinite;
}

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

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.stack-item {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  transition: var(--transition);
}

.stack-item:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-cyan);
}

.stack-icon {
  width: 32px;
  height: 32px;
  opacity: 0.95;
  transition: var(--transition);
}

.stack-item:hover .stack-icon {
  opacity: 1;
  transform: scale(1.08);
}

.stack-name {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: #faf6ee;
  background: var(--text);
  padding: 5px 10px;
  border-radius: 7px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 5;
}

.stack-item:hover .stack-name {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; flex-wrap: wrap; justify-content: center; }
}

/* ============================================================
   PROJECT PANELS (media + info, alternating)
   ============================================================ */
.project-panels {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.project-panel {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: var(--transition);
}

.project-panel:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-cyan);
}

/* alternate: media on the right for even panels */
.project-panel:nth-child(even) .project-media { order: 2; }

.project-media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
  aspect-ratio: 16 / 10;
}

.project-media--iframe {
  aspect-ratio: unset;
  height: 540px;
}

.project-media-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  border-radius: var(--radius);
}

.project-media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-media-img.is-missing { display: none; }

.project-media-ph {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  border: 2px dashed var(--border-accent);
  border-radius: var(--radius);
  color: var(--text-2);
}

.project-media-img.is-missing ~ .project-media-ph { display: flex; }

.project-media-ph-icon { font-size: 40px; }

.project-media-ph-text {
  font-size: 13px;
  letter-spacing: 0.04em;
}

.project-media-ph code {
  font-size: 11px;
  color: var(--cyan);
  background: var(--cyan-dim);
  padding: 4px 10px;
  border-radius: 6px;
}

.project-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.project-date {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: 100px;
}

.project-title {
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.15;
}

.project-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
}

.project-panel .project-impact {
  font-size: 13px;
  color: var(--green);
  font-weight: 500;
}

.project-panel .project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-view {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 28px;
  border-radius: 100px;
  transition: var(--transition);
}

.project-view:hover {
  background: var(--cyan);
  color: #faf6ee;
  border-color: var(--cyan);
  transform: translateY(-2px);
}

@media (max-width: 760px) {
  .project-panel {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .project-panel:nth-child(even) .project-media { order: 0; }
}

/* ---- Insights & Writing intro (AI & Research) ---- */
.insights-intro {
  max-width: 620px;
  margin: -32px 0 36px;
}

.insights-title {
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 12px;
}

.insights-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-2);
}

/* ---- company logo in experience timeline ---- */
.timeline-company {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.company-logo {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 7px;
  object-fit: contain;
  background: #fff;
  padding: 3px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(31, 27, 22, 0.12);
}
