@font-face { font-family: "SF Pro Text Local"; src: url("../fonts/SF-Pro-Text-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "SF Pro Text Local"; src: url("../fonts/SF-Pro-Text-Semibold.otf") format("opentype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "SF Pro Display Local"; src: url("../fonts/SF-Pro-Display-Semibold.otf") format("opentype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "SF Pro Display Local"; src: url("../fonts/SF-Pro-Display-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "GenShin Gothic"; src: url("../fonts/GenShinGothic-P-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "GenShin Gothic"; src: url("../fonts/GenShinGothic-P-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

/* ---------- Tokens (shared with jurina.org) ---------- */
:root {
  color-scheme: light;
  --page: #f5f5f7;
  --surface: #fff;
  --surface-2: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --blue: #0066cc;
  --blue-hover: #0077ed;
  --button: #0071e3;
  --warn: #b25000;
  --glass: rgba(251,251,253,.8);
  --glass-border: rgba(0,0,0,.08);
  --tile-shadow: 0 2px 6px rgba(0,0,0,.03), 0 14px 36px rgba(0,0,0,.06);
  --radius-tile: 28px;
  --radius-field: 14px;
  --ease-out: cubic-bezier(.16,1,.3,1);
  --gutter: 24px;
  --font: "SF Pro Text Local", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --display-font: "SF Pro Display Local", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
[data-theme="dark"] {
  color-scheme: dark;
  --page: #000;
  --surface: #161617;
  --surface-2: #1d1d1f;
  --ink: #f5f5f7;
  --muted: #a1a1a6;
  --line: #424245;
  --blue: #2997ff;
  --blue-hover: #64b5ff;
  --warn: #ff9f0a;
  --glass: rgba(22,22,23,.8);
  --glass-border: rgba(255,255,255,.1);
  --tile-shadow: 0 0 0 1px rgba(255,255,255,.06);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; min-width: 320px; background: var(--page); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.47; letter-spacing: -.022em; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; -webkit-tap-highlight-color: transparent; }
html[lang="ja"] body { font-family: "GenShin Gothic", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif; letter-spacing: 0; }
html:not([lang="ja"]) :is(h1, h2, .brand) { font-family: var(--display-font); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
::selection { background: rgba(188,0,45,.2); }
:is(a, button, input):focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.language-button:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 4px; }
.shell { width: min(980px, calc(100% - var(--gutter) * 2)); margin-inline: auto; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: 17px; font-weight: 600; letter-spacing: -.01em; }

/* ---------- Header ---------- */
.site-header { position: sticky; z-index: 30; top: 0; height: 48px; background: var(--glass); box-shadow: 0 .5px 0 var(--glass-border); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.nav { height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-size: 17px; font-weight: 600; white-space: nowrap; }
.nav-right, .language-switch { display: flex; align-items: center; }
.nav-right { gap: 22px; }
.language-switch { gap: 14px; margin: 0; padding: 0; border: 0; color: var(--muted); font-size: 12px; }
.language-switch legend, .language-button { position: absolute; width: 1px; height: 1px; margin: -1px; clip: rect(0 0 0 0); overflow: hidden; }
.language-option { cursor: pointer; transition: color .2s ease; }
.language-option:hover, .language-option:has(input:checked) { color: var(--ink); }
.language-option:has(input:checked) { font-weight: 600; }
.theme-button { width: 32px; height: 32px; margin-right: -6px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: none; opacity: .8; cursor: pointer; transition: opacity .2s ease, background-color .2s ease; }
.theme-button:hover { opacity: 1; background: rgba(127,127,127,.12); }
.theme-icon { display: grid; place-items: center; }
.theme-icon .icon { width: 17px; height: 17px; }

/* ---------- Buttons ---------- */
.button { min-height: 44px; padding: 0 24px; border: 0; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 17px; white-space: nowrap; cursor: pointer; transition: background-color .25s ease, transform .25s var(--ease-out), opacity .2s ease; }
.button:active { transform: scale(.97); }
.button:disabled { opacity: .6; cursor: progress; }
.button-primary { background: var(--button); color: #fff; }
.button-primary:hover { background: var(--blue-hover); }

/* ---------- Hero & form ---------- */
.hero { padding-block: 80px 56px; }
.hero h1 { margin: 0; font-size: clamp(48px, 7vw, 80px); font-weight: 700; line-height: 1.05; letter-spacing: -.035em; }
html[lang="ja"] .hero h1 { letter-spacing: -.02em; line-height: 1.15; }
/* The flag, clipped into the word: white letters with a red disc in the middle. */
.hero h1 span { display: inline-block; padding: 0 .02em .06em; background: radial-gradient(circle at 50% 54%, #bc002d 0 .4em, #fff calc(.4em + .5px)); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: .025em #1d1d1f; paint-order: stroke fill; }
[data-theme="dark"] .hero h1 span { -webkit-text-stroke: 0; }
.lead { max-width: 620px; margin: 20px 0 0; color: var(--muted); font-size: 21px; line-height: 1.42; }

.search-card { margin-top: 40px; padding: 28px; border-radius: var(--radius-tile); background: var(--surface); box-shadow: var(--tile-shadow); }
.airport-fields { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; }
.field { display: grid; gap: 6px; }
.field > span { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
html[lang="ja"] .field > span { letter-spacing: .02em; }
.field input { width: 100%; min-height: 56px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius-field); background: var(--surface-2); outline: none; transition: border-color .2s ease, background-color .2s ease; }
.field input:focus { border-color: var(--blue); background: var(--surface); }
.airport-fields input { font: 600 28px/1 var(--display-font); letter-spacing: .04em; text-transform: uppercase; }
.airport-fields input::placeholder { color: var(--line); }
.swap-button { width: 44px; height: 44px; margin-bottom: 6px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--blue); cursor: pointer; transition: transform .4s var(--ease-out), background-color .2s ease; }
.swap-button:hover { background: rgba(0,113,227,.1); }
.swap-button:active { transform: rotate(180deg); }
.swap-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.form-row { margin-top: 20px; display: grid; grid-template-columns: 180px 1fr auto; align-items: end; gap: 16px; }
.field-time input { min-height: 44px; font-variant-numeric: tabular-nums; }
.field-hint { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.form-error { min-height: 1.4em; margin: 14px 0 0; color: #e30000; font-size: 14px; }
[data-theme="dark"] .form-error { color: #ff6961; }
.form-error:empty { min-height: 0; margin: 0; }

.examples { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; color: var(--muted); font-size: 14px; }
.examples a { color: var(--blue); font-variant-numeric: tabular-nums; }
.examples a:hover { text-decoration: underline; text-underline-offset: 3px; }

.clocks { margin-top: 40px; display: flex; gap: 32px; }
.clocks div { display: grid; gap: 2px; }
.clocks span { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.clocks time { font-size: 17px; font-variant-numeric: tabular-nums; }

/* ---------- Results ---------- */
.results { padding-bottom: 72px; scroll-margin-top: 64px; animation: rise .6s var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.result-head { margin-bottom: 24px; }
.result-pair { margin: 0; display: flex; align-items: center; gap: 16px; font-size: clamp(36px, 5vw, 56px); font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }
.result-pair svg { width: 48px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badges { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.badges:empty { display: none; }
.badge { padding: 4px 12px; border-radius: 999px; background: var(--surface); box-shadow: var(--tile-shadow); color: var(--muted); font-size: 13px; }

.route-list { display: grid; gap: 16px; }
.route-card { padding: 28px; border-radius: var(--radius-tile); background: var(--surface); box-shadow: var(--tile-shadow); }
.route-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.route-number { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.copy-button { min-height: 32px; padding: 0 14px; border: 0; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); color: var(--blue); font-size: 14px; cursor: pointer; transition: background-color .2s ease; }
.copy-button:hover { background: rgba(0,113,227,.1); }
.copy-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.route-string { margin: 14px 0 0; font: 600 clamp(19px, 2.4vw, 24px)/1.45 var(--mono); letter-spacing: 0; word-spacing: .15em; overflow-wrap: anywhere; user-select: all; }
.route-meta { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px 24px; }
.meta-item dt { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.meta-item dd { margin: 4px 0 0; font-size: 15px; line-height: 1.45; }
.meta-time { grid-column: span 2; }
.time-window { display: block; font-variant-numeric: tabular-nums; }
.time-window b { font-weight: 600; }
.time-window small { margin-left: 6px; color: var(--muted); font-size: 13px; }

.option-groups { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 24px; }
.option-groups:empty { display: none; }
.option-group h4, .route-notes h4 { margin: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.option-group ul, .route-notes ul { margin: 0; padding: 0; list-style: none; font-size: 15px; }
.option-group li { font-family: var(--mono); font-size: 14px; line-height: 1.6; }
.route-notes { margin-top: 18px; padding: 14px 18px; border-radius: var(--radius-field); background: rgba(255,149,0,.1); }
.route-notes h4 { color: var(--warn); }
.route-notes li + li { margin-top: 6px; }
.route-scope { margin: 18px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.notice-card { padding: 28px; border-radius: var(--radius-tile); background: var(--surface); box-shadow: var(--tile-shadow); }
.notice-card p { margin: 0; font-size: 17px; }
.notice-card .notice-hint { margin-top: 8px; color: var(--muted); font-size: 15px; }
.notice-error p { color: #e30000; }
[data-theme="dark"] .notice-error p { color: #ff6961; }
.data-line { margin: 16px 4px 0; color: var(--muted); font-size: 12px; }
.data-line + .data-line { margin-top: 4px; }

/* ---------- About ---------- */
.about { padding-bottom: 80px; }
.about-card { padding: 40px; border-radius: var(--radius-tile); background: linear-gradient(160deg, #eef6ff 0%, #d9ebff 100%); color: #1d1d1f; }
.about-card h2 { margin: 0 0 18px; font-size: clamp(30px, 4vw, 40px); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.about-card .eyebrow { color: #6e6e73; }
.about-card p:not(.eyebrow) { max-width: 680px; margin: 0; color: #424245; font-size: 17px; line-height: 1.5; }
.about-card p + p { margin-top: 12px !important; }
.about-card a { color: #0066cc; }
.about-card a:hover { text-decoration: underline; text-underline-offset: 3px; }
[data-theme="dark"] .about-card { background: linear-gradient(160deg, #0f2236 0%, #0a1726 100%); color: #f5f5f7; }
[data-theme="dark"] .about-card .eyebrow, [data-theme="dark"] .about-card p:not(.eyebrow) { color: #a1a1a6; }
[data-theme="dark"] .about-card a { color: #2997ff; }

/* ---------- Footer ---------- */
.site-footer { padding-block: 22px max(34px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.4; }
.site-footer p { margin: 0; }
.footer-links { margin-block: 14px; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Toast ---------- */
.toast { position: fixed; z-index: 60; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); padding: 10px 18px; border-radius: 999px; background: rgba(29,29,31,.88); color: #fff; font-size: 14px; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .25s ease, transform .4s var(--ease-out); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
[data-theme="dark"] .toast { background: rgba(245,245,247,.9); color: #1d1d1f; }

/* ---------- Icons (Ionicons, MIT: assets/icons/LICENSE-ionicons.txt) ---------- */
.icon { display: inline-block; flex: none; width: 1em; height: 1em; vertical-align: -.125em; background-color: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.icon-sun { --icon: url("../icons/sunny.svg"); }
.icon-moon { --icon: url("../icons/moon.svg"); }
.icon-external { --icon: url("../icons/arrow-forward-outline.svg"); width: .9em; height: .9em; vertical-align: -.1em; transform: rotate(-45deg); }

/* ---------- Phone ---------- */
@media (max-width: 734px) {
  :root { --gutter: 20px; --radius-tile: 24px; }
  body { font-size: 16px; }
  .nav-right { gap: 16px; }
  .hero { padding-block: 48px 40px; }
  .hero h1 { font-size: clamp(42px, 12vw, 56px); }
  .lead { font-size: 17px; }
  .search-card { margin-top: 28px; padding: 20px; }
  .airport-fields { grid-template-columns: 1fr; gap: 8px; }
  .swap-button { justify-self: center; margin: 0; transform: rotate(90deg); }
  .swap-button:active { transform: rotate(270deg); }
  .form-row { grid-template-columns: 1fr; gap: 10px; }
  .field-hint { margin: 0; }
  .form-row .button { width: 100%; }
  .route-card, .notice-card { padding: 22px; }
  .meta-time { grid-column: auto; }
  .about-card { padding: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
