/* ===========================================================
   个人主页 · 前台样式（深色科技风 / Developer Terminal）
   设计 token：深色优先 / 冷青强调 / 等宽字体 / 网格底纹 / 数据化元素
   =========================================================== */

:root {
  /* 强调色由后台设置注入 --accent-set，这里做主题适配 */
  --accent:        var(--accent-set, #22d3ee);
  --accent-ink:    #06121a;
  --accent-wash:   color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-line:   color-mix(in srgb, var(--accent) 42%, var(--line));

  --bg:            #080b11;
  --bg-deep:       #05080d;
  --surface:       #0d131c;
  --surface-2:     #121a25;
  --surface-3:     #182231;
  --text:          #e6edf5;
  --text-soft:     #9aa8bb;
  --muted:         #64748b;
  --line:          #1c2735;
  --line-strong:   #2b3a4d;
  --success:       #4ade80;

  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo,
               Consolas, "Liberation Mono", monospace;

  --wrap: 1200px;
  --radius: 6px;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --header-h: 68px;
}

[data-theme="light"] {
  --accent:      color-mix(in srgb, var(--accent-set, #0891b2) 78%, #000);
  --accent-ink:  #ffffff;
  --accent-wash: color-mix(in srgb, var(--accent) 9%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 45%, var(--line));

  --bg:          #f6f8fb;
  --bg-deep:     #eef2f7;
  --surface:     #ffffff;
  --surface-2:   #f1f5f9;
  --surface-3:   #e8eef5;
  --text:        #0f172a;
  --text-soft:   #475569;
  --muted:       #8494a8;
  --line:        #dbe3ec;
  --line-strong: #b8c4d4;
  --success:     #16a34a;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s var(--ease), color .3s var(--ease);
  overflow-x: hidden;
}

/* 网格底纹：科技感的主要来源之一 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 52px 52px;
  opacity: .42;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, pre { margin: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: min(100% - 48px, var(--wrap)); margin-inline: auto; }
.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }

.skip-link {
  position: fixed; top: -100px; left: 16px; z-index: 1000;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 0 0 6px 6px;
  font-family: var(--font-mono); font-size: 12px;
}
.skip-link:focus { top: 0; }

/* 顶部滚动进度条 */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px;
  width: 0; z-index: 200;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transition: width .1s linear;
}

/* ---------------- Header ---------------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  min-height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  width: min(100% - 48px, var(--wrap));
  margin-inline: auto;
  display: flex; align-items: center; gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent-wash);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: .02em;
  box-shadow: inset 0 0 12px var(--accent-wash);
}
.brand-name { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }

.desktop-nav {
  display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px);
  margin-left: auto; margin-right: 8px;
}
.desktop-nav a {
  position: relative;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--muted);
  padding: 6px 0;
  transition: color .2s var(--ease);
}
.desktop-nav a::before { content: "/ "; color: var(--accent); opacity: 0; transition: opacity .2s; }
.desktop-nav a:hover, .desktop-nav a.is-active { color: var(--text); }
.desktop-nav a:hover::before, .desktop-nav a.is-active::before { opacity: 1; }
.desktop-nav a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--accent); box-shadow: 0 0 8px var(--accent);
}

.header-status {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .08em; color: var(--muted);
  padding-right: 14px; margin-right: 4px;
  border-right: 1px solid var(--line);
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 14%, transparent), 0 0 10px var(--success);
  animation: statusPulse 2.4s ease-in-out infinite;
}
@keyframes statusPulse { 50% { opacity: .45; box-shadow: 0 0 0 5px transparent; } }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 5px;
  background: transparent; color: var(--text-soft); cursor: pointer;
  transition: border-color .2s var(--ease), color .2s, background .2s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-sun { display: none; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

.menu-toggle { display: none; flex-direction: column; gap: 5px; }
.menu-toggle span {
  display: block; width: 15px; height: 1.5px; background: currentColor;
  transition: transform .25s var(--ease);
}
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

.mobile-nav {
  border-top: 1px solid var(--line); background: var(--bg);
  padding: 10px 24px 18px;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav a {
  display: block; padding: 12px 0; border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 12px; color: var(--text-soft);
}
.mobile-nav a:last-child { border-bottom: 0; }
.mobile-nav a::before { content: "/ "; color: var(--accent); }

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  min-height: calc(88vh - var(--header-h));
  display: flex; flex-direction: column; justify-content: center;
  padding-block: clamp(70px, 9vw, 120px) 36px;
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; top: 12%;
  height: 320px; pointer-events: none;
  background: radial-gradient(ellipse 45% 60% at 78% 50%, var(--accent-wash), transparent 70%);
  opacity: .7;
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, .9fr);
  align-items: center; gap: clamp(40px, 6vw, 90px);
}

.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .1em; color: var(--accent);
  margin-bottom: clamp(22px, 3vw, 34px);
}
.eyebrow::before { content: "[ "; color: var(--muted); }
.eyebrow::after  { content: " ]"; color: var(--muted); }
.pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 8px var(--success);
}

.hero-title {
  font-size: clamp(4rem, 10vw, 8.2rem);
  font-weight: 650;
  line-height: .95;
  letter-spacing: -.055em;
  margin-bottom: 18px;
}
.hero-title .cursor-bar {
  display: inline-block;
  width: .07em; height: .82em;
  margin-left: .06em;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
  vertical-align: -.02em;
  animation: blink 1.1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-role {
  display: flex; align-items: baseline; gap: 10px;
  font-family: var(--font-mono);
  font-size: clamp(14px, 1.8vw, 18px);
  letter-spacing: -.01em;
  color: var(--text);
  margin-bottom: 24px;
}
.hero-role::before { content: "❯"; color: var(--accent); font-size: .85em; }

.hero-intro {
  max-width: 34em;
  color: var(--text-soft);
  font-size: 15px; line-height: 1.95;
}
.hero-intro br + * { color: var(--text-soft); }

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: clamp(28px, 4vw, 42px); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px;
  border: 1px solid transparent; border-radius: 5px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  letter-spacing: .03em; cursor: pointer;
  transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-solid {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 28%, transparent);
}
.btn-solid:hover { box-shadow: 0 0 32px color-mix(in srgb, var(--accent) 45%, transparent); }
.btn-line { border-color: var(--line-strong); color: var(--text-soft); }
.btn-line:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }

/* 终端面板 */
.terminal {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0,0,0,.35), 0 0 0 1px var(--accent-wash);
}
.terminal-head {
  display: flex; align-items: center; gap: 12px;
  height: 36px; padding: 0 13px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.terminal-dots { display: flex; gap: 5px; }
.terminal-dots i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--line-strong); display: block;
}
.terminal-dots i:first-child { background: #f87171; }
.terminal-dots i:nth-child(2) { background: #fbbf24; }
.terminal-dots i:last-child { background: var(--success); }
.terminal-path {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--muted); letter-spacing: .04em;
}
.terminal-live {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: .1em; color: var(--success);
  display: inline-flex; align-items: center; gap: 5px;
}
.terminal-live::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 8px currentColor;
}
.terminal-body { padding: 18px 18px 20px; font-family: var(--font-mono); font-size: 12px; line-height: 1.85; }
.term-line { color: var(--text-soft); }
.term-prompt { color: var(--accent); margin-right: 8px; }
.term-cmd { color: var(--text); }
.term-code {
  margin: 10px 0 14px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.9;
  max-width: 100%;
  overflow-x: auto;
}
.term-key { color: var(--accent); }
.term-str { color: #fbbf24; }
.term-ok  { color: var(--success); }
[data-theme="light"] .term-str { color: #b45309; }
[data-theme="light"] .term-ok  { color: #15803d; }
.term-cursor {
  display: inline-block; width: 7px; height: 14px;
  background: var(--accent); vertical-align: -2px;
  box-shadow: 0 0 10px var(--accent);
  animation: blink 1.1s steps(2, start) infinite;
}

.scroll-hint {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 12px;
  margin-top: clamp(48px, 7vw, 84px);
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .16em; color: var(--muted);
  text-transform: uppercase;
}
.scroll-hint i { display: block; width: 56px; height: 1px; background: var(--line-strong); position: relative; overflow: hidden; }
.scroll-hint i::after {
  content: ""; position: absolute; inset: 0; background: var(--accent);
  transform: translateX(-100%); animation: scan 2.6s var(--ease) infinite;
}
@keyframes scan { 0% { transform: translateX(-100%); } 55% { transform: translateX(0); } 100% { transform: translateX(100%); } }

/* ---------------- Sections ---------------- */

.section {
  padding-block: clamp(80px, 11vw, 140px);
  border-top: 1px solid var(--line);
  scroll-margin-top: var(--header-h);
  position: relative;
}
.section-alt { background: color-mix(in srgb, var(--surface) 55%, var(--bg)); }
.section::before {
  content: "// " attr(data-id);
  position: absolute; top: -8px; right: max(24px, calc((100vw - var(--wrap)) / 2));
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .08em; color: var(--muted);
  background: var(--bg); padding-inline: 8px;
}
.section-alt::before { background: color-mix(in srgb, var(--surface) 55%, var(--bg)); }

.section-grid {
  display: grid;
  grid-template-columns: minmax(200px, 270px) minmax(0, 1fr);
  gap: clamp(40px, 7vw, 110px);
  align-items: start;
}
.section-head { position: sticky; top: calc(var(--header-h) + 44px); }
.section-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .12em; color: var(--accent);
  margin-bottom: 18px;
}
.section-tag::before { content: ""; width: 16px; height: 1px; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.section-head h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 650; line-height: 1.1;
  letter-spacing: -.04em;
}
.section-head h2 .accent-dot { color: var(--accent); }
.section-subtitle {
  margin-top: 12px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .04em; color: var(--muted);
}
.section-subtitle::before { content: "> "; color: var(--accent); }
.section-body { max-width: 70ch; }
.section-body-wide { max-width: none; }

.prose {
  color: var(--text-soft);
  font-size: 14.5px; line-height: 1.95;
  padding-left: 18px;
  border-left: 1px solid var(--line-strong);
}
.prose-lead { max-width: 60ch; margin-bottom: clamp(34px, 5vw, 52px); border-left: 0; padding-left: 0; }
.about-figure { margin-top: 32px; }
.about-figure img { border: 1px solid var(--line-strong); border-radius: var(--radius); }

/* 作品列表 */
.work-list { border-top: 1px solid var(--line); }
.work-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 160px;
  gap: 22px; align-items: start;
  padding: clamp(26px, 3.5vw, 36px) 14px;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.work-row:hover { background: var(--surface); border-left-color: var(--accent); }
.work-num {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent); padding-top: 6px;
}
.work-num::before { content: "// "; color: var(--muted); }
.work-title {
  display: inline-flex; align-items: baseline; gap: 10px;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 600; letter-spacing: -.03em; line-height: 1.25;
}
.work-title .arrow { font-size: 14px; color: var(--accent); transition: transform .2s var(--ease); }
a.work-title:hover .arrow { transform: translate(3px, -3px); }
.work-desc { margin-top: 10px; max-width: 62ch; color: var(--text-soft); font-size: 14px; line-height: 1.85; }
.work-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.work-tags span {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .03em; color: var(--text-soft);
  padding: 3px 9px; border: 1px solid var(--line-strong); border-radius: 3px;
  background: var(--surface-2);
}
.work-meta {
  text-align: right; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .06em; color: var(--muted); padding-top: 8px;
}

/* 技能条 */
.skill-list { border-top: 1px solid var(--line); margin-top: 26px; }
.skill-item {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) 44px;
  gap: 18px; align-items: center;
  padding: 15px 0; border-bottom: 1px solid var(--line);
}
.skill-name { font-size: 14px; font-weight: 500; }
.skill-track {
  display: block; height: 4px; border-radius: 2px;
  background: var(--surface-3); overflow: hidden;
}
.skill-track i {
  display: block; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), var(--accent));
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 50%, transparent);
  transform-origin: left; transform: scaleX(0);
  transition: transform .8s var(--ease);
}
.js .reveal.is-visible .skill-track i { transform: scaleX(var(--level, .8)); }
.skill-value {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent); text-align: right;
}
.skill-note { grid-column: 1 / -1; font-size: 11px; color: var(--muted); margin-top: -8px; }

