/* ============================================================
   史子贤 | Shi Zixian — 个人主页
   Style: 暗黑科技 × 终端赛博 × 中文排版规则 (见 DESIGN.md)
   ============================================================ */

/* ===== Tokens ===== */
:root {
  /* Backgrounds */
  --bg: #0A0C10;
  --bg-elev: #0F1218;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-alt: rgba(255, 255, 255, 0.02);
  --surface-hover: rgba(255, 255, 255, 0.06);

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-hover: rgba(0, 212, 255, 0.45);

  /* Text */
  --text: #F0F1F5;
  --text-secondary: #A3A8B8;
  --text-tertiary: #5E6472;

  /* Accent */
  --accent: #00D4FF;
  --accent-hover: #33DDFF;
  --accent-soft: rgba(0, 212, 255, 0.1);
  --accent-ink: #061016;
  --accent-2: #22FF9C;
  --accent-2-soft: rgba(34, 255, 156, 0.1);
  --accent-3: #8B5CF6;

  /* RGB variants */
  --bg-rgb: 10, 12, 16;
  --accent-rgb: 0, 212, 255;
  --accent-2-rgb: 34, 255, 156;
  --accent-3-rgb: 139, 92, 246;

  /* Semantic */
  --success: #22FF9C;
  --error: #FF4D6D;
  --warning: #FFB84D;

  /* Fonts */
  --font-sans: 'Space Grotesk', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Misc */
  --radius: 14px;
  --container: 1080px;
  --container-narrow: 760px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  letter-spacing: 0.02em;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[id] { scroll-margin-top: 84px; }

::selection { background: rgba(var(--accent-rgb), 0.3); color: var(--text); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 5px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(var(--accent-rgb), 0.4); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mono { font-family: var(--font-mono); }

.hl { color: var(--accent); }
.hl-green { color: var(--accent-2); }

/* ===== Scroll progress ===== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 2px;
  z-index: 1000;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

/* ===== Blinking cursor ===== */
.cursor-blink {
  color: var(--accent);
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .3s ease, border-color .3s ease;
}
.navbar.scrolled {
  background: rgba(var(--bg-rgb), 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.08em;
  padding: 12px 0;
}
.nav-logo:hover { color: var(--accent); }
.nav-links {
  list-style: none;
  display: flex;
  gap: 4px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-family: var(--font-mono);
  position: relative;
  transition: color .2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 10px; right: 10px; bottom: 8px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { transform: scaleX(1); }

/* 语言切换 */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 56px;
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: transparent;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 8px;
  cursor: pointer;
  transition: background .25s ease, box-shadow .25s ease, transform .15s ease;
}
.lang-toggle:hover {
  background: var(--accent-soft);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.18);
}
.lang-toggle:active { transform: scale(0.96); }
.lang-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(var(--bg-rgb), 0.97);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 80px 32px;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.16, 1, .3, 1);
  visibility: hidden;
}
.mobile-menu.open { transform: translateX(0); visibility: visible; }
.mobile-link {
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--text);
  text-decoration: none;
  padding: 12px 0;
  min-height: 44px;
  border-bottom: 1px solid var(--border);
  transition: color .2s ease, padding-left .2s ease;
}
.mobile-link:hover { color: var(--accent); padding-left: 12px; }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 72px;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 30%, transparent 75%);
}

.hero-aurora {
  position: absolute;
  width: 640px; height: 640px;
  border-radius: 50%;
  opacity: 0.55;
}
.aurora-a {
  top: -180px; left: -140px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.14) 0%, transparent 65%);
  animation: drift-a 26s ease-in-out infinite alternate;
}
.aurora-b {
  bottom: -220px; right: -160px;
  background: radial-gradient(circle, rgba(var(--accent-3-rgb), 0.12) 0%, transparent 65%);
  animation: drift-b 32s ease-in-out infinite alternate;
}
@keyframes drift-a {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(90px, 60px) scale(1.15); }
}
@keyframes drift-b {
  from { transform: translate(0, 0) scale(1.1); }
  to   { transform: translate(-80px, -70px) scale(0.95); }
}

.hero-spotlight {
  position: absolute;
  inset: 0;
  background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 30%),
              rgba(var(--accent-rgb), 0.06), transparent 65%);
  transition: background .3s ease;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 18px;
}
.hero-eyebrow .scramble { color: var(--accent-2); }

