/* Mayor Hotline — same tokens as the app (apps/mobile/src/theme/tokens.ts).
   Dark only by design, like the game. Hard corners, 2px cream borders,
   blur-free offset shadows, VT323 for display type, IBM Plex Sans for body. */
:root {
  --bg: #120e1a;
  --bg-deep: #08060c;
  --surface: #1e1828;
  --surface-raised: #271f35;
  --ink: #f4eedd;
  --ink-muted: #9c93ae;
  --on-solid: #12101a;
  --line: #f4eedd;
  --line-soft: #352c46;
  --shadow: #08060c;
  --accent: #ffc542;
  --good: #4ade80;
  --good-bg: #15301f;
  --bad: #ff6b61;
  --bad-bg: #3a1512;
  --info: #8da0f5;
  --purple: #a98cf0;

  --display: "VT323", ui-monospace, monospace;
  --body: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --radius: 2px;
  --border: 2px solid var(--line);
  --shadow-4: 4px 4px 0 0 var(--shadow);
  --shadow-6: 6px 6px 0 0 var(--shadow);
  --max: 1080px;
  --gutter: 16px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
}

.display {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 1;
  margin: 0;
}

.muted {
  color: var(--ink-muted);
}

.small {
  font-size: 14px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* —— Pixel primitives (PixelCard / PixelButton / badges) —— */

.card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-4);
}

.badge {
  display: inline-block;
  font-family: var(--display);
  font-size: 18px;
  line-height: 1;
  padding: 5px 8px 4px;
  border: var(--border);
  border-radius: var(--radius);
  color: var(--on-solid);
  white-space: nowrap;
}

.badge-accent {
  background: var(--accent);
}

.badge-bad {
  background: var(--bad);
}

.badge-good {
  background: var(--good);
}

.badge-info {
  background: var(--info);
}

.badge-purple {
  background: var(--purple);
}

.badge-outline {
  background: transparent;
  color: var(--accent);
}

/* The shadow stays put and the face presses into it, like PixelButton. */
.btn {
  display: inline-block;
  padding: 0;
  border: 0;
  background: var(--shadow);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  font: inherit;
}

.btn > span {
  display: block;
  padding: 14px 24px 12px;
  border: var(--border);
  border-radius: var(--radius);
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.5px;
  line-height: 1;
  transform: translate(-4px, -4px);
  transition: transform 120ms ease-out;
}

.btn:active > span {
  transform: translate(0, 0);
  transition-duration: 90ms;
}

.btn-accent > span {
  background: var(--accent);
  color: var(--on-solid);
}

.btn-outline > span {
  background: var(--surface);
  color: var(--ink);
}

.blink {
  animation: blink 0.5s steps(1, end) infinite alternate;
}

@keyframes blink {
  to {
    opacity: 0.15;
  }
}

/* —— Header —— */

.site-header {
  background: var(--bg-deep);
  border-bottom: 2px solid var(--line-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: 26px;
  line-height: 1;
}

.logo img {
  width: 32px;
  height: 32px;
  border: var(--border);
  border-radius: var(--radius);
}

.site-nav {
  display: flex;
  gap: 20px;
  font-size: 14px;
  font-weight: 500;
}

.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
}

/* —— Hero —— */

.hero {
  padding: 56px 0 72px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 48px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-family: var(--display);
  font-size: 20px;
  color: var(--accent);
}

.eyebrow .dot {
  width: 10px;
  height: 10px;
  background: var(--bad);
  border: 2px solid var(--line);
}

.hero h1 {
  font-size: clamp(64px, 11vw, 112px);
  line-height: 0.85;
}

.tagline {
  margin: 20px 0 8px;
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 500;
}

.pitch {
  margin: 0 0 28px;
  max-width: 34em;
  color: var(--ink-muted);
  font-size: 17px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 12px;
  background: var(--bg-deep);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-4);
}

.store-badge .phone {
  width: 18px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  position: relative;
  flex: none;
}

.store-badge .phone::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 2px;
  margin-left: -2px;
  background: var(--ink);
}

.store-badge small {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: 0.3px;
}

.store-badge strong {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
}

.hero-art {
  background: var(--accent);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-6);
  padding: 16px;
}

/* —— Sections —— */

.section {
  padding: 72px 0;
}

.section-alt {
  background: var(--bg-deep);
  border-top: 2px solid var(--line-soft);
  border-bottom: 2px solid var(--line-soft);
}

.section-head {
  max-width: 40em;
  margin-bottom: 36px;
}

.section-head .badge {
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: clamp(40px, 6vw, 56px);
}

.section-head p {
  margin: 12px 0 0;
  color: var(--ink-muted);
}

/* Sample round — a static rendition of the in-game HUD + crisis card. */
.demo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-deep);
  border: var(--border);
  border-bottom: 0;
}

.hud-left {
  display: flex;
  gap: 6px;
}

.hud-timer {
  font-family: var(--display);
  font-size: 40px;
  line-height: 1;
  color: var(--bad);
}

.hud-score {
  text-align: right;
  font-size: 11px;
  color: var(--ink-muted);
}

.hud-score b {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
  color: var(--accent);
}

.crisis {
  padding: 16px;
}

.crisis h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1;
  margin: 12px 0 8px;
}

.crisis p {
  margin: 0 0 14px;
  color: var(--ink-muted);
  font-size: 14px;
}

.must-fix {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  font-weight: 700;
}

.stat-row b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
}

.bar {
  position: relative;
  height: 14px;
  margin: 4px 0 2px;
  border: var(--border);
  background: var(--line-soft);
}

