/* ==========================================================================
   TRACKING — design system
   Concept: a navigation instrument, not a web page.
   True-black base (saves battery on OLED phones), phosphor-green signal lock,
   signage-wide headings readable at arm's length in sunlight.
   Amber + red are reserved ONLY for the two alert buttons.
   ========================================================================== */

/* ---- 1. TOKENS --------------------------------------------------------- */

:root {
  /* dark is the default: field use, night, battery */
  --bg:          #000000;
  --bg-soft:     #070908;
  --surface:     #0C0F0D;
  --surface-2:   #141815;
  --surface-3:   #1C211E;
  --line:        #232A26;
  --line-bright: #35403A;

  --ink:         #F0F4F1;
  --ink-2:       #A7B0AA;
  --ink-3:       #6C766F;

  --signal:      #35F58C;
  --signal-2:    #0BC96A;
  --signal-glow: rgba(53, 245, 140, .18);

  --amber:       #FFB020;
  --amber-glow:  rgba(255, 176, 32, .18);
  --red:         #FF3B30;
  --red-glow:    rgba(255, 59, 48, .20);

  --on-accent:   #04140B;

  --grid:        rgba(255, 255, 255, .035);
  --shadow:      0 24px 60px -20px rgba(0, 0, 0, .9);

  --r-sm: 4px;
  --r:    10px;
  --r-lg: 18px;

  --f-display: 'Archivo', 'Archivo Expanded', system-ui, sans-serif;
  --f-body:    'Archivo', system-ui, sans-serif;
  --f-mono:    'IBM Plex Mono', ui-monospace, 'Courier New', monospace;

  --header-h: 58px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

[data-theme="light"] {
  --bg:          #EBE8E0;
  --bg-soft:     #F2F0EA;
  --surface:     #FBFAF7;
  --surface-2:   #F3F1EA;
  --surface-3:   #E8E5DC;
  --line:        #D6D2C6;
  --line-bright: #B9B4A4;

  --ink:         #14170F;
  --ink-2:       #4E5449;
  --ink-3:       #7C8377;

  --signal:      #00803F;
  --signal-2:    #006B34;
  --signal-glow: rgba(0, 128, 63, .14);

  --amber:       #A96A00;
  --amber-glow:  rgba(169, 106, 0, .14);
  --red:         #C22119;
  --red-glow:    rgba(194, 33, 25, .14);

  --on-accent:   #FFFFFF;

  --grid:        rgba(0, 0, 0, .045);
  --shadow:      0 20px 50px -24px rgba(30, 34, 24, .35);
}

/* ---- 2. RESET ---------------------------------------------------------- */

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

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* the faint instrument grid that sits behind everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 120% 80% at 50% 0%, #000 20%, transparent 78%);
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ---- 3. TYPE ----------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 700;
  font-stretch: 118%;
  letter-spacing: -.015em;
  line-height: 1.04;
  margin: 0;
  text-transform: uppercase;
}

h1 { font-size: clamp(2.1rem, 7vw, 3.6rem); }
h2 { font-size: clamp(1.4rem, 4vw, 2rem); }
h3 { font-size: 1.05rem; letter-spacing: .01em; }

p { margin: 0 0 1rem; color: var(--ink-2); }

.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

.eyebrow {
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 .6rem;
}

.lede { font-size: 1.03rem; max-width: 46ch; }

/* ---- 4. LAYOUT --------------------------------------------------------- */

.wrap {
  width: min(1120px, 100% - 2rem);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}
.wrap--narrow { width: min(560px, 100% - 2rem); }

main { padding-bottom: 5rem; }

