:root {
  --bg: #050816;
  --bg-2: #090e1d;
  --panel: rgba(7, 12, 24, 0.82);
  --panel-2: rgba(10, 18, 34, 0.94);
  --text: #e7f7ff;
  --muted: #8ea4b3;
  --line: rgba(100, 255, 218, 0.16);
  --line-strong: rgba(100, 255, 218, 0.38);
  --accent: #64ffda;
  --accent-2: #7aa2ff;
  --danger: #ff5f56;
  --warn: #ffbd2e;
  --ok: #27c93f;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
}

body.light {
  --bg: #eef4fb;
  --bg-2: #dfe8f4;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-2: rgba(247, 251, 255, 0.96);
  --text: #13202b;
  --muted: #60707f;
  --line: rgba(34, 197, 148, 0.12);
  --line-strong: rgba(34, 197, 148, 0.24);
  --accent: #00aa84;
  --accent-2: #3a78ff;
  --shadow: 0 24px 70px rgba(25, 65, 122, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(100, 255, 218, 0.08), transparent 22%),
    radial-gradient(circle at bottom right, rgba(122, 162, 255, 0.1), transparent 26%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  transition: background 0.3s ease, color 0.3s ease;
}

.mono {
  font-family: "JetBrains Mono", Consolas, monospace;
}

.noise-canvas,
.scanlines,
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.noise-canvas {
  z-index: 0;
  opacity: 0.22;
}

.scanlines {
  z-index: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.02) 0,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.2;
}

.ambient-a,
.ambient-b {
  z-index: 0;
  filter: blur(90px);
}

.ambient-a {
  background: radial-gradient(circle, rgba(100, 255, 218, 0.18), transparent 62%);
  transform: translate(-10%, -20%);
}

.ambient-b {
  background: radial-gradient(circle, rgba(122, 162, 255, 0.18), transparent 56%);
  transform: translate(55%, 30%);
}

.topbar,
.container {
  position: relative;
  z-index: 1;
}

.topbar {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  transition: background 0.2s ease, color 0.2s ease;
}

.lang-btn.active {
  color: #00140d;
  background: linear-gradient(135deg, var(--accent), #b0ffef);
}

.brand {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.nav-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.nav-links a,
.theme-toggle {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.nav-links a:hover,
.theme-toggle:hover {
  color: var(--text);
}

.theme-toggle {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 20px 72px;
}

.section-gap {
  margin-top: 22px;
}

.value-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.value-card {
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(100, 255, 218, 0.08), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow);
}

.value-label {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.value-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 20px;
}

.value-card p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0, rgba(100, 255, 218, 0.08) 48%, transparent 100%);
  transform: translateX(-100%);
  opacity: 0;
}

.panel:hover::before {
  opacity: 1;
  animation: sweep 1.1s ease;
}

.hero {
  min-height: 86vh;
  padding: 28px;
  display: grid;
  grid-template-columns: 320px 1fr 280px;
  gap: 22px;
  align-items: stretch;
}

.hero-terminal,
.profile-card,
.timeline-item,
.contact-item,
.info-chip,
.stack-tag {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
}

.hero-terminal,
.profile-card {
  border-radius: 20px;
  overflow: hidden;
}

.terminal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background: var(--danger); }
.dot-yellow { background: var(--warn); }
.dot-green { background: var(--ok); }

.terminal-title {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
}

.terminal-body {
  padding: 18px 16px 22px;
}

.terminal-body p {
  margin: 0 0 10px;
  line-height: 1.7;
}

.prompt {
  color: var(--accent);
  margin-right: 8px;
}

.terminal-answer {
  color: var(--text);
  padding-left: 18px;
}

.hero-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-badge {
  width: fit-content;
  margin-bottom: 16px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  background: rgba(100, 255, 218, 0.08);
}

