:root {
  color-scheme: light;
  --ink: #182026;
  --muted: #60707c;
  --line: #d8e0e5;
  --panel: #ffffff;
  --soft: #f5f7f4;
  --accent: #0f7b75;
  --accent-2: #c84b31;
  --accent-3: #e8b33d;
  --deep: #12242b;
  --shadow: 0 18px 46px rgba(22, 36, 43, 0.12);
  --shadow-hover: 0 24px 62px rgba(22, 36, 43, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(15, 123, 117, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(15, 123, 117, 0.055) 1px, transparent 1px),
    var(--soft);
  background-size: 44px 44px;
  line-height: 1.7;
  overflow-x: hidden;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(18px, 4vw, 64px);
  background: rgba(245, 247, 244, 0.88);
  border-bottom: 1px solid rgba(216, 224, 229, 0.8);
  backdrop-filter: blur(16px);
}

.brand {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--deep);
  font-weight: 800;
  letter-spacing: 0;
}

.nav {
  display: flex;
  gap: clamp(14px, 3vw, 34px);
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

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

.nav a {
  position: relative;
  padding-bottom: 5px;
}

.nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 220ms ease;
}

.nav a:hover::after,
.nav a.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav a.is-active {
  color: var(--accent);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  min-height: min(820px, calc(100vh - 74px));
  padding: clamp(42px, 7vw, 86px) clamp(18px, 7vw, 96px);
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 14%, rgba(232, 179, 61, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(245, 247, 244, 0.5));
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto 5vw 40px auto;
  width: min(44vw, 620px);
  height: min(44vw, 620px);
  border: 1px solid rgba(15, 123, 117, 0.2);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 48%, rgba(15, 123, 117, 0.14) 49%, rgba(15, 123, 117, 0.14) 51%, transparent 52%),
    linear-gradient(transparent 48%, rgba(15, 123, 117, 0.14) 49%, rgba(15, 123, 117, 0.14) 51%, transparent 52%);
  opacity: 0.75;
  animation: slow-spin 28s linear infinite;
}

.hero-grid {
  position: absolute;
  inset: 22% 7vw auto auto;
  display: grid;
  grid-template-columns: repeat(4, 52px);
  gap: 10px;
  transform: rotate(-8deg);
  animation: float-grid 8s ease-in-out infinite;
}

.hero-grid span {
  height: 52px;
  border: 1px solid rgba(15, 123, 117, 0.22);
  background: rgba(255, 255, 255, 0.45);
  transition: transform 260ms ease, background 260ms ease;
}

.hero:hover .hero-grid span:nth-child(3n + 1) {
  transform: translateY(-8px);
  background: rgba(15, 123, 117, 0.09);
}

.hero:hover .hero-grid span:nth-child(3n + 2) {
  transform: translateY(6px);
  background: rgba(232, 179, 61, 0.12);
}

.hero-content,
.profile-panel {
  position: relative;
  z-index: 1;
}

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

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(58px, 13vw, 142px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 5vw, 54px);
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 22px;
  line-height: 1.3;
}

.hero-title {
  margin-bottom: 22px;
  color: var(--accent);
  font-size: clamp(21px, 3vw, 34px);
  font-weight: 780;
  line-height: 1.35;
}

.hero-copy {
  max-width: 760px;
  margin-bottom: 30px;
  color: #354650;
  font-size: clamp(16px, 2vw, 19px);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid var(--deep);
  border-radius: 8px;
  font-weight: 760;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(18, 36, 43, 0.12);
}

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

.profile-panel {
  width: 360px;
  min-height: 270px;
  outline: 0;
  transition: transform 240ms ease;
}

.profile-panel:hover {
  transform: translateY(-4px);
}

.profile-collapsed {
  display: block;
  width: 100%;
  padding: 24px;
  border: 1px solid rgba(18, 36, 43, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  transition: opacity 220ms ease, transform 260ms ease;
}

.avatar {
  display: grid;
  width: 92px;
  height: 92px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--deep));
  font-size: 48px;
  font-weight: 900;
}

.profile-summary {
  display: grid;
  gap: 18px;
}

.profile-summary dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.profile-summary dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 760;
}

.profile-expanded {
  position: absolute;
  right: 0;
  top: 100%;
  width: min(640px, calc(100vw - 36px));
  padding: 22px 24px;
  border: 1px solid rgba(18, 36, 43, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 244, 0.94));
  box-shadow: var(--shadow-hover);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transform-origin: right top;
  pointer-events: none;
  transition: opacity 220ms ease, transform 260ms ease;
  backdrop-filter: blur(16px);
}

.profile-panel:hover .profile-expanded {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.profile-panel:hover .profile-collapsed {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(22, 36, 43, 0.15);
}

dl {
  margin: 0;
}

.basic-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px 28px;
}

.basic-info-grid div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(216, 224, 229, 0.82);
}

dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
  word-break: break-word;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.metrics div {
  min-height: 138px;
  padding: 24px clamp(18px, 4vw, 48px);
  border-right: 1px solid var(--line);
  transition: background 220ms ease, transform 220ms ease;
}

.metrics div:hover {
  background: rgba(15, 123, 117, 0.045);
  transform: translateY(-3px);
}

.metrics div:last-child {
  border-right: 0;
}

.metrics strong {
  display: block;
  color: var(--accent);
  font-size: clamp(20px, 2.5vw, 28px);
  line-height: 1.25;
}

.metrics span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.65;
}

