@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700&family=Inter:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --paper: #f5f2ea;
  --surface: #fdfaf3;
  --surface-strong: #ece6d8;
  --ink: #111418;
  --ink-soft: #26292f;
  --muted: #5c5850;
  --muted-light: #8e8880;
  --line: #cfc4b0;
  --line-soft: #dfd8cc;
  --accent: #28614c;
  --accent-hover: #347d63;
  --accent-bg: #e8f2ee;
  --accent-2: #883c1d;
  --accent-2-bg: #faf0eb;
  --accent-3: #1c4770;
  --accent-3-bg: #e8f0f8;
  --gold: #c0983c;
  --shadow-xs: 0 1px 4px rgba(15, 18, 24, 0.06);
  --shadow-sm: 0 3px 12px rgba(15, 18, 24, 0.07);
  --shadow: 0 8px 30px rgba(15, 18, 24, 0.09), 0 2px 8px rgba(15, 18, 24, 0.05);
  --shadow-lg: 0 20px 56px rgba(15, 18, 24, 0.11), 0 4px 16px rgba(15, 18, 24, 0.06);
  --radius: 8px;
  --radius-sm: 5px;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --t: 0.22s var(--ease);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.72;
}

a { color: inherit; }

/* ── Typography ─────────────────────────────────────────────────── */

h1, h2, h3 {
  font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", Georgia, serif;
  overflow-wrap: anywhere;
}

p { overflow-wrap: anywhere; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-size: 0.69rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  font-family: "Inter", sans-serif;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  line-height: 1.24;
  letter-spacing: -0.01em;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.72;
}

/* ── Site Header ────────────────────────────────────────────────── */

.site-header {
  width: min(1120px, calc(100% - 40px));
  margin: 36px auto 0;
  padding: 36px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 32px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

/* Tri-color accent stripe */
.site-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    var(--gold) 48%,
    var(--accent-2) 100%
  );
}

/* ── Traits ─────────────────────────────────────────────────────── */

.traits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.traits span {
  border: 1px solid var(--line-soft);
  background: #fff;
  padding: 5px 11px;
  font-size: 0.79rem;
  color: var(--ink-soft);
  border-radius: 2px;
  font-weight: 500;
  transition: background var(--t), border-color var(--t), color var(--t);
  cursor: default;
}

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

/* ── Module Nav ─────────────────────────────────────────────────── */

.module-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: rgba(245, 242, 234, 0.96);
  border: 1px solid var(--line);
  border-top: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-xs);
}

.module-nav a {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--muted);
  transition: background var(--t), color var(--t);
  position: relative;
}

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

.module-nav a:last-child { border-right: 0; }

.module-nav a:hover,
.module-nav a:focus-visible {
  background: #fff;
  color: var(--accent);
  outline: none;
}

.module-nav a:hover::after,
.module-nav a:focus-visible::after {
  transform: scaleX(1);
}

/* ── Main ───────────────────────────────────────────────────────── */

main {
  width: min(1120px, calc(100% - 40px));
  margin: 20px auto 0;
}

/* ── Module Sections ────────────────────────────────────────────── */

.module-section {
  border: 1px solid var(--line);
  background: var(--surface);
  margin: 14px 0;
  padding: 36px 40px;
  scroll-margin-top: 74px;
}

