:root {
  --ink: #1d1a17; --muted: #5d544b; --paper: #f6f1e8; --card: #fffdf9; --line: #e3d8c8; --accent: #b5691f; --night: #1b1714;
  font-family: system-ui, "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); }
a { color: inherit; }
:focus-visible { outline: 3px solid #f4b860; outline-offset: 2px; }

.topbar { position: fixed; inset: 0 0 auto 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  padding: max(12px, env(safe-area-inset-top)) 24px 12px; color: #fff; background: linear-gradient(rgba(20,16,12,.55), rgba(20,16,12,0)); }
.brand { text-decoration: none; font-size: 19px; letter-spacing: .3em; font-weight: 300; }
.brand span { font-size: 11px; letter-spacing: .18em; margin-left: 4px; opacity: .85; }
.topbar nav { display: flex; gap: 4px; align-items: center; }
.topbar nav a { min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 999px; text-decoration: none; font-size: 14px; letter-spacing: .06em; }
.topbar nav a:hover { background: rgba(255,255,255,.14); }
.topbar .pill { border: 1px solid rgba(255,255,255,.55); }

.hero { position: relative; min-height: 100svh; display: grid; align-items: end; color: #fff; overflow: hidden;
  background: radial-gradient(ellipse at 70% 40%, #4a3424 0%, #241b15 45%, var(--night) 100%); }
#store3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.portal-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.portal { position: absolute; left: 0; top: 0; pointer-events: auto; display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px; padding: 4px 12px 4px 4px; border: 1px solid rgba(255,255,255,.4); border-radius: 999px; background: rgba(24,20,16,.74); color: #fff; font: inherit; cursor: pointer;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); white-space: nowrap; }
.portal b, .zone b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #f4d3a5; color: #1d1a17; font-size: 13px; font-weight: 700; flex: none; }
.portal span { font-size: 13px; font-weight: 600; letter-spacing: .06em; }
.portal-labels.compact .portal { padding: 4px; min-width: 36px; justify-content: center; }
.portal-labels.compact .portal span { display: none; }
.portal:hover, .portal.hot { background: rgba(181,105,31,.95); border-color: #f4d3a5; }
.portal.hot { z-index: 1; }
.portal[hidden] { display: none; }
.zone-arrow, .swipe-hint { display: none; }
.zone-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 8px; }
.zone { width: 100%; min-height: 40px; display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 5px; border-radius: 999px; border: 1px solid rgba(255,255,255,.28);
  background: rgba(24,20,16,.55); color: #fff; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.zone span { font-weight: 600; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone small { margin-left: auto; font-size: 11px; color: #f4d3a5; white-space: nowrap; }
.zone-group { grid-column: 1 / -1; margin-top: 4px; font-size: 12px; letter-spacing: .2em; color: #f4d3a5; }
@media (min-width: 721px) and (max-height: 960px) {
  .zone-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px 6px; }
  .hero-text { max-width: 620px; }
  .zone { min-height: 36px; font-size: 13px; padding: 3px 8px 3px 4px; }
  .zone small { display: none; }
  .zone b { width: 24px; height: 24px; font-size: 12px; }
  .lead { margin-bottom: 14px; }
}
.zone:hover, .zone.hot { background: rgba(181,105,31,.9); border-color: #f4d3a5; }
.store-fallback { position: absolute; top: 90px; left: 24px; right: 24px; z-index: 2; color: #f4d3a5; }
.store-fallback[hidden] { display: none; }
.hero::after { content: ""; position: absolute; left: 0; bottom: 0; width: min(780px, 100%); height: 360px; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 0% 100%, rgba(18,14,10,.82), rgba(18,14,10,0) 70%); }
.hero-text { position: relative; z-index: 3; max-width: 560px; padding: 0 40px max(48px, env(safe-area-inset-bottom)); pointer-events: none; }
.hero-text > * { pointer-events: auto; }
.kicker { margin: 0 0 10px; font-size: 13px; letter-spacing: .26em; color: #f4d3a5; }
.kicker.dark { color: var(--accent); }
.hero h1 { margin: 0 0 14px; font-size: clamp(30px, 4.4vw, 52px); line-height: 1.22; letter-spacing: .03em; font-weight: 600; }
.lead { margin: 0 0 24px; font-size: 16px; line-height: 1.8; color: rgba(255,255,255,.88); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { min-height: 50px; padding: 0 24px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 600;
  letter-spacing: .06em; text-decoration: none; cursor: pointer; transition: background .2s, transform .2s; }
.btn.primary { border: 0; background: #f6efe4; color: var(--ink); }
.scenes .btn.primary, .story .btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { transform: translateY(-1px); }
.btn.ghost { border: 1px solid rgba(255,255,255,.6); background: transparent; color: #fff; }

.scenes { padding: 72px 24px 56px; max-width: 1240px; margin: 0 auto; }
.section-head h2 { margin: 0 0 18px; font-size: clamp(26px, 3vw, 36px); letter-spacing: .04em; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.filters button { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.filters button[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; background: var(--card); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(40,30,20,.08); }
.card[hidden] { display: none; }
.card .cover { position: relative; aspect-ratio: 16 / 10; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr; gap: 2px; background: var(--line); }
.card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .cover img:first-child { grid-row: span 2; grid-column: span 2; }
.card .cover .theme { position: absolute; left: 12px; top: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(20,16,12,.7); color: #fff; font-size: 12px; letter-spacing: .1em; }
.card .body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .cat { margin: 0; font-size: 12px; letter-spacing: .2em; color: var(--accent); }
.card h3 { margin: 0; font-size: 21px; line-height: 1.4; }
.card .who { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink); font-weight: 600; }
.card .who:empty { display: none; }
.card .story { margin: 0; font-size: 14px; line-height: 1.7; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .items { margin: 4px 0 8px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.card .items li { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #f1e8da; }
.card .go { margin-top: auto; align-self: flex-start; }
.loading, .error { color: var(--muted); }

.story { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; max-width: 1240px; margin: 0 auto; padding: 24px 24px 72px; }
.story img { width: 100%; height: auto; border-radius: 20px; display: block; }
.story h2 { margin: 0 0 12px; font-size: clamp(24px, 2.6vw, 32px); }
.story p { line-height: 1.8; color: var(--muted); }
.foot { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

@media (max-width: 720px) {
  .topbar { padding-left: 14px; padding-right: 8px; }
  .brand span { display: none; }
  .topbar nav a:not(.pill) { display: none; }
  .hero-text { padding: 0 20px max(24px, env(safe-area-inset-bottom)); min-width: 0; width: 100%; max-width: 100vw; } /* grid item: never wider than the phone */
  .hero { min-height: 92svh; }
  .lead { display: none; }
  .zone-list { display: flex; overflow-x: auto; gap: 6px; margin: 0 -20px 4px; padding: 2px 44px 6px 20px; scroll-snap-type: x proximity; scrollbar-width: thin; }
  /* swipe affordance: edge fade + arrow buttons + a one-line hint (the list scrolls sideways on phones) */
  .zone-wrap { position: relative; }
  .zone-wrap::after { content: ""; position: absolute; top: 0; right: -20px; bottom: 6px; width: 56px; pointer-events: none; background: linear-gradient(90deg, rgba(20,16,12,0), rgba(20,16,12,.85)); }
  .zone-arrow { position: absolute; top: 2px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.6); background: rgba(29,26,23,.85); color: #fff; font-size: 24px; line-height: 1; display: grid; place-items: center; cursor: pointer; }
  .zone-arrow[hidden] { display: none; }
  .zone-arrow.prev { left: -14px; }
  .zone-arrow.next { right: -14px; animation: nudge 1.6s ease-in-out 3; }
  .swipe-hint { display: block; margin: 0 0 12px; font-size: 12px; letter-spacing: .08em; color: #f4d3a5; }
  @keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
  .zone-list li { flex: none; scroll-snap-align: start; }
  .zone-list .zone-group { align-self: center; margin: 0 2px; letter-spacing: .08em; white-space: nowrap; }
  .zone { width: auto; }
  .zone small { margin-left: 2px; }
  .hero h1 { font-size: 28px; }
  .kicker { font-size: 11px; letter-spacing: .16em; }
  .scenes { padding: 48px 16px 40px; }
  .cards { grid-template-columns: 1fr; }
  .story { grid-template-columns: 1fr; padding: 8px 16px 48px; }
}
@media (orientation: portrait) and (min-width: 721px) {
  .lead { display: none; }
  .hero-text { max-width: 640px; }
}
/* round 7r: wide desktop (the home's own wide() layout: canvas >= 900 px and aspect >= 1.35): the hero text sits top-left and the 20-zone
   list is the same one-row sideways scroller as on phones (arrows + hint), so the bottom band of the 3D view stays free for the street
   with the three parked cars (they were below / behind the text). All text and all 20 entrances are kept. */
@media (min-width: 900px) and (min-aspect-ratio: 135/100) {
  .hero { align-items: start; }
  .hero-text { padding: 84px 40px 0; }
  .hero::after { top: 0; bottom: auto; height: 560px; background: radial-gradient(ellipse at 0% 0%, rgba(18,14,10,.82), rgba(18,14,10,0) 70%); }
  .zone-list { display: flex; overflow-x: auto; gap: 6px; margin: 0 0 4px; padding: 2px 44px 6px 0; scroll-snap-type: x proximity; scrollbar-width: thin; }
  .zone-wrap { position: relative; }
  .zone-wrap::after { content: ""; position: absolute; top: 0; right: 0; bottom: 6px; width: 48px; pointer-events: none; background: linear-gradient(90deg, rgba(20,16,12,0), rgba(20,16,12,.85)); }
  .zone-arrow { position: absolute; top: 2px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.6); background: rgba(29,26,23,.85); color: #fff; font-size: 24px; line-height: 1; display: grid; place-items: center; cursor: pointer; }
  .zone-arrow[hidden] { display: none; }
  .zone-arrow.prev { left: -14px; }
  .zone-arrow.next { right: 0; }
  .swipe-hint { display: block; margin: 0 0 12px; font-size: 12px; letter-spacing: .08em; color: #f4d3a5; }
  .zone-list li { flex: none; scroll-snap-align: start; }
  .zone-list .zone-group { align-self: center; margin: 0 2px; letter-spacing: .08em; white-space: nowrap; }
  .zone { width: auto; }
  .zone small { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
