:root {
  --bg: #f8f5ef;
  --paper: #fffdf8;
  --ink: #171717;
  --muted: #68645f;
  --line: rgba(23, 23, 23, 0.12);
  --cyan: #00a8c8;
  --red: #ef4f3a;
  --green: #3aa76d;
  --gold: #d6a846;
  --shadow: 0 26px 80px rgba(23, 23, 23, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(23, 23, 23, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(23, 23, 23, 0.035) 1px, transparent 1px), var(--bg);
  background-size: 42px 42px;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  line-height: 1.6;
}

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

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

.cursor-light {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    420px circle at var(--x, 50%) var(--y, 20%),
    rgba(214, 168, 70, 0.13),
    rgba(0, 168, 200, 0.06) 38%,
    transparent 68%
  );
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.78);
  backdrop-filter: blur(18px);
}

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

.brand {
  gap: 10px;
  padding: 4px 12px 4px 4px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--paper);
  background: var(--ink);
}

.nav-links {
  gap: 4px;
}

.header-actions {
  gap: 8px;
}

.nav-links a {
  min-width: 70px;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  transition:
    color 180ms ease,
    background 180ms ease;
}

.nav-links a:hover {
  color: var(--ink);
  background: rgba(23, 23, 23, 0.07);
}

.language-toggle {
  min-width: 64px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(23, 23, 23, 0.16);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.9);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.language-toggle:hover {
  border-color: rgba(23, 23, 23, 0.34);
  background: var(--paper);
  transform: translateY(-1px);
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.88fr);
  gap: 52px;
  align-items: center;
  min-height: calc(100svh - 74px);
  padding: 64px 0 48px;
}

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

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

h1 {
  max-width: 720px;
  margin-bottom: 24px;
  font-size: clamp(46px, 7.2vw, 88px);
  line-height: 1;
  letter-spacing: 0;
}

.identity-lockup {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 24px);
  margin-bottom: 24px;
}

.identity-lockup h1 {
  margin-bottom: 0;
}

.profile-avatar {
  width: clamp(76px, 9vw, 118px);
  height: clamp(76px, 9vw, 118px);
  flex: 0 0 auto;
  border: 1px solid rgba(23, 23, 23, 0.13);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 18px 46px rgba(23, 23, 23, 0.11);
  object-fit: cover;
}

.hero-subtitle {
  max-width: 700px;
  margin-bottom: 18px;
  color: var(--ink);
  font-size: clamp(24px, 3.2vw, 38px);
  font-weight: 800;
  line-height: 1.12;
}

h2 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 28px;
  line-height: 1.12;
}

.hero-text {
  max-width: 650px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 18px;
}

.education-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 650px;
  margin-bottom: 30px;
}

.education-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 12px 14px;
  border: 1px solid rgba(23, 23, 23, 0.11);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.68);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.education-card:hover {
  border-color: rgba(23, 23, 23, 0.28);
  background: var(--paper);
  transform: translateY(-2px);
}

.education-card img {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  object-fit: contain;
}

.education-card .education-logo-wide {
  width: 76px;
  height: 28px;
}

.education-card span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.education-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

.education-card strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.2;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-weight: 800;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

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

.button-primary {
  color: var(--paper);
  background: var(--ink);
  box-shadow: 8px 8px 0 var(--gold);
}

.button-ghost {
  background: rgba(255, 253, 248, 0.62);
}

.hero-visual {
  position: relative;
  isolation: isolate;
  min-height: 540px;
  border: 1px solid rgba(23, 23, 23, 0.09);
  border-radius: 18px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 30px 90px rgba(23, 23, 23, 0.1);
}

.hero-visual::before {
  position: absolute;
  inset: 18px;
  z-index: -1;
  border: 1px solid rgba(23, 23, 23, 0.055);
  border-radius: 12px;
  content: "";
}

.hero-visual img {
  width: 100%;
  height: 100%;
  min-height: 540px;
  object-fit: cover;
}

