/* ==========================================================================
   Apocalive design system — mapped 1:1 from the app (AegisTheme/Typography/Layout)
   True-black OLED, flat, red emergency accent. Dark-only by design.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Backgrounds */
  --bg0: #000000;
  --bg1: #17171a;
  --bg2: #262629;
  --hairline: rgba(255, 255, 255, 0.12);

  /* Accents — red = victim/SOS/action, amber = rescuer/warning, green = connected */
  --emergency: #ff453b;
  --emergency-dim: rgba(255, 69, 59, 0.18);
  --emergency-text: #ff6e66; /* small-text-safe tint on bg2 */
  --emergency-hover: #ff5b52;
  --warning: #ff9e0a;
  --warning-dim: rgba(255, 158, 10, 0.18);
  --safe: #30d159;
  --safe-dim: rgba(48, 209, 89, 0.18);

  /* Text */
  --text1: #ffffff;
  --text2: rgba(255, 255, 255, 0.7);
  --text3: rgba(255, 255, 255, 0.45);
  --text-on-accent: #000000;

  /* Geometry */
  --r-s: 12px;
  --r-m: 16px;
  --r-l: 24px;
  --sp-s: 8px;
  --sp-m: 16px;
  --sp-l: 24px;
  --sp-xl: 32px;
  --touch: 56px;
  --btn-big: 64px;
  --header-h: 64px;

  /* Type */
  --font-sans: ui-rounded, -apple-system, BlinkMacSystemFont, "SF Pro Rounded",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-h1: clamp(2.1rem, 5.5vw, 3.4rem);
  --fs-h2: clamp(1.55rem, 3.2vw, 2.2rem);
  --fs-h3: 1.25rem;
  --fs-body-lg: 1.1875rem;
  --fs-body: 1rem;
  --fs-caption: 0.875rem;
  --fs-micro: 0.75rem;
}

:lang(ja) {
  --font-sans: ui-rounded, -apple-system, "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}
:lang(zh-Hans) {
  --font-sans: ui-rounded, -apple-system, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}
:lang(zh-Hant) {
  --font-sans: ui-rounded, -apple-system, "PingFang TC", "Microsoft JhengHei",
    sans-serif;
}

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

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg0);
  color: var(--text1);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure {
  margin: 0;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

::selection {
  background: var(--emergency);
  color: #000;
}

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 4px;
}

/* CJK rhythm */
:lang(ja) p, :lang(zh-Hans) p, :lang(zh-Hant) p,
:lang(ja) li, :lang(zh-Hans) li, :lang(zh-Hant) li {
  line-height: 1.85;
}

/* ---- Layout -------------------------------------------------------------- */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding-inline: var(--sp-l);
}

