/* ===== Base ===== */
:root {
  --bg: #0a0a0f;
  --bg-2: #11111a;
  --fg: #e7e7ee;
  --fg-dim: #9b9bb0;
  --fg-faint: #7a7a8e;
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.4);
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-strong: rgba(255, 255, 255, 0.06);
  --radius: 18px;
  --radius-lg: 24px;
  --maxw: 1080px;
  --pad: 28px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body { min-height: 100vh; position: relative; }

a {
  color: var(--accent-2);
  text-decoration: none;
  transition: color 0.15s var(--ease-soft);
}
a:hover { color: var(--accent); }

.dim { color: var(--fg-faint); font-weight: 400; }
.hl { color: var(--accent-2); font-weight: 600; }
.up { color: #6ee7a7; }
.down { color: #ff8a8a; }

/* ===== Background ===== */
#bg {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none; opacity: 0.85;
}
.bg-overlay {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse at 30% 10%, rgba(59, 130, 246, 0.10), transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(59, 130, 246, 0.06), transparent 60%),
    linear-gradient(180deg, rgba(10,10,15,0) 0%, rgba(10,10,15,0.4) 80%, rgba(10,10,15,0.85) 100%);
}

/* ===== Scroll progress ===== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 100;
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 0.05s linear;
  pointer-events: none;
}

/* ===== Top nav ===== */
.topnav {
  position: fixed; top: 18px; left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 8px 14px;
  background: rgba(15, 15, 22, 0.7);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  max-width: calc(100% - 32px);
}
.topnav-brand {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--accent);
  color: white !important; font-weight: 700; font-size: 14px;
  border-radius: 50%;
  transition: transform 0.3s var(--ease);
}
.topnav-brand:hover { transform: rotate(-8deg) scale(1.05); color: white !important; }
.topnav-links {
  display: flex; gap: 4px; list-style: none;
}
.topnav-links a {
  display: block;
  padding: 8px 12px;
  font-size: 14px; color: var(--fg-dim); font-weight: 500;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
  position: relative;
}
.topnav-links a:hover { color: var(--fg); background: var(--glass-strong); }
.topnav-links a.active {
  color: var(--accent-2);
  background: rgba(59, 130, 246, 0.1);
}
.topnav-links a.active::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.topnav-cta {
  display: inline-block;
  padding: 8px 16px;
  background: var(--accent);
  color: white !important;
  font-size: 14px; font-weight: 500;
  border-radius: 999px;
  transition: transform 0.15s, background 0.15s;
}
.topnav-cta:hover { background: #8e72ff; transform: translateY(-1px); color: white !important; }

/* ===== Layout ===== */
main {
  position: relative; z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.section {
  padding: 100px 0 60px;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: 40px;
}
.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: var(--accent);
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
}
.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ===== Reveal animation ===== */
/* Default: visible (no-JS / no-CSS safe). Only hide when JS-ready + not yet visible. */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js-ready .reveal {
  opacity: 0;
  transform: translateY(28px);
}
.js-ready .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ===== 3D tilt (cards) ===== */
.tilt {
  transform-style: preserve-3d;
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
  transition: transform 0.3s var(--ease-soft), border-color 0.3s, background 0.3s, box-shadow 0.3s;
  will-change: transform;
}
.tilt:hover {
  box-shadow: 0 16px 40px rgba(59, 130, 246, 0.18);
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 100px 0 100px;
}
.hero-inner { width: 100%; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  margin-bottom: 28px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  font-size: 13px; color: var(--fg-dim);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero-badge .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #6ee7a7;
  box-shadow: 0 0 12px #6ee7a7;
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.85); }
}

.hero-title {
  font-size: clamp(36px, 9vw, 96px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.0;
  margin-bottom: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #dbeafe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.hero-tagline {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 8px;
}

.hero-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--fg-dim);
  margin-bottom: 36px;
}

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

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 15px; font-weight: 500;
  transition: transform 0.2s var(--ease-soft), background 0.2s, border-color 0.2s, box-shadow 0.2s;
  will-change: transform;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-2px); }