.section {
  padding: clamp(60px, 8vw, 108px) clamp(18px, 7vw, 96px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto 34px;
}

.section-note {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.section-heading-copy {
  min-width: 0;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
}

.project-card,
.skill-grid article,
.timeline article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(22, 36, 43, 0.07);
}

.project-card {
  padding: clamp(22px, 3vw, 32px);
  position: relative;
  overflow: hidden;
  transition: transform 240ms ease, box-shadow 240ms ease, border-color 240ms ease;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 240ms ease;
}

.project-card:hover {
  border-color: rgba(15, 123, 117, 0.35);
  box-shadow: var(--shadow-hover);
  transform: translateY(-6px);
}

.project-card:hover::before {
  transform: scaleY(1);
}

.clickable-card {
  cursor: pointer;
}

.clickable-card:focus-visible {
  outline: 3px solid rgba(232, 179, 61, 0.72);
  outline-offset: 4px;
}

.project-card.featured {
  grid-column: 1 / -1;
  background:
    linear-gradient(135deg, rgba(18, 36, 43, 0.96), rgba(15, 123, 117, 0.9)),
    var(--deep);
  color: #fff;
}

.project-card.featured::before {
  background: var(--accent-3);
}

.project-card p,
.project-card li {
  color: #41535c;
}

.project-card.featured p,
.project-card.featured li {
  color: rgba(255, 255, 255, 0.82);
}

.project-detail {
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  border-top: 1px solid transparent;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height 420ms ease, opacity 260ms ease, transform 260ms ease, margin-top 260ms ease, border-color 260ms ease;
}

.project-card:hover .project-detail,
.project-card:focus-within .project-detail,
.project-card.is-hovering .project-detail {
  max-height: 980px;
  margin-top: 18px;
  padding-top: 16px;
  border-color: rgba(15, 123, 117, 0.2);
  opacity: 1;
  transform: translateY(0);
}

.project-detail p {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.72;
}

.project-detail p:last-child {
  margin-bottom: 0;
}

.project-detail strong {
  color: var(--accent);
}

.featured .project-detail {
  border-color: transparent;
}

.featured:hover .project-detail,
.featured:focus-within .project-detail,
.featured.is-hovering .project-detail {
  border-color: rgba(255, 255, 255, 0.24);
}

.featured .project-detail strong {
  color: var(--accent-3);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.project-meta span {
  padding: 5px 10px;
  border: 1px solid rgba(15, 123, 117, 0.24);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(15, 123, 117, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.featured .project-meta span {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

ul {
  margin: 18px 0 0;
  padding-left: 20px;
}

.project-title-link:hover {
  color: var(--accent-2);
}

.project-title-link {
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 2px;
  transition: color 180ms ease, background-size 220ms ease;
}

.project-title-link:hover {
  background-size: 100% 2px;
}

.featured .project-title-link:hover {
  color: var(--accent-3);
}

.split-section {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
}

.skill-grid article {
  padding: 24px;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.skill-grid article:hover,
.timeline article:hover {
  border-color: rgba(15, 123, 117, 0.35);
  box-shadow: var(--shadow-hover);
  transform: translateY(-5px);
}

.skill-grid p,
.timeline p,
.statement p {
  color: var(--muted);
}

.education {
  background:
    linear-gradient(90deg, rgba(200, 75, 49, 0.08) 1px, transparent 1px),
    var(--soft);
  background-size: 56px 56px;
}

.timeline {
  display: grid;
  gap: 16px;
  max-width: 920px;
  margin: 0 auto;
}

.timeline article {
  padding: 28px;
  border-left: 6px solid var(--accent-3);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

time {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 820;
}

.statement {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(24px, 6vw, 70px);
  align-items: start;
  background: var(--deep);
  color: #fff;
}

.statement p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: clamp(42px, 7vw, 78px) clamp(18px, 7vw, 96px);
  color: #fff;
  background: #0b1519;
}

.footer h2 {
  max-width: 620px;
}

address {
  display: grid;
  gap: 12px;
  align-content: center;
  min-width: min(100%, 320px);
  font-style: normal;
}

address a {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.86);
}

address a:hover {
  color: #fff;
  border-color: var(--accent-3);
}

.js-ready .reveal,
.js-ready .reveal-item {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 600ms ease, transform 600ms ease;
  transition-delay: var(--reveal-delay, 0ms);
}

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

@keyframes float-grid {
  0%,
  100% {
    transform: rotate(-8deg) translate3d(0, 0, 0);
  }
  50% {
    transform: rotate(-8deg) translate3d(0, -14px, 0);
  }
}

@keyframes slow-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .profile-panel {
    width: min(100%, 520px);
    max-width: 520px;
  }

  .profile-expanded {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    margin-top: 48px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .profile-collapsed {
    display: none;
  }

  .metrics,
  .skill-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    gap: 12px;
  }

  .nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 16px;
  }

  .hero {
    padding-top: 42px;
  }

  .hero-grid,
  .hero::before {
    display: none;
  }

  .hero-actions {
    display: grid;
  }

  .basic-info-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .profile-expanded {
    padding: 20px 18px;
  }

  .button {
    width: 100%;
  }

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

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

  .metrics div:last-child {
    border-bottom: 0;
  }

  .section-heading,
  .footer {
    display: block;
  }

  .footer address {
    margin-top: 26px;
  }
}

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

  .js-ready .reveal,
  .js-ready .reveal-item {
    opacity: 1;
    transform: none;
  }
}
