:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --text: #1a2333;
  --text-muted: #5b6b83;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --border: #e4e9f1;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(26, 35, 51, 0.08);
  --font-sans: "Inter", "Noto Sans SC", -apple-system, "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: min(1080px, 92%);
  margin: 0 auto;
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-dot {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a:not(.btn) {
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:not(.btn):hover {
  color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.btn-outline {
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Nav toggle (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

/* Hero */
.hero {
  padding: 5.5rem 0 4.5rem;
  background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.eyebrow {
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
}

.hero-role {
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  font-weight: 600;
  color: var(--text-muted);
  margin: 0.6rem 0 1.2rem;
}

.hero-desc {
  max-width: 34rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Code card */
.hero-visual {
  display: flex;
  justify-content: center;
}

.code-card {
  width: 100%;
  max-width: 420px;
  background: #0f172a;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.code-card-bar {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: #1e293b;
}

.code-card-bar span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ef4444;
}

.code-card-bar span:nth-child(2) {
  background: #f59e0b;
}

.code-card-bar span:nth-child(3) {
  background: #22c55e;
}

.code-card pre {
  padding: 1.2rem 1.4rem;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.8;
  color: #e2e8f0;
  overflow-x: auto;
}

.c-kw {
  color: #c084fc;
}

.c-fn {
  color: #60a5fa;
}

.c-cls {
  color: #34d399;
}

.c-k {
  color: #93c5fd;
}

.c-str {
  color: #fbbf24;
}

.c-bool {
  color: #f472b6;
}

/* Sections */
.section {
  padding: 4.5rem 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.5px;
}

.section-sub {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0.2rem 0 2.5rem;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.about-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
}

.about-card h3 {
  margin-bottom: 0.9rem;
  font-size: 1.2rem;
}

.about-card p {
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.principle-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.principle-list li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--text-muted);
}

.principle-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  transition: transform 0.25s, box-shadow 0.25s;
}

.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.skill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.78rem;
  margin-bottom: 1rem;
}

.skill-card h3 {
  font-size: 1.08rem;
  margin-bottom: 0.35rem;
}

.skill-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.skill-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-alt);
  overflow: hidden;
}

.skill-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-links {
  display: flex;
  gap: 1.2rem;
}

.footer-links a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Responsive */
@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

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

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 64px;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
    background: #fff;
    padding: 1.8rem 2rem;
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--border);
    transform: translateY(-130%);
    transition: transform 0.3s;
    width: 100%;
  }

  .nav-links.open {
    transform: translateY(0);
  }

  .nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle.open span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

@media (max-width: 520px) {
  .hero {
    padding: 3.5rem 0;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
