/* ============================================================
   MyPath styles. Brand colours live in :root — change them here.
   ============================================================ */
:root {
  --blue: #1454D4;
  --blue-dark: #0E3FA3;
  --navy: #082651;
  --powder: #E6EEFC;
  --powder-2: #F3F7FE;
  --white: #fff;
  --ink: #0B1B36;
  --muted: #47597A;
  --gold-1: #FFF3BF;
  --gold-2: #F5CF5E;
  --gold-3: #DDA62B;
  --gold-4: #A9741A;
  --gold-5: #7A5110;
  --amber-bg: #FEF3C7;
  --amber-ink: #8A4B06;
  --red: #C62828;
  --ok-bg: #E3F4E8;
  --ok-ink: #17603A;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(8,38,81,.06), 0 8px 24px rgba(8,38,81,.08);
  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--navy);
  line-height: 1.45; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, figure, fieldset { margin: 0; padding: 0; }
ul { list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--blue); }

:focus-visible { outline: 3px solid #FFD34D; outline-offset: 3px; box-shadow: 0 0 0 6px var(--navy); border-radius: 10px; }
h1:focus, h2:focus, h1:focus-visible, h2:focus-visible, li:focus-visible { outline: none; box-shadow: none; }

.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 10px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { left: 8px; }

.wordmark { font-weight: 500; font-size: 1.35rem; letter-spacing: -.02em; display: inline-flex; align-items: center; gap: 0; }
.wordmark b { font-weight: 800; }
.wm-dot { width: .55em; height: .55em; border-radius: 50%; border: .16em solid currentColor; margin-right: .35em; }
.wordmark-sm { font-size: 1.05rem; }

.chip { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 5px 10px; border-radius: 99px; border: 1.5px solid rgba(255,255,255,.45); color: #fff; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 52px; padding: 10px 22px; border-radius: 16px; border: 2px solid transparent;
  font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer; text-align: center;
  transition: transform .12s ease, background-color .15s ease;
}
.btn:active { transform: scale(.97); }
.btn .sub { font-weight: 500; font-size: .8rem; opacity: .85; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.app .btn-ghost, .celebrate .btn-ghost { color: var(--blue); border-color: var(--blue); }
.btn-quiet { background: var(--powder); color: var(--navy); }
.btn-block { display: flex; width: 100%; margin-top: 14px; }
.text-link { color: #fff; font-weight: 600; text-underline-offset: 4px; padding: 12px 8px; display: inline-block; }

/* ======================= LANDING ======================= */
#landing {
  position: relative; min-height: 100vh; min-height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding: max(18px, env(safe-area-inset-top)) 22px max(18px, env(safe-area-inset-bottom));
  color: #fff; text-align: center;
  background: radial-gradient(120% 70% at 50% 42%, #1B5FE0 0%, var(--blue) 30%, var(--navy) 100%);
}
.route-bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.route-bg path { fill: none; stroke: rgba(255,255,255,.16); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 14; }
.brand { position: relative; width: 100%; max-width: 520px; display: flex; justify-content: space-between; align-items: center; }
.hero { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 480px; padding: 18px 0 6px; }
.eyebrow { font-size: .82rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #CFE0FF; }
.hero h1 { font-size: clamp(2rem, 8.6vw, 3rem); line-height: 1.05; letter-spacing: -.03em; font-weight: 800; margin-top: 10px; }
.lede { margin-top: 12px; font-size: 1.02rem; color: #E3ECFF; max-width: 34ch; }

.token-stage { position: relative; margin-top: clamp(18px, 4.5vh, 40px); display: grid; place-items: center; perspective: 900px; }
.token-btn {
  --size: clamp(150px, 46vw, 210px);
  background: none; border: 0; padding: 14px; cursor: pointer; border-radius: 50%;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  animation: float 4.5s ease-in-out infinite;
}
.token-btn:focus-visible { outline-offset: 6px; border-radius: 50%; }
.token-btn:active .coin { filter: brightness(1.12); }
.coin-shadow { width: 46%; height: 16px; border-radius: 50%; background: rgba(3,14,36,.55); filter: blur(9px); margin-top: 6px; animation: shadow 4.5s ease-in-out infinite; }

.tap-hint { margin-top: 12px; font-weight: 800; font-size: 1.12rem; display: inline-flex; align-items: center; gap: 10px; }
.tap-pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 0 0 rgba(245,207,94,.7); animation: pulse 1.8s ease-out infinite; }

.landing-actions { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; max-width: 360px; margin-top: 14px; }
.landing-actions .btn { width: 100%; }
.landing-foot { position: relative; margin-top: 10px; }
.motto { font-weight: 700; font-size: .98rem; }
.fine { font-size: .8rem; color: var(--muted); margin-top: 8px; }
#landing .fine { color: #C5D6F7; margin-top: 4px; }
.center { text-align: center; }

/* ---------------- The coin ---------------- */
.coin {
  --size: 64px; --thick: calc(var(--size) * .09);
  position: relative; display: block; width: var(--size); height: var(--size);
  transform-style: preserve-3d; transform: rotateY(-24deg) rotateX(8deg);
}
.coin-lg { --size: inherit; animation: sway 6s ease-in-out infinite; }
.token-btn .coin { --size: clamp(150px, 46vw, 210px); }
.coin-sm { --size: 72px; margin: 0 auto; animation: sway 6s ease-in-out infinite; }
.coin i { position: absolute; inset: 0; border-radius: 50%; }
.coin .edge { background: linear-gradient(90deg, var(--gold-5), var(--gold-3) 30%, #F0C552 50%, var(--gold-4) 72%, var(--gold-5)); }
.coin .face {
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background:
    radial-gradient(circle at 32% 26%, rgba(255,255,255,.95) 0, rgba(255,255,255,0) 26%),
    radial-gradient(circle at 50% 50%, var(--gold-2) 0, var(--gold-3) 58%, var(--gold-4) 100%);
  box-shadow:
    inset 0 0 0 calc(var(--size) * .035) var(--gold-3),
    inset 0 0 0 calc(var(--size) * .05) rgba(255,246,200,.75),
    inset 0 0 0 calc(var(--size) * .105) var(--gold-2),
    inset 0 0 0 calc(var(--size) * .12) rgba(122,81,16,.55),
    inset 0 calc(var(--size) * -.05) calc(var(--size) * .12) rgba(122,81,16,.45);
  display: grid; place-items: center; overflow: hidden;
}
.coin .front { transform: translateZ(calc(var(--thick) / 2)); }
.coin .back { transform: rotateY(180deg) translateZ(calc(var(--thick) / 2)); }
.coin .face svg { width: 52%; height: 52%; filter: drop-shadow(0 1.5px 0 rgba(255,246,200,.8)); }
.coin .face::after {
  content: ""; position: absolute; inset: -20%; border-radius: 0;
  background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.55) 50%, transparent 58%);
  transform: translateX(-70%); animation: sheen 5s ease-in-out infinite;
}

.token-btn.collecting { animation: none; }
.token-btn.collecting .coin { animation: flip 1s cubic-bezier(.3,.7,.2,1) forwards; }
.token-btn.collected .coin { animation: none; transform: rotateY(0) scale(.9); opacity: .0; transition: opacity .25s, transform .25s; }
.token-btn.collected + .coin-shadow { opacity: 0; }

@keyframes sway { 0%,100% { transform: rotateY(-28deg) rotateX(8deg); } 50% { transform: rotateY(28deg) rotateX(4deg); } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes shadow { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.82); opacity: .7; } }
@keyframes sheen { 0%, 55% { transform: translateX(-70%); } 85%, 100% { transform: translateX(70%); } }
@keyframes pulse { to { box-shadow: 0 0 0 14px rgba(245,207,94,0); } }
@keyframes flip {
  0% { transform: rotateY(-24deg) rotateX(8deg) translateY(0) scale(1); }
  45% { transform: rotateY(540deg) rotateX(0) translateY(-46px) scale(1.12); }
  100% { transform: rotateY(1080deg) rotateX(0) translateY(-8px) scale(1); }
}

/* ---------------- Celebration ---------------- */
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }
.celebrate { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 22px; background: rgba(8,38,81,.72); animation: fade .25s ease; }
.celebrate-card { width: 100%; max-width: 360px; background: #fff; border-radius: 26px; padding: 26px 22px 20px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); animation: pop .35s cubic-bezier(.2,1.3,.4,1); display: flex; flex-direction: column; gap: 10px; }
.celebrate-card h2 { font-size: 1.75rem; letter-spacing: -.02em; color: var(--navy); margin-top: 6px; }
.celebrate-card p { color: var(--muted); }
.progress { height: 8px; background: var(--powder); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 99px; transition: width .3s ease; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }

/* ======================= DEMO APP ======================= */
.app { background: var(--powder-2); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
.app-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: max(10px, env(safe-area-inset-top)) 16px 10px; background: var(--navy); color: #fff; }
.app-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px 6px 6px; border-radius: 99px; background: rgba(255,255,255,.12); color: #fff; font-weight: 700; font-size: .9rem; text-decoration: none; }
.mini-coin { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #fff 0, var(--gold-2) 30%, var(--gold-3) 70%, var(--gold-4)); box-shadow: 2px 2px 0 var(--gold-5), inset 0 0 0 3px rgba(255,246,200,.6); }
.demo-strip { background: var(--powder); color: var(--navy); font-size: .8rem; padding: 8px 16px; text-align: center; }
.app-main { flex: 1; padding: 18px 16px 110px; }
.panel h1 { font-size: 1.65rem; letter-spacing: -.02em; color: var(--navy); margin-bottom: 12px; }
.panel-lede { color: var(--muted); margin: -4px 0 14px; }
.section-h { font-size: 1.1rem; color: var(--navy); margin: 22px 0 10px; }
.crumb { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; text-decoration: none; }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; border: 0; }

.route-form { display: grid; gap: 12px; }
.field { display: flex; align-items: center; gap: 12px; }
.field .label { display: block; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.field .value { font-weight: 700; font-size: 1.05rem; }
.dot { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.dot-start { border: 4px solid var(--blue); background: #fff; }
.dot-end { background: var(--navy); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.map-card { padding: 0; overflow: hidden; }
.map-card svg { width: 100%; height: auto; }
.map-card figcaption { font-size: .8rem; color: var(--muted); padding: 10px 14px; }
.map-route { stroke-dasharray: 520; stroke-dashoffset: 520; animation: draw .7s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--powder); padding: 4px; border-radius: 14px; margin-bottom: 14px; }
.seg button { min-height: 44px; border: 0; border-radius: 11px; background: transparent; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.seg button[aria-pressed="true"]::before { content: "✓ "; }

.unknowns { background: #EEF0F4; box-shadow: none; }
.unknown-title { font-weight: 800; color: var(--navy); margin-bottom: 10px; }
.unknowns li { display: flex; gap: 10px; align-items: center; padding: 8px 0; color: #3B4658; font-weight: 600; }
.unknowns li span { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 2px dashed #7C8798; font-weight: 800; }

.sample-tag { font-size: .8rem; font-weight: 700; color: var(--muted); margin: 0 2px 10px; }
.entrance h2 { font-size: 1.05rem; color: var(--navy); margin-bottom: 8px; }
.notice { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; font-size: .95rem; margin-top: 6px; }
.notice svg { width: 22px; height: 22px; flex: none; }
.notice-amber { background: var(--amber-bg); color: var(--amber-ink); }
.notice-ok { background: var(--ok-bg); color: var(--ok-ink); }
.outage { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1.5px solid #E7B4B4; font-size: .93rem; margin-bottom: 4px; }
.outage em { color: var(--muted); font-style: normal; }
.red-dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--red); flex: none; }
.pref-off-note { font-size: .85rem; color: var(--muted); margin: 0 2px 12px; }

/* AR */
.ar-frame { position: relative; border-radius: 22px; overflow: hidden; background: #0b1b36; aspect-ratio: 3 / 4; box-shadow: var(--shadow); }
.ar-frame img { width: 100%; height: 100%; object-fit: cover; }
#ar-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.ar-chev { animation: chev 1.6s linear infinite; }
@keyframes chev { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.ar-banner { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; gap: 12px; align-items: center; background: rgba(8,38,81,.92); color: #fff; padding: 12px 14px; border-radius: 16px; }
.ar-banner b { display: block; font-size: 1.08rem; }
.ar-banner span span { font-size: .9rem; color: #D5E3FF; }
.ar-banner.access { background: #0F4D24; }
.ar-banner.access span span { color: #CFF2DA; }
.ar-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--blue); display: grid; place-items: center; }
.ar-banner.access .ar-icon { background: #1E8A3E; color: #fff; }
.ar-icon svg { width: 24px; height: 24px; }
.ar-sim { position: absolute; right: 10px; bottom: 10px; font-size: .7rem; font-weight: 700; background: rgba(255,255,255,.9); color: var(--navy); padding: 4px 9px; border-radius: 99px; }
.ar-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.ar-controls .btn { min-width: 104px; }
.ar-step { font-weight: 700; color: var(--muted); font-size: .9rem; }

/* Shortcuts */
.shortcut-grid { display: grid; gap: 12px; }
.shortcut { padding: 0; overflow: hidden; display: grid; grid-template-columns: 108px 1fr; margin: 0; }
.shortcut-body { padding: 12px 14px; }
.shortcut h2 { font-size: 1rem; color: var(--navy); }
.shortcut p { font-size: .88rem; color: var(--muted); margin: 2px 0 8px; }
.shot { min-height: 108px; background-color: #CFE0FB; }
.shot-a { background-image: linear-gradient(#9DB7EA 0 0), linear-gradient(#9DB7EA 0 0), linear-gradient(#082651 0 0), linear-gradient(#F4F6FA 0 0); background-size: 26px 70%, 26px 70%, 100% 10px, 100% 26%; background-position: 0 0, 100% 0, 0 30%, 0 100%; background-repeat: no-repeat; }
.shot-b { background-image: linear-gradient(155deg, transparent 49.5%, #1454D4 50%, #1454D4 56%, #F4F6FA 56.5%), linear-gradient(#CFE2C8 0 0); background-size: 100% 100%, 100% 30%; background-position: 0 0, 0 100%; background-repeat: no-repeat; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 4px 9px; border-radius: 99px; }
.badge-example { background: var(--powder); color: var(--navy); }
.badge-pending { background: var(--amber-bg); color: var(--amber-ink); }
.form label { display: block; font-weight: 700; font-size: .9rem; margin: 10px 0 6px; color: var(--navy); }
.form label:first-child { margin-top: 0; }
.form input, .form textarea { width: 100%; padding: 12px 14px; border-radius: 12px; border: 2px solid #C3CEE3; background: #fff; font-size: 1rem; }
.form input:focus, .form textarea:focus { border-color: var(--blue); outline: 3px solid #BBD0FA; outline-offset: 0; box-shadow: none; }
.form-error { color: var(--red); font-weight: 700; font-size: .88rem; margin-top: 8px; }
.form-error::before { content: "! "; }
.mine-list li { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 10px; }
.mine-list b { display: block; color: var(--navy); }
.mine-list p { font-size: .88rem; color: var(--muted); margin: 2px 0 8px; }
.mine-list .row { display: flex; justify-content: space-between; align-items: center; }
.mine-list button { background: none; border: 0; color: var(--blue); font-weight: 700; min-height: 44px; padding: 0 6px; cursor: pointer; }

/* Explore */
.building { padding: 0; overflow: hidden; }
.photo-wrap { position: relative; aspect-ratio: 4 / 3; background: #cfd9ea; }
.photo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.pin { position: absolute; transform: translate(-50%, -100%); display: grid; justify-items: center; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); animation: pin 2.4s ease-in-out infinite; }
.pin svg { width: 38px; }
.pin b { position: absolute; top: -26px; background: var(--navy); color: #fff; font-size: .78rem; padding: 3px 9px; border-radius: 99px; }
@keyframes pin { 50% { transform: translate(-50%, -108%); } }
.building-body { padding: 16px; }
.building-body h2 { font-size: 1.2rem; color: var(--navy); }
.abbr { color: var(--muted); font-weight: 600; }
.building-body h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; }
.dest-list li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--powder); }
.dest-ico { width: 38px; height: 38px; border-radius: 12px; background: var(--powder); color: var(--blue); display: grid; place-items: center; font-size: 1.05rem; flex: none; }
.dest-list small { display: block; color: var(--muted); font-size: .8rem; }
.building-body .sample-tag { margin: 10px 0 0; font-weight: 600; }

/* Treasure hunt */
.hunt-progress { margin-bottom: 12px; font-weight: 800; color: var(--navy); display: grid; gap: 8px; }
.hunt-progress .progress { background: #D5E1F7; }
.hunt-progress .progress span { background: var(--gold-3); }
.scene { position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 360 / 260; box-shadow: var(--shadow); }
.scene > svg { width: 100%; height: 100%; }
.hunt-list { margin-top: 12px; display: grid; gap: 8px; }
.hunt-list button { width: 100%; min-height: 48px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border: 2px solid #C3CEE3; border-radius: 14px; font-weight: 700; text-align: left; cursor: pointer; }
.hunt-list button[disabled] { background: var(--powder); border-color: transparent; color: var(--muted); cursor: default; }
.hunt-list .state { font-size: .82rem; color: var(--blue); white-space: nowrap; }
.hunt-list button[disabled] .state { color: var(--ok-ink); }
.done-card { text-align: center; margin-top: 16px; border: 2px solid var(--gold-3); }
.done-card h2 { font-size: 1.6rem; color: var(--navy); margin-top: 10px; letter-spacing: -.02em; }
.done-card p { color: var(--muted); }

/* Profile */
.prefs { display: grid; gap: 4px; }
.prefs legend { font-weight: 800; color: var(--navy); padding: 0; margin-bottom: 6px; float: left; width: 100%; }
.radio { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 600; cursor: pointer; clear: both; }
.radio input { width: 22px; height: 22px; accent-color: var(--blue); }
.switch { -webkit-tap-highlight-color: transparent; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 60px; cursor: pointer; position: relative; border-top: 1px solid var(--powder); }
.switch:first-child { border-top: 0; }
.switch small { display: block; color: var(--muted); font-size: .82rem; }
.switch input { position: absolute; opacity: 0; width: 54px; height: 32px; right: 0; margin: 0; cursor: pointer; }
.switch i { width: 54px; height: 32px; border-radius: 99px; background: #8E9AB0; flex: none; position: relative; transition: background-color .15s; }
.switch i::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + i { background: var(--blue); }
.switch input:checked + i::after { transform: translateX(22px); }
.switch input:checked + i::before { content: "✓"; position: absolute; left: 9px; top: 5px; color: #fff; font-size: .9rem; font-weight: 800; font-style: normal; }
.switch input:focus-visible + i { outline: 3px solid #FFD34D; outline-offset: 3px; box-shadow: 0 0 0 6px var(--navy); }

/* Tab bar */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 1px solid #D9E2F2; padding: 6px 6px max(6px, env(safe-area-inset-bottom)); }
.tabbar a { display: grid; justify-items: center; gap: 2px; min-height: 54px; padding: 6px 2px; border-radius: 14px; font-size: .74rem; font-weight: 700; color: var(--muted); text-decoration: none; position: relative; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--blue); background: var(--powder); }
.tabbar a[aria-current="page"]::after { content: ""; position: absolute; top: 0; width: 22px; height: 3px; border-radius: 3px; background: var(--blue); }

/* ---------------- Larger screens ---------------- */
@media (min-width: 600px) {
  .app { box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 30px 80px rgba(0,0,0,.4); }
  .shortcut-grid { grid-template-columns: 1fr 1fr; }
  .shortcut { grid-template-columns: 1fr; }
}
@media (max-height: 640px) {
  .lede { display: none; }
  .token-btn .coin { --size: clamp(120px, 34vw, 150px); }
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .map-route { stroke-dashoffset: 0; }
}
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation: none !important; transition: none !important; }
html.reduce-motion .map-route { stroke-dashoffset: 0; }

/* ================= v2: voice-note changes ================= */
.btn-white { background: #fff; color: var(--navy); box-shadow: 0 8px 24px rgba(3,14,36,.4); font-size: 1.08rem; min-height: 60px; }
.btn-white:hover { background: var(--powder); }
.btn-white .sub { color: var(--muted); opacity: 1; }

.outage-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 12px; background: #fff; border-radius: var(--radius); border-left: 6px solid var(--red); box-shadow: var(--shadow); }
.outage-card b { display: block; color: #8E1B1B; font-size: 1.05rem; }
.outage-card span { display: block; font-weight: 600; }
.outage-card small { display: block; color: var(--muted); font-size: .82rem; }
.outage-card .red-dot { width: 12px; height: 12px; margin-top: 7px; }
.ent-line { color: var(--muted); font-size: .92rem; margin-top: -4px; }
.filter-row { padding: 4px 16px; background: var(--powder); box-shadow: none; }
.seg-3 { grid-template-columns: repeat(3, 1fr); }
.seg-3 button { font-size: .92rem; padding: 0 4px; }

.game-hud { background: var(--navy); color: #fff; border-radius: 22px; padding: 18px; margin-bottom: 12px; }
.game-kicker { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-2); }
.game-hud h2 { font-size: 1.5rem; letter-spacing: -.02em; margin: 2px 0 4px; }
.game-hud p { font-size: .92rem; }
.slots { display: flex; gap: 10px; margin: 14px 0 8px; }
.slot { width: 38px; height: 38px; border-radius: 50%; border: 2px dashed rgba(255,255,255,.6); }
.slot.filled { border: 0; background: radial-gradient(circle at 32% 28%, #fff 0, var(--gold-2) 30%, var(--gold-3) 70%, var(--gold-4)); box-shadow: 2px 2px 0 var(--gold-5), inset 0 0 0 3px rgba(255,246,200,.6); }
.game-hud .hunt-count { font-weight: 800; font-size: 1rem; }

.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.tile { aspect-ratio: 1 / 1; display: flex; flex-direction: column; justify-content: space-between; padding: 16px; background: #fff; border-radius: 22px; box-shadow: var(--shadow); color: var(--navy); text-decoration: none; transition: transform .12s ease; }
.tile:active { transform: scale(.97); }
.tile b { display: block; font-size: 1.18rem; letter-spacing: -.01em; }
.tile small { display: block; color: var(--muted); font-size: .82rem; }
.tile-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--powder); color: var(--blue); display: grid; place-items: center; }
.tile-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tile-primary { background: var(--blue); color: #fff; }
.tile-primary small { color: #fff; opacity: .9; }
.tile-primary .tile-ico { background: rgba(255,255,255,.18); color: #fff; }

.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; clear: both; }
.swatch { position: relative; display: grid; justify-items: center; gap: 6px; padding: 12px 4px; border: 2px solid #C3CEE3; border-radius: 14px; font-weight: 700; font-size: .84rem; text-align: center; cursor: pointer; }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.swatch i { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(255,255,255,.5); }
.swatch:has(input:checked) { border-color: var(--blue); background: var(--powder); }
.swatch:has(input:checked) span::before { content: "✓ "; }
.swatch:has(input:focus-visible) { outline: 3px solid #FFD34D; outline-offset: 3px; box-shadow: 0 0 0 6px var(--navy); }

.row-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--powder); }
.row-list li:first-child { border-top: 0; padding-top: 2px; }
.row-list b { display: block; color: var(--navy); }
.row-list small { display: block; color: var(--muted); font-size: .84rem; margin-bottom: 6px; }
.btn-mini { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 84px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--blue); background: #fff; color: var(--blue); font-weight: 700; text-decoration: none; white-space: nowrap; cursor: pointer; flex: none; }
.btn-mini[aria-pressed="true"] { background: var(--blue); color: #fff; }
.link-btn { background: none; border: 0; color: var(--blue); font-weight: 700; min-height: 44px; padding: 0 6px; cursor: pointer; }
.empty { color: var(--muted); }
.map-honors { fill: var(--blue); }
.map-route { stroke: var(--blue); }

html.large-text { font-size: 115%; }
#app[data-theme="red"] { --blue: #C8102E; --blue-dark: #9E0B23; --navy: #5A0F1C; --powder: #FBE7EA; --powder-2: #FEF6F7; --muted: #5B4A4D; }
#app[data-theme="orange"] { --blue: #B84A00; --blue-dark: #933B00; --navy: #4A2206; --powder: #FBE9DA; --powder-2: #FFF8F2; --muted: #5C4C40; }

/* ================= v3: real photos ================= */
.outage-card img { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; margin-left: auto; flex: none; }
img.shot { width: 100%; height: 100%; min-height: 108px; object-fit: cover; }
.barrier { padding: 0; overflow: hidden; }
.barrier > img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.scene { aspect-ratio: 4 / 3; background: #0b1b36; }
.scene > img { width: 100%; height: 100%; object-fit: cover; }
.scene-cap { position: absolute; left: 10px; top: 10px; max-width: calc(100% - 20px); background: rgba(8,38,81,.9); color: #fff; font-size: .8rem; font-weight: 700; padding: 5px 11px; border-radius: 99px; }
.building-body > p:not(.fine):not(.sample-tag) { color: var(--muted); margin-top: 4px; }
.school-hero { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; margin-bottom: 10px; }
@media (min-width: 600px) { .shortcut .shot { aspect-ratio: 4 / 3; } }
.barrier h2 { font-size: 1rem; color: var(--navy); }
.barrier p { font-size: .88rem; color: var(--muted); margin: 2px 0 8px; }

/* Door-details control on the entrance screen: one big, self-explaining button */
.door-toggle { -webkit-tap-highlight-color: transparent; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px; margin: 0 0 14px; padding: 14px 16px; text-align: left; font: inherit; color: var(--navy); background: #fff; border: 2px solid var(--blue); border-radius: 16px; cursor: pointer; }
.door-toggle:hover { background: var(--powder-2); }
.door-toggle:focus-visible { outline: 3px solid #FFD34D; outline-offset: 3px; box-shadow: 0 0 0 6px var(--navy); }
.door-toggle .door-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--powder); color: var(--blue); }
.door-toggle .door-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.door-toggle .door-txt { flex: 1; min-width: 0; }
.door-toggle b { display: block; font-size: 1.08rem; color: var(--blue); }
.door-toggle small { display: block; margin-top: 2px; color: var(--muted); font-size: .86rem; line-height: 1.35; }
.door-toggle .door-pill { flex: none; min-width: 48px; padding: 6px 10px; border-radius: 99px; text-align: center; font-weight: 800; font-size: .85rem; background: #DDE3EE; color: #44506A; }
.door-toggle.is-on { background: var(--blue); }
.door-toggle.is-on b, .door-toggle.is-on small { color: #fff; }
.door-toggle.is-on .door-ico { background: rgba(255,255,255,.18); color: #fff; }
.door-toggle.is-on .door-pill { background: #fff; color: var(--blue); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Accessible-door marker in the guidance preview: green circle, white door, white ring */
.ar-door { position: absolute; width: 52px; height: 52px; transform: translate(-50%, -78%); border-radius: 50%; background: #1E8A3E; color: #fff; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(0,0,0,.35); display: grid; place-items: center; }
.ar-door svg { width: 28px; height: 28px; }
.ar-door::after { content: ""; position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); border: 7px solid transparent; border-top-color: #fff; }

/* ================= Hidden tokens: placed in the photo, not floating on it ================= */
.scene { container-type: inline-size; }
.scene > img#scene-photo, .scene-occ img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#scene-tokens { position: absolute; inset: 0; z-index: 1; }
.scene-occ { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.scene-cap { z-index: 4; }

.hide-token {
  --s: 8; --rx: 0deg; --ry: 0deg; --rz: 0deg; --sx: 0;
  position: absolute; width: calc(var(--s) * 1cqw); height: calc(var(--s) * 1cqw);
  transform: translate(-50%, -100%); padding: 0; border: 0; background: none; cursor: pointer;
  perspective: 420px; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.hide-token.pose-flat { transform: translate(-50%, -50%); }
/* Invisible 56px+ tap area, so a small, far-away coin is still easy to hit */
.hide-token::before { content: ""; position: absolute; left: 50%; top: 50%; width: max(140%, 56px); height: max(140%, 56px); transform: translate(-50%, -50%); border-radius: 50%; }
.hide-token:focus-visible { outline: none; }
.hide-token:focus-visible::before { outline: 3px solid #FFD34D; box-shadow: 0 0 0 6px var(--navy); }

.ht-coin { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: 50% 100%;
  transform: rotateZ(var(--rz)) rotateX(var(--rx)) rotateY(var(--ry)); }
.pose-flat .ht-coin { transform-origin: 50% 50%; }
.hide-token .coin { --size: calc(var(--s) * 1cqw); --thick: calc(var(--size) * .13); transform: none; animation: none; }
.hide-token { filter: brightness(var(--tone, .94)) saturate(.9); }
.hide-token .coin .face::after { animation-duration: 3.6s; }

/* Contact shadow where the coin meets the ground; --sx skews it away from the light */
.ht-shadow { position: absolute; left: 50%; bottom: -10%; width: 170%; height: 30%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0,0,0,.75), rgba(0,0,0,.4) 50%, transparent);
  transform: translateX(calc(-50% + var(--sx) * 1%)); filter: blur(1.2px); }
.pose-flat .ht-shadow { bottom: 14%; height: 70%; width: 112%; transform: translate(calc(-50% + var(--sx) * .5%), 8%) rotate(var(--rz)); }

/* A brief glint so a sharp-eyed player can spot it */
.ht-glint { position: absolute; left: 18%; top: 4%; width: 46%; height: 46%; pointer-events: none; opacity: 0;
  background:
    linear-gradient(90deg, transparent 47%, #fff 50%, transparent 53%),
    linear-gradient(0deg, transparent 47%, #fff 50%, transparent 53%),
    radial-gradient(closest-side, rgba(255,250,220,.95), transparent 60%);
  animation: glint 3.8s ease-in-out infinite; }
.pose-flat .ht-glint { top: 22%; }
@keyframes glint { 0%, 78%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); } 86% { opacity: 1; transform: scale(1) rotate(25deg); } }

/* Collect: the coin pops out of its hiding place, spins and rises */
.hide-token.lift { z-index: 3; cursor: default; }
.hide-token.lift .ht-coin { animation: liftout .42s cubic-bezier(.3,.7,.2,1) forwards; }
.hide-token.lift .ht-shadow, .hide-token.lift .ht-glint { opacity: 0; transition: opacity .2s; }
@keyframes liftout {
  0% { transform: rotateZ(var(--rz)) rotateX(var(--rx)) rotateY(var(--ry)); opacity: 1; }
  45% { transform: translateY(-90%) rotateX(0deg) rotateY(360deg) scale(1.5); opacity: 1; }
  100% { transform: translateY(-190%) rotateX(0deg) rotateY(720deg) scale(1.1); opacity: 0; }
}
/* While lifting, the coin is drawn above the foreground copy so it visibly comes out */
.scene:has(.lift) .scene-occ { z-index: 0; }

/* Hint: a pulsing ring around the hiding place, plus a text clue */
.hint-ring { position: absolute; z-index: 3; width: 22cqw; height: 22cqw; transform: translate(-50%, -50%); border-radius: 50%;
  border: 3px solid #FFD34D; box-shadow: 0 0 0 3px rgba(8,38,81,.8), inset 0 0 0 3px rgba(8,38,81,.8); pointer-events: none; }
.hint-ring.go { animation: hintring 1.4s ease-out 3; }
@keyframes hintring { 0% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(.75); opacity: .9; } }
.hunt-tools { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.hunt-tools .btn { min-height: 48px; }
.hint-text { flex: 1; min-width: 12em; font-weight: 700; color: var(--navy); }

@media (prefers-reduced-motion: reduce) { .ht-glint { animation: none; opacity: .8; transform: scale(.7); } .hint-ring.go { animation: none; } }
html.reduce-motion .ht-glint { opacity: .8; transform: scale(.7); }

/* No double-tap-zoom wait on taps */
a, button, label, input, select, summary { touch-action: manipulation; }

/* ================= Home: opens straight into the app ================= */
.app-slides svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.app-slides { padding: 6px 14px; }
.home-kicker { margin: 4px 0 2px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.home-h { font-size: clamp(1.75rem, 7.6vw, 2.1rem); line-height: 1.12; letter-spacing: -.025em; margin: 0 0 14px; }
.where { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 16px; background: #fff; border: 2px solid var(--blue); border-radius: 16px; box-shadow: 0 6px 18px rgba(20,84,212,.12); }
.where:focus-within { outline: 3px solid #FFD34D; outline-offset: 2px; }
.where svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--blue); stroke-width: 2.4; stroke-linecap: round; }
.where input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 1.05rem; color: var(--navy); padding: 14px 0; }
.where input::-webkit-search-cancel-button { cursor: pointer; }
.where-results { list-style: none; margin: 8px 0 0; padding: 6px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); }
.where-results a { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; min-height: 52px; padding: 8px 10px; border-radius: 12px; color: var(--navy); text-decoration: none; }
.where-results a:hover, .where-results a:focus-visible { background: var(--powder); }
.where-results a b { grid-column: 1; }
.where-results a small { grid-column: 1; color: var(--muted); font-size: .84rem; }
.where-results a span { grid-column: 2; grid-row: 1 / span 2; font-size: 1.4rem; color: var(--blue); }
.where-none { padding: 12px 10px; color: var(--muted); font-size: .92rem; }

.feature { margin-top: 16px; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); }
.feature-photo { position: relative; aspect-ratio: 16 / 9; background: #cfd9ea; }
.feature-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feature-chip { position: absolute; left: 12px; top: 12px; padding: 6px 11px; border-radius: 99px; background: var(--navy); color: #fff; font-size: .78rem; font-weight: 700; }
.feature-body { padding: 14px 16px 16px; display: grid; gap: 8px; }
.feature-body h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.015em; color: var(--navy); }
.feature-door { margin: 0; display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--navy); }
.door-badge { width: 34px; height: 34px; flex: none; border-radius: 50%; background: #1E8A3E; color: #fff; display: grid; place-items: center; }
.door-badge svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.feature-src { margin: 0; font-size: .86rem; color: var(--muted); }
.feature-body .btn { margin-top: 4px; }
.text-link-dark { justify-self: center; display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--blue); }

.home-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.home-tile { display: flex; flex-direction: column; gap: 10px; padding: 14px; min-height: 108px; border-radius: 18px; background: #fff; color: var(--navy); text-decoration: none; box-shadow: var(--shadow); }
.home-tile b { display: block; font-size: 1rem; }
.home-tile small { display: block; font-size: .84rem; color: var(--muted); margin-top: 2px; }
.home-tile .tile-ico { width: 40px; height: 40px; border-radius: 12px; }
.home-tile .tile-ico svg { width: 22px; height: 22px; }
.home-tile-hunt { background: var(--navy); color: #fff; }
.home-tile-hunt small { color: #C5D6F7; }
.home-coin { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #FFF3BF 0, var(--gold-2) 34%, var(--gold-3) 72%, var(--gold-4) 100%); box-shadow: 2px 2px 0 var(--gold-5), inset 0 0 0 3px rgba(255,246,200,.55); }
.home-tile:focus-visible, .text-link-dark:focus-visible { outline: 3px solid #FFD34D; outline-offset: 3px; }
.feature .btn { flex-direction: row; gap: 8px; }

/* ================= Welcome: calm, balanced, one thing to tap ================= */
.welcome { position: relative; min-height: 100vh; min-height: 100dvh; box-sizing: border-box; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto auto; justify-items: center; text-align: center;
  padding: max(22px, env(safe-area-inset-top)) 28px max(26px, env(safe-area-inset-bottom));
  background: radial-gradient(120% 70% at 50% 42%, #FFFFFF 0%, #F2F6FD 55%, #E4ECFA 100%); color: var(--navy); }
.welcome[hidden] { display: none; }
.welcome-flow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.welcome-flow path { fill: none; stroke: #1454D4; stroke-width: 1.4; stroke-linecap: round; opacity: .16; vector-effect: non-scaling-stroke; }
.welcome-flow path + path { opacity: .09; }
.welcome-brand { position: relative; margin: 0; font-size: 1.15rem; font-weight: 500; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 8px; }
.welcome-brand b { font-weight: 800; color: var(--blue); margin-left: -8px; }
.welcome-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px #D6E3FB; }

.welcome-center { position: relative; align-self: center; display: grid; justify-items: center; gap: 22px; }
.welcome-logo { position: relative; width: clamp(156px, 46vw, 196px); aspect-ratio: 1; border: 0; padding: 0; border-radius: 50%;
  background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.welcome-mark { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 36% 30%, #3B78F0 0%, #1454D4 55%, #0E3FA3 100%);
  box-shadow: 0 18px 40px rgba(20,84,212,.28), inset 0 2px 0 rgba(255,255,255,.25);
  transition: transform .32s cubic-bezier(.3,.7,.2,1); }
.welcome-mark svg { width: 62%; height: 62%; fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; }
.welcome-mark .fill { fill: #fff; stroke: none; }
.welcome-halo { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(20,84,212,.28); animation: breathe 4.8s ease-in-out infinite; }
.welcome-halo.h2 { animation-delay: 2.4s; }
@keyframes breathe { 0% { transform: scale(1); opacity: .9; } 70% { opacity: 0; } 100% { transform: scale(1.55); opacity: 0; } }
.welcome-logo:hover .welcome-mark { transform: scale(1.03); }
.welcome-logo:active .welcome-mark { transform: scale(.97); }
.welcome-logo:focus-visible { outline: 3px solid #FFD34D; outline-offset: 10px; box-shadow: 0 0 0 16px rgba(8,38,81,.0); }
.welcome-tap { margin: 0; font-size: 1.02rem; font-weight: 700; color: var(--blue); letter-spacing: .01em; }

.welcome-copy { position: relative; display: grid; gap: 8px; max-width: 22rem; margin-bottom: 26px; }
.welcome-copy h1 { margin: 0; font-size: clamp(2.2rem, 10vw, 2.8rem); line-height: 1.05; letter-spacing: -.035em; font-weight: 800; }
.welcome-copy p { margin: 0; font-size: 1.02rem; line-height: 1.45; color: var(--muted); }
.welcome-foot { position: relative; display: grid; gap: 4px; justify-items: center; }
.welcome-motto { margin: 0; font-size: .92rem; font-weight: 600; color: var(--navy); }
.welcome-slides { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; font-weight: 700; color: var(--blue); }

@media (prefers-reduced-motion: reduce) { .welcome-halo { animation: none; opacity: .35; } }
html.reduce-motion .welcome-halo { animation: none; opacity: .35; }

/* ---------- Welcome: gentle motion on arrival ---------- */
.flow-light { fill: #1454D4; opacity: .55; filter: drop-shadow(0 0 4px rgba(20,84,212,.7)); }
.flow-light.dim { opacity: .3; }
.glyph-line { stroke-dasharray: 60; stroke-dashoffset: 60; animation: glyphdraw 1s cubic-bezier(.4,0,.2,1) .35s forwards; }
.glyph-end { opacity: 0; transform-origin: 44px 18px; animation: glyphpop .4s cubic-bezier(.3,1.6,.5,1) 1.2s forwards; }
.glyph-dot { opacity: 0; }
@keyframes glyphdraw { to { stroke-dashoffset: 0; } }
@keyframes glyphpop { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: scale(1); } }
.welcome-mark { animation: markin .7s cubic-bezier(.2,.9,.3,1.15) both; }
@keyframes markin { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.welcome-brand, .welcome-tap, .welcome-copy, .welcome-foot { animation: fadeup .7s ease both; }
.welcome-tap { animation-delay: 1.3s; }
.welcome-copy { animation-delay: .55s; }
.welcome-foot { animation-delay: .8s; }
@keyframes fadeup { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.welcome-tap { animation-name: fadeup, tapglow; animation-duration: .7s, 2.8s; animation-delay: 1.3s, 2s; animation-iteration-count: 1, infinite; animation-timing-function: ease, ease-in-out; }
@keyframes tapglow { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ---------- Tap: dot travels, circle fills the screen, app rises ---------- */
.welcome.go .welcome-halo { animation: none; opacity: 0; transition: opacity .2s; }
.welcome.go .welcome-tap { opacity: 0; transition: opacity .2s; animation: none; }
.welcome.go .glyph-start { opacity: .45; transition: opacity .3s; }
.reveal { position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: radial-gradient(circle at var(--cx) var(--cy), #2F6BEA 0%, #1454D4 35%, #082651 100%);
  clip-path: circle(var(--r0) at var(--cx) var(--cy)); -webkit-clip-path: circle(var(--r0) at var(--cx) var(--cy)); }
.reveal[hidden] { display: none; }
.reveal.grow { animation: revealgrow .52s cubic-bezier(.65,0,.35,1) forwards; }
.reveal.fade { opacity: 0; transition: opacity .45s ease; clip-path: circle(var(--r1) at var(--cx) var(--cy)); -webkit-clip-path: circle(var(--r1) at var(--cx) var(--cy)); animation: none; }
@keyframes revealgrow { from { clip-path: circle(var(--r0) at var(--cx) var(--cy)); } to { clip-path: circle(var(--r1) at var(--cx) var(--cy)); } }

.panel.rise > * { animation: riseup .55s cubic-bezier(.2,.8,.2,1) both; }
.panel.rise > *:nth-child(1) { animation-delay: .05s; }
.panel.rise > *:nth-child(2) { animation-delay: .1s; }
.panel.rise > *:nth-child(3) { animation-delay: .16s; }
.panel.rise > *:nth-child(4), .panel.rise > *:nth-child(5) { animation-delay: .22s; }
.panel.rise > *:nth-child(6) { animation-delay: .3s; }
.panel.rise > *:nth-child(7) { animation-delay: .38s; }
.panel.rise > *:nth-child(n+8) { animation-delay: .44s; }
@keyframes riseup { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .flow-light { display: none; }
  .glyph-line { stroke-dashoffset: 0; } .glyph-end { opacity: 1; }
}
html.reduce-motion .flow-light { display: none; }
html.reduce-motion .glyph-line { stroke-dashoffset: 0; }
html.reduce-motion .glyph-end { opacity: 1; }