.btn.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 30px var(--accent-glow);
}
.btn.primary:hover { background: #8e72ff; color: white; box-shadow: 0 8px 36px var(--accent-glow); }

.btn.ghost {
  background: var(--glass);
  color: var(--fg);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn.ghost:hover {
  background: var(--glass-strong);
  border-color: var(--accent);
  color: var(--fg);
}

.scroll-hint {
  position: absolute;
  bottom: 30px; left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--fg-faint);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  letter-spacing: 0.2em; text-transform: uppercase;
  opacity: 0.6;
}
.scroll-hint .arrow { animation: bob 1.8s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50%      { transform: translateY(4px); opacity: 1; }
}

/* ===== About ===== */
.about-grid {
  display: grid; grid-template-columns: 1.2fr 0.9fr;
  gap: 40px;
  margin-bottom: 32px;
  align-items: start;
}
.about-text p { margin-bottom: 18px; color: var(--fg); }
.about-text strong { color: var(--accent-2); font-weight: 600; }
.about-quote-inline {
  font-size: 16px;
  color: var(--fg-dim);
  line-height: 1.55;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: rgba(59, 130, 246, 0.05);
  border-radius: 0 12px 12px 0;
  margin: 22px 0 0 0;
  font-style: italic;
}

.about-photo {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 5/6;
  max-height: 540px;
  border: 1px solid var(--line);
  background: var(--glass);
  isolation: isolate;
}
.about-photo::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,10,15,0) 40%, rgba(10,10,15,0.7) 100%),
    radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.15), transparent 60%);
  pointer-events: none;
  z-index: 1;
}
.about-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(59, 130, 246, 0.2);
  pointer-events: none;
  z-index: 2;
}
.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.05) saturate(0.95);
  transition: filter 0.4s ease;
}
.about-photo:hover img {
  filter: contrast(1.08) saturate(1.05);
}
.about-photo-caption {
  position: absolute;
  bottom: 16px; left: 16px;
  z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: rgba(15, 15, 22, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--fg);
  letter-spacing: 0.02em;
}
.about-photo-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #6ee7a7;
  box-shadow: 0 0 10px #6ee7a7;
  animation: pulse 2s ease-in-out infinite;
}

.about-trail {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: var(--fg-faint);
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}

/* ===== Stats ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.stat {
  padding: 28px 22px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 100% 0%, var(--accent-glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.stat:hover { border-color: rgba(59, 130, 246, 0.5); background: var(--glass-strong); }
.stat:hover::before { opacity: 1; }
.stat-value {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 10px;
  display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap;
  position: relative;
}
.stat-label {
  font-size: 13px; color: var(--fg-dim); line-height: 1.4;
  position: relative;
}

/* ===== Projects (uniform) ===== */
.projects-stack { display: flex; flex-direction: column; gap: 28px; }

.project-uniform {
  padding: 36px;
  border-radius: var(--radius-lg);
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.3s var(--ease), background 0.3s, transform 0.3s var(--ease);
}
.project-uniform:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: var(--glass-strong);
}

.project-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px; flex-wrap: wrap; gap: 8px;
}
.project-company {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: var(--accent);
  letter-spacing: 0.02em;
  display: inline-flex; align-items: center; gap: 8px;
}
.project-status {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(110, 231, 167, 0.15);
  color: #6ee7a7;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(110, 231, 167, 0.3);
}
.project-status.done {
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg-faint);
  border-color: var(--line);
}
.project-period {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--fg-faint);
}
.project-role {
  font-size: 26px; font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.project-line {
  font-size: 15px; color: var(--fg-dim);
  margin-bottom: 24px;
}

.project-grid {
  display: grid;
  gap: 14px;
}
.project-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 880px) {
  .project-grid-3 { grid-template-columns: 1fr; }
}

.pg-card {
  padding: 22px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
}
.pg-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 12px 36px rgba(59, 130, 246, 0.15);
}
.pg-card-kind {
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.01em;
}
.pg-card-desc {
  font-size: 13px; color: var(--fg-dim);
  line-height: 1.4;
}

.project-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
}
.project-tags span {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  font-size: 12px; color: var(--accent-2);
  transition: background 0.2s;
}
.project-tags span:hover { background: rgba(59, 130, 246, 0.15); }

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  list-style: none;
}
.metrics li {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
}
.m-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--fg-faint);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.m-val {
  font-size: 14px; font-weight: 600;
  letter-spacing: -0.01em;
}

/* ===== My Media (categories) ===== */
.media-intro {
  color: var(--fg-dim);
  font-size: 15px; line-height: 1.65;
  margin-bottom: 32px;
  max-width: 720px;
}
.media-categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 720px) {
  .media-categories { grid-template-columns: 1fr; }
}

.media-cat {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.3s, background 0.3s;
}
.media-cat:hover {
  border-color: rgba(59, 130, 246, 0.3);
  background: var(--glass-strong);
}

.media-cat-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}