.view { display: none; animation: viewIn .4s var(--ease) both; }
.view.is-active { display: block; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.stack   { display: grid; gap: 1rem; }
.stack-2 { display: grid; gap: 1.6rem; }
.row     { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spacer  { flex: 1; }

/* ---- 5. HEADER --------------------------------------------------------- */

.hdr {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-inline: max(1rem, calc(50vw - 560px));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  font-family: var(--f-display);
  font-weight: 700;
  font-stretch: 120%;
  text-transform: uppercase;
  letter-spacing: .01em;
  font-size: 1.02rem;
}

/* the signal mark: three arcs radiating from a dot */
.mark { width: 22px; height: 22px; flex: none; color: var(--signal); }
.mark .a { opacity: .35; animation: markPulse 2.6s var(--ease) infinite; }
.mark .b { opacity: .6;  animation: markPulse 2.6s var(--ease) .25s infinite; }

@keyframes markPulse {
  0%, 70%, 100% { opacity: .28; }
  35%           { opacity: 1; }
}

.hdr-actions { display: flex; align-items: center; gap: .3rem; margin-left: auto; }

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  border: 1px solid transparent;
  transition: .18s var(--ease);
}
.icon-btn:hover { color: var(--ink); background: var(--surface-2); border-color: var(--line); }

.lang-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .08em;
}
.lang-toggle button {
  padding: .34rem .5rem;
  color: var(--ink-3);
  transition: .18s var(--ease);
}
.lang-toggle button[aria-pressed="true"] {
  background: var(--signal);
  color: var(--on-accent);
  font-weight: 600;
}

/* ---- 6. BUTTONS -------------------------------------------------------- */

.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--ink);
  --btn-bd: var(--line-bright);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .85rem 1.3rem;
  min-height: 48px;
  border: 1px solid var(--btn-bd);
  border-radius: var(--r);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--f-display);
  font-weight: 600;
  font-stretch: 112%;
  font-size: .88rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform .12s var(--ease), filter .18s var(--ease), background .18s var(--ease);
}
.btn:hover  { filter: brightness(1.12); }
.btn:active { transform: translateY(1px) scale(.995); }
.btn[disabled] { opacity: .42; pointer-events: none; }

.btn--signal { --btn-bg: var(--signal); --btn-fg: var(--on-accent); --btn-bd: var(--signal); }
.btn--ghost  { --btn-bg: transparent;   --btn-fg: var(--ink-2);     --btn-bd: var(--line); }
.btn--amber  { --btn-bg: var(--amber);  --btn-fg: var(--on-accent); --btn-bd: var(--amber); }
.btn--red    { --btn-bg: var(--red);    --btn-fg: #fff;             --btn-bd: var(--red); }
.btn--block  { width: 100%; }
.btn--lg     { min-height: 62px; font-size: 1rem; padding-inline: 1.8rem; }
.btn--sm     { min-height: 38px; padding: .45rem .8rem; font-size: .74rem; }

/* the one hero action on the home screen */
.btn--hero {
  --btn-bg: var(--signal);
  --btn-fg: var(--on-accent);
  --btn-bd: var(--signal);
  min-height: 78px;
  font-size: 1.15rem;
  letter-spacing: .09em;
  box-shadow: 0 0 0 0 var(--signal-glow);
  animation: heroBreathe 3.4s var(--ease) infinite;
}
@keyframes heroBreathe {
  0%, 100% { box-shadow: 0 0 0 0 var(--signal-glow); }
  50%      { box-shadow: 0 0 0 14px transparent; }
}

/* ---- 7. CARDS / PANELS ------------------------------------------------- */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.4rem;
}
.card--flush { padding: 0; overflow: hidden; }

/* corner ticks — the instrument-panel signature */
.card--ticks::before,
.card--ticks::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border-color: var(--line-bright);
  border-style: solid;
  pointer-events: none;
}
.card--ticks::before { top: 9px;    left: 9px;    border-width: 1px 0 0 1px; }
.card--ticks::after  { bottom: 9px; right: 9px;   border-width: 0 1px 1px 0; }

.panel-title {
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .9rem;
}

/* ---- 8. FORM ----------------------------------------------------------- */

.field { display: grid; gap: .4rem; }

.label {
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.input {
  width: 100%;
  padding: .85rem 1rem;
  min-height: 50px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink);
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.input::placeholder { color: var(--ink-3); }
.input:focus {
  outline: none;
  border-color: var(--signal);
  background: var(--surface);
}

/* the big tracking-code entry box */
.input--code {
  font-family: var(--f-mono);
  font-size: 1.5rem;
  letter-spacing: .16em;
  text-align: center;
  text-transform: uppercase;
  padding-block: 1rem;
  min-height: 64px;
}

.hint { font-size: .8rem; color: var(--ink-3); margin: 0; }

.check { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--signal); flex: none; }
.check span { font-size: .9rem; color: var(--ink-2); }

