/* The Signal: the home and trailer pages (rasena.co.uk/the-signal/).
   Colours, type and effects are the field unit's (lib/theme/tokens.dart, docs/DESIGN.md);
   the phone notifications use the phone's own (lib/theme/phone_tokens.dart). */

@font-face {
  font-family: "DepartureMono";
  src: url("../media/DepartureMono-Regular.woff2") format("woff2");
  font-display: swap;
}

:root {
  --surface-inner: #b8c2a4;
  --surface-edge: #a8b294;
  --surface-periphery: #909a82;
  --bezel: #2a2e26;
  --ink-strong: #050805;
  --ink-body: #0e140a;
  --ink-soft: #3a4232;
  --accent-ink: #5a2a08;
  --accent-lit: #b86838;
  --notification-fill: rgba(232, 226, 200, 0.94);
  --cream: #e8e2c8;
  --warm-halo: 0 0 17px rgba(90, 42, 8, 0.18);
  --bleed-body: 0 0.3px 0.6px #0e140a, 0 0.6px 1.6px #0e140a;
  --bleed-title: 0 0.5px 1px rgba(5, 8, 5, 0.8), 0 1px 3px rgba(5, 8, 5, 0.4);
  --cream-glow: 0 0 6px #e8e2c8, 0 0 12px #e8e2c8;
  --phone-surface: #14161c;
  --phone-ink: #e8eaf0;
  --phone-ink-soft: #8a8f9c;
  --font-display: "DepartureMono", ui-monospace, Menlo, Consolas, monospace;
  --font-phone: system-ui, -apple-system, "SF Pro Text", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bezel); }
body { margin: 0; font-family: var(--font-display); color: var(--ink-body); background: var(--bezel); }
/* Cards slide in from 48px to the side; clip (not hidden, which would unpin the map) stops them
   widening the page into a sideways scroll on phones before they arrive. */
main { overflow-x: clip; }
a { color: var(--accent-ink); }
a:hover { color: var(--ink-strong); }
img { display: block; }
.wrap { max-width: 1360px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.prompt { color: var(--accent-ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The LCD: a radial sage surface, scanlines, a vignette, chromatic edges and the 7s scan bar. */
.lcd { background: radial-gradient(ellipse 90% 80% at 50% 45%, var(--surface-inner) 0%, var(--surface-edge) 65%, var(--surface-periphery) 100%); }
.fx { position: absolute; inset: 0; pointer-events: none; }
.fx-scan { background: repeating-linear-gradient(to bottom, rgba(42, 46, 38, 0.22) 0 1px, transparent 1px 3px); }
.fx-vignette {
  background:
    radial-gradient(ellipse 75% 70% at 50% 50%, transparent 60%, rgba(42, 46, 38, 0.42) 100%),
    linear-gradient(to right, rgba(138, 16, 16, 0.05), transparent 5%, transparent 95%, rgba(42, 74, 120, 0.05));
}
.fx-bar { top: -20%; bottom: auto; height: 20%; background: linear-gradient(to bottom, transparent, rgba(42, 46, 38, 0.06), transparent); animation: sweep 7s linear infinite; }
@keyframes sweep { from { top: -20%; } to { top: 100%; } }
.art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* The HUD: a paper panel pinned to the top. */
.hud { position: sticky; top: 0; z-index: 20; padding-top: 12px; padding-bottom: 12px; }
.hudbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: var(--notification-fill); border: 1px solid rgba(14, 20, 10, 0.55); box-shadow: var(--warm-halo); padding: 6px 8px 6px 18px; }
.ro { font-size: 14px; letter-spacing: 1.5px; text-transform: uppercase; white-space: nowrap; }
.home { color: var(--ink-strong); text-decoration: none; }
.ghost { font-family: var(--font-display); font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; background: none; border: 0; color: var(--accent-ink); cursor: pointer; padding: 12px 6px; min-height: 44px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 18px; font-family: var(--font-display); font-size: 14px; letter-spacing: 1.5px; text-transform: uppercase; text-decoration: none; background: var(--accent-ink); border: 2px solid var(--accent-ink); color: var(--cream); box-shadow: var(--warm-halo); cursor: pointer; }
.btn:hover { color: #fff; }
.sound[aria-pressed="true"] { background: var(--accent-ink); color: var(--cream); padding-left: 10px; padding-right: 10px; }
.btn:focus-visible, .badge:focus-visible, summary:focus-visible, .ph:focus-visible, .ghost:focus-visible, .linkbtn:focus-visible { outline: 2px solid var(--ink-strong); outline-offset: 3px; }

/* Paper slips, the way cards float on the game's map. */
.slip { position: relative; background: var(--notification-fill); border: 1px solid rgba(14, 20, 10, 0.55); box-shadow: var(--warm-halo); padding: 26px 30px; }
.slip.hot { border: 2px solid var(--accent-ink); }
.eyebrow { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 12px; }
.h2 { margin: 0 0 14px; font-weight: 400; font-size: clamp(24px, 2.6vw, 32px); letter-spacing: 2px; text-transform: uppercase; color: var(--ink-strong); text-shadow: var(--bleed-title); }
.h3 { margin: 0 0 6px; font-weight: 400; font-size: 19px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-strong); text-shadow: var(--bleed-body); }
.body { margin: 0; font-size: 16px; line-height: 1.55; }
.num { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent-ink); }
.small { font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-soft); margin: 0; }

