:root {
  color-scheme: dark;
  --top-ground: #08070b;
  --top-ink: #eee8dd;
  --top-muted: #827b8d;
  --top-line: rgba(238, 232, 221, 0.12);
  --top-orange: #ff6b27;
  --top-ease: cubic-bezier(.18, .84, .18, 1);
}

html, body { min-height: 100%; }

body.top-page {
  margin: 0;
  overflow: hidden;
  color: var(--top-ink);
  background:
    radial-gradient(circle at 50% 42%, rgba(86, 43, 34, 0.08), transparent 36%),
    var(--top-ground);
  font-family: "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
}

body.top-page button,
body.top-page a { font: inherit; }

.skip-link {
  position: fixed;
  z-index: 30;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--top-ink);
  background: #1c1822;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  position: fixed;
  z-index: 12;
  inset: 0 0 auto;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 3.2vw, 52px);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 700ms ease, transform 700ms ease;
  pointer-events: none;
}
body.top-page.intro-complete .topbar {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.topbar__brand {
  color: var(--top-ink);
  text-decoration: none;
  font-family: "Helvetica Neue", sans-serif;
  font-size: 12px;
  letter-spacing: .42em;
}
.topbar__controls { display: flex; gap: 8px; }
.top-control {
  min-height: 34px;
  padding: 0 12px;
  color: var(--top-muted);
  background: rgba(8, 7, 11, .68);
  border: 1px solid var(--top-line);
  border-radius: 999px;
  cursor: pointer;
}
.top-control:hover, .top-control:focus-visible {
  color: var(--top-ink);
  border-color: rgba(238, 232, 221, .35);
  outline: none;
}
.skip-intro {
  position: fixed;
  z-index: 20;
  top: 22px;
  right: 24px;
  transition: opacity 240ms ease;
}
body.top-page.intro-complete .skip-intro { opacity: 0; pointer-events: none; }

.stage {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
  cursor: default;
}
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0;
  background:
    linear-gradient(90deg, transparent 0 54%, rgba(255, 107, 39, .035) 54% 55%, transparent 55%),
    radial-gradient(circle at 36% 45%, rgba(255, 107, 39, .06), transparent 38%);
  transition: opacity 1300ms ease;
}
body.top-page.intro-complete .stage::before { opacity: 1; }
.core {
  position: absolute;
  inset: 9vh 8vw 22vh;
  display: grid;
  place-items: center;
  transition: transform 1100ms var(--top-ease);
}
body.top-page.routes-open .core { transform: translateX(-21vw) scale(.78); }
.symbol-wrap {
  position: relative;
  width: clamp(240px, 34vw, 500px);
  aspect-ratio: 1;
}
.symbol-wrap::before {
  content: "";
  position: absolute;
  inset: -18%;
  border: 1px solid rgba(255, 107, 39, .07);
  border-radius: 50%;
  opacity: 0;
  transform: scale(.92);
  transition: opacity 1300ms ease, transform 1500ms var(--top-ease);
}
body.top-page.intro-complete .symbol-wrap::before { opacity: 1; transform: none; }
.symbol {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 18px rgba(255, 107, 39, .06));
  opacity: 0;
  transform: scale(.94);
  transition: opacity 950ms ease, transform 1100ms var(--top-ease);
}
body.top-page.intro-complete .symbol { opacity: 1; transform: none; }
.wordmark {
  position: absolute;
  top: calc(50% + min(23vw, 330px));
  left: 50%;
  width: clamp(230px, 29vw, 430px);
  height: auto;
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity 950ms ease, transform 950ms var(--top-ease);
}
body.top-page.intro-complete .wordmark { opacity: 1; transform: translate(-50%, 0); }
.motto {
  position: absolute;
  z-index: 3;
  left: clamp(24px, 6vw, 96px);
  bottom: clamp(28px, 6vh, 72px);
  max-width: min(760px, 68vw);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1000ms ease, transform 1100ms var(--top-ease), max-width 800ms ease;
}
body.top-page.intro-complete .motto { opacity: 1; transform: none; }
body.top-page.routes-open .motto { max-width: 43vw; }
.motto-label { margin: 0 0 15px; color: var(--top-orange); font-size: 10px; letter-spacing: .34em; }
.motto-main {
  margin: 0;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(20px, 2.5vw, 38px);
  font-weight: 400;
  line-height: 1.72;
  letter-spacing: .04em;
}
.motto-question {
  position: relative;
  display: inline-grid;
  min-width: 10em;
  margin: 7px 0 0;
  padding: 5px 42px 5px 0;
  color: var(--top-ink);
  background: transparent;
  border: 0;
  text-align: left;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif !important;
  font-size: clamp(19px, 2.1vw, 32px) !important;
  cursor: pointer;
}
.motto-question::after {
  content: "↗";
  position: absolute;
  right: 8px;
  top: 50%;
  color: var(--top-muted);
  font-family: sans-serif;
  font-size: 14px;
  transform: translateY(-50%);
  transition: transform 480ms var(--top-ease), color 240ms ease;
}
.motto-now, .motto-answer {
  grid-area: 1 / 1;
  color: var(--top-orange);
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 320ms ease, transform 520ms var(--top-ease);
}
.motto-prompt { grid-area: 1 / 1; transition: opacity 220ms ease, transform 420ms var(--top-ease); }
.motto-question.peek-now .motto-prompt,
.motto-question.now-open .motto-prompt,
.motto-question.joke-open .motto-prompt { opacity: 0; transform: translateX(12px); }
.motto-question.peek-now .motto-now,
.motto-question.now-open .motto-now { opacity: 1; transform: none; }
.motto-question.joke-open .motto-now { opacity: 0; transform: translateX(12px); }
.motto-question.joke-open .motto-answer { opacity: 1; transform: none; }
.motto-question.peek-now::after,
.motto-question.now-open::after,
.motto-question.joke-open::after { color: var(--top-orange); transform: translateY(-50%) rotate(45deg); }
.motto-question:focus-visible { outline: 1px solid rgba(255, 107, 39, .45); outline-offset: 7px; }
.touch-hint {
  position: absolute;
  z-index: 4;
  right: clamp(22px, 4vw, 64px);
  bottom: clamp(22px, 4vh, 52px);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--top-muted);
  background: transparent;
  border: 0;
  padding: 8px 0;
  cursor: pointer;
  font-size: 10px !important;
  letter-spacing: .25em;
  opacity: 0;
  transition: opacity 800ms ease, color 240ms ease;
}
.touch-hint:hover, .touch-hint:focus-visible { color: var(--top-ink); outline: none; }
.touch-hint::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--top-orange);
  transform-origin: right;
  animation: breathe-line 2.8s ease-in-out infinite;
}
body.top-page.intro-complete .touch-hint { opacity: 1; }
body.top-page.routes-open .touch-hint { opacity: 0; pointer-events: none; }
@keyframes breathe-line { 50% { transform: scaleX(.38); opacity: .4; } }