.hero-title {
  font-size: clamp(44px, 8vw, 72px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0.02em;
  animation: fadeInUp .8s cubic-bezier(.16, 1, .3, 1) both;
}
.hero-sub {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 8px;
  animation: fadeInUp .8s .15s cubic-bezier(.16, 1, .3, 1) both;
}
.hero-tagline {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 10px;
  animation: fadeInUp .8s .25s cubic-bezier(.16, 1, .3, 1) both;
}
.hero-tagline::before, .hero-tagline::after { content: ' · '; color: var(--accent); }

/* Terminal */
.terminal {
  margin-top: 36px;
  width: 100%;
  max-width: 640px;
  text-align: left;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 80px rgba(var(--accent-rgb), 0.05);
  overflow: hidden;
  animation: fadeInUp .8s .35s cubic-bezier(.16, 1, .3, 1) both;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}
.terminal-dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-red { background: var(--error); }
.dot-yellow { background: var(--warning); }
.dot-green { background: var(--success); }
.terminal-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
}
.terminal-body {
  padding: 20px 22px 22px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.9;
  min-height: 190px;
}
.t-line { white-space: pre-wrap; word-break: break-word; }
.t-line.t-cmd { color: var(--accent); }
.t-line.t-out { color: var(--text-secondary); }
.t-line.t-ok { color: var(--accent-2); }
.t-line.t-ok::before { content: '✓ '; }
.t-line.t-prompt { color: var(--accent); }
.t-cursor {
  display: inline-block;
  width: 8px; height: 15px;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 1.1s step-end infinite;
}

/* Hero CTA */
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
  animation: fadeInUp .8s .45s cubic-bezier(.16, 1, .3, 1) both;
}

/* Hero stats */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 36px;
  margin-top: 44px;
  animation: fadeInUp .8s .55s cubic-bezier(.16, 1, .3, 1) both;
}
.hero-stat { text-align: center; }
.hero-stat .stat-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
}
.stat-star { color: var(--accent-2); }
.hero-stat .stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
  letter-spacing: 0.08em;
}

/* ===== Marquee ===== */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 14px 0;
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 28px;
  width: max-content;
  animation: marquee 30s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.marquee-track i { color: var(--accent); font-style: normal; font-size: 13px; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ===== Sections ===== */
.section { padding: 110px 24px; position: relative; }
.section-alt { background: var(--surface-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.container { max-width: var(--container); margin: 0 auto; }
.container-narrow { max-width: var(--container-narrow); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-title {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 40px;
}
.section-title::after {
  content: '';
  display: block;
  width: 44px;
  height: 3px;
  margin-top: 12px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.sub-title { font-size: 18px; font-weight: 700; margin: 44px 0 20px; }

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform .3s cubic-bezier(.16, 1, .3, 1), border-color .3s ease,
              box-shadow .3s ease, background .3s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.25), 0 12px 32px rgba(0, 0, 0, 0.45);
  background: var(--surface-hover);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  min-height: 44px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  color: var(--accent);
  background: transparent;
  transition: background .25s ease, box-shadow .25s ease, transform .15s ease, color .25s ease;
}
.btn:hover {
  background: var(--accent-soft);
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.18);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0) scale(0.97); box-shadow: none; }
.btn--solid {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 700;
}
.btn--solid:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 32px rgba(var(--accent-rgb), 0.35);
}
.btn-prompt { color: inherit; opacity: 0.55; }

/* ===== Links ===== */
.link {
  color: var(--accent);
  text-decoration: none;
  position: relative;
  padding: 4px 0;
}
.link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  height: 1px; width: 100%;
  background: rgba(var(--accent-rgb), 0.4);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.link:hover::after { transform: scaleX(1); }

/* ===== Tags ===== */
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface);
  transition: color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.tag:hover { color: var(--accent); border-color: var(--border-hover); }
.tag--green {
  color: var(--accent-2);
  border-color: rgba(var(--accent-2-rgb), 0.35);
  background: var(--accent-2-soft);
}
.tag--green:hover { color: var(--accent-2); border-color: rgba(var(--accent-2-rgb), 0.6); }

/* ===== About ===== */
.about-text p { color: var(--text-secondary); margin-bottom: 16px; }
.about-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 36px;
}
.about-stat {
  flex: 1;
  min-width: 140px;
  padding: 24px;
  text-align: center;
}
.about-stat .stat-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
}
.about-stat .stat-label {
  display: block;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* ===== Timeline (Education / Activities) ===== */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 1px;
  background: var(--border-strong);
}
.tl-item { position: relative; padding-bottom: 30px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: '';
  position: absolute;
  left: -30px; top: 7px;
  width: 15px; height: 15px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid rgba(var(--accent-rgb), 0.6);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.25);
}
.tl-item--done::before {
  background: var(--accent-2);
  border-color: var(--accent-2);
}
.tl-item--featured::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.55);
}
.tl-item h3 { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.tl-item p { color: var(--text-secondary); font-size: 15px; }
.tl-date {
  font-size: 12.5px;
  color: var(--accent);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 4px;
}

/* ===== Grades ===== */
.grades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}
.grade-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
.grade-letter {
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
}
.grade-a-star { color: var(--accent-2); text-shadow: 0 0 24px rgba(var(--accent-2-rgb), 0.35); }
.grade-a { color: var(--accent); text-shadow: 0 0 24px rgba(var(--accent-rgb), 0.3); }
.grade-subject { font-weight: 500; color: var(--text); font-size: 15px; }
.grade-status { display: inline-flex; margin-right: 6px; }

