:root {
  color-scheme: light dark;
  --bg: #f3f5f1;
  --surface: #ffffff;
  --surface-2: #e8eee9;
  --text: #17221f;
  --muted: #58635f;
  --line: #c9d1cc;
  --accent: #176b55;
  --accent-strong: #0e503e;
  --accent-soft: #d9eee6;
  --danger: #a83d30;
  --shadow: 0 18px 50px rgba(31, 67, 56, .11);
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111815;
    --surface: #18211e;
    --surface-2: #202b27;
    --text: #edf4f0;
    --muted: #aebdb7;
    --line: #34433d;
    --accent: #61c6a5;
    --accent-strong: #a2e5cf;
    --accent-soft: #203f35;
    --danger: #f19185;
    --shadow: 0 18px 50px rgba(0, 0, 0, .22);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-strong); text-underline-offset: .2em; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
img { display: block; width: 100%; height: auto; }
h1, h2, h3, p { margin-top: 0; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 20; background: var(--surface); padding: .75rem 1rem; border-radius: 8px; }
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.brand { color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.site-header nav { display: flex; align-items: center; gap: clamp(.8rem, 2.5vw, 2rem); white-space: nowrap; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 700; }
.site-header nav a:hover { color: var(--accent); }

main, footer { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }
.hero { min-height: calc(100dvh - 168px); display: grid; grid-template-columns: .92fr 1.08fr; align-items: center; gap: clamp(2rem, 6vw, 6rem); padding: clamp(3rem, 8vh, 6rem) 0; }
.hero-copy { max-width: 610px; }
.eyebrow { margin-bottom: 1.2rem; color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .15em; }
h1 { font-size: clamp(3rem, 5.4vw, 5.45rem); line-height: .98; letter-spacing: -.065em; margin-bottom: 1.6rem; }
.hero-lead { max-width: 28rem; color: var(--muted); font-size: clamp(1.04rem, 2vw, 1.28rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; padding: .72rem 1.2rem; border: 1px solid transparent; border-radius: 12px; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .18s ease, background .18s ease; }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--accent-strong); color: var(--bg); }
.button.secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.hero-media { margin: 0; min-height: 62vh; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hero-media img { height: 100%; min-height: 62vh; object-fit: cover; }

.alert-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; margin-top: 1rem; border-radius: var(--radius); background: var(--line); box-shadow: var(--shadow); }
.alert-strip > div { padding: 1.25rem 1.4rem; background: var(--surface); }
.alert-label { display: block; color: var(--accent); font-size: .76rem; font-weight: 800; margin-bottom: .25rem; }
.alert-strip strong { font-size: clamp(1rem, 2vw, 1.2rem); }

.day-section { margin-bottom: clamp(6rem, 12vw, 11rem); scroll-margin-top: 84px; }
.section-heading { display: grid; grid-template-columns: 170px 1fr; align-items: start; gap: 2rem; margin-bottom: 3rem; }
.date-block { margin: 0; padding-top: .45rem; color: var(--accent); }
.date-block span { display: block; font-size: .78rem; font-weight: 800; letter-spacing: .16em; }
.date-block strong { display: block; font-size: 2rem; line-height: 1.1; }
.section-heading h2, .status-section h2, .fallback-section h2 { margin-bottom: .75rem; font-size: clamp(2rem, 4vw, 3.6rem); line-height: 1.05; letter-spacing: -.045em; }
.section-heading > div > p { max-width: 42rem; margin-bottom: 0; color: var(--muted); font-size: 1.08rem; }

