/* Battery Alarm website. Colours match src/theme.ts; fonts are self-hosted
   (no third-party requests, which keeps the privacy policy simple). */

@font-face {
  font-family: "Manrope";
  src: url("assets/fonts/manrope-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("assets/fonts/manrope-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("assets/fonts/manrope-800.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #f2f4f1;
  --surface: #ffffff;
  --surface-2: #f6f8f5;
  --border: #e3e8e4;
  --text: #0b1310;
  --text-2: #56655d;
  --text-3: #5f6d66;
  --accent: #16a34a;
  --accent-text: #ffffff;
  /* Darker than the app's accent so white button text passes WCAG AA (5:1). */
  --button: #15803d;
  --accent-soft: #e2f5e8;
  --accent-ink: #0e7a37;
  --hero-from: #124a2d;
  --hero-to: #061810;
  --lime: #c6f432;
  --glow: #3be07e;
  --shadow: 0 1px 2px rgba(11, 19, 16, 0.04), 0 10px 30px rgba(11, 19, 16, 0.06);
  --radius: 20px;
  --radius-lg: 32px;
  --max: 1120px;
  --tile-green: #16a34a;
  --tile-amber: #f59e0b;
  --tile-red: #ef4444;
  --tile-purple: #8b5cf6;
  --tile-indigo: #6366f1;
  --tile-blue: #0ea5e9;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070a08;
    --surface: #111714;
    --surface-2: #0c110e;
    --border: #1e2823;
    --text: #edf4ef;
    --text-2: #9daca4;
    --text-3: #87958e;
    --accent: #22c55e;
    --accent-text: #03140a;
    --button: #22c55e;
    --accent-soft: #12301f;
    --accent-ink: #4ade80;
    --shadow: none;
  }
}

/* Base */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 17px/1.6 "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  margin: 0;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

svg.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.nav {
  display: flex;
  gap: 4px;
}

.nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav a[aria-current="page"] {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

@media (max-width: 440px) {
  .brand span {
    display: none;
  }
  .nav a {
    padding: 8px 10px;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--button);
  color: var(--accent-text);
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}
.btn:hover {
  filter: brightness(1.05);
}
.btn .icon {
  width: 20px;
  height: 20px;
}

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 192px; /* both buttons the same width, also when stacked */
  min-height: 56px;
  padding: 10px 22px 10px 16px;
  border-radius: 16px;
  background: #ffffff;
  color: #0b1310;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
}
.store-btn small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.7;
}
.store-btn:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.store-logo {
  flex: none;
  width: 28px;
  height: 28px;
}
/* The Apple mark is taller than the Play triangle; this keeps them optically even. */
.store-logo.apple {
  width: 26px;
  height: 26px;
  margin-top: -3px;
  color: #000000;
}

/* Home: hero */

.hero {
  padding-top: 24px;
}

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  overflow: hidden;
  padding: 72px 64px 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--hero-from), var(--hero-to));
  color: #ffffff;
}

.hero-card::before {
  content: "";
  position: absolute;
  top: -300px;
  right: -200px;
  width: 720px;
  height: 720px;
  background: radial-gradient(closest-side, rgba(59, 224, 126, 0.32), transparent);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  align-self: center;
  padding-bottom: 72px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
}

.hero h1 {
  margin: 22px 0 18px;
  font-size: clamp(42px, 6vw, 68px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.035em;
}
.hero h1 em {
  font-style: normal;
  color: var(--lime);
}

.hero .lead {
  max-width: 30em;
  margin-bottom: 32px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 19px;
}

.hero-phone {
  position: relative;
  align-self: end;
  justify-self: center;
  width: min(320px, 100%);
  margin-bottom: -150px;
}

@media (max-width: 860px) {
  .hero-card {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 44px 24px 0;
    border-radius: 28px;
  }
  .hero-copy {
    padding-bottom: 32px;
  }
  .hero .lead {
    font-size: 18px;
  }
  .hero-phone {
    width: min(270px, 80%);
    margin-bottom: -170px;
  }
}

/* Phone frame */

.phone {
  position: relative;
  padding: 10px;
  border-radius: 44px;
  background: #0b1310;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    0 30px 60px rgba(0, 0, 0, 0.3);
}
/* Front camera, sitting in the screen's status-bar area. */
.phone::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: #0b1310;
}
/* Screens are exported at exactly this size (tools/make-website-assets.py), so
   nothing is cropped; the top of each image is the status-bar area. */