/* 经历：git log 风格 */
.timeline { position: relative; margin-top: 10px; }
.timeline::before {
  content: ""; position: absolute; left: 76px; top: 6px; bottom: 12px;
  width: 1px; background: var(--line-strong);
}
.timeline-item {
  position: relative;
  display: grid; grid-template-columns: 62px minmax(0, 1fr);
  gap: 28px; padding-bottom: 40px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-hash {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .06em; color: var(--accent);
  padding-top: 5px;
}
.timeline-dot {
  position: absolute; left: 72px; top: 9px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent);
}
.section-alt .timeline-dot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--surface) 55%, var(--bg)), 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent); }
.timeline-when {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .06em; color: var(--muted); margin-bottom: 8px;
}
.timeline-title { font-size: 1.3rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.timeline-desc { margin-top: 8px; color: var(--text-soft); font-size: 14px; max-width: 62ch; }

/* 联系 */
.section-center { text-align: center; }
.section-head-center { position: static; text-align: center; margin-bottom: clamp(38px, 5vw, 58px); }
.section-head-center .section-tag::before { display: none; }
.section-head-center .section-subtitle::before { display: none; }
.contact-body { text-align: center; }
.contact-prompt {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent); margin-bottom: 14px;
}
.contact-mail {
  display: inline-flex; align-items: baseline; gap: 12px;
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 4.6vw, 3.4rem);
  font-weight: 600; letter-spacing: -.04em;
  padding: 12px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s, color .2s;
  word-break: break-all;
}
.contact-mail:hover {
  border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 28px color-mix(in srgb, var(--accent) 18%, transparent), inset 0 0 20px var(--accent-wash);
}
.contact-mail span { font-size: .4em; }
.contact-note { margin-top: 24px; color: var(--text-soft); font-size: 13px; }
.contact-note + .contact-note { margin-top: 8px; }