.bar i {
  display: block;
  height: 100%;
  background: var(--bad);
}

.bar .target {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 3px;
  background: var(--ink);
}

.stat-hint {
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.plan {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--bg-deep);
  border: var(--border);
  font-size: 15px;
}

.plan span {
  display: block;
  font-family: var(--display);
  font-size: 16px;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.verdict {
  padding: 16px;
}

.verdict-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.verdict-head img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  object-position: top;
  background: var(--good);
  border: var(--border);
}

.verdict q {
  display: block;
  font-size: 17px;
  font-weight: 500;
  quotes: "“" "”";
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chip {
  font-family: var(--display);
  font-size: 18px;
  line-height: 1;
  padding: 4px 8px 3px;
  border: 1.5px solid currentColor;
}

.chip-good {
  color: var(--good);
  background: var(--good-bg);
}

.chip-bad {
  color: var(--bad);
  background: var(--bad-bg);
}

/* How it works — the four onboarding steps. */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.step {
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.step-art {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 14px;
  border: var(--border);
}

.step-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.step .num {
  font-family: var(--display);
  font-size: 18px;
  color: var(--accent);
}

.step h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1;
  margin: 4px 0 8px;
  text-transform: uppercase;
}

.step p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
}

.bg-bad {
  background: var(--bad);
}

.bg-info {
  background: var(--info);
}

.bg-purple {
  background: var(--purple);
}

.bg-accent {
  background: var(--accent);
}

.bg-good {
  background: var(--good);
}

/* Advisor reactions. */
.advisors {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.advisor {
  overflow: hidden;
}

.advisor-art {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-bottom: var(--border);
}

.advisor-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.advisor-body {
  padding: 14px;
}

.advisor-body q {
  display: block;
  margin-top: 10px;
  font-size: 15px;
  quotes: "“" "”";
}

/* Stats band. */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.stat {
  padding: 20px;
}

.stat .big {
  font-family: var(--display);
  font-size: 72px;
  line-height: 0.9;
  color: var(--accent);
}

.stat h3 {
  margin: 8px 0 4px;
  font-size: 17px;
}

.stat p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
}

.stat .badge {
  vertical-align: middle;
  margin-left: 8px;
}

/* Closing call. */
.closer {
  padding: 88px 0;
  text-align: center;
}

.closer h2 {
  font-size: clamp(44px, 7vw, 72px);
  margin-bottom: 16px;
}

.closer p {
  margin: 0 auto 28px;
  max-width: 30em;
  color: var(--ink-muted);
}

/* —— Footer —— */

.site-footer {
  background: var(--bg-deep);
  border-top: 2px solid var(--line-soft);
  padding: 28px 0;
  font-size: 14px;
  color: var(--ink-muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-footer nav {
  display: flex;
  gap: 20px;
}

.site-footer a {
  color: var(--ink-muted);
}

.site-footer a:hover {
  color: var(--ink);
}

/* —— Text pages (privacy, support, 404) —— */

.page {
  padding: 48px 0 80px;
}

.page .wrap {
  max-width: 760px;
}

.page h1 {
  font-size: clamp(48px, 8vw, 64px);
  margin-bottom: 8px;
}

.page h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 32px;
  line-height: 1;
  margin: 40px 0 12px;
}

.page h3 {
  font-size: 17px;
  margin: 24px 0 6px;
}

.page p,
.page li {
  color: #d9d2c2;
}

.page ul {
  padding-left: 22px;
}

.page li + li {
  margin-top: 6px;
}

.page .card {
  padding: 20px;
  margin: 24px 0;
}

.page .card p {
  margin: 0;
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border: 2px solid var(--line-soft);
}

th {
  font-family: var(--display);
  font-weight: 400;
  font-size: 18px;
  background: var(--surface);
}

details {
  margin: 12px 0;
  padding: 14px 16px;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

details p {
  margin: 10px 0 0;
}

.center {
  text-align: center;
}

/* —— Lab sign-in (served by src/worker.ts) —— */

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg-deep);
}

.login-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 380px;
  padding: 24px var(--gutter);
}

.login-card {
  width: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.login-card h1 {
  font-size: 48px;
}

.login-card p {
  margin: 0;
}

.login-card .btn {
  align-self: stretch;
  margin-top: 8px;
}

.login-card .btn > span {
  text-align: center;
}

.login-error {
  align-self: stretch;
  padding: 8px 12px;
  background: var(--bad-bg);
  border: 1.5px solid var(--bad);
  color: var(--bad);
  font-size: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
}

.field input {
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg-deep);
  border: var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

/* —— Responsive —— */

@media (max-width: 900px) {
  .hero .wrap,
  .demo {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 36px;
  }

  .hero-art {
    max-width: 440px;
  }

  .steps,
  .advisors {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .site-nav .hide-sm {
    display: none;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 56px 0;
  }
}

/* Phones: each step becomes a compact row (art beside text) and the
   advisors stay two-up, so the page doesn't turn into a wall of art. */
@media (max-width: 600px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .step {
    display: grid;
    grid-template-columns: 96px 1fr;
    column-gap: 14px;
    align-items: start;
  }

  .step-art {
    grid-row: span 3;
    margin-bottom: 0;
  }

  .step h3 {
    font-size: 24px;
  }

  .advisors {
    gap: 12px;
  }

  .advisor-body {
    padding: 10px;
  }

  .advisor-body q {
    font-size: 13px;
  }
}

@media (max-width: 420px) {

  .logo span {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .blink {
    animation: none;
  }

  .btn > span {
    transition: none;
  }
}