.phone img {
  width: 100%;
  aspect-ratio: 600 / 1266;
  border-radius: 34px;
}

/* Sections */

.section {
  padding-top: 96px;
}

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

.kicker {
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-head h2,
.split h2 {
  margin-top: 10px;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
}

.section-head p:not(.kicker) {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.grid.two {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 620px) {
  .grid,
  .grid.two {
    grid-template-columns: 1fr;
  }
}

.card {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card h3 {
  margin-bottom: 6px;
  font-size: 19px;
  font-weight: 800;
}
.card p:not(.kicker) {
  color: var(--text-2);
  font-size: 16px;
}

.tile {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border-radius: 13px;
  color: #ffffff;
}

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  vertical-align: 3px;
}

/* On phones, feature and step cards put the icon beside the text to save scrolling. */
@media (max-width: 620px) {
  .grid {
    gap: 12px;
  }
  .feature {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 16px;
    padding: 20px;
  }
  .feature .tile,
  .feature .step-num {
    grid-row: span 2;
    margin-bottom: 0;
  }
  .feature .step-num {
    width: 46px;
    height: 46px;
  }
}

/* Why 80% */

.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px 56px;
  align-items: center;
  padding: 44px 48px;
}
.split .body p {
  color: var(--text-2);
  font-size: 18px;
}
.split .body p + p {
  margin-top: 14px;
}

.meter {
  position: relative;
  height: 14px;
  margin-top: 26px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime), var(--tile-green) 80%, var(--border) 80%);
}
.meter::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 80%;
  width: 4px;
  height: 26px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--text);
}
.meter-labels {
  position: relative;
  height: 22px;
  margin-top: 10px;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 700;
}
.meter-labels > * {
  position: absolute;
  top: 0;
}
.meter-labels :first-child {
  left: 0;
}
.meter-labels b {
  left: 80%;
  transform: translateX(-50%);
  color: var(--text);
}
.meter-labels :last-child {
  right: 0;
}
@media (max-width: 420px) {
  .meter-labels :last-child {
    display: none;
  }
}

@media (max-width: 760px) {
  .split {
    grid-template-columns: 1fr;
    padding: 30px 24px;
  }
}

/* Steps */

.step-num {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 800;
}

/* Screens */

.screens {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.screens figure {
  margin: 0;
  text-align: center;
}
.screens .phone {
  max-width: 270px;
  margin: 0 auto;
}
.screens figcaption {
  margin-top: 18px;
  font-weight: 800;
}
.screens figcaption span {
  display: block;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
}

@media (max-width: 760px) {
  /* A sideways carousel that runs to the screen edges, so the phones'
     shadows aren't clipped into a box. */
  .screens {
    grid-auto-columns: 70%;
    grid-auto-flow: column;
    grid-template-columns: none;
    gap: 16px;
    margin: 0 -20px;
    padding: 8px 20px 36px;
    overflow-x: auto;
    scroll-padding: 0 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .screens::-webkit-scrollbar {
    display: none;
  }
  .screens figure {
    scroll-snap-align: center;
  }
  .screens .phone {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.09),
      0 12px 24px rgba(0, 0, 0, 0.18);
  }
}

/* Platforms */

.checks {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.checks li {
  display: flex;
  gap: 10px;
  color: var(--text-2);
  font-size: 16px;
}
.checks li + li {
  margin-top: 10px;
}
.checks .icon {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--accent);
}
.note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 14px;
}

