:root {
  color-scheme: light;
  --ink: #19201d;
  --muted: #5c655f;
  --paper: #f6efe0;
  --paper-strong: #fff9ee;
  --spring: #dce9d8;
  --jade: #2f6656;
  --lantern: #bf4f2f;
  --gold: #d7a94f;
  --night: #14231f;
  --line: rgba(25, 32, 29, 0.16);
  --shadow: 0 22px 60px rgba(25, 32, 29, 0.14);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  --sans: "LXGW WenKai", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  letter-spacing: 0;
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
a.button {
  font: inherit;
}

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--night);
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.02);
  transform: scale(1.02);
}

.hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 18, 15, 0.84), rgba(10, 18, 15, 0.36) 54%, rgba(10, 18, 15, 0.08)),
    linear-gradient(0deg, rgba(10, 18, 15, 0.72), transparent 52%);
}

.topline {
  position: absolute;
  top: 18px;
  left: 50%;
  z-index: 2;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
  padding: 7px;
  border: 1px solid rgba(255, 249, 238, 0.22);
  border-radius: 8px;
  background: rgba(20, 35, 31, 0.48);
  backdrop-filter: blur(16px);
}

.topline a {
  min-width: 56px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #fff9ee;
  font-size: 0.92rem;
  text-align: center;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease;
}

.topline a.is-active,
.topline a:hover {
  color: var(--night);
  background: var(--paper-strong);
}

.hero__content {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 12vh;
  color: var(--paper-strong);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 700;
}

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

h1,
h2 {
  font-family: var(--serif);
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  max-width: 10em;
  margin-bottom: 20px;
  font-size: 4.6rem;
  line-height: 1.06;
}

h1 span {
  display: block;
}

.hero__lead {
  max-width: 620px;
  margin-bottom: 30px;
  color: rgba(255, 249, 238, 0.9);
  font-size: 1.14rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.hero__actions,
.tools__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button--primary {
  color: var(--paper-strong);
  background: var(--lantern);
  box-shadow: 0 14px 30px rgba(191, 79, 47, 0.26);
}

.button--light {
  color: var(--ink);
  border-color: var(--line);
  background: var(--paper-strong);
}

.subpage {
  background: #fff8ea;
}

.subhero {
  position: relative;
  min-height: 74svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(20, 35, 31, 0.92), rgba(20, 35, 31, 0.68)),
    url("./assets/mingshui-night.png") center / cover;
}

.subhero__content {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 10vh;
  color: var(--paper-strong);
}

main {
  overflow: hidden;
}

.quick-notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}

.note {
  min-height: 220px;
  padding: 38px;
  background: var(--paper-strong);
}

.note:nth-child(2) {
  background: var(--spring);
}

.note:nth-child(3) {
  background: #f3ddd1;
}

.note__label {
  display: block;
  margin-bottom: 18px;
  color: var(--lantern);
  font-weight: 700;
}

.note strong {
  display: block;
  margin-bottom: 12px;
  font-family: var(--serif);
  font-size: 1.36rem;
}

.note p,
.section p,
.timeline p,
.confirm__item p,
.footer p {
  color: var(--muted);
  line-height: 1.85;
}

.section {
  padding: 96px max(28px, calc((100vw - 1120px) / 2));
}

.section--split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 58px;
  align-items: center;
}

.section__intro h2,
.day__header h2,
.tools__copy h2 {
  margin-bottom: 18px;
  font-size: 3rem;
  line-height: 1.16;
}

.section__intro p {
  max-width: 650px;
}

.route-summary {
  border-top: 1px solid var(--line);
}

.route-summary div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.route-summary span {
  color: var(--muted);
}

.route-summary strong {
  font-family: var(--serif);
  font-size: 1.25rem;
  text-align: right;
}

.transport-teaser {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: end;
  background: #fff8ea;
}

.transport-teaser .button {
  margin-bottom: 8px;
  white-space: nowrap;
}

.trains {
  background: #fff8ea;
}

.trains--standalone {
  padding-top: 96px;
}

.train-picks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 42px;
  background: var(--line);
}

.train-pick {
  min-height: 210px;
  padding: 30px;
  background: #fffdf7;
}

.train-pick:nth-child(2) {
  background: #eef5e9;
}

.train-pick:nth-child(3) {
  background: #f6d8c8;
}

.train-pick span,
.train-board__header span {
  display: block;
  margin-bottom: 12px;
  color: var(--lantern);
  font-weight: 800;
}

.train-pick strong {
  display: block;
  margin-bottom: 12px;
  font-family: var(--serif);
  font-size: 2rem;
}

.train-pick p,
.train-note {
  color: var(--muted);
  line-height: 1.8;
}

.train-board {
  margin-top: 54px;
}

.train-board + .train-board {
  margin-top: 48px;
}

