@font-face {
  font-family: "HiSo Latin Mono";
  font-style: normal;
  font-weight: 400 800;
  src:
    local("Roboto Mono"),
    local("SF Mono"),
    local("SFMono-Regular"),
    local("Menlo"),
    local("Consolas"),
    local("Liberation Mono");
  unicode-range:
    U+0000-00FF,
    U+0100-024F,
    U+1E00-1EFF,
    U+2000-206F,
    U+2070-209F,
    U+20A0-20CF,
    U+2100-214F,
    U+2190-22FF,
    U+25A0-25FF;
}

:root {
  color-scheme: dark;
  --bg: #050705;
  --text: #f0f3eb;
  --muted: #a7afa3;
  --subtle: #6f786b;
  --line: rgba(240, 243, 235, 0.13);
  --line-strong: rgba(240, 243, 235, 0.22);
  --panel: rgba(14, 17, 13, 0.78);
  --accent: #9bcf9f;
  --accent-2: #d7b46a;
  --max: 960px;
  --readable: 820px;
  --font-sans:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    "Noto Sans SC",
    sans-serif;
  --font-mixed: "HiSo Latin Mono", var(--font-sans);
  --font-mono:
    "HiSo Latin Mono",
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7f0;
  --text: #151912;
  --muted: #4f594b;
  --subtle: #747e70;
  --line: rgba(21, 25, 18, 0.13);
  --line-strong: rgba(21, 25, 18, 0.22);
  --panel: rgba(255, 255, 250, 0.82);
  --accent: #2f7b48;
  --accent-2: #8a6720;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--bg);
  background-size: 42px 42px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    radial-gradient(circle at 50% 0%, rgba(155, 207, 159, 0.08), transparent 30%),
    linear-gradient(180deg, transparent 0%, var(--bg) 88%);
  pointer-events: none;
}

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

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

button {
  font: inherit;
}

code,
pre,
kbd,
samp {
  font-family: var(--font-mono);
}

.page {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 42px;
}

.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-strong);
}

.intro-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 15px;
  overflow: hidden;
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
}

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

h3,
strong {
  font-weight: 600;
}

h1,
h2,
.tagline,
.intro-actions,
.project-title,
.project-open,
.project-meta,
.proof-grid span,
.case-kicker,
.case-facts span,
.scale-card span,
.scale-note,
.case-nav,
.architecture-unit span,
.flow-step span,
.timeline-item time,
.timeline-date,
.timeline-tags,
p[data-timeline-progress-text],
.skill-groups span,
.footer {
  font-family: var(--font-mixed);
}