section {
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.section {
  padding-block: clamp(64px, 10vw, 112px);
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(32px, 6vw, 56px);
}

.section-head h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

:lang(ja) .section-head h2, :lang(zh-Hans) .section-head h2, :lang(zh-Hant) .section-head h2 {
  letter-spacing: 0;
}

.section-head p {
  margin-top: var(--sp-m);
  color: var(--text2);
  font-size: var(--fs-body-lg);
}

.eyebrow {
  display: block;
  margin-bottom: var(--sp-m);
  color: var(--text3);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

:lang(ja) .eyebrow, :lang(zh-Hans) .eyebrow, :lang(zh-Hant) .eyebrow {
  letter-spacing: 0.06em;
}

/* ---- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-s);
  min-height: var(--touch);
  padding: 0 28px;
  border-radius: var(--r-m);
  font-size: var(--fs-body-lg);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--emergency);
  color: var(--text-on-accent);
  min-height: var(--btn-big);
}

.btn--primary:hover {
  background: var(--emergency-hover);
}

.btn--secondary {
  background: var(--bg2);
  color: var(--text1);
}

.btn--secondary:hover {
  background: #313134;
}

.btn--sm {
  min-height: 44px;
  padding: 0 18px;
  font-size: var(--fs-body);
  border-radius: var(--r-s);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg0);
  border-bottom: 1px solid var(--hairline);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-m);
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.125rem;
  font-weight: 700;
  text-decoration: none;
  min-height: 44px;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 22%;
}

.site-nav {
  display: none;
}

@media (min-width: 768px) {
  .site-nav {
    display: flex;
    gap: var(--sp-xl);
  }

  .site-nav a {
    color: var(--text2);
    text-decoration: none;
    font-size: var(--fs-caption);
    font-weight: 600;
    padding: 12px 0;
  }

  .site-nav a:hover {
    color: var(--text1);
  }
}

/* ---- Pills / chips -------------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: var(--fs-micro);
  font-weight: 600;
}

.pill--safe {
  background: var(--safe-dim);
  color: var(--safe);
}

.pill--warning {
  background: var(--warning-dim);
  color: var(--warning);
}

.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

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

.hero {
  padding-block: clamp(48px, 8vw, 96px) clamp(56px, 9vw, 104px);
}

.hero .container {
  display: grid;
  gap: clamp(40px, 7vw, 64px);
  align-items: center;
}

@media (min-width: 900px) {
  .hero .container {
    grid-template-columns: 55fr 45fr;
  }
}

.hero h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

:lang(ja) .hero h1, :lang(zh-Hans) .hero h1, :lang(zh-Hant) .hero h1 {
  letter-spacing: 0;
  line-height: 1.25;
}

.hero__sub {
  margin-top: var(--sp-l);
  max-width: 34em;
  color: var(--text2);
  font-size: var(--fs-body-lg);
}

.hero__cta {
  margin-top: var(--sp-xl);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-m);
}

.hero__micro {
  color: var(--text2);
  font-size: var(--fs-caption);
}

.hero__facts {
  margin-top: var(--sp-xl);
  padding-top: var(--sp-l);
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-s) var(--sp-l);
  list-style: none;
  padding-left: 0;
  color: var(--text2);
  font-size: var(--fs-caption);
  font-weight: 600;
}

.hero__facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero__facts svg {
  width: 16px;
  height: 16px;
  color: var(--emergency);
  flex: none;
}

/* ---- Phone mockup (direction finder) -------------------------------------- */

.phone-wrap {
  display: flex;
  justify-content: center;
}

.phone {
  width: clamp(270px, 78vw, 330px);
  aspect-ratio: 9 / 19;
  background: var(--bg0);
  border: 3px solid #2a2a2e;
  border-radius: 48px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 12px;
  position: relative;
  overflow: hidden;
}

.phone__island {
  width: 34%;
  height: 22px;
  margin: 2px auto 0;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
}

.phone__screen {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.phone__status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
  position: absolute;
  top: 10px;
  left: 14px;
  right: 14px;
}

.phone__status .no-service {
  color: var(--text3);
}

.phone__peer {
  margin-top: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.phone__peer-name {
  font-size: 17px;
  font-weight: 700;
}

.finder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 0;
}

.finder__ring {
  position: relative;
  width: min(200px, 58vw, 56%);
  aspect-ratio: 1;
  border: 2px solid var(--hairline);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.finder__arrow {
  width: 44%;
  height: 44%;
  color: var(--emergency);
  transform: rotate(-32deg);
  will-change: transform;
}

.finder__pulse {
  position: absolute;
  inset: 0;
  border: 2px solid var(--emergency);
  border-radius: 50%;
  opacity: 0;
  animation: finder-pulse 2.6s ease-out infinite;
  pointer-events: none;
}

.finder__pulse--2 {
  animation-delay: 1.3s;
}

@keyframes finder-pulse {
  0% {
    transform: scale(0.55);
    opacity: 0.45;
  }
  100% {
    transform: scale(1.12);
    opacity: 0;
  }
}

.readout {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1;
}

.readout__num {
  font-size: clamp(52px, 16vw, 72px);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.readout__unit {
  font-size: 22px;
  font-weight: 600;
  color: var(--text2);
}

.finder__hint {
  color: var(--text3);
  font-size: 12px;
  padding-bottom: 18px;
  text-align: center;
}

/* ---- Role cards (RoleCard.swift recreation) -------------------------------- */

.role-card {
  display: flex;
  align-items: center;
  gap: var(--sp-m);
  background: var(--bg1);
  border-radius: var(--r-l);
  padding: 18px var(--sp-l);
  min-height: 88px;
}

.role-card--victim {
  border: 1.5px solid rgba(255, 69, 59, 0.5);
}

.role-card--rescuer {
  border: 1.5px solid rgba(255, 158, 10, 0.5);
}

.role-card__icon {
  flex: none;
  width: 44px;
  height: 44px;
}

.role-card--victim .role-card__icon {
  color: var(--emergency);
}

.role-card--rescuer .role-card__icon {
  color: var(--warning);
}

.role-card__title {
  font-size: 17px;
  font-weight: 700;
}

.role-card__sub {
  margin-top: 2px;
  color: var(--text2);
  font-size: var(--fs-caption);
}

.role-card__chevron {
  margin-left: auto;
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--text3);
}

/* ---- How it works steps ----------------------------------------------------- */

.steps {
  display: grid;
  gap: clamp(32px, 5vw, 40px);
}

@media (min-width: 900px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--emergency-dim);
  color: var(--emergency);
  font-weight: 800;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--sp-m);
}

.step h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
}

