:root {
  color-scheme: dark;
  --bg: #080b0f;
  --panel: rgba(16, 23, 32, .88);
  --panel-strong: rgba(10, 15, 22, .94);
  --ink: #eef7f8;
  --muted: #9aaab3;
  --subtle: #667883;
  --line: rgba(132, 214, 220, .22);
  --line-strong: rgba(132, 214, 220, .42);
  --cyan: #58e1ef;
  --teal: #35c799;
  --amber: #e1a94f;
  --coral: #e66c62;
  --violet: #a698ff;
  --shadow: 0 22px 60px rgba(0, 0, 0, .34);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(rgba(88, 225, 239, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 225, 239, .04) 1px, transparent 1px),
    linear-gradient(135deg, #080b0f 0%, #111820 42%, #0b1111 72%, #080b0f 100%);
  background-size: 34px 34px, 34px 34px, 100% 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 20%, rgba(88, 225, 239, .09) 20.1% 20.32%, transparent 20.45% 58%, rgba(225, 169, 79, .09) 58.1% 58.35%, transparent 58.5%),
    repeating-linear-gradient(90deg, transparent 0 88px, rgba(255, 255, 255, .025) 88px 89px);
  opacity: .9;
}

a {
  color: inherit;
}

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

.site-header,
main {
  width: min(var(--max), calc(100vw - 40px));
  margin-inline: auto;
}

.site-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 28px 0 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--cyan);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .1em;
}

.brand::before {
  content: "";
  width: 28px;
  height: 28px;
  border: 1px solid var(--cyan);
  background: linear-gradient(135deg, rgba(88, 225, 239, .24), rgba(53, 199, 153, .08));
  clip-path: polygon(50% 0, 100% 28%, 100% 72%, 50% 100%, 0 72%, 0 28%);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 36px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 12, 18, .74);
}

