/* ===========================================================
   Design tokens
   Palette: indigo (aizome) x washi paper x vermillion torii
   =========================================================== */
:root {
  --indigo-900: #1b2a4a;
  --indigo-800: #223458;
  --indigo-700: #2f4573;
  --indigo-100: #e8ecf4;
  --washi: #f7f3e9;
  --washi-dim: #efe9db;
  --vermillion: #c1440e;
  --vermillion-dark: #9b3609;
  --sumi: #1a1a1a;
  --gold: #b8925a;
  --line: rgba(27, 42, 74, 0.14);
  --white: #ffffff;

  --font-display: "Fraunces", "Noto Serif JP", serif;
  --font-body: "Inter", "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius-card: 18px;
  --radius-pill: 999px;
  --shadow-card: 0 12px 32px -16px rgba(27, 42, 74, 0.28);
  --shadow-soft: 0 4px 16px -8px rgba(27, 42, 74, 0.2);

  --max-width: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --washi: #171310;
    --washi-dim: #1e1a15;
    --sumi: #f2ede3;
    --line: rgba(247, 243, 233, 0.14);
    --indigo-100: #232c3f;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--washi);
  color: var(--sumi);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--indigo-900);
  line-height: 1.2;
  margin: 0 0 0.5em;
  word-break: keep-all;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--washi) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--indigo-900);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.logo .mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}
.logo .en {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--vermillion);
  display: block;
  margin-top: 2px;
}
nav.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
nav.main-nav a {
  text-decoration: none;
  font-size: 0.94rem;
  color: var(--indigo-900);
  opacity: 0.82;
}
nav.main-nav a:hover { opacity: 1; }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--indigo-900);
  color: var(--washi) !important;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  opacity: 1 !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }

@media (max-width: 760px) {
  .nav-links { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  min-height: 48px;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--vermillion); color: var(--white); }
.btn-primary:hover { background: var(--vermillion-dark); box-shadow: var(--shadow-soft); }
.btn-ghost { background: transparent; border-color: var(--indigo-900); color: var(--indigo-900); }
.btn-ghost:hover { background: var(--indigo-100); }
.btn-block { width: 100%; }
.btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 76px 0 96px;
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero .kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--vermillion);
  margin-bottom: 18px;
  display: inline-block;
}
.hero h1 {
  font-size: clamp(2.4rem, 4.4vw, 3.6rem);
  max-width: 12ch;
}
.hero p.lead {
  font-size: 1.15rem;
  max-width: 46ch;
  opacity: 0.86;
  margin: 22px 0 34px;
}
.hero .cta-row { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-route {
  position: relative;
  aspect-ratio: 1 / 1;
}
.hero-route svg { width: 100%; height: 100%; }
.route-line {
  fill: none;
  stroke: var(--indigo-700);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 700;
  stroke-dashoffset: 700;
  animation: draw-line 2.6s ease forwards 0.3s;
}
.route-dot {
  fill: var(--washi);
  stroke: var(--vermillion);
  stroke-width: 3;
  opacity: 0;
  animation: pop-dot 0.5s ease forwards;
}
.route-dot.d1 { animation-delay: 0.5s; }
.route-dot.d2 { animation-delay: 1.1s; }
.route-dot.d3 { animation-delay: 1.7s; }
.route-dot.d4 { animation-delay: 2.3s; }
.route-label {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--sumi);
  opacity: 0;
  animation: pop-dot 0.5s ease forwards;
}
.route-label.d1 { animation-delay: 0.7s; }
.route-label.d2 { animation-delay: 1.3s; }
.route-label.d3 { animation-delay: 1.9s; }
.route-label.d4 { animation-delay: 2.5s; }

@keyframes draw-line { to { stroke-dashoffset: 0; } }
@keyframes pop-dot { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .route-line, .route-dot, .route-label { animation: none !important; opacity: 1 !important; stroke-dashoffset: 0 !important; }
}

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-route { max-width: 340px; margin: 0 auto; }
}

/* ---------- Section scaffolding ---------- */
section { padding: 84px 0; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head .kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--vermillion);
}
.alt-bg { background: var(--washi-dim); }

/* ---------- Ticket-stub tour cards ---------- */
.tour-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
@media (max-width: 760px) {
  .tour-grid { grid-template-columns: 1fr; }
}

.ticket {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--line);
}
.ticket:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -16px rgba(27,42,74,0.32); }

.ticket-photo {
  height: 200px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 18px 22px;
}
.ticket-photo::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(27,42,74,0) 40%, rgba(19,26,42,0.55) 100%);
}
.ticket-photo .tag {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--washi);
  background: rgba(27,42,74,0.55);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}