.step p {
  margin-top: var(--sp-s);
  color: var(--text2);
}

.step__art {
  margin-top: var(--sp-l);
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  min-height: 200px;
}

/* Radar art (step 2) */
.radar {
  position: relative;
  width: 180px;
  aspect-ratio: 1;
  margin: 0 auto;
}

.radar__ring {
  position: absolute;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  inset: 0;
}

.radar__ring--2 {
  inset: 18%;
}

.radar__ring--3 {
  inset: 36%;
}

.radar__me {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px;
  border-radius: 50%;
  background: var(--text1);
}

.radar__peer {
  position: absolute;
  left: 71%;
  top: 26%;
  width: 12px;
  height: 12px;
  margin: -6px;
  border-radius: 50%;
  background: var(--safe);
}

.radar__peer::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 2px solid var(--safe);
  border-radius: 50%;
  opacity: 0;
  animation: finder-pulse 2.2s ease-out infinite;
}

/* Mini finder (step 3) */
.minifinder {
  display: flex;
  align-items: center;
  gap: var(--sp-l);
  justify-content: center;
}

.minifinder__ring {
  position: relative;
  width: 96px;
  aspect-ratio: 1;
  border: 2px solid var(--hairline);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.minifinder__ring svg {
  width: 44px;
  height: 44px;
  color: var(--emergency);
  transform: rotate(24deg);
}

.minifinder__num {
  font-size: 40px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}

.minifinder__unit {
  font-size: 16px;
  font-weight: 600;
  color: var(--text2);
}

/* ---- Live Activity recreation ------------------------------------------------ */

.live-activity {
  background: #000;
  border: 1px solid var(--hairline);
  border-radius: var(--r-l);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 420px;
}

.live-activity__arrow {
  flex: none;
  width: 42px;
  height: 42px;
  color: var(--emergency);
  transform: rotate(-24deg);
}

.live-activity__mid {
  min-width: 0;
}

.live-activity__num {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.live-activity__unit {
  font-size: 17px;
  color: var(--text2);
  font-weight: 600;
}

.live-activity__peer {
  color: var(--text2);
  font-size: var(--fs-caption);
}

.live-activity__side {
  margin-left: auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.live-activity__batt {
  color: var(--emergency);
  font-size: var(--fs-micro);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---- Status banner (compatibility note) ---------------------------------------- */

.status-banner {
  display: flex;
  gap: var(--sp-m);
  align-items: flex-start;
  background: var(--warning-dim);
  border-radius: var(--r-m);
  padding: var(--sp-m) var(--sp-l);
  margin-top: var(--sp-xl);
  max-width: 640px;
}

.status-banner svg {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--warning);
  margin-top: 3px;
}

.status-banner p {
  color: var(--text1);
  font-size: var(--fs-caption);
}

.status-banner strong {
  color: var(--warning);
}

/* ---- Feature grid ---------------------------------------------------------------- */

.feature-grid {
  display: grid;
  gap: var(--sp-m);
}

@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature {
  background: var(--bg1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-l);
  padding: var(--sp-l);
}

.feature__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--r-m);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-m);
}

.feature__icon svg {
  width: 28px;
  height: 28px;
}

.feature__icon--emergency {
  background: var(--emergency-dim);
  color: var(--emergency);
}

.feature__icon--warning {
  background: var(--warning-dim);
  color: var(--warning);
}

.feature__icon--safe {
  background: var(--safe-dim);
  color: var(--safe);
}

.feature h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
}

.feature p {
  margin-top: var(--sp-s);
  color: var(--text2);
  font-size: var(--fs-caption);
  line-height: 1.65;
}

/* ---- Free band -------------------------------------------------------------------- */

.free-band {
  border-block: 1px solid var(--hairline);
}

.free-band .container {
  display: flex;
  flex-direction: column;
  gap: var(--sp-l);
  align-items: flex-start;
}

@media (min-width: 768px) {
  .free-band .container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-xl);
  }
}

.free-band h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
}

.free-band p {
  margin-top: var(--sp-s);
  color: var(--text2);
  max-width: 38em;
}