.train-board__header {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.train-board__header h3 {
  margin-bottom: 0;
  font-family: var(--serif);
  font-size: 2rem;
}

.train-board__header p {
  max-width: 420px;
  margin-bottom: 2px;
  text-align: right;
}

.train-list {
  display: grid;
}

.train-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 210px 96px;
  gap: 20px;
  align-items: center;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.train-row strong {
  font-family: var(--serif);
  font-size: 1.25rem;
}

.train-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.train-row b {
  font-weight: 800;
}

.train-row span {
  color: var(--muted);
}

.train-row em {
  color: var(--jade);
  font-style: normal;
  font-weight: 800;
}

.train-row small {
  justify-self: end;
  padding: 6px 9px;
  border-radius: 7px;
  color: var(--ink);
  background: #f2ead8;
  font-weight: 800;
  white-space: nowrap;
}

.train-row--recommended {
  margin: 8px 0;
  padding: 18px;
  border: 1px solid rgba(191, 79, 47, 0.32);
  border-radius: 8px;
  background: #fff1df;
}

.train-row--recommended small {
  color: var(--paper-strong);
  background: var(--lantern);
}

.train-row--muted {
  opacity: 0.66;
}

.train-note {
  margin: 32px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.day {
  padding: 86px max(28px, calc((100vw - 1120px) / 2));
  background: var(--paper-strong);
}

.day--green {
  background: #eef5e9;
}

.day__header {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: end;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--line);
}

.day__kicker {
  flex: 0 0 auto;
  margin-bottom: 24px;
  color: var(--jade);
  font-weight: 800;
}

.timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline__item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 34px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.timeline__item time {
  color: var(--lantern);
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 800;
}

.timeline__item h3,
.confirm__item h3 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.timeline__item p {
  max-width: 760px;
  margin-bottom: 0;
}

.timeline__item--key {
  padding: 34px 24px;
  border: 1px solid rgba(191, 79, 47, 0.35);
  border-radius: 8px;
  background: #fff2df;
  box-shadow: var(--shadow);
}

.confirm {
  background: #243c35;
  color: var(--paper-strong);
}

.confirm .section__intro p {
  color: rgba(255, 249, 238, 0.72);
}

.confirm__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 42px;
  background: rgba(255, 249, 238, 0.18);
}

.confirm__item {
  min-height: 230px;
  padding: 28px;
  background: #243c35;
}

.confirm__item span {
  display: inline-block;
  margin-bottom: 30px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 800;
}

.confirm__item p {
  color: rgba(255, 249, 238, 0.72);
}

.tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  background: #f6d8c8;
}

.tools__actions {
  justify-content: flex-end;
}

.footer {
  display: grid;
  gap: 12px;
  padding: 34px max(24px, calc((100vw - 1120px) / 2));
  background: var(--ink);
  color: var(--paper-strong);
}

.footer p {
  margin: 0;
  color: rgba(255, 249, 238, 0.7);
  font-size: 0.92rem;
}

.footer a {
  margin-right: 12px;
  color: var(--paper-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 620ms ease, transform 620ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  h1 {
    font-size: 3.3rem;
  }

  .quick-notes,
  .train-picks,
  .transport-teaser,
  .section--split,
  .tools {
    grid-template-columns: 1fr;
  }

  .confirm__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tools__actions {
    justify-content: flex-start;
  }

  .transport-teaser .button {
    justify-self: start;
    margin-bottom: 0;
  }

  .train-row {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .train-row em,
  .train-row small {
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 92svh;
  }

  .subhero {
    min-height: 72svh;
  }

  .topline {
    top: 12px;
    width: calc(100% - 28px);
    justify-content: center;
  }

  .hero__content {
    width: calc(100% - 28px);
    padding-bottom: 8vh;
  }

  .subhero__content {
    width: calc(100% - 28px);
    padding-bottom: 8vh;
  }

  h1 {
    font-size: 2.34rem;
  }

  .hero__lead {
    font-size: 1rem;
  }

  .hero__actions,
  .tools__actions {
    display: grid;
  }

  .note,
  .section,
  .day {
    padding: 54px 20px;
  }

  .section__intro h2,
  .day__header h2,
  .tools__copy h2 {
    font-size: 2.1rem;
  }

  .day__header {
    display: block;
  }

  .day__kicker {
    display: block;
    margin-bottom: 12px;
  }

  .timeline__item,
  .timeline__item--key {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .timeline__item--key {
    padding: 24px 18px;
  }

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

  .confirm__item {
    min-height: auto;
  }

  .route-summary div {
    display: block;
  }

  .route-summary strong {
    display: block;
    margin-top: 6px;
    text-align: left;
  }

  .train-pick {
    min-height: auto;
    padding: 24px 20px;
  }

  .train-board__header {
    display: block;
  }

  .train-board__header h3 {
    font-size: 1.6rem;
  }

  .train-board__header p {
    max-width: none;
    text-align: left;
  }

  .train-row,
  .train-row--recommended {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 18px 0;
  }

  .train-row--recommended {
    padding: 18px;
  }

  .train-row strong {
    font-size: 1.18rem;
  }

  .train-row em,
  .train-row small {
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button,
  .reveal {
    transition: none;
  }

  .hero__image,
  .button:hover,
  .reveal {
    transform: none;
  }

}