/* Dark band */

.band {
  position: relative;
  overflow: hidden;
  padding: 56px 48px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--hero-from), var(--hero-to));
  color: #ffffff;
}
.band::before {
  content: "";
  position: absolute;
  bottom: -320px;
  left: -160px;
  width: 640px;
  height: 640px;
  background: radial-gradient(closest-side, rgba(59, 224, 126, 0.24), transparent);
  pointer-events: none;
}
.band > * {
  position: relative;
}
.band h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
}
.band .pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 28px;
  padding: 0;
  list-style: none;
}
.band .pills li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
}
.band .pills .icon {
  width: 18px;
  height: 18px;
  color: var(--lime);
}
.band a {
  color: var(--lime);
  font-weight: 700;
}

@media (max-width: 620px) {
  .band {
    padding: 40px 24px;
    border-radius: 28px;
  }
}

/* Call to action */

.cta {
  text-align: center;
}
.cta h2 {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
}
.cta p {
  margin: 12px auto 24px;
  color: var(--text-2);
  font-size: 18px;
}

/* Documents: support, privacy, terms */

.doc {
  max-width: 780px;
  margin: 0 auto;
  padding: 56px 20px 0;
}

.doc-head h1 {
  font-size: clamp(36px, 6vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.doc-head p {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 19px;
}
.doc-head .meta {
  margin-top: 10px;
  color: var(--text-3);
  font-size: 15px;
}

.doc h2 {
  margin: 44px 0 12px;
  font-size: 23px;
  font-weight: 800;
}
.doc h3 {
  margin: 24px 0 8px;
  font-size: 18px;
  font-weight: 700;
}
.doc p,
.doc li {
  color: var(--text-2);
}
.doc p + p,
.doc ul + p {
  margin-top: 12px;
}
.doc strong {
  color: var(--text);
  font-weight: 700;
}
.doc ul {
  margin: 10px 0 0;
  padding-left: 1.25em;
}
.doc li + li {
  margin-top: 8px;
}
.doc li::marker {
  color: var(--accent);
}

.summary {
  margin-top: 32px;
  padding: 22px 26px;
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.summary h2 {
  margin: 0 0 4px;
  font-size: 17px;
}
.summary li {
  color: var(--text);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.doc th,
.doc td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.doc tr:last-child td {
  border-bottom: 0;
}
.doc th {
  color: var(--text);
  font-weight: 700;
  background: var(--surface-2);
}
.doc td {
  color: var(--text-2);
}
.doc td:first-child {
  min-width: 9.5em;
  color: var(--text);
  font-weight: 700;
}

/* On phones, each row stacks: the name above its explanation. */
@media (max-width: 560px) {
  .doc table,
  .doc tbody,
  .doc tr,
  .doc td {
    display: block;
  }
  .doc thead {
    display: none;
  }
  .doc tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
  }
  .doc tr:last-child {
    border-bottom: 0;
  }
  .doc td {
    padding: 0;
    border: 0;
  }
  .doc td:first-child {
    margin-bottom: 2px;
  }
}

/* Support */

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 24px;
  margin-top: 32px;
}
.contact h2 {
  margin: 0;
  font-size: 20px;
}
.contact p {
  margin-top: 4px;
  font-size: 16px;
}

.faq {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  color: var(--text);
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  flex: none;
  color: var(--text-3);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.2s ease;
}
.faq[open] summary::after {
  transform: rotate(45deg);
}
.faq .answer {
  padding: 0 22px 20px;
}
.faq .answer p,
.faq .answer li {
  font-size: 16px;
}

/* Footer */

.site-footer {
  margin-top: 104px;
  padding: 32px 0 48px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 15px;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.4;
}
.footer-brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.footer-brand strong {
  color: var(--text);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}
.footer-links a {
  color: var(--text-2);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .faq summary::after {
    transition: none;
  }
}