/* 3D-styled icon */
.icon-3d {
  position: relative;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.04));
  border: 1px solid rgba(59, 130, 246, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 4px 16px rgba(59, 130, 246, 0.18);
  overflow: hidden;
  flex-shrink: 0;
}
.icon-3d::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.15), transparent 60%);
  pointer-events: none;
}
.icon-3d svg {
  width: 22px; height: 22px;
  filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.4));
  position: relative;
  z-index: 1;
  transition: transform 0.3s var(--ease-spring);
}
.icon-3d:hover svg {
  transform: rotate(-8deg) scale(1.1);
}

.media-cat-title {
  font-size: 17px; font-weight: 600;
  letter-spacing: -0.01em;
  flex: 1;
}
.media-cat-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--fg-dim);
}

.media-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--line);
  color: var(--fg);
  transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s;
}
.media-item:last-child { margin-bottom: 0; }
.media-item:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.06);
  color: var(--fg);
}
.media-item-main { flex: 1; }
.media-item-kind {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--accent);
  letter-spacing: 0.05em; text-transform: uppercase;
  margin-bottom: 4px;
}
.media-item-title {
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  line-height: 1.35;
}
.media-item-desc {
  font-size: 13px; color: var(--fg-dim);
  line-height: 1.45;
}
.media-item-arrow {
  color: var(--fg-faint); font-size: 18px;
  align-self: center;
  transition: transform 0.25s var(--ease), color 0.25s;
}
.media-item:hover .media-item-arrow {
  color: var(--accent);
  transform: translateX(4px);
}

.media-item-award {
  flex-direction: column;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.04));
  border-color: rgba(59, 130, 246, 0.3);
  padding: 14px;
}
.media-item-award:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.06));
}
.media-item-award .media-item-arrow { display: none; }