/* ---- Checklist -------------------------------------------------------------------- */

.checklist {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 2px;
  max-width: 640px;
}

.prepare-cta {
  margin-top: var(--sp-xl);
}

#arrow .hero__micro {
  margin-top: var(--sp-m);
}

.checklist li {
  display: flex;
  gap: var(--sp-m);
  align-items: flex-start;
  background: var(--bg1);
  padding: var(--sp-m) var(--sp-l);
}

.checklist li:first-child {
  border-radius: var(--r-l) var(--r-l) 0 0;
}

.checklist li:last-child {
  border-radius: 0 0 var(--r-l) var(--r-l);
}

.checklist svg {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--safe);
  margin-top: 2px;
}

.checklist span {
  color: var(--text1);
}

.checklist small {
  display: block;
  color: var(--text3);
  font-size: var(--fs-caption);
}

/* ---- FAQ ---------------------------------------------------------------------------- */

.faq {
  max-width: 760px;
}

.faq details {
  border-top: 1px solid var(--hairline);
}

.faq details:last-child {
  border-bottom: 1px solid var(--hairline);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-m);
  padding: 20px 4px;
  font-size: var(--fs-body-lg);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  min-height: var(--touch);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  color: var(--text3);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details > p {
  padding: 0 4px 20px;
  color: var(--text2);
  max-width: 60ch;
}

.faq a {
  color: var(--emergency-text);
}

/* ---- CTA band -------------------------------------------------------------------------- */

.cta-band {
  text-align: center;
}

.cta-band .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-l);
}

.cta-band img.appicon {
  width: 96px;
  height: 96px;
  border-radius: 22%;
}

.cta-band h2 {
  font-size: var(--fs-h2);
  font-weight: 800;
}

.cta-band .badge img,
.cta-band .badge svg {
  height: 56px;
  width: auto;
}

.cta-band .micro {
  color: var(--text3);
  font-size: var(--fs-caption);
}

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

.site-footer {
  border-top: 1px solid var(--hairline);
  padding-block: clamp(40px, 6vw, 64px) var(--sp-l);
  font-size: var(--fs-caption);
}

.site-footer .cols {
  display: grid;
  gap: var(--sp-xl);
  margin-bottom: var(--sp-xl);
}

@media (min-width: 768px) {
  .site-footer .cols {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.site-footer h4 {
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: var(--sp-m);
}

:lang(ja) .site-footer h4, :lang(zh-Hans) .site-footer h4, :lang(zh-Hant) .site-footer h4 {
  letter-spacing: 0.04em;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 2px;
}

.site-footer ul a {
  display: inline-block;
  padding: 8px 0;
  color: var(--text2);
  text-decoration: none;
}

.site-footer ul a:hover {
  color: var(--text1);
}

.site-footer .about {
  color: var(--text2);
  max-width: 34em;
}

.site-footer .about .brand {
  margin-bottom: var(--sp-m);
}

.site-footer .about .safety {
  margin-top: var(--sp-m);
  color: var(--text3);
}

.site-footer .legalrow {
  border-top: 1px solid var(--hairline);
  padding-top: var(--sp-l);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-m) var(--sp-l);
  align-items: center;
  justify-content: space-between;
  color: var(--text3);
  font-size: var(--fs-micro);
}

/* Language switcher (native details dropdown) */
.lang {
  position: relative;
}

.lang summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-s);
  color: var(--text2);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  min-height: 44px;
}

.lang summary::-webkit-details-marker {
  display: none;
}

.lang summary svg {
  width: 16px;
  height: 16px;
}

.lang[open] summary {
  color: var(--text1);
}

.lang ul {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  background: var(--bg1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-s);
  padding: 6px;
  display: grid;
  gap: 0;
  z-index: 10;
}

.lang ul a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text2);
  text-decoration: none;
}

.lang ul a:hover {
  background: var(--bg2);
  color: var(--text1);
}

.lang ul a[aria-current="true"] {
  color: var(--emergency-text);
  font-weight: 700;
}

/* ---- Prose (legal pages) ----------------------------------------------------------------------- */

.page-head {
  padding-block: clamp(40px, 7vw, 72px) 0;
}

.page-head h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-head .meta {
  margin-top: var(--sp-m);
  color: var(--text3);
  font-size: var(--fs-caption);
}

.prose {
  max-width: 760px;
  padding-block: clamp(32px, 5vw, 48px) clamp(64px, 9vw, 96px);
  color: var(--text2);
}

