/* Perimi site styles. No external requests: system fonts only.
   Palette comes from the app icon: deep blue #0A3366 to teal #077887. */

:root {
  color-scheme: light dark;

  --brand-deep: #0a3366;
  --brand-teal: #077887;
  --hero-from: #0a3366;
  --hero-to: #066b78;

  --bg: #f5f8fa;
  --surface: #ffffff;
  --surface-alt: #e9f2f4;
  --text: #102330;
  --text-muted: #3b5261;
  --heading: #0a2c52;
  --link: #075f8f;
  --link-hover: #0a3366;
  --accent: #066b78;
  --accent-soft: #d9eef1;
  --border: #c9d8df;
  --focus: #e07b00;
  --note-bg: #fff6e5;
  --note-border: #b45f06;
  --note-text: #3d2400;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgb(10 51 102 / 0.06), 0 8px 24px rgb(10 51 102 / 0.07);
  --max: 1120px;
  --prose: 46rem;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, "New York", Charter, "Iowan Old Style", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --hero-from: #072548;
    --hero-to: #05606d;

    --bg: #08131c;
    --surface: #0f202c;
    --surface-alt: #122a38;
    --text: #e6eff3;
    --text-muted: #a9bfcb;
    --heading: #f1f7fa;
    --link: #7fd3e0;
    --link-hover: #b4e8f0;
    --accent: #6cc9d6;
    --accent-soft: #143845;
    --border: #284152;
    --focus: #ffb44d;
    --note-bg: #2a1d0b;
    --note-border: #e39a3b;
    --note-text: #fbe6c8;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.1875rem; /* 19px */
  line-height: 1.6;
  overflow-wrap: break-word;
}

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

h1, h2, h3 { color: var(--heading); line-height: 1.2; margin: 0 0 0.5em; }
h1, h2 { font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.25rem, 5vw + 1rem, 3.5rem); }
h2 { font-size: clamp(1.75rem, 2.5vw + 1rem, 2.4rem); }
h3 { font-size: 1.25rem; font-weight: 650; }
p { margin: 0 0 1em; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--surface);
  color: var(--link);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.skip-link:focus { top: 1rem; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

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

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 48px;
  color: var(--heading);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
}
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0 0.25rem; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 0.7rem;
  border-radius: 10px;
  color: var(--text);
  font-size: 1.0625rem;
  text-decoration: none;
}
.site-nav a:hover { background: var(--surface-alt); color: var(--heading); }
.site-nav a[aria-current="page"] { color: var(--accent); font-weight: 650; }
@media (max-width: 640px) {
  .site-nav .nav-section { display: none; }
  .site-nav a { padding: 0 0.55rem; }
}

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

.hero {
  background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-to) 100%);
  color: #ffffff;
  padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(3rem, 7vw, 6rem);
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
}
.hero h1 { color: #ffffff; margin-bottom: 0.25em; }
.hero-icon {
  width: 112px;
  height: 112px;
  border-radius: 25px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.28), 0 0 0 1px rgb(255 255 255 / 0.18);
}
.promise {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 1.6vw + 1rem, 1.9rem);
  line-height: 1.3;
  margin-bottom: 0.9em;
  max-width: 34ch;
}
.hero .lead { color: #e7f3f6; max-width: 40rem; font-size: 1.1875rem; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 1.75rem; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.14);
  border: 1px solid rgb(255 255 255 / 0.35);
  color: #ffffff;
  font-weight: 600;
}
.pill svg { width: 20px; height: 20px; flex: none; }
.hero-meta .devices { color: #e7f3f6; margin: 0; }

.hero-art { display: none; }
@media (min-width: 900px) {
  .hero .wrap { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 3rem; }
  .hero-icon.small { display: none; }
  .hero-art { display: grid; place-items: center; }
  .hero-art .hero-icon { width: 240px; height: 240px; border-radius: 54px; }
}

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

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section.alt { background: var(--surface-alt); }
.section-intro { max-width: 44rem; color: var(--text-muted); margin-bottom: 2.25rem; }
.eyebrow {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.steps li {
  position: relative;
  padding: 1.75rem 1.5rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-teal));
  color: #ffffff;
  font-weight: 700;
  font-size: 1.2rem;
}
.steps p { margin: 0; color: var(--text-muted); }

.features {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) {
  .features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Seven cards: the last one spans the row, icon beside the text. */
  .features li:last-child:nth-child(3n + 1) {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 1.25rem;
    align-items: start;
  }
  .features li:last-child:nth-child(3n + 1) .feature-icon { grid-row: span 2; margin-bottom: 0; }
}
.features li {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.features p { margin: 0; color: var(--text-muted); }
.feature-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}
.feature-icon svg { width: 28px; height: 28px; }

