:root {
  --ink: #f4f6ff;
  --dim: #a3a9c9;
  --mute: #6f7699;
  --bg: #05060f;
  --glass: rgba(12, 14, 32, 0.72);
  --line: rgba(160, 170, 255, 0.16);
  --mint: #38f2a8;
  --orange: #ff9d2e;
  --red: #ff4766;
  --moon: #f6efd9;
  --r: 18px;
  --display: Unbounded, Geist, system-ui, sans-serif;
  --ui: Geist, system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --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; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--ui); overflow: hidden; overscroll-behavior: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#city { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }

/* loading */
.loading { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 14px; background: radial-gradient(ellipse at 50% 35%, #1a1640 0%, #05060f 70%); transition: opacity .8s ease; }
.loading.gone { opacity: 0; pointer-events: none; }
.loading .mark { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 80px rgba(246, 239, 217, .25); animation: rise 2.4s ease-in-out infinite; }
.loading .word { font: 800 22px/1 var(--display); letter-spacing: .14em; }
.loading .line { color: var(--dim); font-size: 13px; min-height: 1.4em; }
@keyframes rise { 50% { transform: translateY(-6px); } }

/* top */
.top { position: fixed; top: calc(12px + var(--safe-t)); left: 12px; right: 12px; z-index: 10; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 9px; padding: 7px 14px 7px 8px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.brand .word { font: 700 14px/1 var(--display); letter-spacing: .12em; }
.brand .word b { font-weight: 700; color: var(--moon); }
.stats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 62vw; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.pill b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pill.mood.up b { color: var(--mint); }
.pill.mood.down b { color: var(--red); }
.pill.demo { color: var(--orange); border-color: rgba(255, 157, 46, .4); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mute); display: inline-block; }
.dot.mint { background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.dot.orange { background: var(--orange); box-shadow: 0 0 10px var(--orange); }
.dot.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* side buttons */
.side { position: fixed; right: 12px; top: 50%; transform: translateY(-50%); z-index: 10; display: grid; gap: 8px; }
.side button { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--dim); transition: color .2s, border-color .2s; }
.side button:hover, .side button:focus-visible { color: var(--ink); border-color: rgba(56, 242, 168, .5); outline: none; }

/* the floating name over the picked tower */
.tag { position: fixed; z-index: 9; left: 0; top: 0; transform: translate(-50%, -110%); padding: 5px 10px; border-radius: 10px; background: rgba(5, 6, 15, .82); border: 1px solid rgba(56, 242, 168, .55); font: 600 12.5px/1.2 var(--mono); color: var(--mint); pointer-events: none; white-space: nowrap; box-shadow: 0 0 24px rgba(56, 242, 168, .25); }

/* search + follow */
.search { position: fixed; z-index: 10; left: 50%; transform: translateX(-50%); bottom: calc(76px + var(--safe-b)); width: min(520px, calc(100% - 24px)); display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 999px; background: rgba(10, 12, 28, .86); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.search svg { color: var(--mute); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 16px; padding: 8px 0; }
.search input::placeholder { color: var(--mute); }
.search input::-webkit-search-cancel-button { display: none; }
.go { padding: 9px 18px; border: 0; border-radius: 999px; background: var(--ink); color: #05060f; font-weight: 600; }
.follow { position: fixed; z-index: 10; left: 50%; transform: translateX(-50%); bottom: calc(18px + var(--safe-b)); display: inline-flex; align-items: center; gap: 9px; padding: 12px 20px; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: 14.5px; color: #05060f; background: linear-gradient(100deg, #38f2a8, #9ff7d3 55%, #f6efd9); box-shadow: 0 0 40px rgba(56, 242, 168, .35); white-space: nowrap; }
.follow b { font-weight: 700; }

/* the sheet */
.sheet { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-b)); width: min(460px, calc(100% - 20px)); max-height: min(78dvh, 640px); overflow: auto; border-radius: 24px; background: rgba(9, 11, 26, .94); border: 1px solid var(--line); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 20px 70px rgba(0, 0, 0, .6); animation: up .28s cubic-bezier(.2, .8, .2, 1); }
.sheet[hidden] { display: none; }
@keyframes up { from { transform: translate(-50%, 24px); opacity: 0; } }
.sheet .x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); display: grid; place-items: center; color: var(--dim); }
.sheet .body { padding: 20px 20px 18px; }
.kick { font: 600 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mint); margin-bottom: 8px; }
.kick.orange { color: var(--orange); }
.sheet h2 { margin: 0 44px 6px 0; font: 700 22px/1.15 var(--display); letter-spacing: .01em; word-break: break-word; }
.sheet h2 .at { color: var(--mint); }
.sheet p { margin: 8px 0; color: var(--dim); }
.sheet p b { color: var(--ink); font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.fact { padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line); }
.fact small { display: block; font-size: 11px; color: var(--mute); margin-bottom: 3px; }
.fact b { font: 700 17px/1.1 var(--display); }
.rows { display: grid; gap: 2px; margin: 12px 0 16px; }
.row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--dim); }
.row:first-child { border-top: 0; }
.row i { margin-top: 5px; width: 9px; height: 9px; border-radius: 50%; flex: none; border: 1.5px solid var(--mute); }
.row.ok i { background: var(--mint); border-color: var(--mint); box-shadow: 0 0 10px var(--mint); }
.row.wait i { background: var(--orange); border-color: var(--orange); animation: pulse 1.4s infinite; }
.row b { color: var(--ink); font-weight: 600; }
.row a { color: var(--mint); text-decoration: none; }
.row code, .mono { font: 500 12px var(--mono); color: var(--dim); word-break: break-all; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { flex: 1 1 auto; display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 13px 18px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); font-weight: 600; text-decoration: none; text-align: center; }
.btn.main { border: 0; color: #05060f; background: linear-gradient(100deg, #38f2a8, #b6f9dc); box-shadow: 0 0 30px rgba(56, 242, 168, .3); }
.btn.moon { border: 0; color: #05060f; background: linear-gradient(100deg, #f6efd9, #ffd38a); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.code { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0; padding: 14px 16px; border-radius: 16px; background: #000; border: 1px dashed rgba(56, 242, 168, .6); }
.code b { font: 700 24px/1 var(--mono); letter-spacing: .06em; color: var(--mint); }
.code button { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); font-size: 13px; }
.wait { display: flex; gap: 10px; align-items: center; margin-top: 12px; color: var(--dim); font-size: 13.5px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); border-top-color: var(--mint); animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.field { display: flex; gap: 8px; margin: 12px 0; }
.field input { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: #000; font: 500 14px var(--mono); outline: none; }
.field input:focus { border-color: rgba(56, 242, 168, .6); }
.err { color: var(--red); font-size: 13px; margin: 6px 0; }
.steps { counter-reset: s; display: grid; gap: 10px; margin: 14px 0; padding: 0; list-style: none; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 10px; color: var(--dim); font-size: 14px; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--display); color: #05060f; background: var(--moon); }
.steps b { color: var(--ink); }
.blocks { display: grid; gap: 6px; margin: 12px 0; }
.blk { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line); text-align: left; }
.blk .h { font: 700 14px var(--display); }
.blk .s { font-size: 12.5px; color: var(--dim); }
.blk .st { font: 600 11px var(--mono); padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); }
.blk .st.ok { color: var(--mint); border-color: rgba(56, 242, 168, .45); }
.blk .st.open { color: var(--orange); border-color: rgba(255, 157, 46, .45); }
.fine { font-size: 12px !important; color: var(--mute) !important; }
.toast { position: fixed; z-index: 30; top: calc(64px + var(--safe-t)); left: 50%; transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; background: rgba(5, 6, 15, .9); border: 1px solid rgba(255, 157, 46, .5); color: var(--ink); font-size: 13.5px; white-space: nowrap; box-shadow: 0 0 40px rgba(255, 157, 46, .25); animation: up .3s ease; }
.toast[hidden] { display: none; }
.nojs { position: fixed; inset: 0; display: grid; place-items: center; }

