:root {
  color-scheme: light;
  --bg: #edf0eb;
  --paper: #fbfaf4;
  --paper-2: #f2f0e7;
  --ink: #101817;
  --muted: #626b67;
  --line: rgba(16, 24, 23, 0.13);
  --accent: #a75b42;
  --accent-2: #0d6a61;
  --deep: #0b1211;
  --deep-2: #141f1d;
  --white: #fffdf7;
  --shadow: 0 24px 70px rgba(13, 26, 23, 0.12);
  --soft-shadow: 0 12px 36px rgba(13, 26, 23, 0.08);
  --radius: 8px;
  --max: 1160px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b100f;
  --paper: #151b19;
  --paper-2: #101614;
  --ink: #f4f0e8;
  --muted: #aeb7b2;
  --line: rgba(244, 240, 232, 0.14);
  --accent: #e17a59;
  --accent-2: #63d8ca;
  --deep: #060908;
  --deep-2: #101917;
  --white: #fffaf0;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --soft-shadow: 0 12px 36px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(16, 24, 23, 0.045) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(180deg, #dfe5df 0, var(--bg) 760px);
  font-family: "Segoe UI", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  line-height: 1.68;
}

body.menu-open {
  overflow: hidden;
}

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

button,
input,
textarea {
  font: inherit;
}

.site-header {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 20;
  width: min(calc(100% - 32px), var(--max));
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 12px 10px 16px;
  border: 1px solid rgba(255, 253, 247, 0.15);
  border-radius: var(--radius);
  background: rgba(11, 18, 17, 0.82);
  color: var(--white);
  box-shadow: 0 18px 50px rgba(3, 8, 7, 0.24);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.brand,
.nav,
.header-actions,
.hero-actions,
.site-footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 253, 247, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--white);
  font-size: 13px;
}

.nav {
  gap: clamp(12px, 2vw, 26px);
  color: rgba(255, 253, 247, 0.74);
  font-size: 14px;
}

.nav a {
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--white);
}

.header-actions {
  gap: 8px;
}

.icon-button,
.menu-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 253, 247, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.07);
  color: var(--white);
  cursor: pointer;
}

.moon {
  display: none;
}

[data-theme="dark"] .sun {
  display: none;
}

[data-theme="dark"] .moon {
  display: inline;
}

.menu-button {
  display: none;
  gap: 4px;
}

.menu-button span {
  width: 18px;
  height: 2px;
  background: currentColor;
}

.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: end;
  gap: 32px;
  padding: 136px max(24px, calc((100vw - var(--max)) / 2)) 76px;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 18%, rgba(99, 216, 202, 0.14), transparent 30rem),
    radial-gradient(circle at 82% 72%, rgba(167, 91, 66, 0.18), transparent 30rem),
    var(--deep);
  color: var(--white);
}

.hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.34;
  background:
    linear-gradient(90deg, rgba(255, 253, 247, 0.08) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(rgba(255, 253, 247, 0.08) 1px, transparent 1px) 0 0 / 56px 56px;
  mask-image: linear-gradient(90deg, black, transparent 82%);
}

.hero::after {
  content: "01 / CHEN HAO";
  position: absolute;
  right: max(24px, calc((100vw - var(--max)) / 2));
  top: 132px;
  color: rgba(255, 253, 247, 0.24);
  font-size: clamp(42px, 8vw, 112px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.9;
}

.hero-content,
.signal-panel {
  position: relative;
  z-index: 2;
}

.hero-content {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #d7a073;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: "Microsoft YaHei UI", "Noto Sans SC", "Segoe UI", sans-serif;
  font-weight: 850;
  letter-spacing: 0;
}

h1 {
  max-width: 920px;
  margin-bottom: 24px;
  font-size: clamp(44px, 6.2vw, 82px);
  line-height: 1.04;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
}

h3 {
  margin-bottom: 12px;
  font-size: 23px;
  line-height: 1.22;
}

.hero-copy {
  max-width: 720px;
  color: rgba(255, 253, 247, 0.78);
  font-size: 18px;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 850;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

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

.button.primary {
  background: var(--accent);
  color: var(--white);
}

.button.secondary {
  border-color: rgba(255, 253, 247, 0.28);
  background: rgba(255, 253, 247, 0.07);
  color: var(--white);
}

.signal-panel {
  display: grid;
  gap: 1px;
  border: 1px solid rgba(255, 253, 247, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.11);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.signal-row {
  padding: 22px;
  background: rgba(10, 18, 17, 0.34);
}

.signal-row span {
  display: block;
  color: rgba(255, 253, 247, 0.54);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.signal-row strong {
  display: block;
  margin-top: 8px;
  font-size: 17px;
  word-break: break-word;
}

.section {
  width: min(calc(100% - 44px), var(--max));
  margin: 0 auto;
  padding: 92px 0;
}

.metrics-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--soft-shadow);
  transform: translateY(-34px);
  overflow: hidden;
}

.metric {
  min-height: 132px;
  padding: 26px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper), var(--paper-2));
}

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

.metric strong {
  display: block;
  color: var(--accent-2);
  font-size: clamp(30px, 4.4vw, 48px);
  line-height: 1;
}

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

