:root {
  --ink: #20221f;
  --muted: #626761;
  --paper: #f7f2e8;
  --paper-deep: #eee4d5;
  --panel: #fffaf0;
  --line: rgba(32, 34, 31, 0.16);
  --teal: #0f6b66;
  --teal-dark: #0a4544;
  --amber: #c5842c;
  --coral: #b9483c;
  --blue: #233c5f;
  --shadow: 0 24px 60px rgba(30, 34, 28, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(32, 34, 31, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(32, 34, 31, 0.03) 1px, transparent 1px),
    var(--paper);
  background-size: 88px 88px;
  font-family:
    "Noto Sans SC",
    "Source Han Sans SC",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  line-height: 1.7;
  letter-spacing: 0;
}

body::selection {
  color: #fffaf0;
  background: var(--teal-dark);
}

body.lightbox-open {
  overflow: hidden;
}

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

button {
  font: inherit;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 18px;
  left: 50%;
  display: grid;
  width: min(1120px, calc(100% - 32px));
  height: 64px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 8px 10px 8px 12px;
  border: 1px solid rgba(255, 250, 240, 0.58);
  border-radius: 8px;
  background: rgba(32, 34, 31, 0.74);
  color: #fffaf0;
  box-shadow: 0 16px 44px rgba(20, 22, 19, 0.18);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-width: 128px;
  color: #fffaf0;
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  grid-column: 2;
  justify-content: center;
  gap: 6px;
}

.nav-links a {
  display: inline-flex;
  min-width: 64px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: rgba(255, 250, 240, 0.78);
  font-size: 0.92rem;
  transition:
    color 180ms ease,
    background 180ms ease;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255, 250, 240, 0.12);
  color: #fffaf0;
}

.primary-action,
.secondary-action,
.contact-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-action svg,
.secondary-action svg,
.contact-item svg,
.carousel-button svg,
.lightbox-close svg,
.lightbox-nav svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.hero {
  position: relative;
  display: grid;
  min-height: 64vh;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  align-items: start;
  gap: 48px;
  overflow: hidden;
  padding: 108px max(24px, calc((100vw - 1120px) / 2)) 44px;
  color: var(--ink);
}

.hero-backdrop {
  display: none;
}

.hero-content {
  max-width: 760px;
  animation: rise-in 760ms ease both;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--amber);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family:
    "Noto Serif SC",
    "Source Han Serif SC",
    "Songti SC",
    serif;
  font-size: 5rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-role {
  margin: 20px 0 0;
  color: var(--teal-dark);
  font-size: 1.55rem;
  font-weight: 800;
}

.hero-copy {
  max-width: 680px;
  margin: 22px 0 0;
  color: #3f443d;
  font-size: 1.08rem;
}

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

.primary-action,
.secondary-action {
  min-height: 48px;
  gap: 9px;
  border-radius: 6px;
  font-weight: 800;
}

.primary-action {
  padding: 0 20px;
  background: var(--teal);
  color: #fff;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

.primary-action:hover {
  background: #0b5c58;
}

.secondary-action {
  min-width: 138px;
  padding: 0 18px;
  border: 1px solid rgba(32, 34, 31, 0.24);
  background: rgba(255, 250, 240, 0.62);
  color: var(--ink);
  cursor: pointer;
}

.secondary-action:hover {
  background: #fffaf0;
}

.hero-panel {
  display: grid;
  gap: 0;
  align-self: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
  box-shadow: 0 18px 50px rgba(30, 34, 28, 0.08);
  animation: rise-in 760ms 120ms ease both;
}

.hero-panel div {
  padding: 22px;
}

.hero-panel div + div {
  border-top: 1px solid var(--line);
}

.panel-label {
  display: block;
  margin-bottom: 7px;
  color: var(--teal-dark);
  font-size: 0.8rem;
  font-weight: 800;
}

.hero-panel strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}

.metrics-section {
  display: grid;
  width: min(1120px, calc(100% - 48px));
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: -24px auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.metric {
  min-height: 154px;
  padding: 26px;
  background: var(--panel);
}

.metric span {
  display: block;
  color: var(--teal-dark);
  font-family:
    "Noto Serif SC",
    "Source Han Serif SC",
    "Songti SC",
    serif;
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1.15;
}

.metric p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.two-column {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 80px;
}

.section-heading {
  max-width: 410px;
}

.section-heading.wide {
  max-width: 760px;
}

.section-heading h2,
.contact-section h2 {
  margin: 0;
  font-family:
    "Noto Serif SC",
    "Source Han Serif SC",
    "Songti SC",
    serif;
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: 0;
}

.section-heading p:not(.eyebrow),
.contact-section p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.03rem;
}

.profile-copy {
  display: grid;
  gap: 18px;
  color: #393c38;
  font-size: 1.06rem;
}

.profile-copy p {
  margin: 0;
}