/* ---- 9. STATUS / SIGNAL ------------------------------------------------ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--line-bright);
  background: var(--surface-2);
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.pill--live   { border-color: var(--signal); color: var(--signal); background: var(--signal-glow); }
.pill--amber  { border-color: var(--amber);  color: var(--amber);  background: var(--amber-glow); }
.pill--red    { border-color: var(--red);    color: var(--red);    background: var(--red-glow); }

/* radar dot with expanding ring */
.dot {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid currentColor;
  animation: ping 1.9s var(--ease) infinite;
}
@keyframes ping {
  0%   { transform: scale(.6); opacity: .9; }
  70%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* ---- 10. THE WAYBILL (tracking code display) --------------------------- */

.waybill {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-bright);
  border-radius: var(--r-lg);
  overflow: hidden;
}

/* torn-ticket perforation down the middle */
.waybill::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: var(--perf, 132px);
  border-top: 1px dashed var(--line-bright);
}
.waybill-notch {
  position: absolute;
  top: var(--perf, 132px);
  width: 18px; height: 18px;
  background: var(--bg);
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  transform: translateY(-50%);
}
.waybill-notch.l { left: -10px; }
.waybill-notch.r { right: -10px; }

.waybill-top { padding: 1.5rem 1.4rem 1.7rem; text-align: center; }

.code-value {
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: clamp(1.7rem, 8vw, 2.6rem);
  letter-spacing: .12em;
  color: var(--signal);
  margin: .3rem 0 0;
  word-break: break-all;
}

.waybill-body { padding: 1.4rem; }

/* the barcode strip — pure CSS, no image */
.barcode {
  height: 34px;
  margin-top: .9rem;
  background-image: repeating-linear-gradient(
    90deg,
    var(--ink) 0 2px, transparent 2px 4px,
    var(--ink) 4px 5px, transparent 5px 9px,
    var(--ink) 9px 12px, transparent 12px 14px
  );
  opacity: .5;
}

/* ---- 11. STAT READOUTS ------------------------------------------------- */

.readout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.readout {
  background: var(--surface);
  padding: .9rem .8rem;
  min-width: 0;
}
.readout-k {
  font-family: var(--f-mono);
  font-size: .6rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.readout-v {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.3rem;
  font-weight: 500;
  margin-top: .2rem;
  letter-spacing: -.01em;
}
.readout-v.sig   { color: var(--signal); }
.readout-v.amber { color: var(--amber); }
.readout-v.red   { color: var(--red); }

/* the big running clock */
.clock {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.6rem, 13vw, 4.4rem);
  font-weight: 300;
  letter-spacing: -.02em;
  line-height: 1;
  color: var(--ink);
}

/* ---- 12. MAP ----------------------------------------------------------- */

.map {
  width: 100%;
  height: clamp(280px, 46vh, 460px);
  background: var(--surface-2);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  z-index: 1;
}
.map--tall { height: clamp(340px, 60vh, 620px); }

.map-shell { position: relative; }

.map-btn {
  position: absolute;
  z-index: 500;
  top: .6rem; right: .6rem;
  padding: .45rem .7rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-bright);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  font-family: var(--f-mono);
  font-size: .64rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
}

/* keep Leaflet visually consistent with the theme */
.leaflet-container { background: var(--surface-2); font-family: var(--f-body); }
.leaflet-control-attribution {
  background: color-mix(in srgb, var(--bg) 78%, transparent) !important;
  color: var(--ink-3) !important;
  font-size: 9px !important;
}
.leaflet-control-attribution a { color: var(--ink-2) !important; }
[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.95); }
[data-theme="dark"] .leaflet-tile-pane.sat-on { filter: none; }
.leaflet-bar a { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line) !important; }