.route-note { display: grid; grid-template-columns: 1fr 300px; gap: 1px; overflow: hidden; margin-bottom: 3rem; border-radius: var(--radius); background: var(--line); box-shadow: var(--shadow); }
.route-copy, .route-stat { background: var(--surface); padding: clamp(1.5rem, 4vw, 2.6rem); }
.route-copy h3 { font-size: 1.55rem; margin-bottom: .5rem; }
.route-copy p { max-width: 44rem; color: var(--muted); }
.link-row { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.link-row a, .timeline a, .sat-card a, .status-list a { font-weight: 800; }
.route-stat { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; background: var(--accent-soft); }
.route-stat span { color: var(--muted); font-weight: 700; }
.route-stat strong { font-size: 3.5rem; line-height: 1.05; letter-spacing: -.05em; }

.timeline { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.timeline-item { display: grid; grid-template-columns: 118px 1fr; gap: 1.2rem; min-height: 152px; padding: 1.35rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.timeline-item time, .sat-card time { color: var(--accent); font-weight: 850; font-variant-numeric: tabular-nums; }
.timeline-item h3, .sat-card h3 { margin: 0 0 .25rem; font-size: 1.16rem; }
.timeline-item p, .sat-card p { margin-bottom: .45rem; color: var(--muted); }
.timeline-item.featured { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.timeline-item.urgent { border-left: 5px solid var(--danger); }
.timeline-item.food { border-left: 5px solid var(--accent); }
.timeline-item.place-card { display: grid; grid-template-columns: 38% 62%; gap: 0; min-height: 180px; padding: 0; overflow: hidden; }
.place-card > img { width: 100%; height: 100%; min-height: 180px; object-fit: cover; }
.spot-body { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; padding: 1rem; }
.spot-body time { display: block; margin-bottom: .15rem; }
.spot-body p { flex: 1; }
.spot-visual { position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 1.25rem; overflow: hidden; color: #f7fbf9; background: #285f50; }
.spot-visual::after { content: ""; position: absolute; width: 170px; height: 170px; right: -50px; top: -76px; border: 24px solid rgba(255,255,255,.12); border-radius: 50%; }
.spot-visual span, .card-kicker { position: relative; z-index: 1; display: block; margin-bottom: .2rem; font-size: .7rem; font-weight: 900; letter-spacing: .16em; }
.spot-visual strong { position: relative; z-index: 1; font-size: 1.8rem; line-height: 1; }
.spot-visual.bamboo { background: #466842; }
.spot-visual.monkey { background: #765c35; }
.card-links { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .25rem; }
.card-links a { min-height: 32px; display: inline-flex; align-items: center; padding: .35rem .62rem; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 999px; background: color-mix(in srgb, var(--surface) 82%, transparent); text-decoration: none; font-size: .78rem; line-height: 1.1; }
.card-links a:hover { border-color: var(--accent); background: var(--accent-soft); }

.saturday-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.sat-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.sat-card > div, .sat-card.text-card, .sat-card.train-card { padding: 1rem; }
.spot-card { display: grid; grid-template-columns: 38% 62%; min-height: 180px; }
.spot-card > img { width: 100%; height: 100%; min-height: 180px; object-fit: cover; }
.spot-card > div { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; }
.spot-card > div p { flex: 1; }
.wide-card { grid-column: auto; }
.text-card { min-height: 118px; }
.visual-text-card { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 260px; overflow: hidden; }
.visual-text-card::after { content: ""; position: absolute; width: 220px; height: 220px; right: -84px; top: -105px; border: 34px solid color-mix(in srgb, var(--accent) 13%, transparent); border-radius: 50%; pointer-events: none; }
.visual-text-card > * { position: relative; z-index: 1; }
.visual-text-card.market { background: color-mix(in srgb, var(--surface) 78%, #b98536); }
.visual-text-card.gion { background: color-mix(in srgb, var(--surface) 82%, #a34c3c); }
.visual-text-card.dinner { background: var(--accent-soft); }
.card-kicker { color: var(--accent); }
.train-card { grid-column: 1 / -1; color: var(--bg); background: var(--accent-strong); border-color: transparent; }
.train-card time, .train-card p, .train-card a, .train-card .card-kicker { color: var(--bg); }
.train-card .card-links a { border-color: color-mix(in srgb, var(--bg) 50%, transparent); background: transparent; }

.status-section, .budget-section, .fallback-section { margin-bottom: clamp(6rem, 12vw, 10rem); scroll-margin-top: 84px; }
.status-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.status-list article { min-height: 185px; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.status-list article span { display: inline-block; margin-bottom: 1.2rem; color: var(--muted); font-size: .78rem; font-weight: 850; }
.status-list article[data-status="done"] { background: var(--accent-soft); }
.status-list article[data-status="done"] span { color: var(--accent-strong); }
.status-list h3 { margin-bottom: .3rem; font-size: 1.35rem; }
.status-list p { color: var(--muted); }

.budget-section { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.budget-section h2 { margin-bottom: .8rem; font-size: clamp(2.2rem, 5vw, 4.6rem); line-height: 1; letter-spacing: -.055em; }
.budget-section > div > p { color: var(--muted); font-size: 1.08rem; }
.budget-section dl { margin: 0; padding: 1.4rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.budget-section dl div { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: 1rem .25rem; border-bottom: 1px solid var(--line); }
.budget-section dl div:last-child { border-bottom: 0; }
.budget-section dt { color: var(--muted); }
.budget-section dd { margin: 0; text-align: right; font-weight: 850; }

.fallback-section ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding: 0; list-style: none; counter-reset: fallback; }
.fallback-section li { min-height: 185px; padding: 1.4rem; border-radius: var(--radius); background: var(--surface-2); counter-increment: fallback; }
.fallback-section li::before { content: counter(fallback); display: block; margin-bottom: 1.2rem; color: var(--accent); font-size: 1.8rem; font-weight: 900; }
.fallback-section strong, .fallback-section span { display: block; }
.fallback-section span { color: var(--muted); }

footer { display: flex; justify-content: space-between; gap: 2rem; padding: 2.5rem 0 6rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
footer p { max-width: 48rem; }
.photo-credits { max-width: 52rem; font-size: .78rem; }
.photo-credits summary { cursor: pointer; font-weight: 800; }
.photo-credits p { margin-top: .5rem; }
.toast { position: fixed; left: 50%; bottom: max(1.2rem, env(safe-area-inset-bottom)); z-index: 15; transform: translate(-50%, 140%); padding: .8rem 1rem; border-radius: 12px; color: var(--bg); background: var(--accent-strong); font-weight: 800; box-shadow: var(--shadow); transition: transform .25s ease; }
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 2.8rem; }
  .hero-media { min-height: 48vh; order: -1; }
  .hero-media img { min-height: 48vh; }
  h1 { font-size: clamp(3.1rem, 11vw, 4.8rem); }
  .section-heading { grid-template-columns: 100px 1fr; }
  .route-note { grid-template-columns: 1fr; }
  .route-stat { min-height: 190px; }
  .timeline { grid-template-columns: 1fr; }
  .saturday-grid { grid-template-columns: 1fr; }
  .wide-card, .train-card { grid-column: auto; }
  .status-list { grid-template-columns: 1fr; }
  .budget-section { grid-template-columns: 1fr; }
  .fallback-section ol { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .site-header { height: 60px; padding-inline: 1rem; gap: .75rem; }
  .brand { display: none; }
  .site-header nav { width: 100%; justify-content: space-between; gap: .5rem; }
  .site-header nav a { min-height: 44px; display: inline-flex; align-items: center; font-size: .82rem; }
  main, footer { width: min(100% - 1.2rem, 1180px); }
  .hero { min-height: auto; gap: 1.6rem; padding-block: 1rem 4rem; }
  .hero-media, .hero-media img { min-height: 36vh; }
  .hero-copy { padding-inline: .35rem; }
  h1 { font-size: clamp(2.7rem, 13vw, 3.3rem); }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .button { padding-inline: .75rem; }
  .alert-strip { grid-template-columns: 1fr; margin-top: .6rem; }
  .section-heading { grid-template-columns: 1fr; gap: 1rem; }
  .date-block { display: flex; align-items: baseline; gap: .6rem; }
  .date-block span, .date-block strong { display: inline; }
  .timeline-item { grid-template-columns: 1fr; gap: .55rem; }
  .timeline-item time { padding-bottom: .55rem; border-bottom: 1px solid var(--line); }
  .timeline-item:not(.place-card) { min-height: 0; padding: .85rem 1rem; }
  .timeline-item.place-card, .spot-card { grid-template-columns: 38% 62%; min-height: 145px; }
  .place-card > img, .spot-card > img { min-height: 145px; }
  .spot-body, .spot-card > div { padding: .68rem .72rem; overflow: hidden; }
  .place-card time, .spot-card time { padding: 0; border: 0; font-size: .72rem; line-height: 1.2; }
  .place-card h3, .spot-card h3 { display: -webkit-box; overflow: hidden; margin-bottom: .1rem; font-size: .98rem; line-height: 1.2; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .place-card p, .spot-card p { display: -webkit-box; overflow: hidden; margin-bottom: .15rem; font-size: .76rem; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .card-links { width: 100%; flex-wrap: nowrap; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
  .card-links::-webkit-scrollbar { display: none; }
  .card-links a { min-height: 28px; flex: 0 0 auto; padding: .25rem .48rem; font-size: .7rem; }
  .sat-card.text-card { min-height: 0; padding: .85rem 1rem; }
  .train-card { min-height: 0; }
  .budget-section dl div { grid-template-columns: 1fr; gap: .2rem; }
  .budget-section dd { text-align: left; }
  footer { flex-direction: column; padding-bottom: 4rem; }
}

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