.media-item-photo {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ===== Catch gamification ===== */
.catchable { cursor: grab; user-select: none; }
.catchable:active { cursor: grabbing; }

/* Warn wobble - element trembles in place (2s, more visible) */
.catchable.fly-warn {
  animation: wobble 0.55s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(255, 138, 138, 0.5), 0 14px 40px rgba(255, 138, 138, 0.18);
  cursor: grab;
}
@keyframes wobble {
  0%, 100% { transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateY(0) scale(1); }
  20%      { transform: perspective(1000px) rotate(-2.5deg) translateY(-3px) scale(1.025); }
  50%      { transform: perspective(1000px) rotate(2deg) translateY(2px) scale(1.02); }
  80%      { transform: perspective(1000px) rotate(-1.5deg) translateY(-2px) scale(1.015); }
}

/* Run-around phase - element tries to escape (3.5s, slower, more visible) */
.catchable.fly-run {
  animation: flyRun 0.85s linear infinite;
  box-shadow: 0 0 0 2px rgba(255, 200, 100, 0.6), 0 16px 42px rgba(255, 200, 100, 0.25);
  cursor: grab;
}
@keyframes flyRun {
  0%   { transform: translate(0, 0) rotate(0); }
  10%  { transform: translate(-32px, 16px) rotate(-3deg); }
  20%  { transform: translate(24px, -20px) rotate(2.5deg); }
  30%  { transform: translate(-16px, -12px) rotate(-1.5deg); }
  40%  { transform: translate(30px, 18px) rotate(3deg); }
  50%  { transform: translate(-12px, 24px) rotate(-2deg); }
  60%  { transform: translate(18px, -18px) rotate(1deg); }
  70%  { transform: translate(-26px, -6px) rotate(-3deg); }
  80%  { transform: translate(14px, 22px) rotate(2deg); }
  90%  { transform: translate(-20px, 10px) rotate(-2.5deg); }
  100% { transform: translate(0, 0) rotate(0); }
}

/* Grabbed - element follows cursor */
.catchable.fly-grabbed {
  animation: none !important;
  cursor: grabbing;
  z-index: 50;
  box-shadow: 0 0 0 3px rgba(110, 231, 167, 0.7), 0 20px 50px rgba(110, 231, 167, 0.4);
  transition: box-shadow 0.15s ease;
}

/* Flying off - хаотично летает по экрану перед улётом (3.5s) */
.catchable.fly-away {
  animation: flyOff 3.5s cubic-bezier(0.4, 0, 0.7, 0.5) forwards;
  pointer-events: none;
}
@keyframes flyOff {
  0%   { transform: perspective(1000px) translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
  10%  { transform: perspective(1000px) translate(-60vw, -10vh) rotate(-8deg) scale(0.98); opacity: 1; }
  25%  { transform: perspective(1000px) translate(70vw, -30vh) rotate(12deg) scale(0.95); opacity: 0.95; }
  40%  { transform: perspective(1000px) translate(-80vw, -50vh) rotate(-15deg) scale(0.9); opacity: 0.85; }
  55%  { transform: perspective(1000px) translate(50vw, -90vh) rotate(18deg) scale(0.8); opacity: 0.7; }
  70%  { transform: perspective(1000px) translate(-30vw, -150vh) rotate(-22deg) scale(0.65); opacity: 0.45; }
  85%  { transform: perspective(1000px) translate(20vw, -250vh) rotate(28deg) scale(0.45); opacity: 0.2; }
  100% { transform: perspective(1000px) translate(0, -350vh) rotate(35deg) scale(0.3); opacity: 0; }
}

/* Caught success - quick bounce back */
.catchable.fly-success {
  animation: bounceBack 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 0 2px rgba(110, 231, 167, 0.6), 0 16px 40px rgba(110, 231, 167, 0.25);
}
@keyframes bounceBack {
  0%   { transform: perspective(1000px) scale(1.05); }
  40%  { transform: perspective(1000px) scale(0.95); }
  100% { transform: perspective(1000px) scale(1); }
}

/* ===== Avatar popup ===== */
.avatar-popup {
  position: fixed;
  bottom: -200px; right: 24px;
  z-index: 100;
  display: flex; align-items: flex-end; gap: 14px;
  transition: bottom 0.7s var(--ease-spring);
  pointer-events: none;
  max-width: calc(100vw - 48px);
}
.avatar-popup.show {
  bottom: 24px;
  animation: avatarTap 0.5s ease 0.4s 2;
}
@keyframes avatarTap {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}
.avatar-icon {
  width: 84px; height: 84px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.15),
    0 16px 40px rgba(59, 130, 246, 0.4);
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  animation: avatarBreath 3.5s ease-in-out infinite;
}
.avatar-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
@keyframes avatarBreath {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}
.avatar-bubble {
  background: rgba(20, 20, 28, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 14px 18px;
  border-radius: 18px 18px 18px 4px;
  font-size: 14px;
  max-width: 280px;
  position: relative;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.avatar-bubble.wide {
  max-width: 360px;
  font-size: 13px;
  line-height: 1.55;
}
.avatar-msg {
  color: var(--fg);
  font-weight: 500;
  margin-bottom: 4px;
}
.avatar-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.05em;
}

/* ===== Catch counter (top-left badge) ===== */
.catch-counter {
  position: fixed;
  top: 18px; left: 18px;
  z-index: 40;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: rgba(15, 15, 22, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: 0.05em;
  transition: transform 0.3s var(--ease-spring), color 0.3s;
}
.catch-counter.bump {
  transform: scale(1.15);
  color: #6ee7a7;
}
.catch-label { text-transform: uppercase; font-size: 10px; }
.catch-value {
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  min-width: 18px;
  text-align: right;
}

/* ===== FAQ ===== */
.faq-item {
  padding: 18px 22px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--line);
  margin-bottom: 10px;
  transition: background 0.2s, border-color 0.2s;
}
.faq-item[open] { background: var(--glass-strong); border-color: rgba(59, 130, 246, 0.3); }
.faq-item summary {
  font-size: 16px; font-weight: 500;
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  padding-right: 4px;
  transition: color 0.2s;
}
.faq-item summary:hover { color: var(--accent-2); }
.faq-item summary::after {
  content: '+';
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px; color: var(--accent);
  transition: transform 0.2s;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p {
  margin-top: 12px;
  color: var(--fg-dim);
  font-size: 15px; line-height: 1.6;
}
.faq-bullets {
  list-style: none;
  margin-top: 12px;
  padding-left: 0;
}
.faq-bullets li {
  position: relative;
  padding: 8px 0 8px 24px;
  color: var(--fg-dim);
  font-size: 15px;
  line-height: 1.55;
}
.faq-bullets li::before {
  content: '-';
  position: absolute;
  left: 0;
  top: 8px;
  color: var(--accent);
  font-weight: 600;
}

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.contact-card {
  padding: 26px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; flex-direction: column; gap: 6px;
  transition: all 0.25s var(--ease);
  color: var(--fg);
  position: relative;
  overflow: hidden;
  will-change: transform;
}
.contact-card::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), var(--accent-glow), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.contact-card:hover {
  border-color: var(--accent);
  color: var(--fg);
  background: var(--glass-strong);
}
.contact-card:hover::after { opacity: 1; }
.contact-kind {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--accent);
  letter-spacing: 0.05em; text-transform: uppercase;
  position: relative;
}
.contact-val {
  font-size: 15px; font-weight: 500;
  word-break: break-word;
  position: relative;
}

/* ===== Footer ===== */
.footer {
  padding: 60px 0 40px;
  margin-top: 60px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--fg-faint);
  flex-wrap: wrap; gap: 12px;
}