.education-block {
  margin-top: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
  box-shadow: 0 16px 42px rgba(30, 34, 28, 0.08);
}

.education-block .panel-label {
  color: var(--teal-dark);
}

.education-block h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.28rem;
}

.course-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.course-list li,
.tool-strip span,
.project-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 800;
}

.course-list li {
  padding: 4px 10px;
  border: 1px solid rgba(15, 107, 102, 0.2);
  background: rgba(15, 107, 102, 0.08);
  color: var(--teal-dark);
}

.project-list {
  display: grid;
  gap: 22px;
  margin-top: 34px;
}

.project-card {
  position: relative;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 30px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.82);
  box-shadow: 0 18px 50px rgba(30, 34, 28, 0.08);
  overflow: hidden;
}

.project-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: var(--teal);
  content: "";
}

.project-card.featured::before {
  background: linear-gradient(180deg, var(--teal), var(--amber), var(--coral));
}

.project-index {
  color: rgba(32, 34, 31, 0.18);
  font-family:
    "Noto Serif SC",
    "Source Han Serif SC",
    "Songti SC",
    serif;
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1;
}

.project-main h3 {
  margin: 12px 0 12px;
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1.35;
}

.project-main > p {
  max-width: 900px;
  margin: 0;
  color: #474b45;
  font-size: 1.02rem;
}

.project-meta,
.tool-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-meta span {
  padding: 3px 10px;
  background: rgba(35, 60, 95, 0.1);
  color: var(--blue);
}

.tool-strip {
  margin: 18px 0 28px;
}

.tool-strip span {
  padding: 4px 10px;
  background: var(--ink);
  color: #fffaf0;
}

.project-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(260px, 0.82fr);
  gap: 28px;
}

.project-card.featured .project-grid {
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
}

.project-grid h4 {
  margin: 0 0 10px;
  color: var(--teal-dark);
  font-size: 1rem;
}

.project-grid ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.1rem;
  color: #424640;
}

.project-outcome {
  display: grid;
  align-content: start;
  gap: 18px;
}

.powerbi-showcase {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(15, 107, 102, 0.22);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.82);
  box-shadow: 0 16px 36px rgba(30, 34, 28, 0.08);
}

.showcase-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.showcase-header .panel-label {
  margin-bottom: 3px;
}

.showcase-header h5 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.slide-count {
  display: inline-flex;
  min-width: 46px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(15, 107, 102, 0.1);
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.showcase-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(32, 34, 31, 0.12);
  border-radius: 6px;
  background: #f3efe6;
}

.showcase-slide {
  position: absolute;
  inset: 0;
  display: grid;
  margin: 0;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.showcase-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.showcase-image-button {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #fff;
  cursor: zoom-in;
}

.showcase-image-button::after {
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: 5px;
  content: "";
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
  pointer-events: none;
}

.showcase-image-button:hover::after,
.showcase-image-button:focus-visible::after {
  border-color: rgba(15, 107, 102, 0.72);
  box-shadow: inset 0 0 0 999px rgba(15, 107, 102, 0.05);
}

.showcase-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.showcase-slide figcaption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  padding: 5px 8px;
  border-radius: 5px;
  background: rgba(32, 34, 31, 0.78);
  color: #fffaf0;
  font-size: 0.76rem;
  font-weight: 800;
}

.showcase-controls {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 10px;
}

.carousel-button {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(32, 34, 31, 0.16);
  border-radius: 6px;
  background: #fffaf0;
  color: var(--teal-dark);
  cursor: pointer;
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.carousel-button:hover {
  background: rgba(15, 107, 102, 0.1);
  transform: translateY(-1px);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
}

.carousel-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(32, 34, 31, 0.22);
  cursor: pointer;
}

.carousel-dots button.is-active {
  width: 24px;
  background: var(--teal);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 18px;
  padding: 34px;
  background: rgba(20, 22, 19, 0.88);
  backdrop-filter: blur(12px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-figure {
  display: grid;
  gap: 12px;
  margin: 0;
  min-width: 0;
}

.lightbox-figure img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 122px);
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

.lightbox-figure figcaption {
  color: #fffaf0;
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
}

.lightbox-close,
.lightbox-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 250, 240, 0.24);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.12);
  color: #fffaf0;
  cursor: pointer;
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 250, 240, 0.2);
  transform: translateY(-1px);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
}

.lightbox-nav {
  width: 52px;
  height: 72px;
}

.skill-section {
  display: grid;
  grid-template-columns: 0.6fr 1.4fr;
  gap: 54px;
}

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

