/* ============================================================
   山与景 · 项目档案
   Style: Making Software 手册风（纸白 / 墨线 / 衬线标题 / 等宽标签）
   ============================================================ */

:root {
  --paper: #f3f0e8;
  --paper-2: #e9e5da;
  --ink: #131310;
  --muted: #6a685c;
  --line: #131310;
  --green: #2f6b4f;
  --red: #a4422f;
  --blue: #2b5fa8;
  --yellow: #c9971f;

  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, "Times New Roman", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --max: 1180px;
  --gutter: clamp(18px, 4vw, 48px);
  --edge: 1px solid var(--line);
  --shadow: 5px 5px 0 var(--ink);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 纸面细网格 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(19, 19, 16, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(19, 19, 16, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
}

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

a {
  color: inherit;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: rgba(19, 19, 16, 0.07);
  padding: 0.08em 0.35em;
  border: 1px solid rgba(19, 19, 16, 0.18);
}

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font-family: var(--mono);
}
.skip-link:focus {
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  left: 12px;
  top: 12px;
}

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px var(--gutter);
  background: rgba(243, 240, 232, 0.94);
  border-bottom: var(--edge);
  backdrop-filter: blur(6px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 14px;
  height: 14px;
  background: var(--ink);
  display: inline-block;
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--paper);
}

.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.04em;
}

.brand-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 10px;
}

.site-nav {
  display: flex;
  gap: clamp(12px, 2.4vw, 30px);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.site-nav a {
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-nav a:hover,
.site-nav a:focus-visible {
  border-bottom-color: var(--ink);
}

/* ---------------- Shared ---------------- */
main {
  position: relative;
  z-index: 1;
}

.hero,
.index-strip,
.projects-section,
.system-section,
.tech-section,
.services-section {
  padding-inline: var(--gutter);
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
}

.eyebrow,
.section-kicker,
.figure-caption,
.card-en,
.card-no,
.card-status,
.index-label,
.brand-sub,
.footer-meta,
.service-name {
  font-family: var(--mono);
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin: 0 0 18px;
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(28px, 4vw, 46px);
}

.section-kicker {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  border: var(--edge);
  padding: 4px 8px;
  margin-bottom: 16px;
  background: var(--paper-2);
}

.section-head h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(30px, 4.4vw, 50px);
  line-height: 1.16;
  letter-spacing: 0.01em;
  margin: 0 0 14px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  max-width: 62ch;
}

/* ---------------- Hero ---------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding-block: clamp(48px, 8vw, 104px) clamp(36px, 5vw, 66px);
  border-bottom: var(--edge);
  position: relative;
}

.hero-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, rgba(19, 19, 16, 0.06) 1px, transparent 1px);
  background-size: 25% 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.16;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
  text-wrap: balance;
}

.hero-lede {
  font-size: clamp(15px, 1.5vw, 18px);
  color: #3a392f;
  max-width: 46ch;
  margin: 0 0 28px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
}

.btn {
  display: inline-block;
  text-decoration: none;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 13px 22px;
  border: var(--edge);
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.btn:hover,
.btn:focus-visible {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--ink);
}

.text-link {
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
.text-link:hover {
  color: var(--green);
  border-bottom-color: var(--green);
}

.hero-figure {
  position: relative;
  margin: 0;
  border: var(--edge);
  background: var(--paper-2);
  padding: 18px;
  box-shadow: var(--shadow);
}

.hero-figure img {
  width: 100%;
}

.figure-caption {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(19, 19, 16, 0.35);
}

/* ---------------- Index strip ---------------- */
.index-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: var(--edge);
}

.index-item {
  padding: clamp(20px, 3vw, 30px) clamp(14px, 2vw, 24px);
  border-right: var(--edge);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.index-item:last-child {
  border-right: none;
}

.index-num {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
  font-weight: 700;
}
.index-num .plus {
  font-size: 0.5em;
  vertical-align: super;
  color: var(--green);
}

.index-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* ---------------- Projects ---------------- */
.projects-section,
.system-section,
.tech-section,
.services-section {
  padding-block: clamp(52px, 8vw, 96px);
  border-bottom: var(--edge);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.6vw, 30px);
}