/* ===== Timeline ===== */
.timeline-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
.timeline-list::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.4), rgba(59, 130, 246, 0.1));
}
.timeline-item {
  display: flex; gap: 22px; align-items: stretch;
  position: relative;
}
.timeline-marker {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid rgba(59, 130, 246, 0.5);
  margin-top: 22px;
  position: relative;
  z-index: 1;
  transition: transform 0.3s var(--ease-spring);
}
.timeline-marker::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.5);
}
.timeline-item:hover .timeline-marker {
  transform: scale(1.2);
  border-color: var(--accent-2);
}
.timeline-item.highlight .timeline-marker {
  border-color: var(--accent-2);
  box-shadow: 0 0 16px var(--accent-glow);
}
.timeline-item.highlight .timeline-marker::after {
  background: var(--accent-2);
}
.timeline-item.current .timeline-marker {
  border-color: #6ee7a7;
  box-shadow: 0 0 16px rgba(110, 231, 167, 0.4);
  animation: markerPulse 2s ease-in-out infinite;
}
.timeline-item.current .timeline-marker::after {
  background: #6ee7a7;
}
@keyframes markerPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(110, 231, 167, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(110, 231, 167, 0); }
}

.timeline-card {
  flex: 1;
  padding: 18px 22px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.3s, background 0.3s, transform 0.3s var(--ease);
}
.timeline-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: var(--glass-strong);
}
.timeline-item.highlight .timeline-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.10), rgba(59, 130, 246, 0.02));
  border-color: rgba(59, 130, 246, 0.3);
}
.timeline-item.current .timeline-card {
  background: linear-gradient(135deg, rgba(110, 231, 167, 0.06), rgba(59, 130, 246, 0.04));
  border-color: rgba(110, 231, 167, 0.25);
}

.timeline-period {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--fg-faint);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.timeline-company {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: var(--accent);
  margin-bottom: 4px;
  display: inline-flex; align-items: center; gap: 8px;
}
.timeline-tag {
  font-size: 10px; padding: 2px 8px;
  border-radius: 999px;
  background: rgba(110, 231, 167, 0.15);
  color: #6ee7a7;
  letter-spacing: 0.05em; text-transform: uppercase;
  border: 1px solid rgba(110, 231, 167, 0.3);
}
.timeline-role {
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.timeline-desc {
  font-size: 14px; color: var(--fg-dim);
  line-height: 1.5;
}

/* ===== Stack ===== */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 720px) {
  .stack-grid { grid-template-columns: 1fr; }
}
.stack-cat {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.3s, background 0.3s;
}
.stack-cat:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: var(--glass-strong);
}
.stack-cat-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px dashed var(--line);
  flex-wrap: wrap; gap: 8px;
}
.stack-cat-kind {
  font-size: 17px; font-weight: 600;
  letter-spacing: -0.01em;
}
.stack-cat-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.stack-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.pill {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  font-size: 12px;
  color: var(--accent-2);
  cursor: default;
  transition: transform 0.2s var(--ease-spring), background 0.2s;
}
.pill:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
}

/* ===== Mini-feed ===== */
.feed-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}
.feed-item {
  display: flex; gap: 18px;
  padding: 18px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.3s, background 0.3s, transform 0.3s var(--ease);
  position: relative;
}
.feed-item:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: var(--glass-strong);
  transform: translateX(4px);
}
.feed-date {
  flex-shrink: 0;
  width: 70px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 10px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 12px;
  text-align: center;
}
.feed-day {
  font-size: 22px; font-weight: 700;
  line-height: 1;
  color: var(--accent-2);
}
.feed-month {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--fg-faint);
  letter-spacing: 0.04em;
  margin-top: 4px;
  text-transform: uppercase;
}
.feed-body { flex: 1; }
.feed-kind {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--accent);
  letter-spacing: 0.05em; text-transform: uppercase;
  margin-bottom: 4px;
}
.feed-title {
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  line-height: 1.35;
}
.feed-desc {
  font-size: 13px; color: var(--fg-dim);
  line-height: 1.5;
}

