:root {
  --ink: #0d1218;
  --stone: #1d252c;
  --ridge: #2f3b44;
  --mist: #e8eef2;
  --paper: #f8fbfc;
  --muted: #b8c4ca;
  --quiet: #7e8e96;
  --ice: #bfe7ef;
  --moss: #9db27c;
  --amber: #d9a85c;
  --line: rgba(248, 251, 252, 0.18);
  --line-strong: rgba(191, 231, 239, 0.42);
  --panel: rgba(13, 18, 24, 0.58);
  --panel-strong: rgba(13, 18, 24, 0.76);
  --shadow: 0 30px 90px rgba(5, 10, 14, 0.46);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  font-family: "Bahnschrift", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--ink);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -5;
  content: "";
  background-image: url("./assets/alpine-bg.jpg");
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -4;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 11, 14, 0.82) 0%, rgba(13, 18, 24, 0.48) 44%, rgba(13, 18, 24, 0.28) 100%),
    linear-gradient(180deg, rgba(232, 238, 242, 0.08) 0%, rgba(8, 13, 17, 0.22) 45%, rgba(6, 9, 12, 0.88) 100%);
}

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

button {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.mountain-backdrop {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(circle at 76% 18%, rgba(248, 251, 252, 0.26), transparent 24%),
    radial-gradient(circle at 22% 28%, rgba(232, 238, 242, 0.12), transparent 30%),
    linear-gradient(120deg, rgba(191, 231, 239, 0.06), transparent 42%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 16px);
  mix-blend-mode: screen;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.11;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 0, 0, 0.22) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
}

.site-header {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0;
}

.brand-mark {
  border: 1px solid var(--line);
  background: rgba(13, 18, 24, 0.58);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 8px;
  overflow: hidden;
}

.brand-mark img {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.42));
}

.brand-mark span {
  color: var(--paper);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.tab-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  min-height: 48px;
}

.btn {
  cursor: pointer;
}

.tab-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0;
  color: rgba(248, 251, 252, 0.78);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  transition: color 180ms ease, transform 180ms ease;
}

.tab-link::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  content: "";
  background: var(--ice);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 180ms ease;
}

.tab-link:hover,
.tab-link.is-active {
  color: var(--paper);
  transform: translateY(-1px);
}

.tab-link.is-active::after {
  transform: scaleX(1);
}

.tab-panel {
  display: block;
  min-height: calc(100vh - 80px);
  padding-bottom: 88px;
  scroll-margin-top: 24px;
}

.hero-section,
.section-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 420px);
  gap: 42px;
  align-items: center;
  min-height: calc(100vh - 86px);
  padding: 42px 0 56px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--ice);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-title,
.section-title,
.project-feature h3,
.project-card h3,
.identity-card h3,
.stack-block h3,
.experience-item h3,
.phase h3,
.contact-panel h2 {
  font-family: "Bahnschrift", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-weight: 800;
  letter-spacing: 0;
}

.hero-title {
  margin: 0;
  max-width: 850px;
  font-size: clamp(54px, 8.2vw, 112px);
  line-height: 0.96;
  text-transform: uppercase;
}

.hero-title span {
  display: block;
  margin-top: 18px;
  color: var(--ice);
  font-size: clamp(34px, 4.8vw, 60px);
  text-transform: none;
}

.hero-lead {
  max-width: 760px;
  margin: 28px 0 0;
  color: rgba(248, 251, 252, 0.82);
  font-size: 17px;
  line-height: 1.86;
}

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

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  max-width: 100%;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--paper);
  background: rgba(248, 251, 252, 0.08);
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.btn:hover {
  border-color: var(--ice);
  transform: translateY(-2px);
}

.btn.primary {
  color: var(--ink);
  background: var(--ice);
  border-color: var(--ice);
  box-shadow: 0 18px 42px rgba(191, 231, 239, 0.18);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--ink);
  background: var(--paper);
  font-weight: 800;
}

.btn.primary .btn-icon {
  color: var(--paper);
  background: var(--ink);
}

