@font-face {
  font-family: "Huiwen-mincho";
  src: url("../assets/fonts/Huiwen-mincho.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #8a382d;
  --ink-soft: rgba(138, 56, 45, 0.72);
  --paper: #fff;
  --board-width: 402px;
  --board-height: 874px;
  --page-scale: 1;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--paper);
}

body {
  overflow: hidden;
  color: var(--ink);
  font-family: "Huiwen-mincho", serif;
  -webkit-font-smoothing: antialiased;
}

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

img { display: block; }

.artboard {
  position: fixed;
  top: 50%;
  left: 50%;
  width: var(--board-width);
  height: var(--board-height);
  margin: 0;
  overflow: hidden;
  transform: translate(-50%, -50%) scale(var(--page-scale));
  transform-origin: center center;
  background-color: #fff;
}

.home-page {
  background: #fff;
}

.home-map-layer {
  position: absolute;
  z-index: 1;
  top: 0;
  left: -43px;
  width: 590px;
  height: 874px;
  object-fit: fill;
  opacity: 0.6;
  pointer-events: none;
}

.home-nav {
  position: absolute;
  z-index: 6;
  top: 14.5px;
  left: -2px;
  width: 100%;
  font-size: 20px;
  line-height: 21px;
  text-align: center;
}

.nav-row {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-row + .nav-row { margin-top: 9px; }

.nav-row a {
  display: inline-block;
  white-space: nowrap;
  transition: color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.nav-row a:hover,
.nav-row a:focus-visible {
  color: #5c231c;
  outline: none;
}

.line-selector {
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
}

.line-link {
  position: absolute;
  display: block;
  font-size: 14px;
  line-height: 14px;
  letter-spacing: 1.9px;
  color: #a91f24;
  opacity: 0;
  white-space: nowrap;
  pointer-events: auto;
  animation: line-fade 700ms ease forwards;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.line-link:nth-child(1) { left: 169px; top: 109px; }
.line-link:nth-child(2) { left: 270px; top: 308px; }
.line-link:nth-child(3) { left: 255px; top: 179px; }
.line-link:nth-child(4) { left: 90px;  top: 87px;  }
.line-link:nth-child(5) { left: 223px; top: 362px; }
.line-link:nth-child(6) { left: 57px;  top: 239px; }

.line-link:hover,
.line-link:focus-visible {
  color: #7a1416;
  outline: none;
  transform: scale(1.06);
}

.line-link:active { transform: scale(0.94); }

.home-seal {
  position: absolute;
  z-index: 3;
  inset: 0;
  margin: 0;
  pointer-events: none;
}

.seal-image {
  position: absolute;
  top: 437px;
  left: 141px;
  width: 244.5px;
  height: 115.5px;
}

.seal-english {
  position: absolute;
  font-family: Georgia, "Times New Roman", serif;
  top: 536px;
  left: 63px;
  font-size: 62.5px;
  line-height: 1;
  letter-spacing: -3.5px;
  color: var(--ink);
  opacity: 0.26;
}

.home-title {
  position: absolute;
  z-index: 5;
  top: 634px;
  left: 16px;
  margin: 0;
  font-size: 48px;
  line-height: 48px;
  font-weight: 400;
  letter-spacing: 0;
}

.home-title span { display: block; }

.home-footer {
  position: absolute;
  z-index: 5;
  inset: 0;
  pointer-events: none;
}

.footer-ghost {
  position: absolute;
  top: 710px;
  left: 22px;
  font-size: 56px;
  line-height: 1;
  font-style: italic;
  letter-spacing: -4px;
  color: var(--ink);
  opacity: 0.15;
  white-space: nowrap;
}

.footer-metropolitan {
  position: absolute;
  font-family: Georgia, "Times New Roman", serif;
  top: 736px;
  left: 18px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 3px;
  color: var(--ink);
  opacity: 0.5;
  white-space: nowrap;
}

.footer-line {
  position: absolute;
  left: 16px;
  font-size: 48px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--ink);
  opacity: 0.5;
  white-space: nowrap;
}

.footer-rail    { top: 763.5px; }
.footer-network { top: 811.5px; }

.route-page {
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% 100%;
}

.top-navigation {
  position: absolute;
  z-index: 5;
  top: 14px;
  right: 14px;
  display: flex;
  min-width: 104px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid rgba(138, 56, 45, 0.5);
  background: rgba(255, 255, 255, 0.88);
  font-size: 15px;
  transition: color 180ms ease, background-color 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.top-navigation:hover,
.top-navigation:focus-visible,
.top-navigation:active {
  color: #fff;
  background: var(--ink);
  outline: none;
}

.nav-arrow { font-size: 17px; }

.route-heading {
  position: absolute;
  top: 18px;
  left: 22px;
  right: 128px;
  z-index: 2;
  text-shadow: 0 1px 4px rgba(255,255,255,0.9);
}

.route-kicker {
  margin: 0 0 5px;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--ink-soft);
}

.route-heading h1 {
  margin: 0;
  font-size: 29px;
  line-height: 1.18;
  font-weight: 400;
}

.route-endpoints {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.3;
}

.route-description {
  position: absolute;
  z-index: 2;
  top: 475px;
  left: 18px;
  right: 18px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.88);
  border-left: 2px solid rgba(138, 56, 45, 0.62);
}

.route-description h2,
.scenic-list h2 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 2px;
}

.route-description p {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  text-align: justify;
}

.scenic-list {
  position: absolute;
  z-index: 2;
  top: 655px;
  left: 18px;
  right: 18px;
  padding: 8px 12px 10px;
  background: rgba(255, 255, 255, 0.88);
}

.scenic-list ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scenic-list li {
  font-size: 11px;
  line-height: 1.45;
}

.hero-item {
  opacity: 0;
  transform: translateY(22px);
  animation: hero-enter 850ms cubic-bezier(0.2, 0.72, 0.25, 1) forwards;
}

.home-nav      { animation-delay: 60ms; }
.home-map-layer { animation-delay: 0ms; }
.seal-image    { animation-delay: 300ms; }
.seal-english  { animation-delay: 420ms; }
.home-title    { animation-delay: 560ms; }
.home-footer   { animation-delay: 720ms; }
.route-heading { animation-delay: 100ms; }
.route-description { animation-delay: 300ms; }
.scenic-list   { animation-delay: 500ms; }
.top-navigation { animation-delay: 0ms; }

.line-link:nth-child(1) { animation-delay: 200ms; }
.line-link:nth-child(2) { animation-delay: 260ms; }
.line-link:nth-child(3) { animation-delay: 320ms; }
.line-link:nth-child(4) { animation-delay: 380ms; }
.line-link:nth-child(5) { animation-delay: 440ms; }
.line-link:nth-child(6) { animation-delay: 500ms; }

@keyframes hero-enter {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes line-fade {
  from { opacity: 0; }
  to { opacity: 0.8; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }
}