.section-head {
  display: grid;
  grid-template-columns: 0.68fr 1.32fr;
  gap: 32px;
  align-items: end;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.section-head .eyebrow {
  grid-column: 1 / -1;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  line-height: 1.3;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

/* ── Work Grid & Cards ──────────────────────────────────────────── */

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

.work-card {
  display: flex;
  flex-direction: column;
  min-height: 280px;
  padding: 22px;
  border: 1px solid var(--line-soft);
  background: #fff;
  border-radius: var(--radius);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}

.work-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: #b8b0a0;
}

.feature-card {
  grid-column: span 2;
  background: linear-gradient(145deg, #fdfaf3 0%, #e8f2ee 55%, #daeae3 100%);
  border-color: #b8d4c8;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.card-meta span {
  border: 1px solid var(--line-soft);
  background: var(--paper);
  padding: 3px 9px;
  font-size: 0.76rem;
  color: var(--muted);
  border-radius: 3px;
  font-weight: 500;
  font-family: "Inter", sans-serif;
}

.work-card h3 {
  margin: 0 0 10px;
  font-size: 1.18rem;
  line-height: 1.42;
}

.work-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.68;
}

.evidence-list {
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.7;
}

.evidence-list li { margin-bottom: 5px; }

/* ── Actions ────────────────────────────────────────────────────── */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.actions.stacked {
  flex-direction: column;
  align-items: flex-start;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 17px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.87rem;
  font-family: "Inter", sans-serif;
  letter-spacing: 0.01em;
  transition: background var(--t), border-color var(--t),
              transform var(--t), box-shadow var(--t), color var(--t);
}

.button.secondary {
  background: transparent;
  color: var(--accent);
}

.button:hover,
.button:focus-visible {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(40, 97, 76, 0.22);
  outline: none;
}

/* ── Knowledge Map ──────────────────────────────────────────────── */

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

.supporting-grid { margin-top: 18px; }

.knowledge-map div {
  min-height: 165px;
  padding: 20px;
  border: 1px solid var(--line-soft);
  background: #fff;
  border-radius: var(--radius);
  transition: transform var(--t), box-shadow var(--t);
  position: relative;
  overflow: hidden;
}

/* Color-coded top border per domain */
.knowledge-map div::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.knowledge-map div:nth-child(1)::before { background: var(--accent); }
.knowledge-map div:nth-child(2)::before { background: var(--accent-2); }
.knowledge-map div:nth-child(3)::before { background: var(--accent-3); }
.knowledge-map div:nth-child(4)::before { background: var(--gold); }

.knowledge-map div:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.knowledge-map strong {
  display: block;
  margin-bottom: 9px;
  font-size: 0.97rem;
  font-family: "Noto Serif SC", serif;
  color: var(--ink);
}

.knowledge-map p {
  margin: 0;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.65;
}

/* ── Note pill ──────────────────────────────────────────────────── */

.note {
  display: inline-block;
  width: fit-content;
  margin-bottom: 12px;
  border: 1px solid #e0bfb0;
  background: var(--accent-2-bg);
  padding: 3px 10px;
  font-size: 0.76rem;
  color: #72300f;
  border-radius: 3px;
  font-weight: 500;
  font-family: "Inter", sans-serif;
}

/* ── Footer ─────────────────────────────────────────────────────── */

.site-footer {
  width: min(1120px, calc(100% - 40px));
  margin: 14px auto 44px;
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--muted-light);
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
}

.site-footer p { margin: 0; }

.back-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.86rem;
  transition: color var(--t);
}

.back-link:hover { color: var(--accent-hover); }

/* ── Reduced motion ─────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .button:hover, .button:focus-visible,
  .work-card:hover,
  .knowledge-map div:hover,
  .traits span:hover {
    transform: none;
  }

  .module-nav a::after {
    transition: none;
  }
}

/* ── Tablet (≤ 900px) ───────────────────────────────────────────── */

@media (max-width: 900px) {
  .site-header,
  .section-head {
    grid-template-columns: 1fr;
  }

  .traits { justify-content: flex-start; }

  .module-nav,
  .work-grid,
  .knowledge-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-card { grid-column: span 1; }
}

/* ── Mobile (≤ 620px) ───────────────────────────────────────────── */

@media (max-width: 620px) {
  .site-header,
  main,
  .module-nav,
  .site-footer {
    width: min(100% - 24px, 1120px);
  }

  .site-header,
  .module-section {
    padding: 24px 20px;
  }

  h1 { font-size: 1.5rem; }

  .module-nav {
    grid-template-columns: 1fr;
    position: static;
    border-top: 1px solid var(--line);
    box-shadow: none;
  }

  .module-nav a {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    justify-content: flex-start;
    padding-left: 18px;
  }

  .module-nav a:last-child { border-bottom: 0; }

  .module-nav a::after { display: none; }

  .work-grid,
  .knowledge-map {
    grid-template-columns: 1fr;
  }

  .site-footer { flex-direction: column; }
}
