:root {
  --paper: #f4f2ec;
  --card: #fffefb;
  --ink: #171816;
  --muted: #6d7069;
  --line: #d7d5ce;
  --accent: #23665d;
  --accent-soft: #e3eee9;
  --shadow: 0 16px 48px rgba(25, 30, 25, .10);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, a { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.view {
  width: min(100%, 720px);
  min-height: 100svh;
  margin: 0 auto;
}

/* 첫 화면은 여행 매뉴얼 제목과 네 개의 일차 버튼으로 구성한다. */
.home-view {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto repeat(2, minmax(0, 1fr));
  gap: 11px;
  padding: max(13px, env(safe-area-inset-top)) 13px max(13px, env(safe-area-inset-bottom));
}
.home-title {
  grid-column: 1 / -1;
  margin: 4px 4px 3px;
  color: #fff;
  font-size: clamp(20px, 5.4vw, 30px);
  font-weight: 820;
  line-height: 1.25;
  letter-spacing: -.045em;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .34);
}
.home-view::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 10% 5%, rgba(129, 186, 173, .32), transparent 34%),
    radial-gradient(circle at 90% 96%, rgba(151, 126, 177, .23), transparent 38%),
    linear-gradient(145deg, #173b36, #0d201e 60%, #152729);
}
.home-view::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .18;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .28) .6px, transparent .6px);
  background-size: 5px 5px;
}
.day-entry {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 27px;
  color: #fff;
  background-color: #25423e;
  background-position: center;
  background-size: cover;
  font-size: clamp(28px, 8.5vw, 48px);
  font-weight: 800;
  letter-spacing: -.06em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .48);
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .08),
    inset 0 -90px 100px rgba(5, 13, 12, .3),
    0 15px 36px rgba(0, 0, 0, .25);
  transition: transform .24s cubic-bezier(.2, .8, .2, 1), box-shadow .24s ease, filter .24s ease;
  -webkit-tap-highlight-color: transparent;
  animation: home-card-in .52s cubic-bezier(.2, .8, .2, 1) both;
}
.day-entry[data-day="0"] {
  background-image: linear-gradient(180deg, rgba(8, 25, 31, .08), rgba(7, 20, 20, .72)), url('/assets/toya-fireworks.webp');
  background-position: 58% center;
}
.day-entry[data-day="1"] {
  background-image: linear-gradient(180deg, rgba(12, 26, 37, .08), rgba(6, 21, 26, .68)), url('/assets/otaru-canal.webp');
  background-position: 49% center;
  animation-delay: .05s;
}
.day-entry[data-day="2"] {
  background-image: linear-gradient(180deg, rgba(7, 34, 41, .04), rgba(7, 30, 34, .66)), url('/assets/blue-pond.webp');
  background-position: 51% center;
  animation-delay: .1s;
}
.day-entry[data-day="3"] {
  background-image: linear-gradient(180deg, rgba(32, 26, 20, .03), rgba(25, 20, 16, .65)), url('/assets/red-brick-office.webp');
  background-position: 54% center;
  animation-delay: .15s;
}
.day-entry:hover {
  transform: translateY(-3px) scale(1.008);
  filter: saturate(1.08) brightness(1.04);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .16),
    inset 0 -90px 100px rgba(5, 13, 12, .25),
    0 22px 46px rgba(0, 0, 0, .34);
}
.day-entry:active { transform: scale(.98); filter: brightness(.91); }
.day-entry:focus-visible { outline: 4px solid rgba(205, 243, 233, .76); outline-offset: 2px; }