.generic-item { padding: 20px 0; border-bottom: 1px solid var(--line); }
.generic-item h3 { font-size: 17px; font-weight: 600; }
.generic-item p { color: var(--text-soft); font-size: 13px; margin-top: 6px; }
.muted { color: var(--muted); }

/* ---------------- Footer ---------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 32px;
  background: var(--bg-deep);
}
.footer-inner { display: flex; flex-direction: column; gap: 16px; }
.footer-main-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.footer-brand { font-size: 13px; font-weight: 600; }
.footer-brand .accent-dot { color: var(--accent); }
.footer-note, .footer-top {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .05em; color: var(--muted);
}
.footer-top:hover { color: var(--accent); }

/* 备案区域 */
.footer-beian {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center;
  gap: 12px 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.beian-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .03em; color: var(--muted);
  transition: color .2s var(--ease);
}
.beian-link:hover { color: var(--accent); }
.beian-icon {
  width: 17px; height: 17px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: color .2s var(--ease);
}
.beian-link:hover .beian-icon { color: var(--accent); }
.beian-icon svg, .beian-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---------------- 滚动入场 ---------------- */

.js .reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------------- 响应式 ---------------- */

@media (max-width: 1024px) {
  .section-grid { grid-template-columns: 1fr; gap: 36px; }
  .section-head { position: static; }
  .hero-grid { grid-template-columns: 1fr .8fr; gap: 36px; }
  .header-status { display: none; }
}

