:root {
  --paper: #f3efe6;
  --paper-2: #ebe5d8;
  --ink: #17191d;
  --ink-2: #2c2f35;
  --muted: #6a6d73;
  --line: #d3ccbc;
  --line-strong: #b7ae9a;
  --dark-line: #3a3d42;
  --accent: #c8471f;
  --accent-soft: #e2622f;
  --sage: #7fa89a;
  --sand: #d9c48a;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 1200px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

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

::selection {
  background: var(--accent);
  color: var(--paper);
}

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}

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

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  z-index: 100;
}

.skip:focus { left: 12px; top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px);
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  text-decoration: none;
}

.brand-mark,
.footer-brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
}

.brand-mark span,
.footer-brand span { color: var(--accent); }

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.nav {
  display: flex;
  gap: clamp(14px, 2.4vw, 28px);
  font-size: 13px;
}

.nav a {
  text-decoration: none;
  color: var(--ink-2);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}

.nav a:hover,
.nav a[aria-current="true"] {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

.status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- hero ---------- */

.hero {
  padding-top: clamp(56px, 9vw, 112px);
  padding-bottom: clamp(56px, 8vw, 96px);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: end;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
  flex: 0 0 auto;
}

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(36px, 4.6vw, 64px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
}

.lede {
  max-width: 36em;
  font-size: clamp(15px, 1.2vw, 17px);
  color: var(--ink-2);
  margin: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-decoration: none;
  padding: 12px 22px;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--paper);
}

.btn-primary:hover { background: var(--ink); }

.btn-ghost {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-light {
  border-color: var(--paper);
  color: var(--paper);
}

.btn-light:hover {
  background: var(--paper);
  color: var(--ink);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(24px, 4vw, 48px);
  margin: 42px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.hero-meta div { margin: 0; }

.hero-meta dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.hero-meta dd {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 18px;
}

.flow-figure {
  margin: 0;
  padding-left: clamp(20px, 3vw, 40px);
  border-left: 1px solid var(--line);
}

.flow { width: 100%; height: auto; display: block; }

.flow-axis { stroke: var(--ink); stroke-width: 1; }

.flow-steps circle {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.5;
}

.flow-steps circle:nth-child(3) {
  fill: var(--accent);
  stroke: var(--accent);
}

.flow-nums text {
  font-family: var(--mono);
  font-size: 14px;
  fill: var(--accent);
  text-anchor: middle;
  letter-spacing: 0.08em;
}

.flow-labels text {
  font-family: var(--serif);
  font-size: 24px;
  fill: var(--ink);
  text-anchor: middle;
}

.flow-notes text {
  font-family: var(--mono);
  font-size: 16px;
  fill: var(--muted);
  text-anchor: middle;
}

.flow-notes .note-strong {
  fill: var(--accent);
  text-anchor: start;
  letter-spacing: 0.04em;
}

.flow-figure figcaption {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 14px;
  max-width: 40ch;
}

/* ---------- sections ---------- */

.section {
  padding: clamp(64px, 8vw, 112px) 0;
  border-bottom: 1px solid var(--line);
}

.section-alt { background: var(--paper-2); }

.section-dark {
  background: var(--ink);
  color: var(--paper);
  border-bottom: 0;
}

.section-head {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  column-gap: clamp(16px, 2.5vw, 32px);
  align-items: start;
}

.section-head .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  padding-top: 12px;
}

.section-head h2 {
  grid-column: 2;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(30px, 3.6vw, 52px);
  line-height: 1.16;
  letter-spacing: -0.015em;
  margin: 0;
}

.section-lede {
  grid-column: 2;
  max-width: 44em;
  margin: 18px 0 0;
  color: var(--ink-2);
  font-size: clamp(15px, 1.1vw, 16.5px);
}

.section-dark .section-head .num { color: var(--accent-soft); }
.section-dark .section-lede { color: rgba(243, 239, 230, 0.72); }

/* ---------- services ---------- */

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 56px;
}

.service {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  padding: 26px clamp(18px, 2vw, 26px) 28px;
}