/* Store badges, as supplied. Google's PNG carries its own margin, so it is drawn larger and trimmed. */
.badges { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; height: 58px; overflow: hidden; border-radius: 9px; }
.badge img { height: 58px; width: auto; }
.badge.gp img { height: 86px; margin: 0 -12px; }

/* The opening screen: the valley, the title, the badges and the trailer. */
.hero { position: relative; min-height: 880px; margin-top: -82px; padding-top: 82px; overflow: hidden; } /* runs under the 82px HUD */
.herogrid { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: 40px; align-items: start; padding-top: 56px; }
.boot { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-soft); text-shadow: 0 0 6px #e8e2c8; margin: 0; }
.title { margin: 14px 0 8px; font-weight: 400; font-size: clamp(52px, 7.6vw, 120px); line-height: 0.92; letter-spacing: 7px; color: var(--ink-strong); text-shadow: 0 0.5px 1px rgba(5, 8, 5, 0.7), 0 1px 4px rgba(5, 8, 5, 0.35), 0 0 18px rgba(232, 226, 200, 0.55); white-space: nowrap; }
.tagline { margin: 0 0 28px; font-size: clamp(18px, 2vw, 24px); letter-spacing: 1.5px; color: var(--accent-ink); text-shadow: var(--cream-glow); }
.getslip { display: inline-flex; flex-direction: column; gap: 14px; }
.trailer { justify-self: end; display: flex; flex-direction: column; gap: 10px; width: min(300px, 100%); }
.tlabel { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-soft); text-shadow: 0 0 6px #e8e2c8; }
.vframe { position: relative; width: 100%; aspect-ratio: 9 / 16; border: 2px solid var(--accent-ink); box-shadow: var(--warm-halo), 0 0 0 6px rgba(232, 226, 200, 0.35); background: #05060a; }
.vframe video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.linkbtn { align-self: center; display: inline-flex; align-items: center; min-height: 44px; padding: 10px 12px; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; text-decoration: none; color: var(--accent-ink); background: var(--notification-fill); }
.cue { position: absolute; left: 0; right: 0; bottom: 26px; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-strong); font-size: 12px; letter-spacing: 2px; text-shadow: 0 0 6px #e8e2c8; }
.cue i { display: block; width: 2px; height: 36px; background: linear-gradient(var(--accent-ink), transparent); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0%, 100% { transform: translateY(-6px); opacity: 0.4; } 50% { transform: translateY(6px); opacity: 1; } }

/* The walk: the map pinned behind the page while the sections scroll past it. */
.walk { position: relative; }
.stage { position: sticky; top: 0; height: min(100vh, 1100px); margin-bottom: calc(-1 * min(100vh, 1100px)); overflow: hidden; z-index: 0; }
.content { position: relative; z-index: 1; padding-top: 120px; }
.row { display: flex; padding-top: 80px; padding-bottom: 80px; }
.row.r { justify-content: flex-end; }
.col { width: min(480px, 100%); }
.list { display: flex; flex-direction: column; gap: 18px; margin-top: 6px; }
.list .it { padding-top: 16px; border-top: 1px solid rgba(14, 20, 10, 0.3); }

/* A phone notification arriving mid-walk: in the phone's own language, never the field unit's. */
.ph { display: block; width: min(420px, 100%); background: var(--phone-surface); color: var(--phone-ink); font-family: var(--font-phone); border-radius: 18px; padding: 14px 18px; box-shadow: 0 18px 50px rgba(5, 6, 10, 0.45); }
.ph .rw { display: flex; justify-content: space-between; font-size: 14px; }
.ph b { font-weight: 600; }
.ph .now { color: var(--phone-ink-soft); }
.ph .rw, .ph .line { display: block; }
.ph .rw { display: flex; }
.ph .line { margin: 6px 0; font-size: 18px; line-height: 1.35; }
.ph .line.more { font-size: 16px; color: #c9ccd4; }
/* The card's own button, like the call screen's discs: green to answer a call, blue to play a
   message. White labels, since the shipped phone-ink reaches only 4.2:1 on the green. */
.phbtn { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; min-height: 44px; padding: 0 20px 0 16px; border: 0; border-radius: 22px; font-family: var(--font-phone); font-size: 15px; font-weight: 600; color: #fff; cursor: pointer; }
.phbtn svg { width: 18px; height: 18px; flex: none; }
.phbtn.answer { background: #2e7d5b; }
.phbtn.play { background: #3a6ea5; }
.phbtn[aria-busy="true"] { opacity: 0.8; }
.phbtn:focus-visible { outline: 2px solid var(--phone-ink); outline-offset: 3px; }

.mode { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 16px; align-items: center; padding-top: 14px; border-top: 1px solid rgba(14, 20, 10, 0.3); }
.mode .mm { position: relative; height: 96px; overflow: hidden; border: 1px solid rgba(14, 20, 10, 0.55); background: #b0b498; }
.mode .chip { position: absolute; left: 4px; top: 4px; background: var(--notification-fill); border: 1px solid rgba(14, 20, 10, 0.55); padding: 2px 5px; font-size: 10px; letter-spacing: 1px; }

.readouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid rgba(14, 20, 10, 0.35); border-left: 1px solid rgba(14, 20, 10, 0.35); margin: 16px 0; }
.cellr { padding: 12px 14px; border-right: 1px solid rgba(14, 20, 10, 0.35); border-bottom: 1px solid rgba(14, 20, 10, 0.35); }
.cellr .l { font-size: 11px; letter-spacing: 1.5px; color: var(--ink-soft); }
.cellr .v { margin-top: 6px; font-size: 22px; letter-spacing: 2px; color: var(--ink-strong); text-shadow: var(--bleed-body); }

details { border-top: 1px solid rgba(14, 20, 10, 0.3); }
details:last-child { border-bottom: 1px solid rgba(14, 20, 10, 0.3); }
summary { list-style: none; cursor: pointer; padding: 15px 0; font-size: 15px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-strong); min-height: 44px; }
summary::-webkit-details-marker { display: none; }
details p { margin: 0 0 16px 20px; font-size: 15px; line-height: 1.55; }

.end { display: flex; justify-content: center; padding-top: 180px; padding-bottom: 380px; }
.endslip { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 34px 44px; text-align: center; }
.call { margin: 0; font-weight: 400; font-size: clamp(34px, 4.4vw, 56px); letter-spacing: 2px; text-transform: uppercase; color: var(--ink-strong); text-shadow: var(--bleed-title); }

.foot { position: relative; z-index: 1; background: var(--bezel); color: var(--cream); padding: 36px 0 56px; font-size: 14px; letter-spacing: 1px; }
.foot a { color: var(--cream); }
.footin { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.foot nav { display: flex; gap: 20px; flex-wrap: wrap; }

/* Sections slide in from their side as the walk reaches them (only when the script is running). */
.js .rv { opacity: 0; transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .rv.l { transform: translateX(-48px); }
.js .rv.r { transform: translateX(48px); }
.js .rv.u { transform: translateY(32px); }
.js .rv.in { opacity: 1; transform: none; }

/* The trailer page. */
.tpage { position: relative; min-height: 100vh; overflow: hidden; }
.tcol { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 40px; padding-bottom: 64px; text-align: center; }
.tcol .title { font-size: clamp(44px, 6vw, 84px); margin: 6px 0 0; }
.tcol .tagline { margin: 0; }
.tcol .trailer { justify-self: auto; width: min(340px, 100%); }
.tlinks { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* The support and privacy pages (generated by tool/build_policy_site.dart): the same shell,
   the reading text on paper cards in the system face. */
.hudnav { display: flex; gap: 16px; margin-left: auto; }
.hudnav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--ink-body); text-decoration: none; }
.hudnav a:hover { color: var(--accent-ink); }
.hudnav a[aria-current="page"] { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 6px; }
.hudnav a:focus-visible { outline: 2px solid var(--ink-strong); outline-offset: 3px; }
.docmain {
  position: relative; margin-top: -82px; padding-top: 112px; padding-bottom: 96px;
  background:
    repeating-linear-gradient(to bottom, rgba(42, 46, 38, 0.16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse 110% 70% at 50% 0%, var(--surface-inner) 0%, var(--surface-edge) 55%, var(--surface-periphery) 100%);
}
.dochead { max-width: 860px; padding-bottom: 36px; }
.doctitle { margin: 12px 0 10px; font-weight: 400; font-size: clamp(44px, 6.4vw, 92px); line-height: 0.95; letter-spacing: 5px; color: var(--ink-strong); text-shadow: 0 0.5px 1px rgba(5, 8, 5, 0.7), 0 1px 4px rgba(5, 8, 5, 0.35), 0 0 18px rgba(232, 226, 200, 0.55); }
.docmeta { margin: 0 0 14px; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent-ink); }
.docsum { max-width: 680px; margin: 0; font-family: var(--font-phone); font-size: 20px; line-height: 1.5; color: var(--ink-body); }
.docgrid { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px; align-items: start; }
.docgrid.support { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); }
.docgrid.support .side { order: 2; }
.toc, .side { position: sticky; top: 100px; }
.toc { padding: 22px 24px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 7px 0; font-size: 13px; letter-spacing: 1px; line-height: 1.35; text-transform: uppercase; text-decoration: none; color: var(--ink-body); }
.toc a:hover { color: var(--accent-ink); }
.side { display: flex; flex-direction: column; gap: 20px; }
.side p { margin: 10px 0 16px; font-family: var(--font-phone); font-size: 16px; line-height: 1.55; color: #1e2616; }
.side .linkbtn { border: 1px solid var(--ink-body); }
.side .slip > :last-child { margin-bottom: 0; }
h2.eyebrow { font-weight: 400; }
.mail { display: inline-block; margin-top: 2px; font-size: 20px; letter-spacing: 1px; color: var(--accent-ink); overflow-wrap: anywhere; text-underline-offset: 4px; }
.doctext { padding: 34px 40px; font-family: var(--font-phone); font-size: 17px; line-height: 1.65; color: #1e2616; }
.doctext p { margin: 0 0 14px; }
.doctext ul { margin: 0 0 14px; padding-left: 1.2em; }
.doctext li { margin-bottom: 6px; }
.doctext a { color: var(--accent-ink); }
.doch2 { margin: 0 0 14px; font-family: var(--font-display); font-weight: 400; font-size: 20px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-strong); text-shadow: var(--bleed-body); }
.doch3 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 400; font-size: 16px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-strong); }
.docsec { scroll-margin-top: 100px; padding-top: 26px; margin-top: 26px; border-top: 1px solid rgba(14, 20, 10, 0.25); }
.docsec:first-child { padding-top: 0; margin-top: 0; border-top: 0; }
.docsec > :last-child, .faq p { margin-bottom: 0; }
.faq { scroll-margin-top: 100px; padding: 18px 0; border-top: 1px solid rgba(14, 20, 10, 0.25); }
.faq:last-child { padding-bottom: 0; }

@media (max-width: 900px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .herogrid { grid-template-columns: minmax(0, 1fr); }
  .trailer { justify-self: center; }
  .title, .tcol .title { font-size: clamp(32px, 10vw, 72px); letter-spacing: 4px; }
  .hero { min-height: 0; padding-bottom: 64px; }
  .cue { display: none; }
  .row, .row.r { justify-content: stretch; padding-top: 36px; padding-bottom: 36px; }
  .content { padding-top: 64px; }
  .end { padding-top: 80px; padding-bottom: 300px; }
  .hudmid, .sound .st { display: none; }
  .hudbar { flex-wrap: nowrap; gap: 8px; padding-left: 12px; }
  .hudbar .ro, .hudbar .ghost { font-size: 12px; letter-spacing: 1px; }
  .hudbar .btn { font-size: 12px; letter-spacing: 1px; padding: 6px 10px; }
  .hudbar .ro, .hudbar .ghost, .hudbar .btn { white-space: nowrap; }
  .slip { padding: 22px 20px; }
  .endslip { padding: 28px 20px; }
  .docmain { padding-top: 96px; padding-bottom: 64px; }
  .doctitle { font-size: clamp(36px, 11vw, 72px); letter-spacing: 3px; }
  .docsum { font-size: 18px; }
  .docgrid, .docgrid.support { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .docgrid.support .side { order: 0; }
  .toc, .side { position: static; }
  .toc ol { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 14px; }
  .toc a { font-size: 12px; }
  .doctext { padding: 24px 20px; font-size: 16px; }
  .hudnav { gap: 8px; }
  .hudnav + .btn { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .js .rv { opacity: 1; transform: none; transition: none; }
  .fx-bar, .cue i { animation: none; }
}
