:root {
  --ink: #191713;
  --muted: #6f675d;
  --paper: #f5f0e7;
  --paper-deep: #e7dccb;
  --line: #cec2ae;
  --green: #0d6b55;
  --red: #bf3f2f;
  --yellow: #d99a1b;
  --black: #101010;
  --white: #fffaf0;
  --shadow: 0 28px 80px rgba(35, 25, 12, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(25, 23, 19, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(25, 23, 19, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 82% 12%, rgba(191, 63, 47, 0.16), transparent 34%),
    var(--paper);
  background-size: 36px 36px, 36px 36px, auto, auto;
  font-family: "Noto Sans SC", "Noto Sans CJK SC", sans-serif;
}

a {
  color: inherit;
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(25, 23, 19, 0.15);
  background: rgba(245, 240, 231, 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--white);
  background: var(--black);
  border-radius: 50%;
  font-family: "Noto Serif SC", serif;
}

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

.nav-links a {
  text-decoration: none;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr);
  gap: clamp(26px, 6vw, 80px);
  align-items: center;
  min-height: calc(100vh - 73px);
  padding: clamp(42px, 8vw, 92px) clamp(18px, 6vw, 86px);
}

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

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

h1,
h2 {
  font-family: "Noto Serif SC", serif;
}

h1 {
  max-width: 920px;
  margin-bottom: 24px;
  font-size: clamp(42px, 6vw, 86px);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-text {
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.85;
}

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

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

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(25, 23, 19, 0.18);
}

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

.button.secondary {
  background: transparent;
}

.signal-board {
  position: relative;
  padding: 22px;
  overflow: hidden;
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 36%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 18px),
    #151515;
  border: 1px solid rgba(255, 250, 240, 0.2);
  border-radius: 8px;
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 5;
}

.signal-board::before {
  position: absolute;
  inset: 18px;
  content: "";
  border: 1px solid rgba(255, 250, 240, 0.16);
}

.board-header,
.board-metric,
.board-tags {
  position: relative;
  z-index: 1;
}

.board-header {
  display: flex;
  justify-content: space-between;
  color: rgba(255, 250, 240, 0.72);
  font-size: 12px;
  text-transform: uppercase;
}

.status-dot {
  color: #75d5a4;
}

.board-metric {
  margin: 70px 0 32px;
}

.metric-value {
  display: block;
  color: var(--yellow);
  font-family: "Noto Serif SC", serif;
  font-size: clamp(88px, 12vw, 150px);
  font-weight: 900;
  line-height: 0.9;
}

.metric-label {
  color: rgba(255, 250, 240, 0.68);
  font-size: 14px;
  text-transform: uppercase;
}

.trace-lines {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  margin-bottom: 34px;
}

.trace-lines span {
  display: block;
  width: var(--w);
  height: 10px;
  background: linear-gradient(90deg, var(--red), var(--yellow));
  animation: tracePulse 2600ms ease-in-out infinite;
}

.trace-lines span:nth-child(2) {
  animation-delay: 260ms;
}

.trace-lines span:nth-child(3) {
  animation-delay: 520ms;
}

.trace-lines span:nth-child(4) {
  animation-delay: 780ms;
}

.board-tags span {
  padding: 8px 10px;
  border: 1px solid rgba(255, 250, 240, 0.22);
  border-radius: 999px;
  color: rgba(255, 250, 240, 0.82);
  font-size: 12px;
}

.intro-band {
  padding: 38px clamp(18px, 6vw, 86px);
  border-block: 1px solid var(--line);
  background: var(--black);
  color: var(--white);
}

.intro-band p {
  max-width: 1040px;
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(22px, 3vw, 38px);
  line-height: 1.55;
}

.section {
  padding: clamp(58px, 8vw, 108px) clamp(18px, 6vw, 86px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-heading h2,
.contact-section h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.1;
}

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

.project-card {
  min-height: 330px;
  padding: 24px;
  background: rgba(255, 250, 240, 0.68);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 44px rgba(35, 25, 12, 0.08);
}

.project-card,
.timeline article,
.resume-card {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 560ms ease, transform 560ms ease;
}

.project-card.is-visible,
.timeline article.is-visible,
.resume-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card.feature {
  grid-column: span 2;
  color: var(--white);
  background:
    linear-gradient(145deg, rgba(13, 107, 85, 0.9), rgba(16, 16, 16, 0.96)),
    var(--green);
}

.project-index {
  margin-bottom: 38px;
  color: var(--red);
  font-family: "Noto Serif SC", serif;
  font-size: 42px;
  font-weight: 900;
}

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

.project-card h3 {
  margin-bottom: 14px;
  font-size: 25px;
  line-height: 1.2;
}

.project-card p,
.project-card li {
  color: var(--muted);
  line-height: 1.75;
}

.feature p,
.feature li {
  color: rgba(255, 250, 240, 0.78);
}

.project-card ul {
  padding-left: 19px;
}

.project-path {
  display: inline-flex;
  margin-top: 12px;
  color: var(--green);
  font-weight: 800;
}

.feature .project-path {
  color: var(--yellow);
}

.resume-section {
  background: rgba(231, 220, 203, 0.48);
}

.resume-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.36fr) minmax(0, 1fr);
  gap: 16px;
}

.resume-card {
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.resume-card h3 {
  margin-bottom: 8px;
  font-family: "Noto Serif SC", serif;
  font-size: 34px;
}

.resume-card p,
.timeline p {
  color: var(--muted);
  line-height: 1.75;
}

.resume-card dl {
  display: grid;
  gap: 16px;
  margin: 26px 0 0;
}

.resume-card dt {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.resume-card dd {
  margin: 4px 0 0;
}

.timeline {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.timeline article {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 22px;
  padding: 24px;
  background: rgba(255, 250, 240, 0.72);
}

.timeline span {
  color: var(--red);
  font-family: "Noto Serif SC", serif;
  font-weight: 900;
}

.timeline h3 {
  margin-bottom: 8px;
  font-size: 22px;
}

.contact-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(58px, 8vw, 96px) clamp(18px, 6vw, 86px);
  color: var(--white);
  background: var(--green);
}

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

@keyframes tracePulse {
  0%,
  100% {
    opacity: 0.56;
    transform: scaleX(0.92);
    transform-origin: left;
  }
  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@media (max-width: 900px) {
  .hero,
  .resume-layout,
  .timeline article,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .signal-board {
    max-width: 520px;
  }

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

  .project-card.feature {
    grid-column: auto;
  }

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

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

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

  .project-card,
  .resume-card,
  .timeline article {
    padding: 18px;
  }
}
