/* =========================================================================
   PacerBoxPro landing page
   Palette taken from the Android app (res/values/colors.xml).
   ========================================================================= */

:root {
  /* Brand */
  --bluegrey-900: #102027;   /* bluegrey_800_dark */
  --bluegrey-800: #37474F;   /* bluegrey_800 */
  --bluegrey-600: #62727B;   /* bluegrey_800_light */
  --ecg-green: #23E22B;      /* ecg_green: use on dark backgrounds only */
  --ecg-green-dark: #1C9E21; /* ecg_green_dark: decorative/large on light */
  --green-on-light: #11701A; /* AA-compliant green for text/links on white */
  --logo-green: #64DD17;     /* the "Pro" in the logo wordmark; dark backgrounds only */

  /* Surfaces & text */
  --bg: #FFFFFF;
  --bg-tint: #F2F5F6;
  --bg-dark: var(--bluegrey-900);
  --text: #102027;
  --text-muted: #44545C;
  --text-on-dark: #ECF2F4;
  --text-muted-on-dark: #B0C0C7;
  --border: #D5DEE2;

  /* ECG monitor (read by js/ecg.js) */
  --ecg-trace: var(--ecg-green);
  --ecg-grid: rgba(35, 226, 43, 0.09);

  /* Type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-sm: 0.875rem;
  --fs-base: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-h3: 1.1875rem;
  --fs-h2: clamp(1.625rem, 1.2rem + 1.6vw, 2.25rem);
  --fs-h1: clamp(2.5rem, 1.6rem + 3.6vw, 4rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: clamp(3.5rem, 2.5rem + 4vw, 6rem);

  --radius: 12px;
  --gutter: 16px;
  --max-width: 1120px;
  --header-h: 64px;
  --amber: #FFB300;
  --focus: var(--bluegrey-900);  /* light sections; dark sections override */
}

/* Focus ring must contrast >= 3:1 with its surroundings */
.site-header, .hero, .section--dark, .site-footer { --focus: var(--amber); }

@media (min-width: 640px) {
  :root { --gutter: 24px; }
}

/* ---- Base ------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-wrap: break-word;
}

img, svg, canvas { display: block; max-width: 100%; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 var(--space-4); }
h2 { font-size: var(--fs-h2); letter-spacing: -0.01em; }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

a { color: var(--green-on-light); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.narrow { max-width: 760px; }

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--amber);
  color: #000;
  font-weight: 600;
  border-radius: 6px;
}
.skip-link:focus { top: var(--space-2); }

/* ---- Header ----------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  min-height: var(--header-h);
  padding-block: var(--space-3);
}

.brand { display: inline-flex; padding: var(--space-1) 0; }
.brand img { height: 22px; width: auto; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-7);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: var(--space-1) 0;
  color: var(--text-on-dark);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { color: var(--ecg-green); }

@media (max-width: 479px) {
  .site-nav ul { gap: var(--space-1) var(--space-3); }
  .site-nav a { font-size: var(--fs-sm); }
}

/* ---- Hero ------------------------------------------------------------- */

