/* Front page: neon city. Black, neon red, neon yellow. */
body.city {
  --neon-red: #ff1f3d;
  --neon-yellow: #ffe600;
  --glass: rgba(6, 4, 8, 0.82);
  background: #020003;
  color: #f5f1e6;
  padding: 0;
  font-family: 'Space Grotesk', sans-serif;
}
body.city .bg-layer { display: none; }

.city-canvas, .city-fallback, .city-vignette { position: fixed; inset: 0; z-index: 0; }
.city-canvas canvas { display: block; width: 100%; height: 100%; }
.city-canvas { opacity: 0; transition: opacity 900ms ease; }
body.city-live .city-canvas { opacity: 1; }
body.city-live .city-fallback { opacity: 0; }
.city-vignette { pointer-events: none; background: radial-gradient(ellipse at center, transparent 45%, rgba(2, 0, 3, 0.72) 100%); }

/* Backdrop before the 3D loads, and the whole show when WebGL is missing.
   Kept still on purpose: it has to be cheap on machines without a GPU. */
.city-fallback {
  transition: opacity 900ms ease;
  background:
    radial-gradient(ellipse at 50% 115%, rgba(255, 31, 61, 0.35), transparent 55%),
    radial-gradient(ellipse at 80% -10%, rgba(255, 230, 0, 0.14), transparent 50%),
    #020003;
  overflow: hidden;
}
.city-fallback::before, .city-fallback::after {
  content: ''; position: absolute; inset: -80px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 31, 61, 0.42) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(0deg, rgba(255, 31, 61, 0.42) 0 1px, transparent 1px 80px);
  -webkit-mask-image: linear-gradient(transparent 20%, #000 100%); mask-image: linear-gradient(transparent 20%, #000 100%);
}
.city-fallback::after {
  background:
    repeating-linear-gradient(90deg, rgba(255, 230, 0, 0.3) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(0deg, rgba(255, 230, 0, 0.3) 0 1px, transparent 1px 80px);
  -webkit-mask-image: linear-gradient(#000, transparent 70%); mask-image: linear-gradient(#000, transparent 70%);
  transform: rotate(8deg) scale(1.3);
}

/* Top bar */
.city-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.1rem;
  padding: 0.6rem 1.1rem;
  background: linear-gradient(rgba(2, 0, 3, 0.94), rgba(2, 0, 3, 0.6) 70%, transparent);
}
.city-bar .eyebrow { margin: 0; color: var(--neon-yellow); font: 700 0.78rem 'IBM Plex Mono', monospace; letter-spacing: 0.18em; text-shadow: 0 0 12px rgba(255, 230, 0, 0.7); }
.city-bar .live-dot { background: var(--neon-red); box-shadow: 0 0 10px var(--neon-red); }
body.city .site-nav { display: flex; flex-wrap: wrap; gap: 0.15rem 0.2rem; margin: 0; }
body.city .site-nav a {
  color: #f5f1e6; background: transparent; border: 0; box-shadow: none; text-decoration: none;
  font: 600 0.74rem 'IBM Plex Mono', monospace; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.35rem 0.6rem; border-bottom: 2px solid transparent; transform: none;
}
body.city .site-nav a:hover, body.city .site-nav a:focus-visible { color: var(--neon-yellow); border-bottom-color: var(--neon-yellow); text-shadow: 0 0 10px rgba(255, 230, 0, 0.8); }
body.city .site-nav a[aria-current='page'] { color: #020003; background: var(--neon-yellow); }
.city-status { margin-left: auto; font: 500 0.66rem 'IBM Plex Mono', monospace; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(245, 241, 230, 0.55); }

/* Scene rail */
.scene-rail { position: fixed; right: 0.9rem; top: 50%; transform: translateY(-50%); z-index: 5; display: grid; gap: 0.85rem; }
.scene-rail a { position: relative; display: block; width: 14px; height: 14px; border: 2px solid var(--neon-red); transform: rotate(45deg); transition: background 200ms, box-shadow 200ms; }
.scene-rail a[data-active] { background: var(--neon-yellow); border-color: var(--neon-yellow); box-shadow: 0 0 16px var(--neon-yellow); }
.scene-rail span {
  position: absolute; right: 22px; top: 50%; transform: rotate(-45deg) translateY(-50%); transform-origin: right center;
  white-space: nowrap; opacity: 0; pointer-events: none; padding: 0.2rem 0.5rem; background: #020003; border: 1px solid var(--neon-red);
  font: 600 0.66rem 'IBM Plex Mono', monospace; letter-spacing: 0.1em; text-transform: uppercase; color: #f5f1e6;
}
.scene-rail a:hover span, .scene-rail a:focus-visible span { opacity: 1; }
.scene-rail a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* Scenes and panels */
#scenes { position: relative; z-index: 2; width: 100%; margin: 0; display: block; pointer-events: none; }
.scene { position: relative; min-height: 190vh; padding: 16vh clamp(1rem, 4vw, 4rem) 30vh; display: flex; align-items: flex-start; }
.scene-left { justify-content: flex-start; }
.scene-right { justify-content: flex-end; padding-right: clamp(2.6rem, 5vw, 5rem); }
.panel {
  pointer-events: auto; position: sticky; top: 13vh; width: min(520px, 42vw);
  background: var(--glass); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  border: 1px solid rgba(255, 230, 0, 0.55); border-left: 5px solid var(--neon-yellow);
  padding: 1.3rem 1.4rem 1.4rem;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  box-shadow: 0 0 44px rgba(255, 230, 0, 0.1);
}
.panel-red { border-color: rgba(255, 31, 61, 0.65); border-left-color: var(--neon-red); box-shadow: 0 0 44px rgba(255, 31, 61, 0.16); }
.panel-hero { width: min(600px, 46vw); }
.panel .panel-kicker { color: var(--neon-red); font: 700 0.7rem 'IBM Plex Mono', monospace; letter-spacing: 0.2em; margin: 0 0 0.5rem; }
body.city .panel h2 {
  margin: 0 0 0.5rem; font: 700 clamp(2rem, 4.2vw, 3.3rem)/0.95 'Chakra Petch', sans-serif; text-transform: uppercase; letter-spacing: 0.01em;
  color: var(--neon-yellow); text-shadow: 0 0 18px rgba(255, 230, 0, 0.55), 3px 3px 0 rgba(255, 31, 61, 0.85);
}
body.city .panel-red h2 { color: #fff; text-shadow: 0 0 20px rgba(255, 31, 61, 0.9), 3px 3px 0 var(--neon-red); }
.panel-lede { margin: 0 0 1rem; color: rgba(245, 241, 230, 0.78); font-size: 0.98rem; line-height: 1.45; }

/* Hero */
body.city .edition-line { border: 0; padding: 0; background: none; margin: 0 0 0.6rem; font: 600 0.72rem 'IBM Plex Mono', monospace; letter-spacing: 0.14em; text-transform: uppercase; color: var(--neon-red); }
.city .panel-hero h1, body[data-page='frontpage'].city .panel-hero h1 {
  margin: 0 0 0.7rem; font: 400 clamp(3rem, 7.4vw, 6.4rem)/0.88 'Archivo Black', Impact, sans-serif; text-transform: uppercase; letter-spacing: -0.02em; color: #fff;
  text-shadow: 0 0 26px rgba(255, 31, 61, 0.75);
}
.panel-hero h1 span { display: block; }
.panel-hero h1 span:last-child { color: var(--neon-yellow); text-shadow: 0 0 26px rgba(255, 230, 0, 0.6), 4px 4px 0 var(--neon-red); }
.glitch { animation: glitch 5.5s steps(1) infinite; }
@keyframes glitch {
  0%, 91%, 100% { transform: none; clip-path: none; }
  92% { transform: translate(-5px, 2px) skewX(-6deg); clip-path: inset(12% 0 48% 0); }
  94% { transform: translate(6px, -2px) skewX(5deg); clip-path: inset(55% 0 8% 0); }
  96% { transform: translate(-2px, 0); clip-path: inset(30% 0 30% 0); }
}
body.city .manifesto { display: inline-block; margin: 0 0 0.8rem; padding: 0.25rem 0.6rem; background: var(--neon-red); color: #fff; font-weight: 700; }
body.city .editorial-note { margin: 0 0 0.8rem; color: rgba(245, 241, 230, 0.8); font-size: 0.95rem; line-height: 1.45; }
body.city .meta-row { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0 0 0.9rem; font: 500 0.7rem 'IBM Plex Mono', monospace; letter-spacing: 0.06em; text-transform: uppercase; color: var(--neon-yellow); }
body.city .pressure-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin: 0 0 1rem; }
.pressure-cell { border: 1px solid rgba(255, 31, 61, 0.6); padding: 0.45rem 0.5rem; font: 600 0.62rem 'IBM Plex Mono', monospace; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(245, 241, 230, 0.75); }
.pressure-cell strong { display: block; font: 700 1.7rem/1 'Chakra Petch', sans-serif; color: var(--neon-yellow); text-shadow: 0 0 14px rgba(255, 230, 0, 0.6); }
.featured { border-top: 1px solid rgba(255, 230, 0, 0.4); padding-top: 0.9rem; margin-bottom: 1rem; }
body.city .featured h2 { font-family: 'Chakra Petch', sans-serif; font-weight: 700; font-size: clamp(1.2rem, 2vw, 1.6rem); line-height: 1.12; text-transform: none; text-shadow: none; margin-bottom: 0.45rem; }
.featured h2 a { color: #fff; text-decoration-color: var(--neon-red); text-underline-offset: 4px; }
.featured p { margin: 0 0 0.4rem; color: rgba(245, 241, 230, 0.8); font-size: 0.93rem; line-height: 1.45; }

body.city .cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.1rem; margin-top: 1rem; }
body.city .primary-cta {
  display: inline-block; background: var(--neon-yellow); color: #020003; border: 0; box-shadow: 4px 4px 0 var(--neon-red);
  font: 700 0.86rem 'Chakra Petch', sans-serif; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; padding: 0.65rem 1.05rem;
}
body.city .primary-cta:hover, body.city .primary-cta:focus-visible { background: #fff; box-shadow: 4px 4px 0 var(--neon-red), 0 0 26px rgba(255, 230, 0, 0.8); }
body.city .text-cta { color: var(--neon-yellow); font: 600 0.76rem 'IBM Plex Mono', monospace; letter-spacing: 0.06em; text-transform: uppercase; text-underline-offset: 4px; }
body.city a:focus-visible, body.city button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* Story lists */
.story-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.story { display: flex; gap: 0.75rem; padding: 0.7rem 0; border-top: 1px solid rgba(245, 241, 230, 0.14); }
.story:first-child { border-top: 0; padding-top: 0; }
.story a { color: #fff; font: 600 1.02rem/1.25 'Chakra Petch', sans-serif; text-decoration: none; }
.story a:hover, .story a:focus-visible { color: var(--neon-yellow); text-shadow: 0 0 12px rgba(255, 230, 0, 0.6); }
.story-rank { flex: none; font: 700 1.25rem/1.1 'Chakra Petch', sans-serif; color: var(--neon-red); text-shadow: 0 0 12px rgba(255, 31, 61, 0.8); min-width: 1.9rem; }
body.city .story-meta { margin: 0.25rem 0 0; font: 500 0.66rem 'IBM Plex Mono', monospace; letter-spacing: 0.05em; text-transform: uppercase; color: rgba(245, 241, 230, 0.55); }
.story-sum { margin: 0.4rem 0 0; color: rgba(245, 241, 230, 0.78); font-size: 0.88rem; line-height: 1.45; }
body.city .feed-state { background: transparent; border: 1px dashed rgba(255, 230, 0, 0.5); box-shadow: none; color: #f5f1e6; padding: 0.9rem; }
body.city .feed-state p { color: rgba(245, 241, 230, 0.7); }
body.city .feed-state-actions a { color: var(--neon-yellow); }

/* HTML ticker (all 40 headlines, real links) */
.ticker { pointer-events: auto; position: absolute; left: 0; right: 0; bottom: 9vh; overflow: hidden; background: rgba(2, 0, 3, 0.9); border-block: 2px solid var(--neon-red); box-shadow: 0 0 30px rgba(255, 31, 61, 0.45); }
.ticker-track { display: flex; width: max-content; animation: ticker var(--ticker-seconds, 180s) linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
.ticker ul { display: flex; list-style: none; margin: 0; padding: 0; }
.ticker li { white-space: nowrap; padding: 0.6rem 0; }
.ticker li::after { content: '///'; color: var(--neon-red); margin: 0 1.1rem; }
.ticker a { color: var(--neon-yellow); text-decoration: none; font: 600 0.86rem 'IBM Plex Mono', monospace; letter-spacing: 0.04em; text-transform: uppercase; }
.ticker a:hover, .ticker a:focus-visible { color: #fff; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* Hover tip for 3D objects */
.city-tip { position: fixed; left: 0; top: 0; z-index: 6; max-width: 320px; pointer-events: none; background: #020003; border: 1px solid var(--neon-yellow); border-left: 4px solid var(--neon-red); padding: 0.55rem 0.75rem; box-shadow: 0 0 26px rgba(255, 230, 0, 0.35); }
.city-tip strong { display: block; color: #fff; font: 600 0.92rem/1.25 'Chakra Petch', sans-serif; }
.city-tip span { display: block; margin-top: 0.25rem; color: var(--neon-yellow); font: 500 0.66rem 'IBM Plex Mono', monospace; letter-spacing: 0.06em; text-transform: uppercase; }
body.city-pointing { cursor: pointer; }

/* Footer */
.city-foot { position: relative; z-index: 2; background: linear-gradient(transparent, #020003 12%); padding: 14vh clamp(1rem, 4vw, 4rem) 3rem; display: grid; gap: 1.4rem; }
body.city .support-section, body.city .x-section { background: rgba(6, 4, 8, 0.9); border: 1px solid rgba(255, 31, 61, 0.6); box-shadow: 0 0 40px rgba(255, 31, 61, 0.12); padding: 1.3rem; color: #f5f1e6; }
body.city .city-foot h2 { font: 700 1.7rem 'Chakra Petch', sans-serif; text-transform: uppercase; color: var(--neon-yellow); }
body.city .city-foot h3 { color: #fff; }
body.city .support-card, body.city .support-brief { background: #0a080c; border: 1px solid rgba(255, 230, 0, 0.35); box-shadow: none; color: #f5f1e6; }
body.city .support-address { color: var(--neon-yellow); font-family: 'IBM Plex Mono', monospace; overflow-wrap: anywhere; }
body.city .copy-button, body.city .wallet-button { background: transparent; color: var(--neon-yellow); border: 1px solid var(--neon-yellow); box-shadow: none; }
body.city .copy-button:hover, body.city .wallet-button:hover { background: var(--neon-yellow); color: #020003; }
body.city .support-status, body.city .radar-meta, body.city .support-note, body.city .support-copy { color: rgba(245, 241, 230, 0.7); }
body.city .x-list a, .foot-note a { color: var(--neon-yellow); }
.foot-note { margin: 0; font: 500 0.74rem 'IBM Plex Mono', monospace; color: rgba(245, 241, 230, 0.6); }

/* Phones: the scene shows above, the panel sits below it. */
@media (max-width: 860px) {
  .scene { min-height: 0; padding: 52vh 0.8rem 16vh; display: block; }
  .scene-right { padding-right: 0.8rem; }
  #skyline { padding-top: 34vh; }
  .panel, .panel-hero { position: relative; top: auto; width: 100%; }
  .scene-rail { display: none; }
  .city-status { display: none; }
  .ticker { position: relative; bottom: auto; margin: 1.2rem -0.8rem 0; }
  body.city .pressure-strip { grid-template-columns: repeat(2, 1fr); }
  .city-bar { padding: 0.45rem 0.7rem; }
  body.city .site-nav a { padding: 0.25rem 0.4rem; font-size: 0.66rem; }
}

@media (prefers-reduced-motion: reduce) {
  .glitch { animation: none; }
  .ticker { overflow-x: auto; }
  .ticker-track { animation: none; }
  .ticker-track ul[aria-hidden='true'] { display: none; }
}

body.city .edition-line::before, body.city .edition-line::after, body.city .panel-hero::before, body.city .panel-hero::after { content: none; }
body.city main { width: 100%; margin: 0; display: block; }

/* Live tracking labels on the ring gate */
.city-tracks { position: absolute; inset: 0; pointer-events: none; transition: opacity 200ms; opacity: 0; }
.city-tracks span { position: absolute; left: 0; top: 0; padding: 1px 5px; background: rgba(2, 0, 3, 0.7); border: 1px solid #3dff7a; color: #d9ffe6; font: 500 10px 'IBM Plex Mono', monospace; white-space: nowrap; }

/* ---------- Spectrum pass: each scene takes a pair of tones from the gradient ---------- */
.scene { --a: var(--n-yellow); --b: var(--n-red); }
.scene[data-scene='1'] { --a: var(--n-magenta); --b: var(--n-cyan); }
.scene[data-scene='2'] { --a: var(--n-red); --b: var(--n-orange); }
.scene[data-scene='3'] { --a: var(--n-yellow); --b: var(--n-violet); }
.scene[data-scene='4'] { --a: var(--n-green); --b: var(--n-cyan); }
.scene[data-scene='5'] { --a: var(--n-magenta); --b: var(--n-blue); }
body.city .panel, body.city .panel-red {
  border: 1px solid color-mix(in srgb, var(--a) 55%, transparent); border-left: 5px solid var(--a);
  border-image: linear-gradient(180deg, var(--a), var(--b)) 1; clip-path: none;
  box-shadow: 0 0 54px color-mix(in srgb, var(--b) 22%, transparent);
}
body.city .panel h2, body.city .panel-red h2 {
  background: linear-gradient(100deg, var(--a), var(--b)); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; filter: drop-shadow(3px 3px 0 color-mix(in srgb, var(--b) 45%, transparent));
}
body.city .featured h2 { background: none; color: #fff; filter: none; }
body.city .panel .panel-kicker { font: 400 0.64rem 'Silkscreen', 'IBM Plex Mono', monospace; color: var(--b); }
body.city .story-rank { color: var(--a); text-shadow: 0 0 12px color-mix(in srgb, var(--a) 70%, transparent); }
body.city .story a:hover, body.city .story a:focus-visible { color: var(--a); text-shadow: 0 0 12px color-mix(in srgb, var(--a) 60%, transparent); }
body.city .panel-hero h1 span:last-child {
  background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none;
  filter: drop-shadow(4px 4px 0 rgba(255, 31, 61, 0.6));
}
body.city .manifesto { background: var(--duo); color: #020003; }
.pressure-cell { border-color: color-mix(in srgb, var(--n-cyan) 60%, transparent); }
.pressure-cell:nth-child(1) strong { color: var(--n-magenta); text-shadow: none; }
.pressure-cell:nth-child(2) strong { color: var(--n-red); text-shadow: none; }
.pressure-cell:nth-child(3) strong { color: var(--n-green); text-shadow: none; }
.pressure-cell:nth-child(4) strong { color: var(--n-cyan); text-shadow: none; }
.ticker { border-image: var(--spectrum) 1; box-shadow: 0 0 30px rgba(255, 43, 214, 0.35); }
.ticker li:nth-child(6n + 1) a { color: var(--n-magenta); }
.ticker li:nth-child(6n + 2) a { color: var(--n-cyan); }
.ticker li:nth-child(6n + 3) a { color: var(--n-yellow); }
.ticker li:nth-child(6n + 4) a { color: var(--n-green); }
.ticker li:nth-child(6n + 5) a { color: var(--n-orange); }
.ticker li:nth-child(6n + 6) a { color: var(--n-violet); }
.scene-rail a { border-color: var(--n-cyan); }
.scene-rail a[data-active] { background: var(--n-magenta); border-color: var(--n-magenta); box-shadow: 0 0 16px var(--n-magenta); }
body.city .city-bar .brand-lockup { margin: 0; }
body.city .panel-hero { position: sticky; }
body.city .panel-hero .brand-seal { right: 1rem; top: 1rem; bottom: auto; width: 6rem; height: 6rem; }
body.city .panel-hero .brand-kinetic { margin: 0 0 0.8rem; }
@media (max-width: 860px) { body.city .panel-hero { position: relative; } body.city .panel-hero .brand-seal { width: 4.2rem; height: 4.2rem; } }
