:root {
  --paper: #FBF8F1;
  --ink: #17140F;
  --green: #12382B;
  --deep: #0E2A20;
  --gold: #C29A4B;
  --gold-l: #E9D49C;
  --wa: #1FA855;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--deep); color: #fff; font: 500 18px/1.4 var(--sans); overscroll-behavior: none; }
button, a { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- layers ---------- */
.layer { position: fixed; inset: 0; width: 100%; height: 100%; transition: opacity .9s ease; }
#map { z-index: 0; background: #2b3b2c; }
#pano { z-index: 1; touch-action: none; cursor: grab; }
#pano:active { cursor: grabbing; }
#pano canvas { width: 100%; height: 100%; display: block; }
#film { z-index: 2; object-fit: cover; background: var(--deep); pointer-events: none; }
.off { opacity: 0; pointer-events: none !important; }
#shade { z-index: 3; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.45) 0, transparent 22%, transparent 52%, rgba(0,0,0,.72) 100%); }
.maplibregl-ctrl-attrib { font: 10px var(--sans); opacity: .7; }
body.at-start .maplibregl-ctrl-bottom-right, body.on-hub .maplibregl-ctrl-bottom-right { display: none; }

/* ---------- top ---------- */
#top { position: fixed; z-index: 20; left: 0; right: 0; top: 0; padding: calc(14px + var(--safe-t)) 16px 0; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
#top > * { pointer-events: auto; }
#brand { display: flex; gap: 9px; align-items: center; font: 800 14px/1 var(--sans); letter-spacing: .28em; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
#brand .mark { width: 16px; height: 16px; background: var(--gold); transform: rotate(45deg); box-shadow: inset 0 0 0 4px var(--green); }
body.at-start #brand { opacity: 0; }
.pill { border: 0; border-radius: 999px; padding: 10px 16px; background: rgba(14,42,32,.62); color: #fff; font-weight: 700; font-size: 15px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 0 0 1px rgba(255,255,255,.16); cursor: pointer; }

/* ---------- caption ---------- */
#caption { position: fixed; z-index: 12; left: 50%; transform: translate(-50%, 8px); bottom: calc(118px + var(--safe-b)); width: min(92vw, 760px); text-align: center; font: 700 clamp(21px, 5.6vw, 30px)/1.28 var(--sans); text-shadow: 0 2px 14px rgba(0,0,0,.75), 0 1px 2px rgba(0,0,0,.9); opacity: 0; transition: opacity .35s, transform .35s; pointer-events: none; text-wrap: balance; }
#caption.on { opacity: 1; transform: translate(-50%, 0); }
body.on-hub #caption { bottom: auto; top: calc(64px + var(--safe-t)); font-size: clamp(19px, 4.8vw, 26px); }

/* ---------- place title ---------- */
#title { position: fixed; z-index: 11; left: 16px; right: 16px; top: calc(62px + var(--safe-t)); text-shadow: 0 2px 16px rgba(0,0,0,.7); animation: rise .7s ease both; }
#title small { display: inline-block; font: 800 13px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--gold-l); }
#title h2 { margin: 8px 0 6px; font: 600 clamp(32px, 8.4vw, 54px)/1.02 var(--serif); max-width: 15ch; }
#title p { margin: 0; display: inline-block; padding: 7px 13px; border-radius: 999px; background: var(--gold); color: var(--deep); font: 800 17px/1 var(--sans); text-shadow: none; }
#title p:empty { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* ---------- 360 helpers ---------- */
#coach { position: fixed; z-index: 14; left: 50%; top: 46%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 6px; padding: 22px 26px 20px; border-radius: 24px; background: rgba(14,42,32,.58); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); text-align: center; pointer-events: none; animation: rise .6s ease both; }
#coach b { font: 800 24px/1.15 var(--sans); }
#coach span { font-size: 16px; opacity: .85; }
#coach .hand { width: 150px; height: 64px; position: relative; }
#coach .hand::before { content: ""; position: absolute; left: 10px; right: 10px; top: 30px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); }
#coach .hand::after { content: ""; position: absolute; top: 4px; left: 50%; width: 46px; height: 56px; margin-left: -23px; background: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 56'%3E%3Cpath d='M17 30V8a4 4 0 0 1 8 0v14l10 2.4c3 .7 4.8 3.6 4.2 6.6L37 44c-.6 3-3.2 5-6.2 5H22c-2 0-3.8-.9-5-2.5L8 35a3.6 3.6 0 0 1 5.4-4.7z' fill='%23fff' stroke='%230E2A20' stroke-width='2.4' stroke-linejoin='round'/%3E%3C/svg%3E"); animation: swipe 2.2s ease-in-out infinite; }
@keyframes swipe { 0%, 100% { transform: translateX(-48px) rotate(-8deg); } 50% { transform: translateX(48px) rotate(8deg); } }

#ring { position: fixed; z-index: 13; left: 16px; bottom: calc(108px + var(--safe-b)); width: 64px; height: 64px; padding: 0; border: 0; border-radius: 50%; background: rgba(14,42,32,.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: pointer; display: grid; place-items: center; }
#ring svg { position: absolute; inset: 2px; }
#ring .rim { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 2; }
#ring #cone { fill: rgba(233,212,156,.55); transform-origin: 30px 30px; }
#ring .dot { fill: #fff; }
#ring span { position: relative; top: 19px; font: 800 11px/1 var(--sans); letter-spacing: .05em; }
#gyroBtn { position: fixed; z-index: 13; left: 92px; bottom: calc(120px + var(--safe-b)); }

#signs { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.sign { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 9px; border-radius: 999px; background: var(--gold); color: var(--deep); border: 0; font: 800 17px/1 var(--sans); white-space: nowrap; pointer-events: auto; cursor: pointer; box-shadow: 0 6px 22px rgba(0,0,0,.4), 0 0 0 3px rgba(255,255,255,.35); will-change: transform; }
.sign i { width: 34px; height: 34px; border-radius: 50%; background: var(--deep) center/cover; flex: none; box-shadow: 0 0 0 2px #fff; }
.sign em { font-style: normal; font-weight: 700; opacity: .8; }
.sign::after { content: "›"; font-size: 24px; margin-left: 2px; }
.sign.pulse { animation: beckon 1.6s ease-in-out infinite; }
@keyframes beckon { 50% { box-shadow: 0 6px 22px rgba(0,0,0,.4), 0 0 0 10px rgba(233,212,156,.35); } }
/* the arrow at the screen edge that says "there is more this way" */
#edge { position: fixed; z-index: 13; top: 50%; padding: 12px 14px; border-radius: 999px; background: rgba(194,154,75,.95); color: var(--deep); font: 800 15px/1 var(--sans); border: 0; transform: translateY(-50%); box-shadow: 0 6px 20px rgba(0,0,0,.35); cursor: pointer; animation: nudge 1.4s ease-in-out infinite; }
#edge.l { left: 10px; } #edge.r { right: 10px; }
@keyframes nudge { 50% { transform: translateY(-50%) translateX(var(--nx, 6px)); } }
#edge.l { --nx: -6px; }

/* ---------- bottom bar ---------- */
#bar { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; padding: 14px 16px calc(16px + var(--safe-b)); display: flex; gap: 10px; justify-content: center; }
#bar .btn { flex: 1 1 0; max-width: 420px; }
#secondary:empty { display: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 60px; padding: 0 22px; border-radius: 18px; border: 0; font: 800 19px/1.15 var(--sans); text-decoration: none; cursor: pointer; text-align: center; transition: transform .15s, filter .15s; }
.btn:active { transform: scale(.98); }
.btn.gold { background: var(--gold); color: var(--deep); box-shadow: 0 8px 26px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.35); }
.btn.gold:disabled { filter: saturate(.3) brightness(.85); }
.btn.ghost { background: rgba(14,42,32,.6); color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn.light { background: var(--paper); color: var(--deep); }
.btn.link { background: none; min-height: 48px; padding: 0 12px; text-decoration: underline; text-underline-offset: 4px; font-weight: 700; font-size: 17px; }
.btn.big { width: 100%; min-height: 64px; font-size: 20px; }
.btn.pulse { animation: beckon 1.6s ease-in-out infinite; }
.skip { position: fixed; z-index: 16; right: 16px; bottom: calc(26px + var(--safe-b)); padding: 14px 20px; font-size: 17px; }
.wa { position: fixed; z-index: 16; right: 16px; bottom: calc(102px + var(--safe-b)); width: 58px; height: 58px; border-radius: 50%; background: var(--wa); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.wa svg { width: 32px; height: 32px; }

/* ---------- map markers ---------- */
.mk { display: grid; justify-items: center; gap: 4px; cursor: pointer; transition: opacity .5s; } /* never transition transform: the map positions markers with it */
.mk .ph { width: 54px; height: 54px; border-radius: 50%; background: var(--deep) center/cover; box-shadow: 0 0 0 3px #fff, 0 6px 16px rgba(0,0,0,.45); }
.mk b { padding: 5px 10px; border-radius: 999px; background: rgba(14,42,32,.86); font: 800 14px/1 var(--sans); white-space: nowrap; }
.mk.seen .ph { box-shadow: 0 0 0 3px var(--gold), 0 6px 16px rgba(0,0,0,.45); }
.mk.seen b::after { content: " ✓"; color: var(--gold-l); }
.mk.hide { opacity: 0; pointer-events: none; }
.mk.home { pointer-events: none; }
.mk.home .gem { width: 30px; height: 30px; background: var(--gold); transform: rotate(45deg); box-shadow: inset 0 0 0 7px var(--green), 0 0 0 3px #fff, 0 0 0 14px rgba(233,212,156,.3), 0 0 40px 18px rgba(233,212,156,.45); animation: glow 2s ease-in-out infinite; }
.mk.home b { margin-top: 10px; background: var(--gold); color: var(--deep); font-size: 16px; letter-spacing: .14em; padding: 7px 12px; }
@keyframes glow { 50% { box-shadow: inset 0 0 0 7px var(--green), 0 0 0 3px #fff, 0 0 0 22px rgba(233,212,156,.18), 0 0 60px 26px rgba(233,212,156,.5); } }
.mk.start .dot { width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px var(--green); }
.mins { padding: 6px 11px; border-radius: 999px; background: var(--gold); color: var(--deep); font: 800 15px/1 var(--sans); box-shadow: 0 4px 12px rgba(0,0,0,.35); white-space: nowrap; transition: opacity .5s; }
.mins.big { font-size: 19px; padding: 9px 15px; }

/* ---------- hub ---------- */
#hub { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; padding: 20px 0 calc(16px + var(--safe-b)); background: linear-gradient(180deg, rgba(14,42,32,0), rgba(14,42,32,.92) 18%, var(--deep)); animation: up .6s ease both; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.hubHead { padding: 8px 16px 4px; }
.hubHead h2 { margin: 0; font: 600 clamp(28px, 7vw, 40px)/1.05 var(--serif); }
.hubHead p { margin: 6px 0 0; font-size: 16px; opacity: .82; }
#cards { display: flex; gap: 12px; overflow-x: auto; padding: 14px 16px 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
#cards::-webkit-scrollbar { display: none; }
.pc { flex: none; width: 150px; padding: 0; border: 0; border-radius: 16px; overflow: hidden; background: var(--paper); color: var(--deep); text-align: left; cursor: pointer; scroll-snap-align: start; box-shadow: 0 6px 18px rgba(0,0,0,.35); position: relative; }
.pc .im { height: 96px; background: #2b3b2c center/cover; }
.pc b { display: block; padding: 9px 11px 2px; font: 800 16px/1.15 var(--sans); }
.pc span { display: block; padding: 0 11px 11px; font: 700 14px/1.2 var(--sans); color: #7A5A1C; }
.pc.seen::after { content: "✓ Seen"; position: absolute; top: 8px; left: 8px; padding: 4px 8px; border-radius: 999px; background: var(--gold); font: 800 12px/1 var(--sans); }
.hubBtns { display: flex; gap: 10px; padding: 0 16px; }
.hubBtns .btn { flex: 1; }

/* ---------- start / end cards ---------- */
.card { position: fixed; z-index: 30; inset: 0; display: grid; align-items: end; padding: 16px 16px calc(22px + var(--safe-b)); background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,0) 35%, rgba(8,26,19,.86) 72%, rgba(8,26,19,.96)); transition: opacity .8s; }
.card .inner { width: min(100%, 520px); margin: 0 auto; display: grid; gap: 12px; text-align: center; justify-items: center; }
.card .kicker { font: 800 13px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-l); }
.card h1 { margin: 2px 0 0; font: 600 clamp(52px, 15vw, 96px)/.95 var(--serif); letter-spacing: -.01em; }
#end h1 { font-size: clamp(40px, 11vw, 72px); }
.card .lede { margin: 0 0 8px; font-size: 19px; line-height: 1.45; opacity: .92; }
.card .small { margin: 0; font-size: 15px; opacity: .75; }
.card .row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.card.fade { opacity: 0; pointer-events: none; }

@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  #caption { bottom: calc(110px + var(--safe-b)); }
  #title { left: 32px; top: 72px; }
  .card { align-items: center; background: radial-gradient(ellipse at 50% 60%, rgba(8,26,19,.7), rgba(8,26,19,.25) 70%); }
  #hub { left: 50%; right: auto; width: min(1100px, 100%); transform: translateX(-50%); border-radius: 24px 24px 0 0; }
  #cards { flex-wrap: wrap; overflow: visible; }
  .pc { width: 160px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  #title { top: 50px; } #title h2 { font-size: 30px; }
  #caption { bottom: 86px; font-size: 20px; }
  #hub .hubHead p { display: none; } .pc .im { height: 64px; }
  .card h1 { font-size: 48px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* ---------- fixes after the first look ---------- */
/* captions sit above the ring, the WhatsApp bubble and the big button */
body:not(.on-hub) #caption { bottom: calc(196px + var(--safe-b)); }
body.at-start:not(.on-end) #caption { bottom: calc(118px + var(--safe-b)); }
body.on-end #caption { z-index: 40; bottom: auto; top: calc(70px + var(--safe-t)); }
#title p.fact { display: block; max-width: 30ch; padding: 0; background: none; color: #fff; font: 600 19px/1.4 var(--sans); text-shadow: 0 2px 12px rgba(0,0,0,.8); margin-top: 8px; }
body.on-hub .mk .ph { width: 44px; height: 44px; }
body.on-hub .mk b { font-size: 13px; }
@media (max-height: 520px) and (orientation: landscape) { #end h1 { font-size: 40px; } body:not(.on-hub) #caption { bottom: 100px; } }

/* ---------- the drive, offered as the second thing to do ---------- */
.driveCard { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 6px; padding: 10px 14px 10px 10px; border-radius: 18px; background: rgba(14,42,32,.62); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.3); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); text-decoration: none; text-align: left; cursor: pointer; }
.driveCard:active { transform: scale(.98); }
.driveCard .dimg { flex: none; width: 76px; height: 56px; border-radius: 10px; background: #2b3b2c center 80%/cover url(media/cut/sagamu_l.jpg); box-shadow: 0 0 0 2px rgba(255,255,255,.5); position: relative; }
.driveCard .dimg::after { content: ""; position: absolute; inset: 0; border-radius: 10px; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.35)); }
.driveCard .dtxt { flex: 1; display: grid; gap: 3px; }
.driveCard b { font: 800 17px/1.2 var(--sans); }
.driveCard em { font-style: normal; font-size: 14.5px; opacity: .8; }
.driveCard .darr { font-size: 30px; line-height: 1; color: var(--gold-l); }
.pc.drive .im { background-position: center 80%; }
.pc.drive { background: var(--deep); color: #fff; box-shadow: 0 0 0 2px var(--gold), 0 6px 18px rgba(0,0,0,.35); }
.pc.drive span { color: var(--gold-l); }

.card { overflow-y: auto; }
#cards a.pc { display: block; text-decoration: none; }
#cards .pc.drive { background: var(--deep); color: #fff; }
#cards .pc.drive span { color: var(--gold-l); }

/* ---------- the small "drag to look around" sign, on every 360 until you drag ---------- */
#dragHint { position: fixed; z-index: 14; left: 50%; bottom: calc(108px + var(--safe-b)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px; border-radius: 999px; background: rgba(14,42,32,.72); box-shadow: 0 0 0 1.5px rgba(233,212,156,.55), 0 6px 18px rgba(0,0,0,.35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font: 800 16px/1 var(--sans); white-space: nowrap; pointer-events: none; animation: hintIn .5s ease both; }
#dragHint .mini-hand { width: 40px; height: 26px; position: relative; }
#dragHint .mini-hand::before { content: "‹  ›"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold-l); font-size: 14px; letter-spacing: 10px; }
#dragHint .mini-hand::after { content: ""; position: absolute; left: 50%; top: -2px; width: 22px; height: 27px; margin-left: -11px; background: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 56'%3E%3Cpath d='M17 30V8a4 4 0 0 1 8 0v14l10 2.4c3 .7 4.8 3.6 4.2 6.6L37 44c-.6 3-3.2 5-6.2 5H22c-2 0-3.8-.9-5-2.5L8 35a3.6 3.6 0 0 1 5.4-4.7z' fill='%23fff' stroke='%230E2A20' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E"); animation: miniSwipe 1.8s ease-in-out infinite; }
@keyframes miniSwipe { 0%, 100% { transform: translateX(-11px) rotate(-8deg); } 50% { transform: translateX(11px) rotate(8deg); } }
@keyframes hintIn { from { opacity: 0; transform: translate(-50%, 8px); } }
#dragHint { left: calc(50% + 22px); }

/* ---------- always a way to the drive ---------- */
.topR { display: flex; gap: 8px; align-items: center; }
.pill.ride { background: var(--gold); color: var(--deep); text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
body.at-start .pill.ride, body.on-end .pill.ride { display: none; }
.hubLinks { display: flex; justify-content: center; gap: 8px; padding: 4px 16px 0; }
@media (max-width: 420px) { #brand { font-size: 0; letter-spacing: 0; gap: 0; } #brand .mark { width: 18px; height: 18px; } .topR .pill { padding: 10px 13px; font-size: 14px; } }
#bar #secondary { flex: 0 0 auto; padding: 0 18px; }