.day-view { padding-bottom: max(32px, env(safe-area-inset-bottom)); }
.day-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 88px;
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  background: rgba(244, 242, 236, .93);
  border-bottom: 1px solid rgba(23, 24, 22, .08);
  backdrop-filter: blur(18px) saturate(150%);
}
.day-header h1 { margin: 0; font-size: 27px; line-height: 1; letter-spacing: -.045em; }
.day-header p { margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.2; }
.icon-button {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #e7e5df;
  font-size: 25px;
  cursor: pointer;
}
.route-summary {
  margin: 20px 16px 8px;
  padding: 18px 20px;
  border-radius: 20px;
  color: #f7fbf9;
  background: var(--accent);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -.025em;
}
.schedule-list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 12px 16px 18px;
}
.schedule-list::before {
  content: "";
  position: absolute;
  top: 32px;
  bottom: 42px;
  left: 44px;
  width: 1px;
  background: #c9c7bf;
}
.schedule-item { position: relative; padding: 0 0 12px 48px; }
.schedule-item::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 24px;
  left: 23px;
  width: 11px;
  height: 11px;
  border: 4px solid var(--paper);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.schedule-button {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(64px, auto) 1fr 24px;
  gap: 12px;
  align-items: center;
  padding: 18px 16px;
  border: 1px solid rgba(23, 24, 22, .09);
  border-radius: 20px;
  text-align: left;
  background: var(--card);
  box-shadow: 0 8px 28px rgba(28, 31, 27, .06);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.schedule-button:active { transform: scale(.992); background: #f8f6f1; }
.schedule-time {
  align-self: start;
  padding-top: 2px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.01em;
}
.schedule-copy { min-width: 0; }
.schedule-copy strong {
  display: block;
  margin-bottom: 5px;
  font-size: 18px;
  line-height: 1.28;
  letter-spacing: -.035em;
  word-break: keep-all;
}
.schedule-copy span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: -.015em;
  word-break: keep-all;
}
.chevron { color: #8c8e88; font-size: 23px; text-align: right; }
.day-switcher { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 20px; }
.day-switcher button {
  min-height: 52px;
  border: 1px solid #cac8c1;
  border-radius: 16px;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}
.day-switcher button:disabled { opacity: .32; cursor: default; }

.detail-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  align-items: end;
}
.detail-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(15, 18, 16, .56);
  backdrop-filter: blur(3px);
}
.detail-sheet {
  position: relative;
  z-index: 2;
  width: min(100%, 720px);
  max-height: 92svh;
  margin: 0 auto;
  overflow: auto;
  border-radius: 28px 28px 0 0;
  background: var(--card);
  box-shadow: 0 -20px 70px rgba(0, 0, 0, .24);
  animation: sheet-in .22s ease-out both;
}
.sheet-handle { width: 44px; height: 5px; margin: 9px auto 8px; border-radius: 99px; background: #d0cec8; }
.close-button {
  position: sticky;
  top: 12px;
  z-index: 5;
  float: right;
  width: 42px;
  height: 42px;
  margin: 0 14px -42px 0;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 21, 19, .76);
  color: #fff;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}
.detail-image { width: 100%; height: min(34svh, 300px); display: block; object-fit: cover; }
.detail-body { padding: 26px 22px max(34px, env(safe-area-inset-bottom)); }
.detail-kicker { margin: 0 0 8px; color: var(--accent); font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.detail-body h2 { margin: 0; font-size: clamp(30px, 8vw, 42px); line-height: 1.08; letter-spacing: -.055em; word-break: keep-all; }
.detail-summary { margin: 14px 0 0; color: #555852; font-size: 17px; line-height: 1.55; word-break: keep-all; }
.detail-facts { display: grid; gap: 0; margin: 24px 0; border-top: 1px solid var(--line); }
.detail-facts div { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.detail-facts dt { color: var(--muted); font-size: 14px; }
.detail-facts dd { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.45; word-break: keep-all; }
.detail-description { font-size: 16px; line-height: 1.72; color: #343632; word-break: keep-all; }
.detail-description p { margin: 0 0 12px; }
.detail-notice {
  margin: 0 0 20px;
  padding: 16px 17px;
  border: 1px solid rgba(181, 84, 27, .24);
  border-radius: 16px;
  color: #743813;
  background: #fff2e7;
  font-size: 15px;
  font-weight: 720;
  line-height: 1.6;
  word-break: keep-all;
}
.detail-tips-wrap {
  margin-top: 25px;
  padding: 20px;
  border-radius: 19px;
  background: #eef5f1;
}
.detail-tips-wrap h3 {
  margin: 0 0 13px;
  color: #153e34;
  font-size: 17px;
  letter-spacing: -.03em;
}
.detail-tips {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.detail-tips li {
  position: relative;
  padding-left: 18px;
  color: #30443e;
  font-size: 15px;
  line-height: 1.62;
  word-break: keep-all;
}
.detail-tips li::before {
  content: "";
  position: absolute;
  top: .68em;
  left: 1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4d8c7b;
}
.detail-source {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  border: 1px solid rgba(22, 76, 63, .17);
  border-radius: 14px;
  color: var(--accent);
  background: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 750;
}
.map-link {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  border-radius: 16px;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  font-weight: 750;
}
body.sheet-open { overflow: hidden; }

@keyframes sheet-in { from { transform: translateY(34px); opacity: .7; } to { transform: translateY(0); opacity: 1; } }
@keyframes home-card-in {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (min-width: 760px) {
  .home-view {
    width: min(100% - 64px, 960px);
    gap: 18px;
    padding-top: 32px;
    padding-bottom: 32px;
  }
  .day-entry { border-radius: 34px; }
  .day-view { padding-left: 20px; padding-right: 20px; }
  .day-header { margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
  .route-summary, .schedule-list, .day-switcher { margin-left: 0; margin-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