.hero {
  background:
    radial-gradient(ellipse at 80% 20%, rgba(35, 226, 43, 0.10), transparent 55%),
    linear-gradient(160deg, var(--bluegrey-900) 0%, #1A2D35 55%, var(--bluegrey-800) 100%);
  color: var(--text-on-dark);
  padding-block: var(--space-7) var(--space-8);
}

.hero__inner {
  display: grid;
  gap: var(--space-7);
  align-items: center;
}

@media (min-width: 900px) {
  .hero { padding-block: var(--space-8); }
  .hero__inner { grid-template-columns: 1fr 1.05fr; gap: var(--space-7); }
}

.eyebrow {
  margin-bottom: var(--space-3);
  color: var(--ecg-green);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: var(--fs-h1);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.wordmark-accent { color: var(--logo-green); }

.hero__lead {
  max-width: 34em;
  font-size: var(--fs-lg);
  color: var(--text-muted-on-dark);
  margin-bottom: var(--space-6);
}

/* Store badges: both rendered at the same height */
.store-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  --badge-h: 52px;
}

.store-badge { display: inline-flex; height: var(--badge-h); }
.store-badge--play { border-radius: 8px; }
.store-badge--play img { height: 100%; width: auto; }

.store-badge--soon {
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-4) 0 var(--space-3);
  border: 1px dashed rgba(236, 242, 244, 0.45);
  border-radius: 8px;
  color: var(--text-muted-on-dark);
  cursor: default;
  user-select: none;
}
.store-badge__icon { width: 24px; height: 24px; flex: none; }
.store-badge__text { display: flex; flex-direction: column; line-height: 1.15; }
.store-badge__small { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.store-badge__large { font-size: 1.0625rem; font-weight: 600; color: var(--text-on-dark); }

/* ECG monitor */
.monitor {
  background: #061014;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 0 0 6px #0C1A20;
  padding: var(--space-4);
  font-family: var(--font-mono);
  color: var(--ecg-green);
  min-width: 0;
}

.monitor__bar,
.monitor__readouts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}
.monitor__bar { margin-bottom: var(--space-2); }
.monitor__label--hr { margin-left: auto; }
.monitor__label--hr strong { font-size: 1.5rem; line-height: 1; margin-left: var(--space-1); }
.monitor__readouts {
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(35, 226, 43, 0.18);
  color: #9FE8A2;
}
.monitor__readouts strong { color: var(--ecg-green); }

.monitor__screen {
  position: relative;
  width: 100%;
  aspect-ratio: 600 / 220;
  min-height: 120px;
  background-image:
    linear-gradient(var(--ecg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--ecg-grid) 1px, transparent 1px);
  background-size: 20px 20px;
}

.monitor__static,
.monitor__live {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.monitor__static { color: var(--ecg-green); filter: drop-shadow(0 0 3px rgba(35, 226, 43, 0.6)); }
.monitor__live { display: none; }

/* When the JS animation runs, swap the static trace for the live canvas. */
.monitor.is-live .monitor__static { display: none; }
.monitor.is-live .monitor__live { display: block; }

/* ---- Sections --------------------------------------------------------- */

.section { padding-block: var(--space-8); }
.section--tint { background: var(--bg-tint); }
.section--dark { background: var(--bg-dark); color: var(--text-on-dark); }
.section--dark p { color: var(--text-muted-on-dark); }

#about p { font-size: 1.125rem; color: var(--text-muted); }

/* Features */
.feature-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  margin-top: var(--space-6);
}

.feature {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
}
.feature p { color: var(--text-muted); }

.feature__icon {
  width: 40px;
  height: 40px;
  padding: 6px;
  margin-bottom: var(--space-4);
  color: var(--green-on-light);
  background: rgba(35, 226, 43, 0.12);
  border-radius: 10px;
}

/* Teams */
.teams {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}
.teams h2 { color: var(--text-on-dark); }
@media (min-width: 900px) {
  .teams { grid-template-columns: 1fr auto; gap: var(--space-8); }
}

.button {
  display: inline-block;
  justify-self: start;
  padding: var(--space-3) var(--space-5);
  background: var(--ecg-green);
  color: var(--bluegrey-900);
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  transition: background-color 0.15s ease;
}
.button:hover { background: #4CEB53; }

/* Contact */
.contact-list {
  display: grid;
  gap: var(--space-5);
  margin: var(--space-6) 0 0;
}
@media (min-width: 640px) {
  .contact-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.contact-list dt {
  margin-bottom: var(--space-1);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.contact-list dd { margin: 0; font-weight: 500; }
.contact-list address { font-style: normal; }

/* ---- Footer ----------------------------------------------------------- */

.site-footer {
  background: var(--bg-dark);
  color: var(--text-muted-on-dark);
  padding-block: var(--space-7);
  font-size: var(--fs-sm);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.site-footer__brand { color: var(--text-on-dark); font-weight: 600; }
.disclaimer {
  max-width: 70em;
  padding: var(--space-4);
  border-left: 3px solid var(--ecg-green-dark);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0 6px 6px 0;
}
.disclaimer strong { color: var(--text-on-dark); }
.site-footer__legal { font-size: 0.8125rem; opacity: 0.85; }