/* ===== Love block ===== */
.love-intro {
  color: var(--fg-dim);
  font-size: 15px;
  margin-bottom: 28px;
  max-width: 600px;
}
.love-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 720px) {
  .love-grid { grid-template-columns: 1fr; }
}
.love-card {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.3s, background 0.3s, transform 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}
.love-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.1), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.love-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: var(--glass-strong);
}
.love-card:hover::before { opacity: 1; }
.love-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  position: relative;
}
.love-title {
  font-size: 19px; font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  position: relative;
}
.love-desc {
  font-size: 14px; color: var(--fg-dim);
  line-height: 1.55;
  position: relative;
}

/* ===== Story (merged Feed + Media) ===== */
.story-intro {
  color: var(--fg-dim);
  font-size: 15px;
  margin-bottom: 28px;
  max-width: 600px;
}
.story-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.story-year {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.story-year-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.05em;
  padding: 6px 14px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  flex-shrink: 0;
  min-width: 56px;
  text-align: center;
}
.story-year-bonus .story-year-label {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  color: var(--fg-dim);
}
.story-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.story-item {
  display: flex;
  gap: 16px;
  padding: 18px 20px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.3s, background 0.3s, transform 0.3s var(--ease);
}
.story-item:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: var(--glass-strong);
  transform: translateX(4px);
}
.story-item.highlight {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.10), rgba(59, 130, 246, 0.02));
  border-color: rgba(59, 130, 246, 0.3);
}
.story-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-width: 56px;
  padding-top: 2px;
  flex-shrink: 0;
}
.story-body { flex: 1; }
.story-kind {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
  border: 1px solid currentColor;
}
.story-kind.award { color: #fbbf24; background: rgba(251, 191, 36, 0.1); }
.story-kind.speaking { color: var(--accent-2); background: rgba(59, 130, 246, 0.1); }
.story-kind.media { color: #6ee7a7; background: rgba(110, 231, 167, 0.1); }
.story-kind.video { color: #c4b5fd; background: rgba(196, 181, 253, 0.1); }
.story-kind.launch { color: #f472b6; background: rgba(244, 114, 182, 0.1); }

.story-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  line-height: 1.35;
  color: var(--fg);
  transition: color 0.15s;
}
a.story-title:hover { color: var(--accent); }
.story-title-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.story-title-row .story-title {
  margin-bottom: 0;
}
.story-photo-link {
  display: block;
  flex-shrink: 0;
}
.story-photo {
  width: 90px; height: 68px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.25s var(--ease);
}
.story-photo-link:hover .story-photo {
  transform: scale(1.05);
}
.story-desc {
  font-size: 13px;
  color: var(--fg-dim);
  line-height: 1.5;
}

@media (max-width: 720px) {
  .story-year { flex-direction: column; gap: 12px; }
  .story-year-label { align-self: flex-start; }
  .story-item { flex-direction: column; gap: 10px; padding: 14px; }
  .story-photo { width: 100%; height: 180px; }
}

/* ===== Lang switcher ===== */
.topnav-lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--fg-faint);
  text-transform: uppercase;
}
.topnav-lang a {
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  color: var(--fg-faint);
}
.topnav-lang a:hover {
  color: var(--fg);
  background: var(--glass-strong);
}
.topnav-lang a.active {
  color: var(--accent-2);
  background: rgba(59, 130, 246, 0.1);
}
@media (max-width: 720px) {
  .topnav-lang {
    padding: 4px 6px;
    font-size: 11px;
  }
  .topnav-lang a { padding: 3px 6px; }
}

/* ===== Map ===== */
.section-head-wide {
  max-width: var(--maxw);
  margin: 0 auto 40px;
  padding: 0 var(--pad);
}
.map-intro {
  max-width: var(--maxw);
  margin: 0 auto 24px;
  padding: 0 var(--pad);
  color: var(--fg-dim);
  font-size: 15px;
}
.map-filters {
  max-width: var(--maxw);
  margin: 0 auto 16px;
  padding: 0 var(--pad);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.map-filter {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--fg-dim);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease-soft);
  font-family: inherit;
}
.map-filter:hover {
  border-color: var(--accent);
  color: var(--fg);
}
.map-filter.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.leaflet-map {
  width: 100%;
  height: 360px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-2);
  position: relative;
  z-index: 1;
}
.map-stats {
  max-width: var(--maxw);
  margin: 24px auto 0;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.map-stat {
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.map-stat-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-2);
}
.map-stat-label {
  font-size: 12px;
  color: var(--fg-dim);
}