.project-card {
  display: flex;
  flex-direction: column;
  border: var(--edge);
  background: var(--paper);
  padding: clamp(18px, 2.4vw, 28px);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.project-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-no {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
  border: var(--edge);
  padding: 2px 8px;
}

.card-status {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  padding: 3px 9px;
  border: 1px solid currentColor;
}
.card-status.live {
  color: var(--green);
}
.card-status.ship {
  color: var(--blue);
}

.project-card h3 {
  font-family: var(--serif);
  font-size: clamp(21px, 2.4vw, 28px);
  font-weight: 700;
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.card-en {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.card-desc {
  margin: 0 0 16px;
  font-size: 14.5px;
  color: #3d3c31;
  line-height: 1.75;
}

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

.tag-list li {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  border: 1px solid rgba(19, 19, 16, 0.4);
  padding: 3px 8px;
  background: var(--paper-2);
}

.card-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed rgba(19, 19, 16, 0.35);
}

.card-link {
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
  color: var(--blue);
  word-break: break-all;
}
.card-link:hover {
  text-decoration: underline;
}

.card-note {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------------- System ---------------- */
.system-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(26px, 4vw, 54px);
  align-items: start;
}

.system-figure {
  margin: 0;
  border: var(--edge);
  background: var(--paper-2);
  padding: 18px;
  box-shadow: var(--shadow);
}

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

.chapter-list li {
  border-left: 3px solid var(--ink);
  padding-left: 16px;
}

.chapter-no {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--green);
}

.chapter-list h3 {
  font-family: var(--serif);
  font-size: 20px;
  margin: 4px 0 6px;
}

.chapter-list p {
  margin: 0;
  font-size: 14.5px;
  color: #3d3c31;
}

/* ---------------- Tech table ---------------- */
.table-wrap {
  overflow-x: auto;
  border: var(--edge);
  box-shadow: var(--shadow);
  background: var(--paper);
}

.tech-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 660px;
  font-size: 14px;
}

.tech-table th,
.tech-table td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(19, 19, 16, 0.25);
  vertical-align: top;
}

.tech-table thead th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--paper);
  background: var(--ink);
  position: sticky;
  top: 0;
}

.tech-table tbody th {
  font-family: var(--serif);
  font-size: 15px;
  white-space: nowrap;
}

.tech-table tbody tr:nth-child(even) {
  background: rgba(19, 19, 16, 0.035);
}

.tech-table tbody tr:last-child th,
.tech-table tbody tr:last-child td {
  border-bottom: none;
}

/* ---------------- Services ---------------- */
.service-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: var(--edge);
}

.service-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: 16px;
  align-items: baseline;
  padding: 16px 4px;
  border-bottom: 1px solid rgba(19, 19, 16, 0.28);
  transition: background-color 0.16s ease;
}
.service-list li:hover {
  background: rgba(19, 19, 16, 0.035);
}

.service-name {
  font-size: 13px;
  letter-spacing: 0.08em;
}

.service-desc {
  color: var(--muted);
  font-size: 14.5px;
}

.service-list a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
}
.service-list a:hover {
  text-decoration: underline;
}

/* ---------------- Footer ---------------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(36px, 5vw, 58px) var(--gutter);
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.footer-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
}

.footer-note {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  max-width: 52ch;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.footer-meta a {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

/* ---------------- Motion ---------------- */
.motion-ready [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.motion-ready [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* SVG 线条绘制 */
.system-figure img,
.hero-figure img {
  transition: transform 0.4s ease;
}

[data-parallax] {
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .motion-ready [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .project-card,
  .btn,
  .hero-figure img {
    transition: none;
  }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .hero,
  .system-layout {
    grid-template-columns: 1fr;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .index-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .index-item {
    border-bottom: var(--edge);
  }
  .index-item:nth-child(2n) {
    border-right: none;
  }
  .index-item:nth-last-child(-n + 2) {
    border-bottom: none;
  }
  .hero-figure {
    max-width: 560px;
  }
}

@media (max-width: 620px) {
  .brand-sub {
    display: none;
  }
  .site-nav {
    gap: 14px;
    font-size: 11px;
  }
  .service-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .footer-meta {
    align-items: flex-start;
  }
}
