:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-alt: #eef3fa;
  --text: #16233a;
  --muted: #5c6b82;
  --line: #e1e8f2;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf1ff;
  --accent: #f59e0b;
  --dark: #0f1c33;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 45px rgba(22, 35, 58, 0.08);
  --shadow-sm: 0 8px 24px rgba(22, 35, 58, 0.07);
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

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

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

img {
  max-width: 100%;
  display: block;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  z-index: 999;
  padding: 8px 14px;
  background: #fff;
  border-radius: 8px;
}

.skip-link:focus {
  left: 12px;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

/* ===================== 顶部导航 ===================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(225, 232, 242, 0.9);
  transition: box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 10px 30px rgba(22, 35, 58, 0.08);
}

.nav-wrap {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.brand span {
  margin-left: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav-link {
  position: relative;
  padding: 8px 0;
  font-size: 15px;
  color: var(--muted);
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--primary);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: var(--primary-soft);
  border-radius: 10px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

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

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

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

/* ===================== 首屏 ===================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 150px 0 90px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 20%, rgba(245, 158, 11, 0.28), transparent 32%),
    radial-gradient(circle at 15% 85%, rgba(37, 99, 235, 0.34), transparent 34%),
    linear-gradient(135deg, #0f1c33 0%, #14294d 55%, #18386b 100%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 18px;
  padding: 6px 12px;
  font-size: 13px;
  color: #dce9ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 70px);
  line-height: 1.08;
  letter-spacing: -1px;
}

.hero h1 span {
  color: #ffd27a;
}

.hero-subtitle {
  max-width: 620px;
  margin: 24px 0 0;
  font-size: 18px;
  color: #cdd9eb;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

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

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

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.06);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.12);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.hero-stats .stat {
  padding: 22px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(8px);
}

.hero-stats strong {
  display: block;
  font-size: 28px;
  color: #ffd27a;
}

.hero-stats span {
  margin-top: 4px;
  font-size: 13px;
  color: #c6d3e8;
}

/* ===================== 通用模块 ===================== */
.section {
  padding: 100px 0;
}

.section-alt {
  background: #eef3fa;
}

.section-head {
  max-width: 720px;
  margin-bottom: 46px;
}

.section-kicker {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--primary);
}

.section-head h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.2;
}

.section-lead {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
}

/* ===================== 关于我 ===================== */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.about-card {
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  font-size: 24px;
  background: var(--primary-soft);
  border-radius: 14px;
}

.about-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.about-card p {
  margin: 0;
  color: var(--muted);
}

.priority-card {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 26px;
  padding: 26px 30px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 52%, #0f1c33 100%);
  border-radius: var(--radius);
  box-shadow: 0 20px 45px rgba(37, 99, 235, 0.22);
}

.priority-label {
  flex-shrink: 0;
  margin: 0;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
}

.priority-value {
  margin: 0;
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 800;
  line-height: 1.45;
}

/* ===================== 工作经历 ===================== */
.timeline {
  position: relative;
  display: grid;
  gap: 18px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 210px;
  width: 1px;
  background: #d5dfee;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 40px;
  padding: 26px 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 206px;
  top: 34px;
  width: 9px;
  height: 9px;
  background: var(--primary);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--primary);
}

.timeline-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.time {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.company {
  font-size: 14px;
  color: var(--muted);
}

.timeline-body h3 {
  margin: 0 0 12px;
  font-size: 21px;
}

.timeline-body h3 span {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.timeline-body ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.timeline-body li {
  margin: 6px 0;
}

/* ===================== 专业能力 ===================== */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.skill-card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.skill-card h3 {
  margin: 0 0 16px;
  font-size: 20px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 6px 12px;
  font-size: 14px;
  color: #33445f;
  background: var(--primary-soft);
  border-radius: 999px;
}

/* ===================== 个人亮点 ===================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.project-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.project-visual {
  height: 150px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.9);
}

.visual-a { background: linear-gradient(135deg, #2563eb, #38bdf8); }
.visual-b { background: linear-gradient(135deg, #0f1c33, #4f46e5); }
.visual-c { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.visual-d { background: linear-gradient(135deg, #0f766e, #22c55e); }

.project-content {
  padding: 24px;
}

.project-tag {
  display: inline-block;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.project-content h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.project-content > p {
  margin: 0;
  color: var(--muted);
}

.project-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.project-metrics span {
  font-size: 13px;
  color: var(--muted);
}

.project-metrics strong {
  display: block;
  font-size: 17px;
  color: var(--text);
}

.subsection-head {
  margin: 52px 0 22px;
}

.subsection-head h3 {
  margin: 0;
  font-size: 26px;
  line-height: 1.3;
}

.subsection-head > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
}

/* ===================== 作品集 ===================== */
.portfolio-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.filter-btn:hover {
  transform: translateY(-1px);
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.35);
}

.filter-btn span {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
  text-align: center;
}

.filter-btn.is-active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.filter-btn.is-active span {
  color: var(--primary);
  background: #fff;
}

.portfolio-count {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.portfolio-card {
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.portfolio-card:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--shadow);
}

.portfolio-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0f1c33;
}

