:root {
  --bg: #ffffff;
  --bg-subtle: #fafaf8;
  --text: #1a1a1a;
  --text-secondary: #6b6b6b;
  --border: #e8e8e4;
  --accent: #0e5c45;
  --accent-ink: #0a4634;
  --font-display: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --text-body: 17px;
  --text-small: 14px;
  --text-h2: 26px;
  --text-h1: clamp(30px, 4.5vw, 42px);
  --num-hero: clamp(40px, 5vw, 60px);
  --num-card: clamp(32px, 5vw, 48px);
  --content-width: 42em;
  --section-gap: 112px;
  --radius: 6px;
  --page-width: min(1120px, calc(100vw - 40px));
}

* {
  box-sizing: border-box;
}

html {
  color: var(--text);
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-variant-numeric: tabular-nums;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--accent), transparent 55%);
  text-underline-offset: 4px;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

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

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

h1,
h2,
h3 {
  color: var(--text);
  font-family: var(--font-display);
}

h1 {
  font-size: var(--text-h1);
  font-weight: 700;
  line-height: 1.35;
}

h2 {
  margin-bottom: 24px;
  font-size: var(--text-h2);
  font-weight: 600;
  line-height: 1.35;
}

h3 {
  margin-bottom: 8px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
}

p {
  color: var(--text-secondary);
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 100;
  transform: translateY(-180%);
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.site-header {
  width: var(--page-width);
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
}

.desktop-nav {
  display: flex;
  gap: 28px;
  align-items: center;
  color: var(--text-secondary);
  font-size: 15px;
}

.desktop-nav a,
.mobile-nav a {
  text-decoration: none;
}

.desktop-nav a[aria-current="page"],
.mobile-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

.mobile-nav {
  display: none;
  position: relative;
}

.mobile-nav summary {
  cursor: pointer;
  list-style: none;
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
}

.mobile-nav summary::-webkit-details-marker {
  display: none;
}

.mobile-nav nav {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: min(240px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  z-index: 20;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 168px;
  padding: 10px 22px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: #fff;
}

.hero {
  width: var(--page-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 38%);
  grid-template-areas:
    "copy portrait"
    "stats stats"
    "action action";
  gap: 56px;
  align-items: center;
  padding: 72px 0 56px;
}

.hero-copy {
  grid-area: copy;
}

.hero-copy > p {
  max-width: 48em;
  margin-bottom: 0;
}

.hero-stats {
  grid-area: stats;
  display: grid;
  grid-template-columns: 2fr 1fr 0.8fr;
  margin: 0;
}

.stat-number {
  padding: 0 20px;
  border-right: 1px solid var(--border);
}

.stat-number:first-child {
  padding-left: 0;
}

.stat-number:last-child {
  border-right: 0;
}

.stat-number strong {
  display: block;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--num-hero);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.stat-number span {
  display: block;
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: var(--text-small);
}

.hero-action {
  grid-area: action;
  display: flex;
  gap: 28px;
  align-items: center;
}

.hero-action span {
  color: var(--text-secondary);
  font-size: var(--text-small);
}

.hero-portrait {
  grid-area: portrait;
  margin: 0;
}

.hero-portrait img {
  width: 100%;
  height: min(42vw, 520px);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius);
}

.hero-portrait figcaption {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.section,
.page {
  width: var(--page-width);
  margin: 0 auto;
}

.section {
  padding: 0 0 var(--section-gap);
}

.page {
  max-width: var(--content-width);
  padding: 72px 0;
}

.track-grid,
.case-grid,
.article-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

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

.track-card,
.problem-item,
.case-card,
.article-card,
.case-index-card,
.service-detail-list article {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.track-card p,
.problem-item p,
.case-card p,
.article-card p {
  margin-bottom: 0;
}

.problem-list {
  display: grid;
  gap: 12px;
}

.problem-item {
  display: grid;
  grid-template-columns: 0.38fr 1fr;
  gap: 24px;
  align-items: start;
}

.case-card strong,
.case-index-card strong,
.result-number {
  display: block;
  margin: 18px 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--num-card);
  font-weight: 700;
  line-height: 1;
}

.case-card a {
  color: var(--accent);
  font-size: var(--text-small);
  font-weight: 700;
}

.service-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.service-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
}

.service-row:last-child {
  border-bottom: 0;
}

.service-row strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.note,
.kicker,
.article-card time,
.signature {
  color: var(--text-secondary);
  font-size: var(--text-small);
}

.service-detail-list {
  display: grid;
  gap: 16px;
  margin-top: 40px;
}

.service-detail-list h2 {
  margin-bottom: 8px;
}

.article-card,
.case-index-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.article-card time {
  display: block;
  margin-top: 24px;
}

.vendor-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.vendor-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
}