.about,
.work,
.contact {
  padding: 76px 0;
}

.section-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 28px;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: stretch;
}

.intro-panel {
  min-height: 250px;
  padding: clamp(26px, 5vw, 44px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
}

.intro-panel p {
  margin-bottom: 0;
  font-size: clamp(17px, 1.9vw, 22px);
  font-weight: 600;
  line-height: 1.55;
}

.traits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.traits span {
  display: grid;
  min-height: 74px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  transition:
    color 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.traits span:hover {
  color: var(--ink);
  background: var(--paper);
  transform: translateY(-3px) rotate(-1deg);
}

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

.project-card {
  position: relative;
  display: flex;
  min-height: 360px;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
  transition:
    transform 200ms ease,
    box-shadow 200ms ease,
    border-color 200ms ease;
}

.project-card::after {
  position: absolute;
  inset: auto 18px 18px auto;
  width: 84px;
  height: 84px;
  border: 1px solid rgba(23, 23, 23, 0.14);
  border-radius: 50%;
  background:
    linear-gradient(45deg, transparent 48%, rgba(23, 23, 23, 0.2) 49% 51%, transparent 52%),
    radial-gradient(circle at 40% 40%, rgba(0, 168, 200, 0.18), transparent 56%);
  content: "";
}

.project-featured {
  grid-column: span 2;
  background:
    linear-gradient(135deg, rgba(0, 168, 200, 0.13), transparent 42%),
    linear-gradient(315deg, rgba(58, 167, 109, 0.13), transparent 46%),
    var(--paper);
}

.project-featured h3 {
  font-size: clamp(34px, 4vw, 46px);
}

.project-featured p {
  font-size: 17px;
}

.project-card:hover {
  border-color: rgba(23, 23, 23, 0.32);
  box-shadow: 10px 10px 0 rgba(23, 23, 23, 0.12);
  transform: translateY(-6px);
}

.project-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 62px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-index {
  color: var(--red);
}

.project-card p {
  color: var(--muted);
}

.project-card a {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1fr);
  gap: 30px;
  align-items: start;
  margin-bottom: 40px;
  border-top: 1px solid var(--line);
}

.contact-copy p:last-child {
  max-width: 520px;
  margin-top: 18px;
  color: var(--muted);
}

.social-links {
  display: grid;
  gap: 12px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.74);
  transition:
    background 180ms ease,
    transform 180ms ease,
    border-color 180ms ease;
}

.social-links a:hover {
  border-color: rgba(23, 23, 23, 0.32);
  background: var(--paper);
  transform: translateX(5px);
}

.social-links span {
  color: var(--muted);
  font-weight: 800;
}

.social-links strong {
  overflow-wrap: anywhere;
  text-align: right;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.site-footer a {
  color: var(--ink);
}

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

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

@media (max-width: 900px) {
  .site-header {
    border-radius: 22px;
  }

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

  .hero {
    gap: 28px;
    padding-top: 48px;
  }

  .hero-visual,
  .hero-visual img {
    min-height: 430px;
  }

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

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

@media (max-width: 640px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .brand {
    justify-content: center;
  }

  .header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .nav-links a {
    min-width: 0;
  }

  .language-toggle {
    width: 100%;
  }

  .section-shell,
  .site-header,
  .site-footer {
    width: min(100% - 22px, 1180px);
  }

  h1 {
    font-size: clamp(40px, 14vw, 62px);
  }

  .identity-lockup {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-avatar {
    width: 82px;
    height: 82px;
  }

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

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

  .education-strip {
    grid-template-columns: 1fr;
  }

  .hero-visual,
  .hero-visual img {
    min-height: 360px;
    border-radius: 18px;
  }

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

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

  .project-featured {
    grid-column: auto;
  }

  .about,
  .work,
  .contact {
    padding: 54px 0;
  }

  .social-links a,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .social-links strong {
    text-align: left;
  }
}

@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;
  }
}