.portfolio-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.portfolio-card:hover .portfolio-thumb img {
  transform: scale(1.05);
}

.portfolio-badge,
.portfolio-duration {
  position: absolute;
  z-index: 1;
  color: #fff;
  background: rgba(15, 28, 51, 0.78);
}

.portfolio-badge {
  top: 10px;
  left: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.portfolio-duration {
  right: 10px;
  bottom: 10px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.portfolio-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 28, 51, 0.22);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.portfolio-card:hover .portfolio-play,
.portfolio-card:focus-visible .portfolio-play {
  opacity: 1;
}

@media (hover: none) {
  .portfolio-play {
    opacity: 1;
    background: rgba(15, 28, 51, 0.12);
  }
}

.portfolio-play span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  padding-left: 4px;
  border-radius: 50%;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.94);
  font-size: 18px;
  box-shadow: 0 8px 22px rgba(15, 28, 51, 0.25);
}

.portfolio-info {
  display: block;
  padding: 16px 18px 18px;
}

.portfolio-info strong {
  display: block;
  font-size: 17px;
  line-height: 1.45;
}

.portfolio-info .portfolio-meta {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.portfolio-info .portfolio-description {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0;
  text-transform: none;
}

.portfolio-empty {
  grid-column: 1 / -1;
  padding: 40px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
  text-align: center;
}

/* ===================== 个人标签 ===================== */
.personality-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  align-items: start;
}

.personality-stack {
  display: grid;
  gap: 22px;
}

.personality-card {
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.personality-card-featured {
  padding: 30px;
}

.personality-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.personality-head .card-icon {
  flex-shrink: 0;
  margin-bottom: 0;
}

.personality-head h3 {
  margin: 0;
  font-size: 22px;
}

.tag-group + .tag-group {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.tag-group-title {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
}

.media-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.media-item {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.media-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
}

.media-item span {
  display: block;
  padding: 8px 9px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===================== 联系方式 ===================== */
.contact-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 26px;
}

.contact-info {
  display: grid;
  gap: 14px;
  align-content: start;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

a.contact-item:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.contact-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 21px;
  background: var(--primary-soft);
  border-radius: 12px;
}

.contact-item small {
  display: block;
  color: var(--muted);
}

.contact-item strong {
  font-size: 16px;
}

.contact-form {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.contact-form label {
  display: block;
  margin-bottom: 16px;
}

.contact-form label span {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 700;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.contact-form textarea {
  resize: vertical;
}

.form-tip {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* ===================== 页脚与工具 ===================== */
.site-footer {
  padding: 28px 0;
  color: #aebbd0;
  background: var(--dark);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 13px;
}

.footer-inner p {
  margin: 0;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  padding: 12px 18px;
  color: #fff;
  background: #0f1c33;
  border-radius: 10px;
  font-size: 14px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.modal-open {
  overflow: hidden;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.video-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 28, 51, 0.82);
  backdrop-filter: blur(6px);
}

.video-modal-panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s ease;
}

.video-modal.is-open .video-modal-panel {
  transform: translateY(0) scale(1);
}

.video-modal video {
  width: 100%;
  max-height: calc(100vh - 180px);
  display: block;
  background: #000;
}

.video-modal-info {
  padding: 16px 20px 20px;
}

.video-modal-category {
  margin: 0;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.video-modal-info h3 {
  margin: 5px 0 0;
  font-size: 20px;
  line-height: 1.4;
}

.video-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(15, 28, 51, 0.78);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.video-modal-close:hover {
  background: var(--primary);
}

/* ===================== 动画 ===================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

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

/* ===================== 响应式：平板与手机 ===================== */
@media (max-width: 900px) {
  .site-nav {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 14px 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 30px rgba(22, 35, 58, 0.12);
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-link {
    padding: 12px 8px;
    border-bottom: 1px solid #eef2f7;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .hero-stats {
    grid-template-columns: repeat(4, 1fr);
  }

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

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

  .project-grid,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline::before {
    left: 14px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-left: 42px;
  }

  .timeline-item::before {
    left: 10px;
    top: 31px;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 28px, 1120px);
  }

  .nav-wrap {
    height: 66px;
  }

  .site-nav {
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 14px 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 30px rgba(22, 35, 58, 0.12);
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-link {
    padding: 12px 8px;
    border-bottom: 1px solid #eef2f7;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding: 110px 0 60px;
  }

  .hero h1 {
    font-size: 40px;
  }

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

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .hero-stats .stat {
    padding: 16px 14px;
  }

  .section {
    padding: 68px 0;
  }

  .section-head {
    margin-bottom: 32px;
  }

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

  .portfolio-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .video-modal {
    padding: 10px;
  }

  .video-modal-panel {
    max-height: calc(100vh - 20px);
    border-radius: 14px;
  }

  .video-modal video {
    max-height: calc(100vh - 160px);
  }

  .video-modal-close {
    top: 8px;
    right: 8px;
  }

  .priority-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 22px;
  }

  .priority-value {
    font-size: 22px;
  }

  .subsection-head {
    margin-top: 42px;
  }

  .personality-card,
  .personality-card-featured {
    padding: 22px;
  }

  .media-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .media-item span {
    font-size: 12px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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