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

:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121c;
  --bg-card: #181825;
  --text: #e4e4ed;
  --text-secondary: #8b8ba7;
  --text-dim: #5c5c7a;
  --accent: #7c6cf0;
  --accent-soft: rgba(124, 108, 240, 0.15);
  --accent-glow: rgba(124, 108, 240, 0.25);
  --border: #1e1e32;
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

[data-theme="light"] {
  --bg: #f5f5f9;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #5a5a7a;
  --text-dim: #9a9ab4;
  --accent: #6c5ce7;
  --accent-soft: rgba(108, 92, 231, 0.1);
  --accent-glow: rgba(108, 92, 231, 0.15);
  --border: #e2e2ee;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background .3s, color .3s;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== Navbar ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10,10,15,0.75);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s;
}

[data-theme="light"] .navbar {
  background: rgba(245,245,249,0.8);
}

.navbar.scrolled {
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 32px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}

.nav-logo {
  font-size: 1.3rem; font-weight: 700; text-decoration: none; color: var(--text);
  letter-spacing: -0.02em;
}
.nav-logo .dim { color: var(--text-dim); }

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

.nav-links { display: flex; gap: 4px; }
.nav-link {
  color: var(--text-secondary); text-decoration: none;
  font-size: .875rem; padding: 6px 16px; border-radius: 8px;
  transition: all .2s; font-weight: 500;
}
.nav-link:hover { color: var(--text); background: var(--accent-soft); }

.theme-btn {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); width: 38px; height: 38px; border-radius: 10px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-btn svg { width: 18px; height: 18px; }
[data-theme="dark"] .theme-btn .sun { display: block; }
[data-theme="dark"] .theme-btn .moon { display: none; }
[data-theme="light"] .theme-btn .sun { display: none; }
[data-theme="light"] .theme-btn .moon { display: block; }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  padding: 120px 32px 80px;
}

.hero-bg {
  position: absolute; inset: 0; overflow: hidden;
  pointer-events: none;
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: .35;
}
.orb-1 {
  width: 600px; height: 600px;
  background: var(--accent);
  top: -15%; right: -10%;
  animation: orbFloat 20s ease-in-out infinite;
}
.orb-2 {
  width: 400px; height: 400px;
  background: #e040fb;
  bottom: -10%; left: -5%;
  animation: orbFloat 25s ease-in-out infinite reverse;
}
.orb-3 {
  width: 300px; height: 300px;
  background: #00cec9;
  top: 40%; left: 50%;
  animation: orbFloat 18s ease-in-out infinite 5s;
  opacity: .15;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -60px) scale(1.1); }
  66% { transform: translate(-30px, 40px) scale(.95); }
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: 1100px;
  width: 100%;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* Hero Text */
.hero-label {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.hero-title {
  display: flex; flex-direction: column;
  margin-bottom: 20px;
}

.hero-greeting {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.hero-name {
  font-size: clamp(3.5rem, 8vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 50%, #e040fb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .hero-name {
  background: linear-gradient(135deg, #1a1a2e 0%, var(--accent) 60%, #e040fb 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-surname {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 300;
  color: var(--text-secondary);
  letter-spacing: .08em;
  margin-top: -4px;
}

.hero-bio {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 36px;
  max-width: 440px;
}

.hero-actions {
  display: flex; align-items: center; gap: 20px;
}

.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .95rem; font-weight: 600;
  text-decoration: none; transition: all .25s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #e040fb);
  color: #fff;
  padding: 14px 28px;
  border-radius: 50px;
  box-shadow: 0 4px 24px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px var(--accent-glow);
}

.btn-ghost {
  color: var(--text-secondary);
  padding: 14px 0;
}
.btn-ghost:hover { color: var(--accent); }

/* Hero Visual */
.hero-visual {
  position: relative;
  display: flex; justify-content: center; align-items: center;
  height: 100%;
}

.avatar-frame {
  position: relative;
  width: 240px; height: 240px;
}

.avatar-bg {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #e040fb, #00cec9);
  animation: spin 8s linear infinite;
}

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

.avatar-initials {
  position: absolute;
  inset: 6px; border-radius: 50%;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; font-weight: 700;
  color: var(--text);
  letter-spacing: .05em;
  z-index: 1;
}

.avatar-ring {
  position: absolute; inset: -8px; border-radius: 50%;
  border: 1px solid var(--border);
  animation: spin 12s linear infinite reverse;
  opacity: .4;
}

/* Hero Stats */
.hero-stat {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  display: flex; flex-direction: column;
  backdrop-filter: blur(8px);
  animation: statFloat 3s ease-in-out infinite;
}
.stat-1 { top: 10%; right: 0; animation-delay: 0s; }
.stat-2 { bottom: 20%; left: 0; animation-delay: 1.5s; }

@keyframes statFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.stat-num {
  font-size: 1.4rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #e040fb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.stat-label {
  font-size: .7rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .06em;
  margin-top: 2px;
}

/* Scroll Hint */
.scroll-hint {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px;
  color: var(--text-dim); font-size: .75rem;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ===== Quote Band ===== */
.quote-band {
  padding: 60px 32px;
  background: var(--bg-elevated);
}
.quote-inner {
  max-width: 700px; margin: 0 auto;
  text-align: center; position: relative;
}
.quote-mark {
  font-size: 4rem; line-height: 0;
  color: var(--accent); opacity: .3;
  position: absolute; top: -10px; left: -30px;
  font-family: Georgia, serif;
}
.quote-inner p {
  font-size: 1.3rem; font-weight: 500;
  color: var(--text-secondary);
  font-style: italic;
}

/* ===== Section Shared ===== */
.section {
  max-width: 1100px; margin: 0 auto;
  padding: 100px 32px;
}

.section-label {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px;
}
.label-line {
  width: 32px; height: 2px;
  background: var(--accent); border-radius: 1px;
}
.label-text {
  font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--accent);
}

.section-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 48px;
  line-height: 1.2;
}

/* ===== Work / Projects ===== */
.work-divider {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px;
}
.work-divider-line {
  flex: 1; height: 1px;
  background: var(--border);
}
.work-divider-text {
  font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-dim);
  white-space: nowrap;
}

.work-list {
  display: flex; flex-direction: column;
  gap: 20px;
}

.work-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 28px;
  align-items: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  transition: all .35s cubic-bezier(.22,1,.36,1);
  cursor: default;
  position: relative;
}

