:root {
  --ink: #102833;
  --muted: #5d7480;
  --line: #d7e8ee;
  --paper: #f6fbfc;
  --white: #ffffff;
  --teal: #18b7b2;
  --blue: #2377c6;
  --deep: #0c4f72;
  --aqua: #e7f8fa;
  --shadow: 0 18px 45px rgba(12, 79, 114, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial,
    sans-serif;
  line-height: 1.65;
}

body.modal-open {
  overflow: hidden;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 clamp(20px, 4vw, 56px);
  border-bottom: 1px solid rgba(215, 232, 238, 0.9);
  background: rgba(246, 251, 252, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0;
}

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

.nav-links a {
  position: relative;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--deep);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

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

.section-band,
.section,
.contact-section,
.quick-facts,
.home-hero {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(32px, 6vw, 78px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: clamp(48px, 8vw, 96px) 0;
}

.home-copy h1 {
  margin-bottom: 18px;
}

.home-copy p:not(.eyebrow) {
  max-width: 520px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.45;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.home-wordmark {
  display: grid;
  justify-items: end;
  color: var(--ink);
  font-size: clamp(72px, 14vw, 190px);
  font-weight: 950;
  line-height: 0.82;
  letter-spacing: 0;
  text-align: right;
}

.home-wordmark span {
  display: block;
}

.home-wordmark span:nth-child(2) {
  color: transparent;
  -webkit-text-stroke: 2px var(--blue);
}

.home-wordmark span:nth-child(3) {
  color: var(--deep);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  align-items: center;
  gap: clamp(34px, 6vw, 78px);
  min-height: calc(92vh - 72px);
  padding: clamp(42px, 7vw, 84px) 0 clamp(28px, 5vw, 52px);
}

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

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 1;
  letter-spacing: 0;
}

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

h3 {
  margin-bottom: 8px;
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: 0;
}

.hero-role {
  margin-bottom: 18px;
  color: var(--blue);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 750;
}

.hero-summary {
  max-width: 660px;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

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

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(12, 79, 114, 0.12);
}

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

.button.ghost {
  background: rgba(255, 255, 255, 0.84);
}

.button.light {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.26);
}

.portrait-wrap {
  border: 0;
  padding: 0;
  position: relative;
  overflow: hidden;
  width: min(430px, 100%);
  justify-self: end;
  aspect-ratio: 0.76;
  border-radius: 6px;
  background: var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.portrait-wrap::after {
  display: none;
}

.portrait-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-bottom: clamp(70px, 10vw, 130px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.quick-facts div {
  min-height: 112px;
  padding: 24px;
  background: var(--white);
}

.quick-facts span,
.info-list dt,
.project-content span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quick-facts strong {
  display: block;
  margin-top: 6px;
  font-size: 21px;
}

.section {
  padding: clamp(58px, 8vw, 98px) 0;
}

.section-heading {
  margin-bottom: 34px;
}

.resume-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: clamp(26px, 5vw, 64px);
  align-items: start;
}

.profile-panel {
  position: sticky;
  top: 102px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}

.info-list {
  display: grid;
  gap: 17px;
  margin: 0;
}

.info-list div {
  display: grid;
  gap: 2px;
}

.info-list dd {
  margin: 0;
  font-weight: 750;
  overflow-wrap: anywhere;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.timeline-item:last-child {
  border-bottom: 1px solid var(--line);
}

.time {
  color: var(--blue);
  font-weight: 850;
}

.timeline-item p,
.portfolio-heading p,
.project-content p,
.about-text {
  color: var(--muted);
}

.skills-band {
  width: 100%;
  padding-inline: max(20px, calc((100vw - 1160px) / 2));
  background: var(--aqua);
}

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

.skill-item {
  min-height: 104px;
  display: flex;
  align-items: end;
  padding: 20px;
  border: 1px solid rgba(35, 119, 198, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.portfolio-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(260px, 0.7fr);
  gap: 30px;
  align-items: end;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -8px 0 28px;
}

.filter-button {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.filter-button:hover,
.filter-button.is-active {
  border-color: rgba(24, 183, 178, 0.55);
  background: var(--aqua);
  color: var(--deep);
  transform: translateY(-1px);
}

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

.featured-project {
  grid-column: span 2;
  grid-row: span 2;
}

.featured-project img {
  aspect-ratio: 0.72;
}

.project-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  cursor: pointer;
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition:
    border-color 0.22s ease,
    opacity 0.2s ease,
    transform 0.22s ease,
    box-shadow 0.22s ease;
}

.project-card:hover,
.project-card:focus-visible {
  border-color: rgba(24, 183, 178, 0.6);
  box-shadow: var(--shadow);
  outline: none;
}

.project-card.is-hidden {
  display: none;
}

.project-card img {
  width: 100%;
  aspect-ratio: 1.28;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.board-card img {
  aspect-ratio: 0.72;
  object-fit: contain;
  background: #eef6f8;
}

.project-card:hover img {
  transform: scale(1.035);
}

.project-content {
  padding: 22px;
}

.featured-project .project-content {
  padding: 28px;
}

.project-content span {
  color: var(--blue);
  margin-bottom: 8px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.project-tags em {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--aqua);
  color: var(--deep);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
}

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

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

.tilt-card {
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

.about-band {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: clamp(28px, 6vw, 86px);
}

.about-text {
  margin: 0;
  font-size: clamp(19px, 2.2vw, 27px);
  line-height: 1.7;
}

.contact-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 40px;
  padding: clamp(34px, 6vw, 56px);
  border-radius: 6px;
  background: linear-gradient(135deg, var(--deep), #123444);
  color: var(--white);
}

.contact-section .eyebrow {
  color: #8ce9e4;
}

.contact-section h2 {
  max-width: 660px;
}

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--deep);
  color: var(--white);
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(12, 79, 114, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 26px;
  background: rgba(9, 32, 43, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lightbox[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.55fr);
  width: min(1120px, 100%);
  max-height: min(760px, calc(100vh - 52px));
  overflow: hidden;
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.26);
}

.lightbox-image {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: contain;
  background: #eef6f8;
}

.lightbox.is-board {
  align-items: start;
  overflow-y: auto;
}

.lightbox.is-board .lightbox-panel {
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  width: min(1040px, 100%);
  max-height: none;
  overflow: visible;
}

.lightbox.is-board .lightbox-image {
  height: auto;
  min-height: 0;
  object-fit: contain;
}

.lightbox.is-board .lightbox-copy {
  position: sticky;
  top: 24px;
}

.lightbox-copy {
  padding: clamp(24px, 4vw, 38px);
  align-self: center;
}

.lightbox-copy h3 {
  font-size: clamp(24px, 3vw, 36px);
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 90;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
}

@media (max-width: 900px) {
  .home-hero,
  .hero,
  .resume-layout,
  .about-band,
  .portfolio-heading {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .home-hero {
    min-height: auto;
  }

  .home-wordmark {
    justify-items: start;
    text-align: left;
  }

  .portrait-wrap {
    justify-self: start;
    width: min(360px, 100%);
  }

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

  .featured-project {
    grid-column: span 2;
  }

  .profile-panel {
    position: static;
  }

  .contact-section {
    align-items: flex-start;
    flex-direction: column;
  }

  .lightbox-panel {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .lightbox.is-board .lightbox-panel {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .lightbox.is-board .lightbox-copy {
    position: static;
  }

  .lightbox-image {
    max-height: 56vh;
    min-height: 260px;
  }

  .lightbox.is-board .lightbox-image {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .site-header {
    min-height: 64px;
  }

  .nav-links {
    gap: 12px;
    font-size: 14px;
  }

  .section-band,
  .section,
  .contact-section,
  .quick-facts,
  .home-hero {
    width: min(100% - 28px, 1160px);
  }

  .hero {
    padding-top: 38px;
  }

  .home-wordmark {
    font-size: clamp(58px, 20vw, 92px);
  }

  .quick-facts,
  .skill-grid,
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .featured-project {
    grid-column: span 1;
  }

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

  .button {
    width: 100%;
  }

  .filter-button {
    flex: 1 1 auto;
  }

  .contact-actions {
    width: 100%;
  }

  .lightbox {
    padding: 14px;
  }
}
