@font-face {
  font-family: "Overpass";
  src: url("assets/overpass.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Overpass Mono";
  src: url("assets/overpass-mono.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #eef0ea;
  --paper-soft: #e5e7e0;
  --panel: #fafbf7;
  --ink: #16181a;
  --ink-soft: #3a3d3f;
  --muted: #62676a;
  --line: rgba(22, 24, 26, 0.16);
  --line-strong: rgba(22, 24, 26, 0.42);
  --blue: #1f4e9c;
  --blue-dark: #163a75;
  --red: #b23a2b;
  --red-dark: #8f2e24;
  --yellow: #e9b949;
  --white: #ffffff;
  --sans: "Overpass", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Overpass Mono", ui-monospace, "SFMono-Regular", "Cascadia Code", "Liberation Mono", monospace;
  --max: 1440px;
  --pad: clamp(1.25rem, 3.4vw, 3rem);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  caret-color: var(--blue);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--yellow);
  color: var(--ink);
}

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

a {
  color: var(--blue);
  text-underline-offset: 0.18em;
}

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

h1,
h2,
h3 {
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

button {
  font: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2.5px solid var(--blue);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--ink);
  color: var(--white);
  padding: 0.6rem 0.9rem;
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

section[id] {
  scroll-margin-top: 6rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.75rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--ink);
}

.brand b {
  font-size: 1.35rem;
  letter-spacing: 0.13em;
}

.brand span {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  font-size: 0.9rem;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.16s ease;
}

.site-nav a:hover {
  color: var(--blue);
}

.site-nav .lang {
  border: 1.5px solid var(--ink);
  padding: 0.28rem 0.55rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.25rem, 2.2vw, 2rem);
  padding-top: clamp(1.5rem, 3.4vw, 2.75rem);
  padding-bottom: clamp(1rem, 2vw, 1.5rem);
  min-height: calc(100svh - 4.75rem - 6.5rem);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.hero h1 {
  max-width: 11ch;
  margin-top: 0;
  font-size: clamp(3rem, 5.6vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

html[lang="en"] .hero h1 {
  max-width: 14ch;
  font-size: clamp(2.8rem, 4.8vw, 4.3rem);
}

.hero h1 .route-mark {
  display: inline-block;
  width: 0.52em;
  height: 0.52em;
  margin-right: 0.12em;
  border: 0.12em solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  vertical-align: 0.04em;
  position: relative;
}

.hero h1 .route-mark::after {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: var(--red);
}

.lede {
  max-width: 34rem;
  margin-top: 1.15rem;
  font-size: clamp(1rem, 1.25vw, 1.12rem);
  line-height: 1.62;
  color: var(--ink-soft);
}

.lede b {
  color: var(--ink);
  font-weight: 700;
}

.routes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.35rem;
}

.route {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1.5px solid var(--ink);
  padding: 0.38rem 0.65rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.route i {
  width: 1.25rem;
  height: 0.34rem;
  display: inline-block;
}

.route.a i {
  background: var(--blue);
}

.route.b i {
  background: var(--red);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  border: 1.5px solid var(--ink);
  padding: 0.65rem 1.05rem;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

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

.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.btn.primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: var(--white);
}

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

.btn.ghost:hover {
  background: var(--blue);
  color: var(--white);
}

.note {
  max-width: 32rem;
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.65;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* Map */

.map-panel {
  position: relative;
  min-height: 30rem;
  border: 2px solid var(--ink);
  background: var(--panel);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.map-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  position: relative;
  z-index: 2;
}

.map-head b {
  color: var(--ink);
  font-weight: 600;
}

.map-canvas {
  position: relative;
  flex: 1 1 auto;
  min-height: 22rem;
}

.map-canvas > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-grid {
  fill: none;
  stroke: rgba(22, 24, 26, 0.07);
  stroke-width: 1;
}

.rail-a {
  stroke: var(--blue);
  stroke-width: 11;
  stroke-linecap: round;
  fill: none;
}

.rail-b {
  stroke: var(--red);
  stroke-width: 11;
  stroke-linecap: round;
  fill: none;
}

.station-dot {
  fill: var(--panel);
  stroke: var(--ink);
  stroke-width: 3;
}

.station-core {
  fill: var(--ink);
}

.map-label {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.015em;
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--panel);
  stroke-width: 5px;
  stroke-linejoin: round;
}

.map-sub {
  font-family: var(--mono);
  font-size: 12px;
  fill: var(--muted);
  paint-order: stroke;
  stroke: var(--panel);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.map-station {
  text-decoration: none;
}

.map-station:hover .station-dot,
.map-station:focus-visible .station-dot {
  fill: var(--yellow);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  padding: 0 1.1rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  position: relative;
  z-index: 2;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.map-legend i {
  width: 1.1rem;
  height: 0.3rem;
  display: inline-block;
}

.map-legend .a {
  background: var(--blue);
}

.map-legend .b {
  background: var(--red);
}

.map-showcase {
  margin-left: auto;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1.5px solid var(--blue);
  padding-bottom: 1px;
  transition: color 0.16s ease;
}

.map-showcase:hover {
  color: var(--blue);
}

/* Install strip */

.install-strip {
  border-top: 2px solid var(--ink);
  background: var(--paper);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.command-block {
  min-width: 0;
}

.install-strip-inner {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr) auto;
  gap: 1.4rem;
  align-items: center;
  min-height: 5.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.install-label {
  font-family: var(--sans);
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.install-label b {
  display: block;
  font-weight: 700;
}

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.platform {
  border: 1.5px solid var(--ink);
  padding: 0.38rem 0.65rem;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.platform[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.command {
  display: flex;
  align-items: stretch;
  margin-top: 0.55rem;
  border: 1.5px solid var(--ink);
  background: var(--paper-soft);
  min-width: 0;
}

.command code {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.7rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.4;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--muted) transparent;
}

.copy {
  flex: 0 0 auto;
  border: 0;
  border-left: 1.5px solid var(--ink);
  background: transparent;
  padding: 0 0.9rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--ink);
}

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

.copy[data-copied="true"] {
  background: var(--blue);
  color: var(--white);
}

/* Sections */

.section {
  border-top: 2px solid var(--ink);
  padding-top: clamp(3rem, 6vw, 5.5rem);
  padding-bottom: clamp(3rem, 6vw, 5.5rem);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(1.5rem, 4vw, 4rem);
}

.section h2 {
  max-width: 14ch;
  margin-top: 0;
  font-size: clamp(1.85rem, 3.2vw, 3rem);
  font-weight: 800;
}

.section-head p {
  max-width: 26rem;
  margin-top: 1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* Route sequence */

.route-line {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  padding-top: 1.1rem;
}

.route-line::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  right: 0.45rem;
  top: 1.55rem;
  height: 0.45rem;
  background: linear-gradient(90deg, var(--blue) 0 46%, var(--ink) 46% 54%, var(--red) 54% 100%);
}

.stop {
  position: relative;
  padding-top: 2.5rem;
}

.stop::before {
  content: "";
  position: absolute;
  top: 0.88rem;
  left: 0;
  width: 1.35rem;
  height: 1.35rem;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}

.stop:first-child::before {
  background: var(--blue);
}

.stop:last-child::before {
  background: var(--red);
}

.stop h3 {
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.stop .tag {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.stop p {
  max-width: 22rem;
  margin-top: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.65;
}

/* Departure board */

.board {
  border-top: 2px solid var(--ink);
}

.board-row {
  display: grid;
  grid-template-columns: minmax(9rem, 1.1fr) minmax(0, 2fr) auto;
  gap: 1rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

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

.board-row .feature {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.board-row .feature i {
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
}

.board-row .desc {
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.55;
}

.board-row .state {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--blue);
  white-space: nowrap;
}

.board-note {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--muted);
}

/* Install detail */

.install-panel {
  border: 2px solid var(--ink);
  background: var(--panel);
  padding: clamp(1.1rem, 2vw, 1.6rem);
}

.install-panel .platforms {
  margin-bottom: 0.8rem;
}

.install-panel .command {
  background: var(--paper-soft);
}

.install-panel .command code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.install-lead {
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.install-lead b {
  color: var(--ink);
}

.manual {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}

.manual summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--blue);
}

.manual summary:hover {
  color: var(--blue-dark);
}

.manual[open] summary {
  margin-bottom: 0.8rem;
}

.install-panel .hint {
  margin-top: 0.8rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--muted);
}

.install-panel .hint a {
  color: var(--blue);
}

.req {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.req b {
  color: var(--ink);
}

/* Docs list */

.docs-list {
  border-top: 2px solid var(--ink);
}

.doc-row {
  transition: color 0.16s ease;
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: baseline;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}

.doc-row:hover {
  color: var(--blue);
}

.doc-row .line {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--red);
}

.doc-row h3 {
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.doc-row p {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.doc-row .arrow {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--blue);
}

/* Footer */

.site-footer {
  border-top: 2px solid var(--ink);
  background: var(--paper);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 2rem;
}

.footer-brand {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.8;
  color: var(--muted);
}

.footer-brand b {
  display: block;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  letter-spacing: 0.13em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.footer-links a {
  color: var(--ink);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--blue);
}

/* Motion */

@media (prefers-reduced-motion: no-preference) {
  .rail-a,
  .rail-b {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    animation: draw-rail 1.15s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  }

  .rail-b {
    animation-delay: 0.18s;
  }

  .map-station .station-dot,
  .map-station .station-core {
    opacity: 0;
    animation: station-in 0.35s ease-out 0.75s forwards;
  }

  @keyframes draw-rail {
    to {
      stroke-dashoffset: 0;
    }
  }

  @keyframes station-in {
    to {
      opacity: 1;
    }
  }


}

/* Responsive */

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero h1 {
    max-width: 14ch;
  }

  .map-panel {
    min-height: 34rem;
  }

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

  .section h2 {
    max-width: 20ch;
  }
}

@media (max-width: 860px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
    padding-block: 0.75rem;
  }

  .site-nav {
    width: 100%;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .install-strip-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.8rem;
    padding-block: 1rem;
  }

  .install-strip .btn {
    justify-self: start;
  }

  .install-strip .copy {
    min-height: 2.6rem;
  }

  .route-line {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 0;
  }

  .route-line::before {
    left: 0.6rem;
    right: auto;
    top: 0.8rem;
    bottom: 0.8rem;
    width: 0.45rem;
    height: auto;
    background: linear-gradient(180deg, var(--blue) 0 46%, var(--ink) 46% 54%, var(--red) 54% 100%);
  }

  .stop {
    padding: 0 0 1.6rem 2.5rem;
  }

  .stop::before {
    top: 0.1rem;
    left: 0;
  }

  .board-row {
    grid-template-columns: 1fr auto;
    gap: 0.35rem 0.8rem;
  }

  .board-row .desc {
    grid-column: 1 / -1;
  }

  .doc-row {
    grid-template-columns: 2.6rem minmax(0, 1fr);
  }

  .doc-row .arrow {
    display: none;
  }
}

@media (max-width: 620px) {
  html {
    font-size: 16px;
  }

  .hero {
    padding-top: 1.2rem;
  }

  .hero h1 {
    font-size: clamp(2.6rem, 11vw, 3.8rem);
  }

  .map-panel {
    min-height: 0;
  }

  .map-canvas {
    min-height: 20rem;
  }

  .map-legend {
    padding-bottom: 0.7rem;
  }

  .section {
    padding-block: 2.4rem;
  }

  .footer-inner {
    padding-block: 1.5rem;
  }
}

/* Mobile route diagram */
.mobile-route {
  display: none;
}

@media (max-width: 620px) {
  .map-canvas {
    display: none;
  }

  .map-panel {
    min-height: 0;
  }

  .mobile-route {
    display: block;
    position: relative;
    padding: 1.2rem 1.1rem 1.2rem 2rem;
  }

  .mobile-route::before {
    content: "";
    position: absolute;
    left: 0.65rem;
    top: 1.6rem;
    bottom: 1.6rem;
    width: 6px;
    background: linear-gradient(180deg, var(--blue) 0 45%, var(--ink) 45% 55%, var(--red) 55%);
  }

  .mr-stop {
    position: relative;
    padding: 0.65rem 0;
  }

  .mr-stop + .mr-stop {
    border-top: 1px solid var(--line);
  }

  .mr-dot {
    position: absolute;
    left: -1.75rem;
    top: 0.9rem;
    width: 1.2rem;
    height: 1.2rem;
    border: 3px solid var(--ink);
    border-radius: 50%;
    background: var(--paper);
  }

  .mr-dot.a {
    background: var(--blue);
  }

  .mr-dot.x {
    background: var(--yellow);
  }

  .mr-dot.b {
    background: var(--red);
  }

  .mr-stop b {
    display: block;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
  }

  .mr-stop em {
    display: block;
    margin-top: 0.15rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-style: normal;
    color: var(--muted);
  }

  .site-nav {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 0.55rem 0.75rem;
    font-size: 0.86rem;
  }
}

/* Mobile screenshot card */

.mobile-shot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.mobile-shot img {
  display: block;
  width: min(100%, 320px);
  height: auto;
  border: 4px solid var(--ink);
  border-radius: 1.3rem;
  box-shadow: 0 18px 40px rgba(22, 24, 26, 0.18);
}

.mobile-caption {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-align: center;
}