.screening-cta {
  width: var(--page-width);
  margin: 0 auto var(--section-gap);
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 36px;
  align-items: center;
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}

.screening-cta.compact {
  margin-top: 16px;
}

.screening-cta h2 {
  margin-bottom: 22px;
  text-align: center;
}

.screening-copy {
  display: grid;
  justify-items: center;
}

.screening-copy p {
  margin: 10px 0 0;
  font-size: var(--text-small);
  text-align: center;
}

.screening-cta img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border: 1px solid var(--border);
  background: #fff;
}

.prose {
  max-width: var(--content-width);
}

.about-page {
  max-width: 960px;
}

.about-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 30%);
  gap: 48px;
  align-items: start;
}

.about-photo {
  margin: 0;
}

.about-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius);
}

.resume-section {
  max-width: var(--content-width);
  margin-top: 56px;
}

.fact-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fact-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.fact-list strong {
  color: var(--text);
}

.prose h1 {
  margin-bottom: 24px;
}

.prose h2 {
  margin-top: 48px;
}

.prose p {
  margin-bottom: 18px;
}

.case-index-list {
  display: grid;
  gap: 18px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 34px;
  color: var(--text-secondary);
  font-size: var(--text-small);
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-bottom: 10px;
}

.footer-record,
.copyright {
  margin: 6px 0 0;
}

@media (max-width: 767px) {
  :root {
    --section-gap: 64px;
    --page-width: min(100vw - 32px, 1120px);
  }

  body {
    font-size: 16px;
  }

  .site-header {
    min-height: 64px;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-nav {
    display: block;
  }

  .brand {
    font-size: 20px;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "portrait"
      "stats"
      "action";
    gap: 22px;
    padding: 44px 0 40px;
  }

  .hero-copy {
    display: contents;
  }

  .hero h1 {
    margin-bottom: 20px;
  }

  .hero-copy > p {
    margin-bottom: 0;
  }

  .hero-portrait {
    width: 60%;
    justify-self: end;
  }

  .hero-portrait img {
    height: calc((100vw - 32px) * 0.75);
  }

  .hero-stats {
    grid-template-columns: 1fr;
    margin: 12px 0 0;
  }

  .stat-number {
    padding: 20px 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .stat-number:last-child {
    border-bottom: 0;
  }

  .hero-action {
    display: grid;
    gap: 14px;
  }

  .track-grid,
  .case-grid,
  .article-list,
  .problem-item,
  .about-intro {
    grid-template-columns: 1fr;
  }

  .about-photo {
    width: 62%;
    justify-self: end;
  }

  .track-card,
  .problem-item,
  .case-card,
  .article-card,
  .case-index-card,
  .service-detail-list article {
    padding: 20px;
  }

  .service-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .service-row strong {
    text-align: left;
  }

  .screening-cta {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 28px 20px;
  }

  .screening-cta h2 {
    text-align: left;
  }

  .screening-copy {
    justify-items: stretch;
  }

  .screening-copy p {
    text-align: left;
  }
}

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