h1 {
  margin-bottom: 2px;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.intro-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.theme-toggle {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.section {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.about-lead {
  padding-top: 28px;
}

.about-lead p,
#about > p {
  max-width: var(--readable);
}

.section p:last-child,
.compact-list:last-child {
  margin-bottom: 0;
}

p {
  color: var(--muted);
  overflow-wrap: break-word;
}

h2 {
  display: inline-block;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
}

.project-list {
  display: grid;
  gap: 8px;
}

.project {
  position: relative;
  display: block;
  min-width: 0;
  padding: 12px 14px 12px 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.project::before {
  position: absolute;
  left: 12px;
  top: 16px;
  color: var(--accent);
  content: "↳";
  transition: transform 160ms ease;
}

.project::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(155, 207, 159, 0.08), transparent 36%);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.project:hover,
.project:focus-visible {
  border-color: var(--line-strong);
  background: rgba(240, 243, 235, 0.035);
  color: inherit;
  transform: translateX(4px);
}

.project:hover::before,
.project:focus-visible::before {
  transform: translate(2px, -2px);
}

.project:hover::after,
.project:focus-visible::after {
  opacity: 1;
}

.project-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 3px;
}

.project-title {
  min-width: 0;
  color: var(--text);
  font-weight: 600;
}

.project-open {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 0.78rem;
  opacity: 0.82;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.open-short {
  display: none;
}

.project:hover .project-open,
.project:focus-visible .project-open {
  opacity: 1;
  transform: translateX(3px);
}

.project p {
  position: relative;
  z-index: 1;
  margin-bottom: 4px;
}

.project-meta {
  color: var(--subtle);
  font-size: 0.86rem;
}

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

.proof-grid div {
  min-height: 128px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.proof-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 1.24rem;
  font-weight: 700;
  line-height: 1.2;
}

.proof-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.detail {
  scroll-margin-top: 24px;
}

.case-page {
  --max: 1080px;
}

.case-page .intro {
  margin: 0 auto;
}

.case-hero {
  display: grid;
  gap: 16px;
}

.case-kicker {
  margin-bottom: -4px;
  color: var(--accent-2);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.case-lead {
  max-width: 880px;
  color: var(--text);
  font-size: 1.05rem;
}

.case-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-facts span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.operational-scale {
  display: grid;
  gap: 14px;
}

.operational-scale h2 {
  margin-bottom: 0;
}

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

.scale-card {
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.scale-card-primary {
  border-color: var(--line-strong);
  background:
    linear-gradient(rgba(155, 207, 159, 0.08), rgba(155, 207, 159, 0.03)),
    var(--panel);
}

.scale-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.scale-card p {
  margin: 0;
  font-size: 0.88rem;
}

.scale-note {
  max-width: var(--readable);
  margin: 0;
  color: var(--subtle);
  font-size: 0.82rem;
}

.media-section {
  display: grid;
  gap: 18px;
}

.media-section h2 {
  margin-bottom: 0;
}

.shot {
  margin: 0;
}

.shot picture {
  display: block;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.shot figcaption {
  margin-top: 8px;
  color: var(--subtle);
  font-size: 0.82rem;
}

.case-grid {
  display: grid;
  gap: 14px;
}

.case-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.case-nav a {
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}

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

.scope-list div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.scope-list span {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-2);
  font-size: 0.82rem;
}

.scope-list p {
  margin: 0;
  font-size: 0.9rem;
}

.architecture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.architecture-unit {
  min-height: 150px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.architecture-unit span,
.flow-step span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-2);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.architecture-unit h3,
.timeline-detail h3 {
  margin-bottom: 8px;
  font-size: 0.96rem;
  line-height: 1.35;
}

.architecture-unit p {
  margin-bottom: 0;
  font-size: 0.88rem;
}

.flow-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.flow-step {
  position: relative;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.flow-step::after {
  position: absolute;
  top: 16px;
  right: 12px;
  color: var(--accent);
  content: "→";
}

.flow-step:last-child::after {
  content: "";
}

.flow-step p {
  margin-bottom: 0;
  font-size: 0.88rem;
}

.timeline-shell {
  display: grid;
  gap: 14px;
}

.timeline-help {
  margin-bottom: 0;
  color: var(--subtle);
  font-size: 0.82rem;
}

.timeline-track {
  display: grid;
  grid-auto-columns: minmax(240px, 300px);
  grid-auto-flow: column;
  gap: 10px;
  margin: 0 -2px;
  padding: 2px 2px 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-color: var(--line-strong) transparent;
  cursor: grab;
}

.timeline-track.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.timeline-item {
  appearance: none;
  min-height: 156px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.timeline-item[aria-selected="true"] {
  border-color: var(--accent);
  background:
    linear-gradient(rgba(155, 207, 159, 0.1), rgba(155, 207, 159, 0.04)),
    var(--panel);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(155, 207, 159, 0.24);
}

.timeline-item time {
  display: block;
  margin-bottom: 10px;
  color: var(--accent-2);
  font-size: 0.8rem;
}

.timeline-item strong {
  display: block;
  margin-bottom: 8px;
  color: inherit;
  font-size: 0.95rem;
  line-height: 1.35;
}

.timeline-item span {
  display: block;
  font-size: 0.84rem;
}

.timeline-panel {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 10px;
}

.timeline-detail,
.timeline-progress {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.timeline-detail p {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.timeline-date,
.timeline-tags {
  color: var(--subtle);
  font-size: 0.82rem;
}

.timeline-meter {
  height: 8px;
  margin: 10px 0 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(240, 243, 235, 0.04);
}

.timeline-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 180ms ease;
}

.timeline-progress p {
  margin: 0;
  color: var(--subtle);
  font-size: 0.82rem;
}

.compact-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.compact-list li::marker {
  color: var(--accent);
}

.skill-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.skill-groups div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.skill-groups div:last-child {
  grid-column: 1 / -1;
}

.skill-groups span {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-2);
  font-size: 0.82rem;
}

.skill-groups p {
  margin: 0;
  font-size: 0.9rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  color: var(--subtle);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .page {
    width: min(var(--max), calc(100% - 28px));
    padding-top: 28px;
  }

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

  .intro-actions {
    width: 100%;
    justify-content: space-between;
  }

  .case-page {
    --max: 760px;
  }

  .case-lead {
    font-size: 1rem;
  }

  .case-facts span {
    white-space: normal;
  }

  .scope-list {
    grid-template-columns: 1fr;
  }

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

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

  .open-wide {
    display: none;
  }

  .open-short {
    display: inline;
  }

  .architecture-grid,
  .flow-row,
  .timeline-panel {
    grid-template-columns: 1fr;
  }

  .timeline-track {
    grid-auto-columns: minmax(250px, 86vw);
  }

  .skill-groups {
    grid-template-columns: 1fr;
  }

  .skill-groups div:last-child {
    grid-column: auto;
  }

  .footer {
    align-items: center;
    justify-content: space-between;
  }
}
