:root {
  --bg: #f6f3ee;
  --bg-strong: #fbfaf7;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(28, 30, 36, 0.09);
  --text: #13161c;
  --muted: #5f6672;
  --accent: #365f8f;
  --shadow: 0 18px 46px rgba(25, 29, 35, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(54, 95, 143, 0.08), transparent 26%),
    radial-gradient(circle at right 12%, rgba(138, 90, 53, 0.07), transparent 24%),
    linear-gradient(180deg, var(--bg-strong) 0%, var(--bg) 100%);
  font-family: "Manrope", "Noto Sans SC", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(19, 22, 28, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 22, 28, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.22), transparent 78%);
}

.ambient {
  position: fixed;
  width: 32vw;
  height: 32vw;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
  animation: drift 18s ease-in-out infinite alternate;
}

.ambient-left {
  top: -8vw;
  left: -10vw;
  background: rgba(54, 95, 143, 0.16);
}

.ambient-right {
  right: -10vw;
  top: 16vh;
  background: rgba(138, 90, 53, 0.12);
  animation-duration: 22s;
}

.site-shell {
  position: relative;
  z-index: 1;
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 72px;
}

.topbar,
.hero,
.section,
.support-dialog {
  backdrop-filter: blur(18px);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(19, 22, 28, 0.08);
  box-shadow: 0 8px 24px rgba(25, 29, 35, 0.08);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 14px;
  letter-spacing: 0.04em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 12px;
}

.language-nav {
  display: inline-flex;
  justify-self: center;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(19, 22, 28, 0.04);
}

.lang-pill {
  min-width: 72px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}

.lang-pill.active {
  background: var(--text);
  color: #fff;
}

.top-actions {
  justify-self: end;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.top-actions a,
.button,
.support-button,
.linked-stack a {
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.top-actions a {
  color: var(--text);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
}

.top-actions a:hover,
.button:hover,
.support-button:hover,
.linked-stack a:hover {
  transform: translateY(-1px);
}

.content {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.hero,
.section {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.92fr);
  gap: 24px;
  padding: 32px;
}

.eyebrow,
.section-tag,
.stage-label,
.modal-tag {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1,
.section h2,
.support-dialog h3 {
  margin: 12px 0 0;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero h1,
.section h2 {
  font-family: "Source Serif 4", "Noto Serif SC", serif;
}

body[data-page-lang="zh"] .hero h1,
body[data-page-lang="zh"] .section h2 {
  font-family: "Noto Serif SC", serif;
  letter-spacing: -0.02em;
}

.hero h1 {
  max-width: 13ch;
  font-size: clamp(34px, 4.7vw, 56px);
}

.hero-lead,
.card p,
.timeline-item p,
.support-copy p,
.support-dialog p {
  color: var(--muted);
  line-height: 1.82;
}

.hero-lead {
  max-width: 58ch;
  margin: 18px 0 0;
  font-size: 16px;
}

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

.hero-notes div {
  padding: 14px 16px;
  border-left: 2px solid rgba(54, 95, 143, 0.24);
  background: rgba(255, 255, 255, 0.3);
}

.hero-notes span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.hero-notes strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
}

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

.button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

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

.button.secondary {
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.hero-stage {
  display: grid;
  align-items: stretch;
}

.stage-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 18% 18%, rgba(54, 95, 143, 0.08), transparent 22%),
    radial-gradient(circle at 78% 32%, rgba(138, 90, 53, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(248, 247, 244, 0.94));
}

.stage-profile {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.stage-avatar {
  width: 72px;
  height: 72px;
  display: block;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid rgba(19, 22, 28, 0.08);
}

.stage-profile strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.stage-profile small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.hero-canvas {
  width: 100%;
  height: auto;
  min-height: 300px;
  border-radius: 18px;
  border: 1px solid rgba(19, 22, 28, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 248, 245, 0.88));
}

.stage-tags,
.support-actions,
.project-meta,
.linked-stack {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stage-tags span,
.project-meta span,
.linked-stack a {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.linked-stack a {
  color: var(--text);
  text-decoration: none;
}

.section {
  padding: 28px;
}

.section-grid {
  display: grid;
  gap: 20px;
}

.section-head h2 {
  max-width: 24ch;
  font-size: clamp(24px, 3.2vw, 34px);
}

.grid-cards,
.project-layout,
.metric-grid {
  display: grid;
  gap: 16px;
}

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

.project-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}

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

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

.card,
.timeline-item {
  padding: 18px 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.54);
}

.card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.card strong,
.timeline-item h3 {
  display: block;
  margin-top: 10px;
  font-size: 17px;
  line-height: 1.5;
}

.metric-card strong {
  line-height: 1.6;
}

.card p,
.timeline-item p {
  margin: 12px 0 0;
}

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

.timeline-item {
  position: relative;
  padding-left: 24px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 24px;
  bottom: 24px;
  width: 1px;
  background: rgba(54, 95, 143, 0.18);
}

.timeline-item::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 24px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(54, 95, 143, 0.78);
  box-shadow: 0 0 0 6px rgba(54, 95, 143, 0.09);
}

.support-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.support-copy h2 {
  max-width: none;
}

.support-copy p {
  margin-top: 14px;
  max-width: 44ch;
}

.support-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.support-button img {
  width: 20px;
  height: 20px;
}

.support-modal[hidden] {
  display: none;
}

.support-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 50;
}

.support-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 24, 0.48);
}

.support-dialog {
  position: relative;
  width: min(460px, calc(100% - 24px));
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 72px rgba(12, 14, 20, 0.22);
}

.support-dialog h3 {
  font-size: 28px;
}

.support-dialog img {
  width: 100%;
  display: block;
  margin-top: 18px;
  border-radius: 18px;
  border: 1px solid rgba(19, 22, 28, 0.08);
}

.support-dialog p:last-child {
  margin: 14px 0 0;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(19, 22, 28, 0.08);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}

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

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

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(32px, 22px, 0) scale(1.08);
  }
}

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

  .language-nav,
  .top-actions {
    justify-self: start;
  }

  .grid-cards,
  .project-layout,
  .project-layout-wide,
  .metric-grid,
  .hero-notes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(var(--max-width), calc(100% - 20px));
    padding-top: 16px;
  }

  .topbar,
  .hero,
  .section,
  .support-dialog {
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(30px, 12vw, 46px);
  }

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

  .hero-canvas {
    min-height: 240px;
  }

  .top-actions {
    gap: 8px;
  }

  .top-actions a,
  .support-button,
  .button {
    width: 100%;
    justify-content: center;
  }

  .hero-actions,
  .support-actions {
    display: grid;
  }

  .stage-profile {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .stage-avatar {
    width: 60px;
    height: 60px;
  }
}