.split {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: clamp(36px, 6vw, 76px);
  align-items: start;
}

.section-heading {
  position: sticky;
  top: 112px;
}

.section-heading h2 {
  max-width: 8em;
}

.profile-panel,
.stack-card,
.project-card,
.role-card,
.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--soft-shadow);
}

.profile-panel {
  padding: clamp(28px, 4vw, 44px);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-2) 8%, transparent), transparent 38%),
    var(--paper);
}

.lead {
  color: var(--ink);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.72;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 30px;
}

.profile-grid div {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper-2) 70%, transparent);
}

.profile-grid span,
.role-card span {
  display: block;
  margin-bottom: 9px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-grid p,
.stack-card p,
.project-card span,
.role-card p,
.timeline-item p,
.contact-card p {
  color: var(--muted);
}

.stack-grid,
.project-grid,
.role-grid {
  display: grid;
  gap: 18px;
}

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

.stack-card,
.project-card,
.role-card {
  min-height: 248px;
  padding: 26px;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.stack-card:hover,
.project-card:hover,
.role-card:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.stack-card span {
  display: inline-grid;
  width: 34px;
  height: 34px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--deep-2);
  color: var(--white);
  font-size: 12px;
  font-weight: 900;
}

.capability-map {
  display: grid;
  gap: 28px;
  padding: 74px 0;
}

.map-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.map-flow {
  display: grid;
  grid-template-columns: 1fr 34px 1fr 34px 1fr 34px 1fr;
  align-items: stretch;
}

.map-flow div {
  min-height: 150px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--soft-shadow);
}

.map-flow b {
  display: block;
  margin-bottom: 18px;
  color: var(--accent-2);
  font-size: 20px;
}

.map-flow span {
  color: var(--muted);
}

.map-flow i {
  position: relative;
}

.map-flow i::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 6px;
  right: 6px;
  height: 1px;
  background: var(--accent);
}

.map-flow i::after {
  content: "";
  position: absolute;
  top: calc(50% - 4px);
  right: 5px;
  width: 8px;
  height: 8px;
  border-top: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  transform: rotate(45deg);
}

.project-grid,
.role-grid {
  grid-template-columns: repeat(3, 1fr);
}

.project-card p,
.article-row time,
.timeline-item time {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.timeline {
  display: grid;
  border-top: 1px solid var(--line);
}

.timeline-item {
  position: relative;
  padding: 30px 0 30px 38px;
  border-bottom: 1px solid var(--line);
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 38px;
  left: 0;
  width: 13px;
  height: 13px;
  border: 3px solid var(--accent-2);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent-2) 10%, transparent);
}

.article-list {
  border-top: 1px solid var(--line);
}

.article-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 24px;
  align-items: center;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
}

.article-row span {
  font-size: clamp(18px, 2.6vw, 26px);
  font-weight: 750;
  line-height: 1.28;
}

.article-row b {
  color: var(--accent-2);
  font-size: 14px;
}

.contact-section {
  width: 100%;
  padding-left: max(20px, calc((100vw - var(--max)) / 2));
  padding-right: max(20px, calc((100vw - var(--max)) / 2));
  background:
    linear-gradient(135deg, rgba(167, 91, 66, 0.16), transparent 28rem),
    var(--deep);
}

.contact-card {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 38px;
  padding: clamp(28px, 5vw, 58px);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.button.light {
  border-color: var(--line);
  background: var(--paper-2);
  color: var(--ink);
}

.site-footer {
  justify-content: space-between;
  width: min(calc(100% - 44px), var(--max));
  margin: 0 auto;
  padding: 30px 0;
  color: var(--muted);
  font-size: 14px;
}

.site-footer a {
  color: var(--accent-2);
  font-weight: 900;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

@media (max-width: 980px) {
  .nav {
    position: fixed;
    top: 88px;
    right: 16px;
    left: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    box-shadow: var(--shadow);
  }

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

  .nav a {
    padding: 12px;
  }

  .menu-button {
    display: grid;
  }

  .hero,
  .split,
  .contact-card {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 100vh;
  }

  .signal-panel {
    max-width: 500px;
  }

  .section-heading {
    position: static;
  }

  .metrics-band,
  .stack-grid,
  .project-grid,
  .role-grid,
  .profile-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .map-flow {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .map-flow i {
    display: none;
  }

  .metric:nth-child(2) {
    border-right: 0;
  }
}

@media (max-width: 640px) {
  .site-header {
    top: 10px;
    width: min(calc(100% - 20px), var(--max));
    min-height: 58px;
  }

  .brand-text {
    display: none;
  }

  .hero {
    padding: 106px 20px 46px;
  }

  .hero::after {
    display: none;
  }

  h1 {
    font-size: clamp(38px, 13vw, 54px);
  }

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

  .section {
    width: min(calc(100% - 28px), var(--max));
    padding: 68px 0;
  }

  .metrics-band,
  .stack-grid,
  .project-grid,
  .role-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

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

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

  .article-row {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 20px 0;
  }

  .contact-section {
    padding-left: 14px;
    padding-right: 14px;
  }

  .contact-actions {
    justify-content: flex-start;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}
