/* 鐵道誌 / Taiwan Rail Log — landing.
   Tokens mirror TwraillogApp/DesignSystem/Tokens/Color+Twraillog.swift
   (paper #FBFAF6, ink #1A1813, accent burgundy #7A2E3B) plus the 臺鐵
   station-sign blue from the app icon (#1961B8). Series layout follows
   the Tetsulog landing (~/kkirukstudio-site/tetsulog/). */
:root {
  --accent: #7a2e3b;
  --accent-soft: #f2e3e5;
  --sign: #1961b8;
  --ink: #1a1813;
  --ink2: rgba(26,24,19,.62);
  --ink3: rgba(26,24,19,.44);
  --paper: #fbfaf6;
  --paper-2: #f3f1ea;
  --rule: rgba(26,24,19,.14);
  --rule-soft: rgba(26,24,19,.07);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --serif: "Songti TC", "Hiragino Mincho ProN", "Noto Serif TC", "Noto Serif CJK TC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", sans-serif;
  --unridden: rgba(110,106,94,.30);
  --thsr: #e8722a;
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans); color: var(--ink); background: var(--paper);
  line-height: 1.65; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
/* keep-all suits Korean; in Chinese / Japanese it only breaks at punctuation
   and leaves ragged lines, so those locales break normally. */