/* live marker */
.me-marker { position: relative; width: 20px; height: 20px; }
.me-marker i {
  position: absolute; inset: 4px;
  background: var(--signal);
  border: 2px solid var(--bg);
  border-radius: 50%;
  display: block;
}
.me-marker::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid var(--signal);
  animation: ping 2s var(--ease) infinite;
}
.me-marker.is-sos i,
.me-marker.is-sos::after { background: var(--red); border-color: var(--red); }
.me-marker.is-sos i { background: var(--red); }

/* ---- 13. EMERGENCY CONTROLS ------------------------------------------- */

.alert-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem;
}

/* SOS: hold to confirm — the fill sweeps across as you hold */
.sos {
  position: relative;
  width: 100%;
  min-height: 84px;
  border-radius: var(--r-lg);
  border: 2px solid var(--red);
  background: var(--red-glow);
  color: var(--red);
  font-family: var(--f-display);
  font-weight: 700;
  font-stretch: 120%;
  font-size: 1.35rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  overflow: hidden;
  isolation: isolate;
}
.sos .fill {
  position: absolute;
  inset: 0;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  z-index: -1;
}
.sos.holding .fill { transform: scaleX(1); transition: transform 2s linear; }
.sos.holding { color: #fff; }
.sos-sub {
  display: block;
  font-family: var(--f-mono);
  font-size: .6rem;
  letter-spacing: .18em;
  opacity: .8;
  margin-top: .25rem;
}

/* full-screen emergency takeover */
.emergency-skin {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  box-shadow: inset 0 0 0 6px var(--red);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
body.is-sos .emergency-skin { opacity: 1; animation: sosFlash 1.4s steps(1) infinite; }
@keyframes sosFlash { 0%, 100% { opacity: 1; } 50% { opacity: .28; } }

/* ---- 14. LISTS / TIMELINE --------------------------------------------- */

.list { display: grid; gap: .5rem; }

.item {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-decoration: none;
  transition: .18s var(--ease);
}
.item:hover { border-color: var(--line-bright); background: var(--surface-2); }
.item-main { min-width: 0; flex: 1; }
.item-t { font-weight: 600; font-size: .95rem; }
.item-s { font-family: var(--f-mono); font-size: .72rem; color: var(--ink-3); margin-top: .15rem; }

.tl { display: grid; gap: 0; position: relative; }
.tl-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: .8rem;
  align-items: start;
  padding: .65rem 0;
  border-bottom: 1px solid var(--line);
}
.tl-row:last-child { border-bottom: 0; }
.tl-mark {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink-3);
  margin-top: .38rem;
  justify-self: center;
}
.tl-mark.sos     { background: var(--red); }
.tl-mark.danger  { background: var(--red); }
.tl-mark.traffic { background: var(--amber); }
.tl-mark.arrived,
.tl-mark.start   { background: var(--signal); }
.tl-t { font-size: .9rem; }
.tl-time { font-family: var(--f-mono); font-size: .7rem; color: var(--ink-3); white-space: nowrap; }

/* activity calendar */
.cal {
  display: grid;
  grid-template-columns: repeat(auto-fill, 13px);
  gap: 3px;
}
.cal i {
  width: 13px; height: 13px;
  border-radius: 2px;
  background: var(--surface-3);
  display: block;
}
.cal i[data-n="1"] { background: color-mix(in srgb, var(--signal) 32%, var(--surface-3)); }
.cal i[data-n="2"] { background: color-mix(in srgb, var(--signal) 62%, var(--surface-3)); }
.cal i[data-n="3"] { background: var(--signal); }

/* ---- 15. SHARE TARGETS ------------------------------------------------- */

.share-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: .5rem;
}
.share-btn {
  display: grid;
  gap: .35rem;
  place-items: center;
  padding: .8rem .4rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink-2);
  text-decoration: none;
  font-family: var(--f-mono);
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: .18s var(--ease);
}
.share-btn:hover { color: var(--ink); border-color: var(--line-bright); transform: translateY(-2px); }
.share-btn svg { width: 20px; height: 20px; }

.qr-box {
  display: grid;
  place-items: center;
  padding: 1rem;
  background: #fff;
  border-radius: var(--r);
  width: fit-content;
  margin-inline: auto;
}
.qr-box canvas, .qr-box img { display: block; }

/* ---- 16. BANNERS / TOAST ---------------------------------------------- */