.routes {
  position: absolute;
  z-index: 8;
  inset: 0 0 0 auto;
  width: min(47vw, 720px);
  display: grid;
  align-content: center;
  padding: 88px clamp(24px, 4vw, 58px) 48px;
  background: rgba(13, 11, 17, .94);
  border-left: 1px solid var(--top-line);
  box-shadow: -46px 0 100px rgba(0, 0, 0, .3);
  overflow-y: auto;
  transform: translateX(calc(100% + 48px));
  transition: transform 1150ms var(--top-ease);
}
body.top-page.routes-open .routes { transform: none; }
.routes-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 24px; color: var(--top-muted); font-size: 10px; letter-spacing: .28em; }
.route-list { border-top: 1px solid var(--top-line); }
.route {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  min-height: 68px;
  padding: 10px 4px;
  color: var(--top-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--top-line);
  transition: color 180ms ease, padding 520ms var(--top-ease), background 360ms ease;
}
.route:hover, .route:focus-visible {
  padding-inline: 14px;
  color: var(--top-ink);
  background: linear-gradient(90deg, rgba(255, 107, 39, .08), transparent 74%);
  outline: none;
}
.route-index { color: #494252; font-family: ui-monospace, monospace; font-size: 10px; }
.route-name { font-family: "Helvetica Neue", sans-serif; font-size: clamp(17px, 1.65vw, 24px); letter-spacing: .21em; }
.route-ja { max-width: 16em; color: #514a59; font-size: 10px; line-height: 1.5; letter-spacing: .1em; text-align: right; }
.close-routes { position: absolute; top: 22px; left: 24px; opacity: 0; pointer-events: none; transition: opacity 400ms ease; }
body.top-page.routes-open .close-routes { opacity: 1; pointer-events: auto; }

@media (max-width: 760px) {
  .topbar { min-height: 60px; padding-inline: 18px; }
  .topbar__brand { font-size: 10px; letter-spacing: .26em; }
  .topbar__controls .top-control:last-child { display: none; }
  .core { inset: 8vh 8vw 38vh; }
  body.top-page.routes-open .core { transform: translateY(-24vh) scale(.55); }
  .symbol-wrap { width: min(72vw, 340px); }
  .wordmark { top: calc(50% + min(34vw, 170px)); width: min(64vw, 300px); }
  .motto { left: 24px; right: 24px; bottom: 9vh; max-width: none; }
  body.top-page.routes-open .motto { max-width: none; opacity: .18; transform: translateY(-31vh); }
  .motto-main { font-size: clamp(19px, 5.2vw, 27px); }
  .motto-question { font-size: clamp(18px, 5vw, 25px) !important; }
  .touch-hint { right: 22px; bottom: 22px; }
  .routes { inset: auto 0 0; width: 100%; max-height: 67svh; padding: 58px 20px 22px; border-left: 0; border-top: 1px solid var(--top-line); border-radius: 24px 24px 0 0; transform: translateY(calc(100% + 32px)); }
  .route { grid-template-columns: 28px minmax(104px, .75fr) 1fr; min-height: 54px; column-gap: 5px; }
  .route-name { font-size: clamp(14px, 4.3vw, 19px); }
  .route-ja { display: block; max-width: none; font-size: 9px; }
  .close-routes { top: 14px; right: 16px; left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  body.top-page *, body.top-page *::before, body.top-page *::after { animation: none !important; transition-duration: .01ms !important; }
  body.top-page .symbol, body.top-page .wordmark { opacity: 1; transform: none; }
}