/* ===== Achievements ===== */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.ach-card { padding: 24px; }
.ach-badge {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.ach-card h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 8px; line-height: 1.5; }
.ach-result { font-weight: 600; color: var(--text-secondary); font-size: 14px; margin-bottom: 6px; }
.ach-date { font-size: 12.5px; color: var(--text-tertiary); }
.ach-highlight {
  background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.09), rgba(var(--accent-3-rgb), 0.07)), var(--surface);
  border-color: rgba(var(--accent-rgb), 0.3);
}
.ach-highlight .ach-result { color: var(--accent); }

/* ===== Projects (Bento) ===== */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}
.proj-card {
  padding: 28px;
  position: relative;
  display: flex;
  flex-direction: column;
}
.bento--feature { grid-column: span 7; grid-row: span 2; }
.bento--card { grid-column: span 5; }
.bento--wide { grid-column: span 12; }
.bento--wide .proj-desc { max-width: 78ch; }
.proj-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.proj-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.proj-icon svg { width: 22px; height: 22px; }
.proj-card h3 { font-size: 17px; font-weight: 700; line-height: 1.5; }
.bento--feature h3 { font-size: 20px; }
.proj-meta { font-size: 12.5px; color: var(--text-tertiary); margin-top: 4px; }
.proj-flag { vertical-align: middle; margin-left: 6px; }
.proj-desc {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 16px;
}
.bento--feature .proj-desc { font-size: 16px; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.proj-links { display: flex; gap: 20px; margin-top: 16px; }

/* Spotlight */
.spotlight::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%),
              rgba(var(--accent-rgb), 0.08), transparent 65%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.spotlight:hover::before { opacity: 1; }
.spotlight > * { position: relative; z-index: 1; }

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.skill-group { padding: 24px; }
.skill-head {
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.skill-items { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-note { font-size: 12.5px; color: var(--text-tertiary); margin-top: 12px; }

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 20px;
  text-decoration: none;
  text-align: center;
}
.contact-icon {
  width: 46px; height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  margin-bottom: 4px;
  transition: color .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.contact-icon svg { width: 22px; height: 22px; }
.contact-item:hover .contact-icon {
  color: var(--accent);
  border-color: var(--border-hover);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.2);
}
.contact-name { font-weight: 700; font-size: 15px; color: var(--text); }
.contact-handle { font-size: 12px; color: var(--text-tertiary); word-break: break-all; }

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px 36px;
  background: var(--surface-alt);
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-tertiary);
}
.footer-status { display: inline-flex; align-items: center; gap: 8px; }
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(var(--accent-2-rgb), 0.6);
  animation: glowPulse 2.5s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(var(--accent-2-rgb), 0.4); }
  50%      { box-shadow: 0 0 14px rgba(var(--accent-2-rgb), 0.8); }
}
.footer-credit {
  max-width: var(--container);
  margin: 14px auto 0;
  font-size: 11.5px;
  color: var(--text-tertiary);
  opacity: 0.75;
  text-align: center;
}

/* ===== CRT overlay (Konami 彩蛋) ===== */
.crt-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.45) 100%);
}
.crt-overlay.on { display: block; }

/* ===== Reveal ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
html.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.16, 1, .3, 1), transform .7s cubic-bezier(.16, 1, .3, 1);
}
html.js .reveal.in-view { opacity: 1; transform: translateY(0); }

/* Section title:clip 揭示放在内层 span 上(外层 h2 保持可观测,避免 IO 因全裁剪失效) */
html.js .title-inner {
  display: inline-block;
  transform: translateY(18px);
  clip-path: inset(0 0 100% 0);
  transition: transform .7s cubic-bezier(.16, 1, .3, 1),
              clip-path .8s cubic-bezier(.16, 1, .3, 1);
}
html.js .reveal.in-view .title-inner {
  transform: translateY(0);
  clip-path: inset(0 0 0% 0);
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .bento--feature, .bento--card, .bento--wide { grid-column: span 12; grid-row: auto; }
  .section { padding: 96px 24px; }
  .hero-stats { gap: 28px; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .section { padding: 72px 20px; }
  .hero { padding: 104px 20px 60px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .marquee { display: none; }
  .terminal-body { font-size: 12.5px; padding: 16px 16px 18px; }
  .terminal-title { font-size: 11px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { justify-content: center; }
  .hero-stats { gap: 20px; }
  .hero-stat .stat-num { font-size: 22px; }
  .grades-grid, .ach-grid, .skills-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-stat { min-width: 120px; }
  .footer-inner { flex-direction: column; align-items: center; text-align: center; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .title-inner { opacity: 1; transform: none; clip-path: none; }
  .marquee-track { animation: none; }
  .hero-aurora { animation: none; }
}