.quick-facts,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.quick-facts span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(248, 251, 252, 0.18);
  border-radius: 8px;
  color: rgba(248, 251, 252, 0.78);
  background: rgba(13, 18, 24, 0.48);
  font-size: 13px;
}

.summit-panel,
.identity-card,
.project-card,
.stack-block,
.phase,
.contact-panel,
.project-feature {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summit-panel {
  position: relative;
  padding: 22px;
  overflow: hidden;
}

.summit-panel::before,
.project-feature::before,
.contact-panel::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(248, 251, 252, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(248, 251, 252, 0.045) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(135deg, black, transparent 72%);
  pointer-events: none;
}

.panel-topline {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 800;
}

.panel-topline strong {
  color: var(--ice);
}

.summit-card {
  position: relative;
  z-index: 2;
  padding: 68px 0 24px;
}

.summit-mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink);
  background: var(--ice);
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.24);
}

.summit-card h2 {
  max-width: 320px;
  margin: 24px 0 12px;
  font-size: 32px;
  line-height: 1.12;
}

.summit-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.signal-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.signal-grid div {
  min-height: 84px;
  padding: 14px;
  border: 1px solid rgba(248, 251, 252, 0.14);
  border-radius: 8px;
  background: rgba(8, 13, 17, 0.4);
}

.signal-grid strong {
  display: block;
  color: var(--paper);
  font-size: 18px;
}

.signal-grid span {
  display: block;
  margin-top: 8px;
  color: var(--quiet);
  font-size: 12px;
}

.metrics-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(13, 18, 24, 0.54);
  backdrop-filter: blur(16px);
}

.metric {
  min-height: 128px;
  padding: 26px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric strong {
  display: block;
  color: var(--ice);
  font-size: 42px;
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.section-shell {
  padding: 76px 0 0;
}

#profile .section-shell {
  padding-top: 22px;
}

.section-heading {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 34px;
}

.section-title,
.contact-panel h2 {
  margin: 0;
  font-size: clamp(31px, 4.2vw, 54px);
  line-height: 1.08;
}

.identity-grid,
.project-grid,
.stack-grid {
  display: grid;
  gap: 16px;
}

.identity-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.identity-card,
.project-card,
.stack-block,
.phase {
  padding: 24px;
}

.card-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ice);
  font-weight: 800;
}

.identity-card h3,
.project-card h3,
.project-feature h3,
.phase h3,
.stack-block h3,
.experience-item h3 {
  margin: 22px 0 12px;
  font-size: 22px;
  line-height: 1.3;
}

.identity-card p,
.project-card p,
.project-feature p,
.phase p,
.stack-block li,
.experience-item p,
.contact-panel p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.project-feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.8fr);
  gap: 24px;
  align-items: stretch;
  min-height: 430px;
  padding: 26px;
  overflow: hidden;
}

.project-copy {
  position: relative;
  z-index: 2;
}

.project-kicker {
  margin: 0;
  color: var(--amber);
  font-size: 13px;
  font-weight: 800;
}

.project-feature h3 {
  margin-top: 16px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.02;
}

.system-map {
  position: relative;
  z-index: 2;
  min-height: 340px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(248, 251, 252, 0.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(248, 251, 252, 0.04) 1px, transparent 1px),
    rgba(8, 13, 17, 0.44);
  background-size: 34px 34px;
  overflow: hidden;
}

.system-map svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.system-map path {
  fill: none;
  stroke: rgba(191, 231, 239, 0.44);
  stroke-width: 1.5;
  stroke-dasharray: 7 7;
  animation: dash 12s linear infinite;
}

.node {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 106px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(248, 251, 252, 0.22);
  border-radius: 8px;
  color: var(--paper);
  background: rgba(13, 18, 24, 0.84);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.node-core {
  left: 50%;
  top: 50%;
  color: var(--ink);
  background: var(--ice);
  border-color: var(--ice);
  transform: translate(-50%, -50%);
}

.node:nth-of-type(2) {
  left: 24px;
  top: 34px;
}

.node:nth-of-type(3) {
  right: 24px;
  top: 34px;
}

.node:nth-of-type(4) {
  left: 24px;
  bottom: 34px;
}

.node:nth-of-type(5) {
  right: 24px;
  bottom: 34px;
}

.node:nth-of-type(6) {
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
}

.project-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.project-card {
  min-height: 342px;
}

.phase-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 42px;
}