.ticket-body { padding: 22px 22px 20px; }
.ticket-body h3 { font-size: 1.28rem; margin-bottom: 8px; }
.ticket-body p { margin: 0 0 16px; opacity: 0.8; font-size: 0.95rem; }

.ticket-perforation {
  border-top: 2px dashed var(--line);
  margin: 0 22px;
  position: relative;
}
.ticket-perforation::before, .ticket-perforation::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--washi);
  border: 1px solid var(--line);
}
.ticket-perforation::before { left: -32px; }
.ticket-perforation::after { right: -32px; }

.ticket-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.ticket-meta .price { color: var(--vermillion); font-weight: 700; font-size: 1rem; }
.ticket-meta .duration { opacity: 0.7; }

/* ---------- How it works / steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }
.step {
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.step .num {
  font-family: var(--font-mono);
  color: var(--vermillion);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 12px;
}
.step h4 { margin-bottom: 8px; font-size: 1.1rem; }
.step p { margin: 0; opacity: 0.8; font-size: 0.94rem; }

/* ---------- Travel mode chips ---------- */
.mode-select {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.mode-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--white);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--indigo-900);
  transition: border-color 0.16s ease, background 0.16s ease;
  min-height: 48px;
  flex: 1 1 140px;
}
.mode-chip:hover { border-color: var(--indigo-700); }
.mode-chip.active {
  background: var(--indigo-900);
  color: var(--washi);
  border-color: var(--indigo-900);
}
.mode-chip svg { width: 22px; height: 22px; flex-shrink: 0; }

/* ---------- Itinerary (route-map stops) ---------- */
.itinerary { position: relative; padding-left: 36px; }
.itinerary::before {
  content: "";
  position: absolute;
  left: 9px; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--indigo-700);
  border-radius: 3px;
}
.stop { position: relative; padding-bottom: 34px; }
.stop:last-child { padding-bottom: 0; }
.stop::before {
  content: "";
  position: absolute;
  left: -36px; top: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--washi);
  border: 3px solid var(--vermillion);
}
.stop .time { font-family: var(--font-mono); font-size: 0.8rem; color: var(--vermillion); display: block; margin-bottom: 4px; }
.stop h4 { margin: 0 0 6px; font-size: 1.05rem; }
.stop p { margin: 0; opacity: 0.82; font-size: 0.93rem; }

/* ---------- Login card ---------- */
.auth-shell {
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: repeating-linear-gradient(90deg, var(--vermillion) 0 10px, transparent 10px 20px);
}
.auth-card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-card .sub { opacity: 0.75; margin-bottom: 30px; font-size: 0.95rem; }

.auth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--white);
  font-weight: 600;
  font-size: 0.96rem;
  cursor: pointer;
  margin-bottom: 12px;
  min-height: 50px;
  color: var(--sumi);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.auth-btn:hover { border-color: var(--indigo-700); background: var(--indigo-100); }
.auth-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.auth-btn.apple { background: var(--sumi); color: var(--washi); border-color: var(--sumi); }
.auth-btn.apple:hover { background: #000; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  font-size: 0.82rem;
  opacity: 0.6;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--washi);
  color: var(--sumi);
}
.field input:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
}

.auth-note {
  margin-top: 22px;
  font-size: 0.82rem;
  opacity: 0.65;
  text-align: center;
}
.magic-sent {
  display: none;
  background: var(--indigo-100);
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 0.9rem;
  margin-top: 14px;
}
.magic-sent.show { display: block; }

/* ---------- Footer ---------- */
footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 0;
  font-size: 0.88rem;
  opacity: 0.75;
}
footer.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Directions modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(27,42,74,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--washi);
  border-radius: 20px;
  max-width: 460px;
  width: 100%;
  padding: 32px;
  box-shadow: var(--shadow-card);
}
.modal h3 { margin-bottom: 6px; }
.modal .sub { opacity: 0.75; font-size: 0.92rem; margin-bottom: 22px; }
.modal-close {
  float: right;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--sumi);
  line-height: 1;
}
.geo-status {
  margin-top: 18px;
  font-size: 0.86rem;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--indigo-100);
  display: none;
}
.geo-status.show { display: block; }
.geo-status.error { background: #fde8e0; color: var(--vermillion-dark); }

/* ---------- Utility ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  background: var(--indigo-100);
  color: var(--indigo-900);
  padding: 5px 11px;
  border-radius: var(--radius-pill);
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