body.sheet-open .search, body.sheet-open .follow { opacity: 0; pointer-events: none; }
.search, .follow { transition: opacity .2s; }

@media (max-width: 600px) {
  .brand .word { font-size: 12.5px; }
  .stats { max-width: 52vw; }
  .pill { font-size: 11.5px; padding: 6px 10px; }
  #sMood { display: none; }
  .pill .long { display: none; }
  .stats { flex-direction: column; align-items: flex-end; }
  .pill.demo { padding: 4px 9px; font-size: 10.5px; }
  .side { top: auto; bottom: calc(140px + var(--safe-b)); transform: none; }
  .side button { width: 40px; height: 40px; }
  .sheet h2 { font-size: 20px; }
  .facts { gap: 6px; }
  .fact b { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* recording (?rec): the city alone, with the reel's words when the recorder sets them */
.rec .top, .rec .side, .rec .search, .rec .follow, .rec .tag { display: none !important; }
.reel { position: fixed; z-index: 40; left: 0; right: 0; padding: 0 7%; text-align: center; pointer-events: none; transition: opacity .5s; }
.reel.r-top { top: 13%; }
.reel.r-mid { top: 42%; }
.reel.r-low { bottom: 15%; }
.reel h1 { margin: 0; font: 800 clamp(30px, 9vw, 64px)/1.08 var(--display); letter-spacing: -.01em; text-shadow: 0 4px 30px rgba(0,0,0,.7); }
.reel h1 em { font-style: normal; color: var(--mint); }
.reel h1 b { color: var(--orange); font-weight: 800; }
.reel p { margin: 14px 0 0; font: 600 clamp(16px, 4.6vw, 28px)/1.3 var(--ui); color: #e8ebff; text-shadow: 0 2px 20px rgba(0,0,0,.8); }