.phase-timeline::before {
  position: absolute;
  left: 0;
  right: 0;
  top: 22px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, var(--ice), var(--moss), var(--amber), var(--ice));
}

.phase {
  position: relative;
  min-height: 236px;
  padding-top: 58px;
}

.phase::before {
  position: absolute;
  left: 22px;
  top: 15px;
  width: 14px;
  height: 14px;
  content: "";
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--ice);
  box-shadow: 0 0 0 1px rgba(191, 231, 239, 0.44), 0 0 28px rgba(191, 231, 239, 0.22);
}

.phase span {
  color: var(--amber);
  font-size: 13px;
  font-weight: 800;
}

.phase h3 {
  margin-top: 12px;
}

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

.stack-block ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.stack-block li::marker {
  color: var(--ice);
}

.experience-list {
  display: grid;
  gap: 12px;
}

.experience-item {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.experience-item time {
  color: var(--ice);
  font-size: 16px;
  font-weight: 800;
}

.experience-item h3 {
  margin: 0 0 8px;
}

.experience-item p {
  margin: 0;
}

.contact-section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 76px 0 0;
}

.contact-panel {
  position: relative;
  padding: 42px;
  overflow: hidden;
}

.contact-panel > * {
  position: relative;
  z-index: 2;
}

.contact-panel p {
  max-width: 760px;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 650ms ease, transform 650ms ease;
}

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

.click-ripple {
  position: fixed;
  z-index: 50;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(191, 231, 239, 0.7);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: clickRipple 620ms ease-out forwards;
}

.delay-1 {
  transition-delay: 100ms;
}

.delay-2 {
  transition-delay: 190ms;
}

.delay-3 {
  transition-delay: 280ms;
}

@keyframes dash {
  to {
    stroke-dashoffset: -140;
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes clickRipple {
  from {
    opacity: 0.75;
    transform: translate(-50%, -50%) scale(0.6);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(8);
  }
}

@media (max-width: 980px) {
  .hero-section,
  .project-feature {
    grid-template-columns: 1fr;
  }

  .hero-section {
    min-height: auto;
  }

  .summit-panel {
    max-width: 540px;
  }

  .metrics-band,
  .identity-grid,
  .project-grid,
  .phase-timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .phase-timeline::before {
    display: none;
  }
}

@media (max-width: 720px) {
  body::before {
    background-position: 56% center;
  }

  .site-header {
    position: relative;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 0;
  }

  .brand-mark {
    justify-content: center;
  }

  .tab-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .tab-link {
    min-width: 0;
    padding: 0 4px;
    font-size: 13px;
  }

  .hero-section,
  .section-shell,
  .metrics-band,
  .contact-section {
    width: min(100% - 24px, 1180px);
  }

  .hero-title {
    font-size: 44px;
  }

  .hero-title span {
    font-size: 31px;
  }

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

  .metrics-band,
  .identity-grid,
  .project-grid,
  .phase-timeline,
  .stack-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric:last-child {
    border-bottom: 0;
  }

  .section-shell,
  .contact-section {
    padding-top: 48px;
  }

  .project-feature,
  .contact-panel {
    padding: 22px;
  }

  .system-map {
    min-height: 320px;
  }

  .experience-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .contact-actions .btn {
    width: 100%;
    justify-content: flex-start;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 420px) {
  .btn {
    width: 100%;
  }

  .quick-facts span,
  .tag-row span {
    width: 100%;
  }

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

  .node {
    min-width: 94px;
    padding: 0 8px;
    font-size: 12px;
  }

  .node:nth-of-type(4) {
    left: 22px;
    bottom: 78px;
  }

  .node:nth-of-type(5) {
    right: 22px;
    bottom: 78px;
  }

  .node:nth-of-type(6) {
    bottom: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