/* Escalation ladder */
.ladder {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}
@media (min-width: 760px) { .ladder { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ladder li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.ladder .feature-icon { margin: 0; flex: none; }
.ladder strong { display: block; color: var(--heading); }
.ladder span { color: var(--text-muted); }

/* Privacy */
.checks { margin: 0 0 1.5rem; padding: 0; list-style: none; max-width: 46rem; }
.checks li { position: relative; padding-left: 2.5rem; margin-bottom: 1rem; }
.checks li svg { position: absolute; left: 0; top: 0.2rem; width: 26px; height: 26px; color: var(--accent); }

/* Important note */
.note {
  max-width: 50rem;
  padding: 1.5rem 1.5rem 0.75rem;
  background: var(--note-bg);
  color: var(--note-text);
  border: 1px solid var(--note-border);
  border-left-width: 6px;
  border-radius: var(--radius-sm);
}
.note h2 { color: var(--note-text); font-size: 1.6rem; display: flex; align-items: center; gap: 0.6rem; }
.note h2 svg { width: 28px; height: 28px; flex: none; }
.note ul { margin: 0 0 1rem; padding-left: 1.25rem; }
.note li { margin-bottom: 0.5rem; }
.note a { color: inherit; }

/* Availability */
.availability { text-align: center; }
.availability .wrap { max-width: 44rem; }
.availability img { margin: 0 auto 1.25rem; width: 88px; height: 88px; border-radius: 20px; }
.availability p { color: var(--text-muted); }
.store-slot { display: flex; justify-content: center; margin-top: 1rem; }

/* Footer */
.site-footer {
  padding: 2.5rem 0 3rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.0625rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0 0.5rem; margin: 0; padding: 0; list-style: none; }
.site-footer a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 0.5rem; }
.site-footer p { margin: 0; }

/* Long-form pages (privacy, support, 404) ------------------------------- */

.page { padding: clamp(2rem, 6vw, 4rem) 0 clamp(3rem, 7vw, 5rem); }
.prose { max-width: var(--prose); }
.prose h1 { font-size: clamp(2rem, 4vw + 1rem, 3rem); }
.prose h2 { font-size: clamp(1.5rem, 1.5vw + 1rem, 1.9rem); margin-top: 2em; }
.prose h3 { margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.25em; }
.prose li { margin-bottom: 0.6em; }
.prose li::marker { color: var(--accent); }
.prose .meta { color: var(--text-muted); }

.prose table { width: 100%; margin: 0 0 1.5em; border-collapse: collapse; font-size: 1.0625rem; }
.prose th, .prose td { padding: 0.75rem; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose thead th { background: var(--surface-alt); color: var(--heading); }
.prose tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-alt) 45%, transparent); }
@media (max-width: 640px) {
  .prose table, .prose tbody, .prose tr, .prose td { display: block; width: 100%; }
  .prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .prose tr { margin-bottom: 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
  .prose td { border: 0; border-top: 1px solid var(--border); }
  .prose tr td:first-child { border-top: 0; background: var(--surface-alt); font-weight: 650; color: var(--heading); }
  .prose tbody tr:nth-child(even) td:not(:first-child) { background: transparent; }
  .prose td:not(:first-child)::before {
    content: attr(data-label) ": ";
    font-weight: 650;
    color: var(--text-muted);
  }
}

.faq { margin-top: 2.5rem; }
.faq details {
  margin-bottom: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 56px;
  padding: 0.75rem 1.25rem;
  color: var(--heading);
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-size: 1.5rem; line-height: 1; color: var(--accent); }
.faq details[open] summary::after { content: "\2212"; }
.faq .answer { padding: 0 1.25rem 0.5rem; }

.contact-card {
  margin: 1rem 0 0;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.not-found { text-align: center; }
.not-found .prose { margin: 0 auto; }
.not-found img { margin: 0 auto 1.5rem; width: 96px; height: 96px; border-radius: 22px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 1.5rem;
  border-radius: 999px;
  background: var(--brand-deep);
  color: #ffffff;
  font-weight: 650;
  text-decoration: none;
}
.button:hover { background: var(--brand-teal); color: #ffffff; }
@media (prefers-color-scheme: dark) {
  .button { background: var(--accent); color: #06202a; }
  .button:hover { background: var(--link-hover); color: #06202a; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