h1,
h2,
h3,
p,
ul {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.subtitle {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.hero-actions {
  margin-top: 26px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #00140d;
  background: linear-gradient(135deg, var(--accent), #b0ffef);
  box-shadow: 0 12px 30px rgba(100, 255, 218, 0.18);
}

.btn-secondary {
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.info-chip {
  padding: 14px 16px;
  border-radius: 18px;
}

.chip-label {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.info-chip strong {
  font-size: 18px;
}

.profile-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: center;
}

.profile-frame {
  position: relative;
  aspect-ratio: 0.92;
  border-radius: 28px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(100, 255, 218, 0.08), rgba(122, 162, 255, 0.05)),
    radial-gradient(circle at top, rgba(100, 255, 218, 0.12), transparent 58%);
  overflow: hidden;
}

.profile-frame::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 14px;
  height: 72px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.24), transparent);
  pointer-events: none;
  z-index: 1;
}

.profile-frame::after {
  content: "PROFILE_SCAN";
  position: absolute;
  top: 24px;
  left: 24px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(100, 255, 218, 0.82);
  z-index: 2;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 22px;
  background-image:
    linear-gradient(180deg, rgba(7, 12, 24, 0.02), rgba(7, 12, 24, 0.18)),
    url('./avatar.jpg');
  background-size: cover;
  background-position: center 34%;
  background-repeat: no-repeat;
  filter: saturate(1.03) contrast(1.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.avatar::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(100, 255, 218, 0.55), transparent);
  opacity: 0.6;
}

.avatar-corners {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--accent);
  opacity: 0.85;
  z-index: 2;
}

.avatar-corner-tl { top: 4px; left: 4px; border-top: 2px solid; border-left: 2px solid; }
.avatar-corner-tr { top: 4px; right: 4px; border-top: 2px solid; border-right: 2px solid; }
.avatar-corner-bl { bottom: 4px; left: 4px; border-bottom: 2px solid; border-left: 2px solid; }
.avatar-corner-br { bottom: 4px; right: 4px; border-bottom: 2px solid; border-right: 2px solid; }

.profile-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.panel:not(.hero) {
  padding: 24px;
}

.section-title {
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.panel p,
.panel li,
.meta {
  color: var(--muted);
  line-height: 1.8;
}

.stack-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stack-tag {
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
}

.timeline {
  display: grid;
  gap: 14px;
}

.experience-note {
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 12px;
}

.timeline-item {
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
}

.accordion-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 190px 1fr auto;
  gap: 20px;
  padding: 18px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.accordion-icon {
  color: var(--accent);
  align-self: start;
  font-size: 14px;
}

.accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}

.accordion-item.is-open .accordion-panel {
  grid-template-rows: 1fr;
}

.accordion-panel > div {
  overflow: hidden;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px 18px;
}

.detail-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.detail-label {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 11px;
}

.timeline-date {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.timeline-body h3 {
  margin-bottom: 6px;
  font-size: 20px;
}

.signal-list {
  padding-left: 18px;
}

.edu-block {
  margin-bottom: 18px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.contact-item {
  padding: 18px;
  border-radius: 18px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-item:hover,
.timeline-item:hover,
.stack-tag:hover,
.info-chip:hover,
.profile-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.contact-key {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.hiring-card {
  padding: 24px;
}

.hiring-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hiring-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.hiring-item strong {
  display: block;
  margin-bottom: 10px;
  font-size: 18px;
}

.hiring-item p {
  margin: 0;
}

.reveal-card {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.reveal-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.tilt-card,
.magnetic {
  will-change: transform;
}

@keyframes sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

@media (max-width: 1080px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .value-strip,
  .info-grid,
  .content-grid,
  .contact-grid,
  .hiring-grid,
  .detail-grid,
  .accordion-toggle {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
  }

  .topbar-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
  }

  .container {
    padding-top: 18px;
  }

  .hero,
  .panel:not(.hero) {
    padding: 18px;
  }

  h1 {
    font-size: clamp(34px, 12vw, 48px);
  }

  .subtitle {
    font-size: 16px;
  }
}