.work-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 40px rgba(0,0,0,.15);
  transform: translateY(-3px) scale(1.005);
}

[data-theme="light"] .work-card:hover {
  box-shadow: 0 8px 40px rgba(0,0,0,.06);
}

.work-visual {
  display: flex; align-items: center; justify-content: center;
}

.work-emoji-bg {
  width: 80px; height: 80px;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
  transition: transform .3s;
}

.work-card:hover .work-emoji-bg {
  transform: scale(1.08) rotate(-2deg);
}

.work-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 10px;
}

.work-tag {
  font-size: .72rem; padding: 3px 10px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent); font-weight: 500;
}

.work-status {
  font-size: .72rem; padding: 3px 10px;
  border-radius: 6px; font-weight: 600;
}
.work-status.live { background: rgba(0, 200, 83, 0.12); color: #00c853; }
.work-status.done { background: rgba(100, 200, 255, 0.12); color: #64c8ff; }
.work-status.dev { background: rgba(255, 200, 0, 0.12); color: #ffc800; }

.work-title {
  font-size: 1.3rem; font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.work-desc {
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== Stack ===== */
.stack-grid {
  display: flex; flex-wrap: wrap;
  gap: 10px;
}

.stack-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 10px 22px;
  transition: all .25s;
  cursor: default;
}

.stack-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.stack-icon {
  color: var(--accent);
  font-size: .7rem;
}

.stack-name {
  font-size: .85rem; font-weight: 500;
}

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

.about-p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

.about-milestones {
  display: flex; flex-direction: column;
  gap: 0;
}

.milestone {
  display: grid;
  grid-template-columns: 60px 16px 1fr;
  gap: 16px;
  align-items: start;
  padding: 20px 0;
  position: relative;
}

.milestone:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 76px; top: 44px; bottom: 0;
  width: 1px;
  background: var(--border);
}

.milestone-year {
  font-size: .85rem; font-weight: 700;
  color: var(--accent);
  text-align: right;
  padding-top: 2px;
}

.milestone-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
  margin-top: 4px;
  z-index: 1;
}

.milestone-content {
  padding-top: 1px;
}
.milestone-content strong {
  display: block;
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.milestone-content span {
  font-size: .85rem;
  color: var(--text-dim);
}

/* ===== Contact ===== */
.contact-wrap {
  margin-top: 80px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.contact-heading {
  font-size: 1.2rem; font-weight: 700;
  margin-bottom: 20px;
}

.contact-chips {
  display: flex; flex-wrap: wrap; gap: 12px;
}

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 10px 22px;
  font-size: .9rem; font-weight: 500;
  text-decoration: none; color: var(--text);
  transition: all .25s;
}

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

.chip-icon {
  font-size: .9rem;
}

.chip-dim {
  opacity: .6;
  cursor: default;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px;
}

.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  font-size: .8rem; color: var(--text-dim);
}

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

/* ===== Animations ===== */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}

.fade-up.show {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.work-card:nth-child(1) { transition-delay: 0s; }
.work-card:nth-child(2) { transition-delay: .05s; }
.work-card:nth-child(3) { transition-delay: .1s; }
.work-card:nth-child(4) { transition-delay: .15s; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero-text {
    display: flex; flex-direction: column; align-items: center;
  }

  .hero-bio { max-width: none; }
  .hero-actions { justify-content: center; }

  .hero-visual { height: auto; padding: 20px 0; }

  .avatar-frame { width: 180px; height: 180px; }
  .avatar-initials { font-size: 2.2rem; }

  .stat-1 { top: 0; right: 10%; }
  .stat-2 { bottom: 0; left: 10%; }

  .nav-links { display: none; }

  .work-card {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px;
  }

  .work-emoji-bg {
    width: 64px; height: 64px;
    font-size: 1.6rem;
    border-radius: 16px;
  }

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

  .section {
    padding: 60px 20px;
  }

  .hero {
    padding: 100px 20px 60px;
  }

  .milestone {
    grid-template-columns: 50px 14px 1fr;
    gap: 12px;
  }

  .milestone:not(:last-child)::after {
    left: 64px;
  }

  .quote-mark { display: none; }
}

@media (max-width: 480px) {
  .hero-name { font-size: 2.8rem; }
  .hero-surname { font-size: 1.4rem; }

  .hero-stat { display: none; }

  .stack-item { padding: 8px 16px; }
  .stack-name { font-size: .8rem; }

  .contact-chips { flex-direction: column; }
  .chip { width: 100%; justify-content: center; }
}