html:not([lang="ko"]) :is(p, h2, h3, figcaption) { word-break: normal !important; line-break: strict; }
img { display: block; max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.kicker {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  letter-spacing: .24em; text-transform: uppercase; color: var(--accent);
}
.kicker .glyph { font-family: var(--serif); font-size: 15px; letter-spacing: 0; }
.kicker .rule { flex: 1; height: 1px; background: var(--rule); }
.kicker .num { color: var(--ink3); letter-spacing: .08em; text-transform: none; }

/* ---------- nav ---------- */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,250,246,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule-soft);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.wordmark img { width: 28px; height: 28px; border-radius: 7px; }
.wordmark span { font-family: var(--serif); font-size: 17px; font-weight: 700; letter-spacing: .06em; }
.lang { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.lang a { font-size: 12px; font-weight: 700; text-decoration: none; padding: 4px 7px; border-radius: 7px; color: var(--ink2); }
.lang a:hover { color: var(--ink); }
.lang a.cur { color: var(--accent); pointer-events: none; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, #fff, var(--paper)); }
.hero .wrap {
  display: grid; grid-template-columns: 1.08fr .92fr; gap: 52px; align-items: center;
  padding-top: 64px; padding-bottom: 72px;
}
.hero .wrap > * { min-width: 0; }
.hero h1 {
  margin: 28px 0 0; font-family: var(--serif); font-size: clamp(32px, 4.6vw, 52px); line-height: 1.3;
  font-weight: 700; letter-spacing: .01em; word-break: keep-all;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .sub { margin-top: 22px; max-width: 34em; font-size: 16.5px; color: var(--ink2); word-break: keep-all; }
.cta { margin: 30px 0 0; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.store-badge {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 22px;
  border: 1px solid rgba(255,255,255,.1); transition: transform .15s ease;
}
.store-badge:hover { transform: translateY(-2px); }
.store-badge.disabled { background: transparent; color: var(--ink3); border: 1px dashed var(--rule); cursor: default; pointer-events: none; }
.store-badge svg { width: 22px; height: 22px; fill: currentColor; }
.store-badge .txt { line-height: 1.15; text-align: left; }
.store-badge .txt small { display: block; font-size: 11px; opacity: .75; }
.store-badge .txt strong { font-size: 16px; font-weight: 700; letter-spacing: .01em; }
.cta .note { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; color: var(--ink3); }

/* ---------- 站名牌 title card (the app icon's motif) ---------- */
.sign {
  display: inline-block; min-width: min(100%, 420px); background: var(--sign); padding: 9px; border-radius: 6px;
  box-shadow: 0 22px 44px rgba(25,97,184,.18);
}
.sign .panel { background: #fff; border-radius: 2px; overflow: hidden; }
.sign .top { height: 5px; background: var(--sign); margin: 8px 10px 0; }
.sign .name { text-align: center; padding: 10px 18px 8px; }
.sign .name .zh { font-family: var(--sans); font-weight: 800; font-size: 34px; letter-spacing: .3em; margin-right: -.3em; line-height: 1.2; }
.sign .name .en { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .3em; color: var(--ink3); margin-top: 2px; }
.sign .adj {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--sign); color: #fff; margin: 0 10px 10px; padding: 6px 10px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .06em; white-space: nowrap;
}
.sign .adj span { display: inline-flex; align-items: center; gap: 7px; }
.sign .adj i { width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.sign .adj .l i { border-right: 9px solid #fff; }
.sign .adj .r i { border-left: 9px solid #fff; }

/* ---------- hero rail map ---------- */
.railmap {
  position: relative; background: #fff; border: 1px solid var(--rule); border-radius: 22px;
  padding: 18px 18px 14px; box-shadow: 0 30px 60px rgba(26,24,19,.09); overflow: hidden;
  max-width: 440px; margin: 0 auto;
}
.railmap svg { width: 100%; height: auto; display: block; }
.county { fill: #efece3; stroke: #fff; stroke-width: 2.4; stroke-linejoin: round; }
.base { fill: none; stroke: var(--unridden); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.ride {
  fill: none; stroke: var(--c); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 100; stroke-dashoffset: 100;
  animation: draw var(--d, .62s) ease-in-out forwards; animation-delay: calc(.4s + var(--g) * .62s);
}
.ride.thsr { stroke-width: 7; }
.ride.tra-br, .ride.afr { stroke-width: 7; }
.ride.trtc-r, .ride.trtc-bl, .ride.krtc-r { stroke-width: 7; }
.st {
  fill: #fff; stroke: var(--unridden); stroke-width: 3.5;
  animation: ink .3s ease-out forwards; animation-delay: calc(.4s + (var(--g) + 1) * .62s);
}
.labels text {
  font-family: var(--sans); font-weight: 700; font-size: 34px; fill: var(--ink);
  paint-order: stroke; stroke: #fff; stroke-width: 8px; stroke-linejoin: round;
}
.g0{--g:0}.g1{--g:1}.g2{--g:2}.g3{--g:3}.g4{--g:4}.g5{--g:5}.g6{--g:6}.g7{--g:7}.g8{--g:8}.g9{--g:9}.g10{--g:10}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes ink { to { stroke: var(--accent); } }

.stamp {
  position: absolute; right: 22px; bottom: 64px; width: 104px; height: 104px; border-radius: 50%;
  border: 3.5px solid var(--accent); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-family: var(--serif); pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.9), rgba(255,255,255,.55) 70%);
  opacity: 0; transform: rotate(-14deg) scale(1.5);
  animation: stamp .35s cubic-bezier(.2,.9,.3,1.3) forwards; animation-delay: 7.6s;
}
.stamp::before { content: ""; position: absolute; inset: 7px; border: 1px solid var(--accent); border-radius: 50%; opacity: .6; }
.stamp span { font-size: 25px; font-weight: 700; letter-spacing: .1em; }
@keyframes stamp { to { opacity: .92; transform: rotate(-14deg) scale(1); } }

.railmap .read {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  border-top: 1px solid var(--rule-soft); margin-top: 10px; padding-top: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--ink3);
}
.railmap .read b { font-size: 22px; color: var(--accent); letter-spacing: 0; margin-right: 4px; font-variant-numeric: tabular-nums; }
.railmap-credit { max-width: 440px; margin: 8px auto 0; font-family: var(--mono); font-size: 9.5px; letter-spacing: .04em; color: var(--ink3); text-align: right; }

@media (prefers-reduced-motion: reduce) {
  .ride, .st, .stamp { animation: none !important; }
  .ride { stroke-dashoffset: 0; }
  .st { stroke: var(--accent); }
  .stamp { opacity: .92; transform: rotate(-14deg); }
}

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); background: #fff; }
.marquee .track {
  display: flex; gap: 40px; padding: 14px 0; width: max-content;
  font-size: 13px; font-weight: 700; letter-spacing: .18em; color: var(--ink2);
  animation: scroll 40s linear infinite;
}
.marquee .track span { display: inline-flex; align-items: center; gap: 9px; }
.marquee .track i { width: 14px; height: 4px; border-radius: 2px; background: var(--c); }
.marquee .track span.hl { color: var(--accent); font-family: var(--serif); }
@keyframes scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee .track { animation: none; } }

/* ---------- sections ---------- */
section { padding: 84px 0; }
section h2 { font-family: var(--serif); font-size: clamp(24px, 3.2vw, 36px); font-weight: 700; line-height: 1.4; margin: 20px 0 14px; word-break: keep-all; }
section h2 em { font-style: normal; color: var(--accent); }
section .lede { color: var(--ink2); max-width: 42em; font-size: 16px; word-break: keep-all; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 46px; }
.step { position: relative; border-top: 1px solid var(--rule); padding-top: 22px; }
.step .n { position: absolute; right: 0; top: 6px; font-family: var(--serif); font-weight: 700; font-size: 80px; line-height: 1; color: rgba(26,24,19,.06); pointer-events: none; }
.step h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.step p { color: var(--ink2); font-size: 14.5px; word-break: keep-all; }
.step .tag { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .2em; color: var(--accent); display: block; margin-bottom: 10px; }

/* ---------- value / ghost numeral ---------- */
.value { position: relative; overflow: hidden; background: var(--paper-2); border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); }
.value .ghost {
  position: absolute; right: -20px; bottom: -60px; font-family: var(--serif); font-weight: 700;
  font-size: clamp(140px, 24vw, 340px); line-height: 1; color: rgba(26,24,19,.05); pointer-events: none; user-select: none;
}
.value .wrap { position: relative; z-index: 1; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 44px; }
.stat { border-top: 1px solid var(--rule); padding-top: 18px; }
.stat .n { font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 4vw, 44px); color: var(--accent); line-height: 1.2; }
.stat .l { margin-top: 6px; font-size: 13.5px; color: var(--ink2); }
.ops { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.op {
  display: inline-flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--rule-soft);
  border-radius: 99px; padding: 7px 14px 7px 10px; font-size: 13.5px; font-weight: 600;
}
.op i { width: 5px; height: 18px; border-radius: 2px; background: var(--c); }
.op b { font-family: var(--mono); font-size: 12px; color: var(--ink3); font-weight: 600; }

/* ---------- screenshots ---------- */
.shots .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; margin-top: 52px; align-items: start; }
.phone {
  position: relative; width: 100%; max-width: 280px; margin: 0 auto;
  border-radius: 40px; padding: 10px; background: #101010;
  box-shadow: 0 30px 60px rgba(26,24,19,.18), inset 0 0 0 2px rgba(255,255,255,.06);
}
.phone img { border-radius: 31px; width: 100%; height: auto; }
.phone .island { position: absolute; top: 19px; left: 50%; transform: translateX(-50%); width: 78px; height: 24px; border-radius: 13px; background: #030303; }
.shots figcaption { text-align: center; margin-top: 16px; font-size: 14px; color: var(--ink2); word-break: keep-all; }
.shots figcaption .beta, .feat .tagpill {
  font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .14em;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 99px; padding: 2px 7px; margin-left: 6px; vertical-align: 1px;
}
.shots figure:nth-child(2) { transform: translateY(28px); }

/* ---------- details grid ---------- */
.grid6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px 32px; margin-top: 48px; }
.feat { border-top: 1px solid var(--rule); padding-top: 18px; }
.feat h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.feat p { color: var(--ink2); font-size: 14px; word-break: keep-all; }

/* ---------- final cta / footer ---------- */
.final { background: linear-gradient(165deg, var(--ink), #2b2520); color: #fff; text-align: center; }
.final h2 { color: #fff; margin: 0 0 12px; }
.final h2 em { color: #e3a3ae; }
.final .lede { color: rgba(255,255,255,.75); margin: 0 auto; }
.final .cta { justify-content: center; margin: 30px 0 0; }
.final .store-badge { background: #fff; color: var(--ink); }
.final .store-badge.disabled { color: rgba(255,255,255,.6); border-color: rgba(255,255,255,.3); background: transparent; }

footer { background: #15120f; color: #a9a49a; padding: 44px 0; font-size: 14px; }
footer .row { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
footer .brand { display: flex; align-items: center; gap: 10px; color: #fff; }
footer .brand img { width: 24px; height: 24px; border-radius: 6px; }
footer .links { display: flex; gap: 22px; flex-wrap: wrap; }
footer a { color: #a9a49a; text-decoration: none; }
footer a:hover { color: #fff; }
footer .disclaimer { margin-top: 22px; font-size: 12px; line-height: 1.7; color: #857f74; max-width: 60em; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 36px; padding-top: 44px; padding-bottom: 56px; }
  .steps, .grid6, .shots .row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .shots figure:nth-child(2) { transform: none; }
  section { padding: 60px 0; }
  .wordmark span { display: none; }
  .value .ghost { font-size: clamp(100px, 40vw, 200px); right: -10px; }
  .sign { min-width: 0; width: 100%; }
  .sign .name .zh { font-size: 28px; }
  .stamp { width: 82px; height: 82px; right: 16px; bottom: 58px; }
  .stamp span { font-size: 19px; }
}