/* Leaflet custom styling */
.leaflet-map .leaflet-container {
  background: var(--bg-2);
}
.leaflet-tile {
  filter: invert(0.92) hue-rotate(180deg) brightness(0.9) saturate(0.7);
  will-change: transform;
}
@media (max-width: 768px) {
  .leaflet-tile {
    filter: none;
    opacity: 0.85;
  }
}
.leaflet-control-zoom a,
.leaflet-control-attribution {
  background: rgba(20, 20, 28, 0.85) !important;
  color: var(--fg-dim) !important;
  border-color: var(--line) !important;
}
.leaflet-control-attribution a {
  color: var(--accent-2) !important;
}
.leaflet-popup-content-wrapper {
  background: rgba(20, 20, 28, 0.95);
  color: var(--fg);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  backdrop-filter: blur(12px);
}
.leaflet-popup-tip {
  background: rgba(20, 20, 28, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.leaflet-popup-content {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  margin: 12px 16px;
}
.leaflet-popup-content strong {
  color: var(--accent-2);
  font-weight: 600;
}
.custom-marker .marker-dot {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-glow);
  transition: transform 0.2s var(--ease-spring);
}
.custom-marker.born .marker-dot {
  background: #6ee7a7;
  box-shadow: 0 0 16px rgba(110, 231, 167, 0.6);
  width: 18px;
  height: 18px;
}
.custom-marker:hover .marker-dot {
  transform: scale(1.4);
}
.leaflet-tooltip.map-tip {
  background: rgba(20, 20, 28, 0.85);
  color: var(--fg);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  backdrop-filter: blur(8px);
  padding: 6px 10px;
}
.leaflet-tooltip.map-tip::before { border-top-color: rgba(59, 130, 246, 0.3); }

/* ===== Mobile ===== */
@media (max-width: 720px) {
  :root { --pad: 18px; }
  html, body { font-size: 16px; }
  .section { padding: 60px 0 40px; }
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
  .about-photo { max-width: 280px; margin: 0 auto; }
  .hero { padding: 40px 0 80px; }
  .hero-title {
    font-size: clamp(34px, 11.5vw, 64px);
    letter-spacing: -0.05em;
  }
  .hero-tagline { font-size: 19px; }
  .hero-sub { font-size: 12px; }
  .project-uniform { padding: 24px; }
  .pg-card { padding: 18px; }
  .hero-cta { width: 100%; }
  .hero-cta .btn { flex: 1; justify-content: center; }
  .footer { flex-direction: column; text-align: center; }
  .scroll-hint { display: none; }
  .topnav-links { display: none; }
  .topnav { padding: 6px 8px 6px 6px; }
  .media-item-photo { max-height: 220px; }
  .stat-value { font-size: 28px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .section-title { font-size: 26px; }
  .section-num { font-size: 11px; padding: 3px 8px; }
  .catch-counter { top: 12px; left: 12px; padding: 4px 10px; font-size: 11px; }
  .shake-trigger { top: 12px; left: calc(12px + 88px + 8px); width: 32px; height: 32px; }
  .shake-trigger svg { width: 16px; height: 16px; }
  .avatar-popup { right: 12px; max-width: calc(100vw - 24px); }
  .avatar-popup.show { bottom: 12px; }
  .avatar-icon { width: 64px; height: 64px; }
  .avatar-bubble { padding: 10px 14px; max-width: 200px; font-size: 13px; }
  .timeline-item { gap: 14px; }
  .timeline-card { padding: 14px 16px; }
  .timeline-list::before { left: 9px; }
  .timeline-marker { width: 20px; height: 20px; margin-top: 18px; }
  .feed-item { padding: 14px; gap: 14px; flex-direction: column; }
  .feed-date { flex-direction: row; width: auto; padding: 6px 12px; gap: 6px; }
  .feed-day { font-size: 18px; }
}

@media (max-width: 380px) {
  .hero-title {
    font-size: 32px;
    letter-spacing: -0.05em;
  }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .tilt { transform: none !important; }
}

/* ===== Sphere mode (phone click → only 3D visible) ===== */
body.sphere-mode {
  overflow: hidden;
}
body.sphere-mode #bg {
  z-index: 200;
  opacity: 1;
}
body.sphere-mode main,
body.sphere-mode .topnav,
body.sphere-mode .catch-counter,
body.sphere-mode .shake-trigger,
body.sphere-mode .avatar-popup,
body.sphere-mode .scroll-progress,
body.sphere-mode .exit-hint,
body.sphere-mode .sphere-mode-hint,
body.sphere-mode .footer {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
body.sphere-mode .sphere-mode-hint {
  opacity: 1;
}
.sphere-mode-hint {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, calc(-50% + 220px));
  z-index: 201;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  text-shadow: 0 0 12px rgba(0,0,0,0.6);
}
.sphere-mode-hint::before {
  content: '';
  display: block;
  width: 1px;
  height: 24px;
  margin: 0 auto 12px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: hintPulse 2s ease-in-out infinite;
}
@keyframes hintPulse {
  0%, 100% { transform: scaleY(0.6); opacity: 0.4; }
  50%      { transform: scaleY(1); opacity: 0.8; }
}

/* ===== Focus styles (a11y) ===== */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* ===== Custom scrollbar ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(59, 130, 246, 0.5); }
* {
  scrollbar-color: rgba(59, 130, 246, 0.3) var(--bg);
  scrollbar-width: thin;
}