.service-no {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.service h3 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  margin: 10px 0 8px;
  letter-spacing: -0.01em;
}

.service-for {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  min-height: 4.9em;
}

.deliverables {
  list-style: none;
  margin: 18px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-2);
}

.deliverables li {
  padding: 3px 0 3px 18px;
  position: relative;
}

.deliverables li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.facts {
  display: flex;
  gap: 28px;
  margin: auto 0 0;
  padding-top: 20px;
}

.facts div { margin: 0; }

.facts dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.facts dd {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 16px;
}

.footnote {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--muted);
  border-left: 2px solid var(--line-strong);
  padding-left: 16px;
  margin: 40px 0 0;
  max-width: 72ch;
}

/* ---------- process ---------- */

.process-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 44px);
  margin: 60px 0 0;
  padding: 0;
}

.process-grid li {
  border-top: 2px solid var(--ink);
  padding-top: 16px;
}

.step-no {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.process-grid h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin: 8px 0 8px;
}

.process-grid p {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-2);
}

/* ---------- fit ---------- */

.fit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 5vw, 72px);
  margin-top: 56px;
}

.fit-col {
  border-top: 2px solid var(--ink);
  padding-top: 20px;
}

.fit-col h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 14px;
}

.fit-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fit-col li {
  position: relative;
  padding: 8px 0 8px 20px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--ink-2);
}

.fit-col li::before {
  content: "·";
  position: absolute;
  left: 2px;
  top: 4px;
  font-size: 20px;
  color: var(--accent);
}

.fit-col-no { border-top-color: var(--line-strong); }
.fit-col-no h3 { color: var(--muted); }

.fit-col-no li::before {
  content: "×";
  top: 8px;
  font-size: 13px;
  color: var(--line-strong);
}

.stack {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.stack h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 10px;
}

.stack p {
  margin: 0;
  max-width: 72ch;
  font-size: 15px;
  color: var(--ink-2);
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
}

.chips li {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 6px 10px;
}

/* ---------- contact ---------- */

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 52px;
  padding-top: 36px;
  border-top: 1px solid var(--dark-line);
}

.mail {
  font-family: var(--serif);
  font-size: clamp(22px, 4.4vw, 52px);
  letter-spacing: -0.01em;
  color: var(--paper);
  text-decoration: none;
  border-bottom: 2px solid var(--accent-soft);
  padding-bottom: 4px;
  overflow-wrap: anywhere;
}

.mail:hover { color: var(--sand); }

.mail-hints {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 18px clamp(24px, 4vw, 56px);
  margin: 52px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--dark-line);
  font-size: 13px;
  color: rgba(243, 239, 230, 0.72);
}

.mail-hints span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent-soft);
  margin-right: 8px;
  letter-spacing: 0.08em;
}

/* ---------- footer ---------- */

.footer {
  padding: 32px 0;
  background: var(--paper);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer p {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.icp {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
}

.icp:hover { color: var(--ink); }

.to-top {
  font-family: var(--mono);
  font-size: 11px;
  text-decoration: none;
  color: var(--muted);
}

.to-top:hover { color: var(--ink); }

/* ---------- reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .service-grid { grid-template-columns: 1fr; }
  .service-for { min-height: 0; }
  .process-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status { display: none; }
}

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .flow-figure {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 28px;
  }
  .brand-sub { display: none; }
  .section-head { grid-template-columns: 44px minmax(0, 1fr); }
}

@media (max-width: 680px) {
  .topbar-inner { height: 56px; gap: 10px; }
  .brand { flex: 0 0 auto; }
  .nav {
    gap: 12px;
    font-size: 12px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: 0 0 auto; }
  .section-head { grid-template-columns: 1fr; }
  .section-head .num { padding-top: 0; margin-bottom: 8px; }
  .section-head h2,
  .section-lede { grid-column: 1; }
  .process-grid,
  .fit-grid { grid-template-columns: 1fr; }
  .contact { flex-direction: column; align-items: flex-start; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