.prose h2 {
  color: var(--text1);
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: var(--sp-xl);
  padding-bottom: var(--sp-s);
  border-bottom: 1px solid var(--hairline);
}

.prose h3 {
  color: var(--text1);
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: var(--sp-l);
}

.prose p,
.prose ul {
  margin-top: var(--sp-m);
  line-height: 1.75;
}

.prose ul {
  padding-left: 1.4em;
}

.prose li {
  margin-top: var(--sp-s);
}

.prose a {
  color: var(--emergency-text);
}

.prose strong {
  color: var(--text1);
}

/* ---- Tip page -------------------------------------------------------------------------------------- */

.tip-main {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-l);
}

.tip-box {
  width: 100%;
  max-width: 440px;
}

.tip-box .tip-head {
  text-align: center;
  margin-bottom: var(--sp-xl);
}

.tip-box .tip-head img {
  width: 64px;
  height: 64px;
  border-radius: 22%;
  margin: 0 auto var(--sp-m);
}

.tip-box h1 {
  font-size: 1.75rem;
  font-weight: 800;
}

.tip-box .tip-head p {
  margin-top: var(--sp-m);
  color: var(--text2);
}

.tip-card {
  background: var(--bg1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-l);
  padding: var(--sp-l);
}

.tip-card label {
  display: block;
  font-size: var(--fs-caption);
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 10px;
}

.presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-s);
  margin-bottom: var(--sp-l);
}

.preset {
  min-height: 52px;
  border-radius: var(--r-s);
  background: var(--bg2);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.15s ease;
}

.preset:hover {
  background: #313134;
}

.preset.selected {
  box-shadow: 0 0 0 2px var(--emergency);
  color: var(--emergency-text);
}

.amount-wrap {
  position: relative;
  margin-bottom: var(--sp-l);
}

.amount-wrap .cur {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-weight: 600;
}

.amount-wrap input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px 0 30px;
  border-radius: var(--r-s);
  border: 1px solid transparent;
  background: var(--bg2);
  color: var(--text1);
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.amount-wrap input::placeholder {
  color: var(--text3);
}

.amount-wrap input:focus {
  outline: none;
  border-color: var(--emergency);
}

.tip-card .btn {
  width: 100%;
}

.tip-card .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.tip-status {
  margin-top: var(--sp-m);
  text-align: center;
  font-size: var(--fs-caption);
  color: var(--text2);
  min-height: 1.4em;
}

.tip-fine {
  margin-top: var(--sp-s);
  text-align: center;
  font-size: var(--fs-micro);
  color: var(--text3);
}

.tip-back {
  margin-top: var(--sp-l);
  text-align: center;
  font-size: var(--fs-caption);
}

.tip-back a {
  color: var(--text2);
}

.tip-back a:hover {
  color: var(--text1);
}

.tip-result {
  text-align: center;
}

.tip-result h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-top: var(--sp-l);
}

.tip-result p {
  margin-top: var(--sp-m);
  color: var(--text2);
}

.tip-result .actions {
  margin-top: var(--sp-xl);
  display: flex;
  gap: var(--sp-m);
  justify-content: center;
  flex-wrap: wrap;
}

.tip-result .glyph {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tip-result .glyph--safe {
  background: var(--safe-dim);
  color: var(--safe);
}

.tip-result .glyph--neutral {
  background: var(--bg2);
  color: var(--text2);
}

.tip-result .glyph svg {
  width: 34px;
  height: 34px;
}

/* ---- Reveal on scroll (additive — content visible without JS) ---------------------------------------- */

.js-reveal .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease-out, transform 0.55s ease-out;
}

.js-reveal .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---- Reduced motion ------------------------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .finder__pulse,
  .radar__peer::after {
    animation: none;
    opacity: 0;
  }

  .js-reveal .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn,
  .faq summary::after,
  .preset {
    transition: none;
  }
}

/* ---- Print ---------------------------------------------------------------------------------------------- */

@media print {
  :root {
    color-scheme: light;
  }

  body {
    background: #fff;
    color: #111;
  }

  .site-header,
  .site-footer,
  .btn,
  .phone-wrap {
    display: none !important;
  }

  .page-head h1 {
    color: #000;
  }

  .page-head .meta {
    color: #444;
  }

  .prose {
    color: #222;
    max-width: none;
  }

  .prose h2,
  .prose h3,
  .prose strong {
    color: #000;
  }

  .prose h2 {
    border-bottom-color: #ccc;
  }

  .prose a {
    color: #000;
    text-decoration: underline;
  }
}