/* ===== Shake fall / return ===== */
.shake-fall {
  animation: fallDown 0.7s cubic-bezier(0.4, 0, 0.7, 0.4) forwards !important;
}
@keyframes fallDown {
  0%   { opacity: 1; transform: translateY(0) rotate(0); }
  100% { opacity: 0.2; transform: translateY(110vh) rotate(20deg); }
}
.shake-return {
  animation: bounceUp 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
@keyframes bounceUp {
  0%   { transform: translateY(110vh) rotate(20deg); }
  50%  { transform: translateY(-3vh) rotate(-2deg); }
  100% { transform: translateY(0) rotate(0); }
}

/* ===== Shake trigger (desktop explicit button) ===== */
.shake-trigger {
  position: fixed;
  top: 18px; left: calc(18px + 120px + 10px);
  z-index: 41;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(15, 15, 22, 0.7);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  color: var(--accent);
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring), background 0.2s, border-color 0.2s, border-radius 0.8s var(--ease-spring);
  animation: phoneIdle 6s ease-in-out infinite;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
body.scrolled .shake-trigger {
  border-radius: 30% 70% 50% 50% / 50% 50% 30% 70%;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--accent-2);
}
.shake-trigger:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  transform: scale(1.1);
  color: var(--accent-2);
}
.shake-trigger:active {
  transform: scale(0.92);
}
.shake-trigger svg { width: 18px; height: 18px; transition: transform 0.5s var(--ease-spring); }
body.scrolled .shake-trigger svg { transform: rotate(15deg) scale(1.05); }
@keyframes phoneIdle {
  0%, 90%, 100% { transform: rotate(0deg); }
  93% { transform: rotate(-10deg); }
  96% { transform: rotate(10deg); }
}

/* ===== Exit hint (mobile shake prompt) ===== */
.exit-hint {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  z-index: 80;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: rgba(15, 15, 22, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 999px;
  color: var(--accent-2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.4s, transform 0.4s var(--ease-spring);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  pointer-events: none;
}
.exit-hint.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.exit-hint svg {
  animation: hintShake 1.2s ease-in-out infinite;
}
@keyframes hintShake {
  0%, 100% { transform: rotate(0); }
  20%, 60% { transform: rotate(15deg); }
  40%, 80% { transform: rotate(-15deg); }
}

/* ===== Selection ===== */
::selection {
  background: rgba(59, 130, 246, 0.3);
  color: white;
}

/* ===== ?clean=1 mode (HR/CEO-friendly: без Three.js/gamification) ===== */
body.clean-mode #bg,
body.clean-mode .bg-overlay,
body.clean-mode .catch-counter,
body.clean-mode #shake-trigger,
body.clean-mode .avatar-popup,
body.clean-mode .scroll-progress {
  display: none !important;
}
body.clean-mode .tilt:hover {
  transform: none !important;
  box-shadow: none !important;
}
body.clean-mode .magnetic {
  transform: none !important;
}

/* ===== GDPR/cookie banner ===== */
.cookie-banner {
  position: fixed;
  bottom: 18px;
  left: 18px;
  max-width: 360px;
  z-index: 90;
  padding: 14px 18px;
  background: rgba(15, 15, 22, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 14px;
  color: var(--fg-dim);
  font-size: 13px;
  line-height: 1.5;
}
.cookie-banner-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cookie-banner p { margin: 0; }
.cookie-banner a { color: var(--accent-2); }
.cookie-dismiss {
  align-self: flex-start;
  padding: 6px 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
@media (max-width: 480px) {
  .cookie-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }
}
