/* FILE: public_html/qradio.app/front.css
   ARCHITECTURE: STYLE Layer - QRadio's Front Door
   STORY: A first screen that is a whole poster: nav, a plain "It works.", and a
   framed box of mailbox cards resting just above the bottom edge (the box
   scrolls sideways, the page never does). Below it, two short bands and a
   footer. Phone first: 16px gutters, 44px+ touch targets, light and dark by the
   phone's own setting, motion off when the phone asks for less. Colours are
   tokens on :root; nothing is hard-coded below them.
   TREE KEEPER: tokens, base, nav, hero, frame and cards, bands, footer. */
:root {
  --bg: #f7f4ee; --fg: #151a26; --muted: #5a6275; --panel: #ffffff; --line: #d9d3c6;
  --signal: #b36b00; --signal-soft: #fff0d6; --live: #0e8f5b; --ink: #0b1020; --ink-fg: #f5f1e8;
  --glow: rgba(179, 107, 0, .14);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020; --fg: #eef0f6; --muted: #9aa3b8; --panel: #131a2e; --line: #2a3350;
    --signal: #ffb547; --signal-soft: #2a2111; --live: #3ddc97; --ink: #f5f1e8; --ink-fg: #0b1020;
    --glow: rgba(255, 181, 71, .16);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { overflow-x: hidden; }
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { margin: 0; line-height: 1.15; }

/* ---- the first screen ---- */
.screen {
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  padding: 0 16px calc(20px + env(safe-area-inset-bottom));
  background: radial-gradient(ellipse 80% 50% at 50% 38%, var(--glow), transparent 70%);
  max-width: 1080px; margin: 0 auto;
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 1.2rem; letter-spacing: .01em; color: var(--signal); }
.brand span { color: var(--fg); }
.nav nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; }
.nav nav a { text-decoration: none; color: var(--muted); padding: 10px 2px; min-height: 44px; display: inline-flex; align-items: center; }
.nav nav a:hover { color: var(--fg); }
.nav nav a.login { color: var(--ink-fg); background: var(--ink); padding: 10px 18px; border-radius: 999px; font-weight: 600; }
.nav nav a.login:hover { color: var(--ink-fg); opacity: .88; }

.hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px 0 20px; }
.eyebrow { margin: 0 0 10px; text-transform: uppercase; letter-spacing: .22em; font-size: .78rem; color: var(--signal); font-weight: 700; }
h1 { font: 700 clamp(3.4rem, 15vw, 8rem)/1 ui-serif, Georgia, "Times New Roman", serif; letter-spacing: -.02em; }
.lede { max-width: 34rem; margin: 18px 0 0; font-size: 1.12rem; color: var(--muted); }
.cta { margin: 24px 0 0; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; }
.button { display: inline-flex; align-items: center; min-height: 48px; padding: 12px 26px; border-radius: 999px; background: var(--signal); color: var(--ink-fg); font-weight: 700; text-decoration: none; }
@media (prefers-color-scheme: light) { .button { color: #fff; } }
.button:hover { filter: brightness(1.06); }
.ghost { display: inline-flex; align-items: center; min-height: 48px; padding: 12px 8px; color: var(--muted); text-decoration: none; }
.ghost:hover { color: var(--fg); }

/* ---- the framed box of mailbox cards ---- */
.frame {
  position: relative; margin: 8px 0 0; padding: 26px 14px 14px;
  border: 1px solid var(--signal); border-radius: 18px; background: var(--panel);
  box-shadow: inset 0 0 0 5px var(--panel), inset 0 0 0 6px var(--line), 0 18px 40px -22px rgba(0, 0, 0, .55);
}
.frame::before, .frame::after { content: ""; position: absolute; width: 22px; height: 22px; border: 2px solid var(--signal); pointer-events: none; }
.frame::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 18px; }
.frame::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 18px; }
.legend { position: absolute; top: -14px; left: 22px; max-width: calc(100% - 44px); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; background: var(--panel); padding: 0 10px; font-size: .95rem; font-weight: 700; letter-spacing: .04em; color: var(--signal); }
.hint { margin: 0; padding: 0 6px; color: var(--muted); font-size: .85rem; }
@media (max-width: 559px) { .nav nav a.hide-sm { display: none; } }
.cards {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 8px;
  padding: 10px 6px 12px; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: var(--signal) transparent;
}
.mailbox {
  position: relative; flex: 0 0 min(76%, 250px); scroll-snap-align: start; text-decoration: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 14px 16px;
  display: flex; flex-direction: column; gap: 8px; min-height: 168px;
  transition: transform .18s ease, border-color .18s ease;
}
.mailbox:hover { transform: translateY(-3px); border-color: var(--signal); }
.mailbox h3 { font-size: 1.05rem; padding-right: 26px; }
.mailbox p { margin: 0; color: var(--muted); font-size: .93rem; flex: 1; }
.flag { position: absolute; top: 14px; right: 14px; width: 12px; height: 22px; border-left: 2px solid var(--muted); }
.flag::after { content: ""; position: absolute; top: 0; left: 0; width: 12px; height: 9px; background: var(--muted); border-radius: 1px 3px 3px 1px; }
.mailbox.live { border-color: var(--live); background: var(--signal-soft); }
.mailbox.live .flag { border-left-color: var(--live); }
.mailbox.live .flag::after { background: var(--live); }
.state { align-self: flex-start; font-size: .8rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; display: inline-flex; align-items: center; gap: 7px; }
.mailbox.live .state { color: var(--live); border-color: var(--live); }
.state i { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: beep 1.8s ease-in-out infinite; }
@keyframes beep { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }

/* ---- the bands below ---- */
.band { padding: 56px 16px; max-width: 1080px; margin: 0 auto; }
.band.alt { max-width: none; background: var(--panel); border-block: 1px solid var(--line); padding-inline: max(16px, calc((100% - 1032px) / 2)); }
.band h2 { font: 700 clamp(1.7rem, 6vw, 2.4rem)/1.15 ui-serif, Georgia, serif; margin-bottom: 18px; }
.lead { color: var(--muted); max-width: 44rem; margin: 0 0 18px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 44rem; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.steps li::before { content: counter(s); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--signal); color: var(--signal); font-weight: 700; }
.plugs { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 12px; max-width: 44rem; }
.plugs li { padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }

/* ---- footer ---- */
.foot { padding: 28px 16px calc(36px + env(safe-area-inset-bottom)); max-width: 1080px; margin: 0 auto; display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; color: var(--muted); }
.foot p { margin: 0; }
.foot .by a { color: var(--signal); font-weight: 700; text-decoration: none; }
.foot nav { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.foot nav a { text-decoration: none; padding: 10px 0; min-height: 44px; display: inline-flex; align-items: center; }

@media (min-width: 720px) {
  .mailbox { flex-basis: 240px; }
  .screen { padding-inline: 24px; }
  .band:not(.alt), .foot { padding-inline: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .state i { animation: none; }
  .mailbox { transition: none; }
}
.mailbox.waiting { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal); }
.mailbox.waiting .flag { border-left-color: var(--signal); }
.mailbox.waiting .flag::after { background: var(--signal); }
.mailbox.waiting .state { color: var(--signal); border-color: var(--signal); }

/* the language toggle (SO-61): the shared script fills it; a lone button is hidden until a second language is on */
.langs { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.langs button { min-height: 44px; min-width: 44px; padding: 6px 10px; font-size: .85rem; }
.langs button:only-child { display: none; }
.langs button[aria-pressed="true"] { border-color: var(--accent, var(--signal)); font-weight: 700; }
.nav nav .langs button { background: transparent; border: 1px solid var(--line); color: var(--fg); border-radius: 999px; cursor: pointer; font: inherit; font-size: .85rem; }