.skill-card {
  min-height: 160px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.skill-card:hover {
  border-color: rgba(15, 107, 102, 0.36);
  box-shadow: 0 18px 42px rgba(30, 34, 28, 0.09);
  transform: translateY(-3px);
}

.skill-card h3 {
  margin: 0 0 12px;
  color: var(--teal-dark);
  font-size: 1.14rem;
}

.skill-card p {
  margin: 0;
  color: #444942;
}

.advantage-section {
  padding-bottom: 96px;
}

.advantage-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 34px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  list-style: none;
  overflow: hidden;
  counter-reset: strengths;
}

.advantage-list li {
  min-height: 230px;
  padding: 24px;
  background: #fffaf0;
  color: #444942;
  counter-increment: strengths;
}

.advantage-list li::before {
  display: block;
  margin-bottom: 30px;
  color: var(--coral);
  font-family:
    "Noto Serif SC",
    "Source Han Serif SC",
    "Songti SC",
    serif;
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
  content: counter(strengths, decimal-leading-zero);
}

.contact-section {
  display: grid;
  width: min(1120px, calc(100% - 48px));
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 36px;
  margin: 0 auto 36px;
  padding: 42px;
  border-radius: 8px;
  background: var(--ink);
  color: #fffaf0;
  box-shadow: var(--shadow);
}

.contact-section p {
  color: rgba(255, 250, 240, 0.7);
}

.contact-actions {
  display: grid;
  gap: 10px;
  min-width: 220px;
}

.contact-item {
  min-height: 48px;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid rgba(255, 250, 240, 0.2);
  border-radius: 6px;
  background: rgba(255, 250, 240, 0.08);
  color: #fffaf0;
  font-weight: 800;
}

.contact-item:hover {
  background: rgba(255, 250, 240, 0.14);
}

.toast {
  position: fixed;
  z-index: 40;
  right: 24px;
  bottom: 24px;
  padding: 12px 16px;
  border-radius: 6px;
  background: var(--teal-dark);
  color: #fffaf0;
  box-shadow: 0 20px 46px rgba(15, 107, 102, 0.28);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.project-card,
.skill-card,
.education-block,
.advantage-list,
.metric {
  animation: fade-up 620ms ease both;
  animation-timeline: view();
  animation-range: entry 0% cover 22%;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .site-header {
    top: 10px;
    width: calc(100% - 20px);
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
    min-height: auto;
    padding: 92px 24px 44px;
  }

  .hero h1 {
    font-size: 4rem;
  }

  .hero-panel {
    max-width: 520px;
  }

  .metrics-section,
  .advantage-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column,
  .skill-section,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .two-column,
  .skill-section {
    gap: 30px;
  }

  .project-card {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .project-index {
    font-size: 2.2rem;
  }

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

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

  .lightbox {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 56px 14px 18px;
  }

  .lightbox-nav {
    position: absolute;
    top: 50%;
    width: 42px;
    height: 54px;
    transform: translateY(-50%);
  }

  .lightbox-prev {
    left: 12px;
  }

  .lightbox-next {
    right: 12px;
  }

  .lightbox-nav:hover {
    transform: translateY(calc(-50% - 1px));
  }

  .lightbox-figure img {
    max-height: calc(100vh - 132px);
  }

  .contact-actions {
    width: 100%;
  }
}

@media (max-width: 720px) {
  body {
    background-size: 54px 54px;
  }

  .site-header {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }

  .nav-links {
    display: none;
  }

  .brand {
    min-width: auto;
  }

  .hero {
    min-height: auto;
    padding-top: 86px;
    padding-bottom: 44px;
  }

  .hero h1 {
    font-size: 3.2rem;
  }

  .hero-role {
    font-size: 1.22rem;
  }

  .hero-copy {
    font-size: 1rem;
  }

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

  .hero-panel {
    display: none;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .metrics-section,
  .section,
  .contact-section {
    width: calc(100% - 28px);
  }

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

  .section {
    padding-top: 68px;
  }

  .section-heading h2,
  .contact-section h2 {
    font-size: 2.25rem;
  }

  .project-card {
    padding: 26px 22px 26px 26px;
  }

  .project-main h3 {
    font-size: 1.38rem;
  }

  .contact-section {
    padding: 30px 22px;
  }
}

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

@media print {
  body {
    background: #fff;
    color: #111;
  }

  .site-header,
  .hero-actions,
  .toast {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 24px 0;
    color: #111;
  }

  .hero::before,
  .hero::after,
  .hero-backdrop {
    display: none;
  }

  .hero-panel,
  .metric,
  .project-card,
  .skill-card,
  .education-block,
  .contact-section {
    break-inside: avoid;
    box-shadow: none;
  }

  .hero-panel {
    border-color: #ccc;
    background: #fff;
  }

  .hero-panel strong,
  .panel-label,
  .contact-section,
  .contact-section p {
    color: #111;
  }

  .metrics-section,
  .section,
  .contact-section {
    width: 100%;
  }

  .section {
    padding-top: 32px;
  }

  .contact-section {
    margin-bottom: 0;
    padding: 24px 0;
    background: #fff;
  }
}