.banner {
  display: flex;
  gap: .7rem;
  align-items: center;
  padding: .8rem 1rem;
  border-radius: var(--r);
  border: 1px solid var(--line-bright);
  background: var(--surface-2);
  font-size: .88rem;
}
.banner--sig   { border-color: var(--signal); background: var(--signal-glow); }
.banner--amber { border-color: var(--amber);  background: var(--amber-glow); }
.banner--red   { border-color: var(--red);    background: var(--red-glow); }

.toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 90;
  display: grid;
  gap: .5rem;
  width: min(460px, calc(100% - 2rem));
}
.toast {
  padding: .8rem 1rem;
  border-radius: var(--r);
  background: var(--surface-3);
  border: 1px solid var(--line-bright);
  box-shadow: var(--shadow);
  font-size: .88rem;
  animation: toastIn .32s var(--ease) both;
}
.toast--red { border-color: var(--red); }
.toast--sig { border-color: var(--signal); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---- 17. MODAL --------------------------------------------------------- */

.modal-host {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 1rem;
  background: color-mix(in srgb, #000 68%, transparent);
  backdrop-filter: blur(6px);
}
.modal-host.is-open { display: grid; }
.modal {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line-bright);
  border-radius: var(--r-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow);
  animation: modalIn .3s var(--ease) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* ---- 18. BLACKOUT (battery saver) -------------------------------------- */

.blackout {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  display: none;
  place-items: center;
  color: #0d3d22;
  text-align: center;
}
.blackout.is-on { display: grid; }
.blackout .bo-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #35F58C;
  margin: 0 auto .8rem;
  animation: boBlink 3s steps(1) infinite;
}
@keyframes boBlink { 0%, 88% { opacity: .85; } 89%, 100% { opacity: 0; } }
.blackout .bo-txt {
  font-family: var(--f-mono);
  font-size: .62rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #124a2a;
}

/* ---- 19. HOME HERO ----------------------------------------------------- */

.hero {
  padding: clamp(2.5rem, 9vw, 5rem) 0 clamp(2rem, 6vw, 3.5rem);
  position: relative;
}

/* faint radar sweep behind the hero */
.hero::after {
  content: '';
  position: absolute;
  top: -20%; right: -10%;
  width: min(560px, 90vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--signal-glow) 0%, transparent 62%);
  pointer-events: none;
  z-index: -1;
  animation: heroDrift 14s ease-in-out infinite alternate;
}
@keyframes heroDrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-4%, 4%) scale(1.1); }
}

.hero h1 span { color: var(--signal); display: block; }

.hero-actions {
  display: grid;
  gap: .7rem;
  margin-top: 2rem;
  max-width: 420px;
}

.divider-or {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 1.6rem 0;
  font-family: var(--f-mono);
  font-size: .64rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.divider-or::before,
.divider-or::after { content: ''; height: 1px; background: var(--line); flex: 1; }

/* feature strip */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
  margin-top: 3rem;
}
.feature { background: var(--bg); padding: 1.4rem 1.2rem; }
.feature svg { width: 22px; height: 22px; color: var(--signal); margin-bottom: .7rem; }
.feature h3 { margin-bottom: .35rem; }
.feature p { font-size: .86rem; margin: 0; }

/* ---- 20. FOOTER -------------------------------------------------------- */

.ftr {
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  padding: 2rem 0 3rem;
  font-family: var(--f-mono);
  font-size: .7rem;
  letter-spacing: .06em;
  color: var(--ink-3);
}
.ftr a { color: var(--ink-2); text-decoration: none; }
.ftr a:hover { color: var(--signal); }

/* ---- 21. UTILITIES ----------------------------------------------------- */

.hidden { display: none !important; }
.center { text-align: center; }
.sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--ink-3); }
.sig   { color: var(--signal); }
.amber { color: var(--amber); }
.red   { color: var(--red); }

/* ---- 22. RESPONSIVE ---------------------------------------------------- */

@media (max-width: 560px) {
  .hdr { padding-inline: 1rem; }
  .brand span.full { display: none; }
  .card { padding: 1.1rem; }
  .alert-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