.language-switch button {
  min-width: 48px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.language-switch button[aria-pressed="true"] {
  color: #061116;
  background: var(--cyan);
}

.mail-link,
.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.mail-link {
  padding: 8px 12px;
  border: 1px solid rgba(88, 225, 239, .38);
  background: rgba(88, 225, 239, .08);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 22px;
  align-items: stretch;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.section-band {
  min-height: 560px;
}

.hero-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 530px;
  overflow: hidden;
  padding: 34px;
  border: 1px solid rgba(88, 225, 239, .28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(16, 23, 32, .90), rgba(8, 12, 18, .96)),
    linear-gradient(90deg, rgba(88, 225, 239, .10), transparent 44%);
  box-shadow: var(--shadow);
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: 34px;
  bottom: 28px;
  width: 260px;
  height: 170px;
  border: 1px solid rgba(88, 225, 239, .14);
  background:
    linear-gradient(90deg, rgba(88, 225, 239, .50), transparent 2px),
    linear-gradient(rgba(88, 225, 239, .34), transparent 2px);
  background-size: 26px 26px;
  transform: perspective(600px) rotateX(58deg) rotateZ(-16deg);
  opacity: .34;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(48px, 8vw, 96px);
  line-height: .92;
  letter-spacing: 0;
}

.role {
  max-width: 820px;
  margin: 20px 0 0;
  color: #dff5f7;
  font-size: 31px;
  font-weight: 850;
  line-height: 1.2;
}

.summary {
  max-width: 800px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.72;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.primary-action {
  padding: 0 16px;
  color: #061116;
  border: 1px solid var(--cyan);
  background: var(--cyan);
}

.secondary-action {
  padding: 0 16px;
  color: var(--ink);
  border: 1px solid rgba(225, 169, 79, .45);
  background: rgba(225, 169, 79, .10);
  cursor: pointer;
}

.identity-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 530px;
  padding: 14px;
  border: 1px solid rgba(88, 225, 239, .26);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.headshot {
  display: block;
  width: 100%;
  height: 365px;
  object-fit: cover;
  object-position: center top;
  border-radius: 6px;
  filter: saturate(.9) contrast(1.04);
}

.identity-mark {
  display: grid;
  place-items: center;
  min-height: 360px;
  border: 1px solid rgba(225, 169, 79, .35);
  border-radius: 8px;
  color: var(--amber);
  background:
    linear-gradient(135deg, rgba(225, 169, 79, .16), rgba(88, 225, 239, .05)),
    rgba(255, 255, 255, .03);
  font-size: 92px;
  font-weight: 900;
}

html[data-view="zh"] .en-only { display: none; }
html[data-view="en"] .zh-only { display: none; }
html[data-view="en"] .identity-panel { align-content: center; }

.identity-meta {
  display: grid;
  gap: 9px;
}

.identity-meta span {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(126, 147, 165, .22);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, .035);
  font-size: 13px;
  line-height: 1.35;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.metrics article,
.module {
  border: 1px solid rgba(126, 147, 165, .22);
  border-radius: 8px;
  background: rgba(12, 18, 26, .78);
  box-shadow: 0 14px 42px rgba(0, 0, 0, .20);
}

.metrics article {
  min-height: 108px;
  padding: 16px;
}

.metrics b {
  display: block;
  margin-bottom: 9px;
  color: var(--cyan);
  font-size: 25px;
  line-height: 1;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.content-grid.lower {
  margin-bottom: 48px;
}

.module {
  padding: 24px;
}

.module.wide {
  margin-top: 22px;
}

.module h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  color: var(--cyan);
  font-size: 18px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.module h2::before {
  content: "";
  width: 11px;
  height: 11px;
  background: var(--cyan);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.timeline-item {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 16px 0;
  border-top: 1px solid rgba(126, 147, 165, .18);
}

.timeline-item:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.timeline-item time {
  color: var(--amber);
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}

.timeline-item h3 {
  margin: 0 0 8px;
  color: #dff5f7;
  font-size: 17px;
  line-height: 1.3;
}

.timeline-item p,
.module > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.64;
}

.timeline-item strong {
  color: var(--ink);
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.skill-grid span {
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(88, 225, 239, .20);
  border-radius: 7px;
  color: #d9f7fa;
  background: rgba(88, 225, 239, .06);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.25;
}

.skill-grid span:nth-child(3n) {
  border-color: rgba(53, 199, 153, .25);
  background: rgba(53, 199, 153, .055);
}

.skill-grid span:nth-child(5n) {
  border-color: rgba(225, 169, 79, .24);
  background: rgba(225, 169, 79, .055);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 14px;
  border: 1px solid rgba(53, 199, 153, .42);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(8, 13, 18, .94);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

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

:focus-visible {
  outline: 3px solid rgba(225, 169, 79, .86);
  outline-offset: 3px;
}

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

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .identity-panel {
    min-height: auto;
  }

  .headshot {
    height: 420px;
    object-position: center 18%;
  }

  .identity-mark {
    min-height: 260px;
  }
}

@media (max-width: 860px) {
  .content-grid,
  .metrics,
  .skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .timeline-item strong {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .site-header,
  .hero,
  .content-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .site-header {
    width: min(var(--max), calc(100vw - 24px));
    padding-top: 18px;
  }

  main {
    width: min(var(--max), calc(100vw - 24px));
  }

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

  .hero-copy {
    min-height: auto;
    padding: 24px;
  }

  .hero-copy::after {
    width: 180px;
    height: 112px;
    right: 16px;
    bottom: 18px;
    opacity: .24;
  }

  h1 {
    font-size: clamp(44px, 18vw, 72px);
  }

  .role {
    font-size: 24px;
  }

  .summary {
    font-size: 15px;
  }

  .headshot {
    height: 360px;
  }

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

  .mail-link,
  .primary-action,
  .secondary-action {
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .site-header {
    gap: 14px;
  }

  .header-actions,
  .hero-actions {
    width: 100%;
  }

  .language-switch,
  .mail-link,
  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .language-switch button {
    flex: 1;
  }

  .module,
  .identity-panel {
    padding: 16px;
  }
}
