/* ─── Variables ─────────────────────────────────────────────────────────── */

:root {
  --bg: #0b0f14;
  --card: rgba(255, 255, 255, 0.06);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.74);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --max: 920px;
  --btn-bg: rgba(255, 255, 255, 0.10);
  --inset: rgba(255, 255, 255, 0.05);
  --accent: #9bb8ff;
  --callout-border: rgba(120, 160, 255, 0.34);
  --callout-bg: rgba(120, 160, 255, 0.10);
  --warn-border: rgba(255, 190, 90, 0.40);
  --warn-bg: rgba(255, 190, 90, 0.09);
  --focus: #9bb8ff;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9;
    --card: rgba(255, 255, 255, 0.62);
    --text: rgba(0, 0, 0, 0.88);
    --muted: rgba(0, 0, 0, 0.66);
    --border: rgba(0, 0, 0, 0.10);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.10);
    --btn-bg: rgba(0, 0, 0, 0.05);
    --inset: rgba(0, 0, 0, 0.03);
    --accent: #2f4fb3;
    --callout-border: rgba(47, 79, 179, 0.30);
    --callout-bg: rgba(47, 79, 179, 0.07);
    --warn-border: rgba(170, 100, 0, 0.35);
    --warn-bg: rgba(200, 130, 0, 0.08);
    --focus: #2f4fb3;
  }
}

/* Home page overrides */
body.page--home {
  --max: 980px;
}

/* ─── Base ───────────────────────────────────────────────────────────────── */

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1100px 700px at 20% -10%, rgba(92, 104, 214, 0.40), transparent 60%),
    radial-gradient(900px 600px at 85% 10%, rgba(52, 150, 160, 0.30), transparent 55%),
    radial-gradient(900px 700px at 50% 115%, rgba(10, 0, 0, 0.28), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
}

a { color: inherit; }

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

.skipLink {
  position: absolute;
  left: -9999px;
  top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  z-index: 10;
}

.skipLink:focus { left: 8px; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */

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

header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  margin-top: 18px;
}

/* ─── Site nav ───────────────────────────────────────────────────────────── */

.siteNav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 18px;
  font-size: 13.5px;
}

.siteNav a {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
}

.siteNav a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

.siteNav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.siteNav .brand {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-right: 6px;
}

/* ─── Typography ─────────────────────────────────────────────────────────── */

.title {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

body.page--home .title {
  font-size: 36px;
}

.tagline {
  margin: 10px 0 0;
  font-size: 19px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text);
  font-weight: 600;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 76ch;
  line-height: 1.55;
  font-size: 15px;
}

h2 {
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

h3 {
  margin: 16px 0 6px;
  font-size: 15px;
  letter-spacing: -0.01em;
}

p, li, dd, td, th {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14.5px;
}

p + p { margin-top: 10px; }

strong { color: var(--text); }

ul, ol { padding-left: 18px; margin: 10px 0 0; }
li { margin: 6px 0; }

.card a:not(.btn):not(.appstore-badge) { color: var(--accent); text-underline-offset: 3px; }

/* ─── Card ───────────────────────────────────────────────────────────────── */

.card {
  grid-column: span 12;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-width: 0;
}

/* ─── Buttons & Links ────────────────────────────────────────────────────── */

.ctaRow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }

.smallLink {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 13.5px;
}

/* ─── App Store badge ────────────────────────────────────────────────────── */

.appstore-badge img {
  height: 44px;
  display: block;
}

.appstore-badge:hover { opacity: 0.85; }

/* ─── Badge ──────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--inset);
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

/* ─── Note & Callout ─────────────────────────────────────────────────────── */

.note {
  margin-top: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  background: var(--inset);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.callout {
  border: 1px solid var(--callout-border);
  background: var(--callout-bg);
  border-radius: 16px;
  padding: 14px 14px;
  margin-top: 12px;
}

.callout:first-child { margin-top: 0; }

.callout h2 { margin-bottom: 6px; }

.callout p.lead {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.warn {
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 12px;
}

.warn p { color: var(--text); }

/* ─── Inline code ────────────────────────────────────────────────────────── */

code, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12.5px;
  color: var(--text);
  overflow-wrap: anywhere;
}

code {
  padding: 1px 5px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--inset);
}

/* ─── Screenshots (home) ─────────────────────────────────────────────────── */

.shots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 10px;
  justify-items: center;
}

.shot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  width: 100%;
}

.shot img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.25));
}

.shot.iphone { max-width: 240px; }
.shot.ipadPortrait { max-width: 360px; }
.shot.ipadLandscape { max-width: 480px; }
.shot.mac { max-width: 520px; }

.shotCaption {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

/* ─── Feature highlights (home) ──────────────────────────────────────────── */

.features {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.feature {
  grid-column: span 12;
  border: 1px solid var(--border);
  background: var(--inset);
  border-radius: 14px;
  padding: 12px 12px;
}

.feature h3 {
  color: var(--text);
  margin: 0 0 6px;
  font-size: 14px;
}

/* ─── Table of contents ──────────────────────────────────────────────────── */

.toc ol {
  columns: 1;
  margin-top: 6px;
}

.toc li { margin: 4px 0; break-inside: avoid; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */

.tableWrap {
  overflow-x: auto;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

th { color: var(--text); font-weight: 600; background: var(--inset); }
tr:last-child td { border-bottom: none; }

/* ─── Definition list ────────────────────────────────────────────────────── */

dl { margin: 10px 0 0; }
dt { color: var(--text); font-weight: 600; font-size: 14.5px; margin-top: 12px; }
dt:first-child { margin-top: 0; }
dd { margin: 4px 0 0; }

/* ─── FAQ ────────────────────────────────────────────────────────────────── */

.faq details {
  border: 1px solid var(--border);
  background: var(--inset);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
}

.faq summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.45;
}

.faq details[open] summary { margin-bottom: 8px; }

/* ─── Numbered steps ─────────────────────────────────────────────────────── */

.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
  margin: 10px 0 0;
}

.steps li {
  counter-increment: step;
  margin: 10px 0;
  padding-left: 38px;
  position: relative;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--inset);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */

footer {
  margin-top: 22px;
  color: var(--muted);
  font-size: 12.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: space-between;
}

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

.footerBadge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: var(--inset);
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12.5px;
  text-decoration: none;
  white-space: nowrap;
}

.footerBadge:hover { filter: brightness(1.08); color: var(--text); }
.footerBadge img { display: block; border-radius: 3px; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (min-width: 700px) {
  header { flex-direction: row; }
  .shots { grid-template-columns: repeat(2, 1fr); align-items: end; }
  .toc ol { columns: 2; column-gap: 28px; }
}

@media (min-width: 860px) {
  .card.half { grid-column: span 6; }
}

@media (min-width: 920px) {
  .feature { grid-column: span 4; }
}

@media (max-width: 420px) {
  .title, body.page--home .title { font-size: 30px; }
  .tagline { font-size: 17px; }
  .card { padding: 16px 14px 14px; }
}

/* ─── Accessibility ──────────────────────────────────────────────────────── */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