@media (max-width: 760px) {
  :root { --wrap: 100%; --header-h: 60px; }
  .wrap, .header-inner { width: 100%; padding-inline: 20px; }

  .desktop-nav { display: none; }
  .menu-toggle { display: flex; }
  .header-actions { margin-left: auto; flex: none; }

  .hero { min-height: auto; padding-block: 62px 28px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero-copy, .hero-visual { min-width: 0; }
  .hero-title { font-size: clamp(3.4rem, 16vw, 5.5rem); }
  .terminal-body { font-size: 11px; }
  .term-code { font-size: 10.5px; }

  .work-row { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding-inline: 10px; }
  .work-meta { grid-column: 2; text-align: left; padding-top: 0; }
  .work-tags span { font-size: 9px; }

  .skill-item { grid-template-columns: minmax(110px, 1fr) minmax(0, 1.2fr) 36px; gap: 10px; }
  .skill-name { font-size: 12px; }

  .timeline::before { left: 4px; }
  .timeline-item { grid-template-columns: 1fr; gap: 0; padding-left: 26px; }
  .timeline-hash { padding-top: 0; margin-bottom: 4px; }
  .timeline-dot { left: 0; top: 5px; }

  .section-alt::before, .section::before { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 420px) {
  .hero-actions .btn { flex: 1 1 auto; }
  .contact-mail { font-size: 1.25rem; padding: 10px 12px; }
  .skill-item { grid-template-columns: 1fr 40px; }
  .skill-track { grid-column: 1 / -1; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .skill-track i { transform: scaleX(var(--level, .8)) !important; }
}
