/* Armory Wise — shared stylesheet. No external fonts, no scripts.
   Colors come from the app's default "Blaze on Graphite" theme
   (accent seed #E2601A, neutral seed #4E5348) and the app icon's olive. */

:root {
  color-scheme: light dark;

  --paper: #eef0e9;
  --paper-raised: #f8f9f5;
  --ink: #22251e;
  --ink-soft: #4e5348;
  --ink-faint: #6b7064;
  --rule: #cdd1c4;
  --blaze: #e2601a;
  --blaze-text: #b0470c;
  --olive: #5a6b4a;
  --olive-soft: #dfe4d5;
  --focus: #b0470c;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Avenir Next Condensed", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: 2.375rem;
  --step-4: clamp(2.6rem, 6.4vw, 4.6rem);

  --measure: 66ch;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1a1c17;
    --paper-raised: #23261f;
    --ink: #e8eae2;
    --ink-soft: #c2c6b8;
    --ink-faint: #9a9f91;
    --rule: #3a3e34;
    --blaze: #f07a3a;
    --blaze-text: #f39058;
    --olive: #9db089;
    --olive-soft: #2c3326;
    --focus: #f39058;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

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

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

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--paper);
  z-index: 10;
}
.skip-link:focus { top: 1rem; }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-stretch: condensed;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); font-weight: 800; }
h2 { font-size: var(--step-3); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 700; letter-spacing: 0; }
p { margin: 0 0 1em; }
.lede { font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); max-width: 36ch; }

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

.site-header {
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-stretch: condensed;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}
.brand img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 22%;
  box-shadow: 0 0 0 1px var(--rule);
}
.site-nav ul {
  display: flex;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: var(--step--1);
  font-weight: 600;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--blaze); }

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

.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 4rem); }
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero h1 { max-width: 13ch; }
.beta-note {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.55rem 0.9rem 0.55rem 0.75rem;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--blaze);
  background: var(--paper-raised);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink-soft);
}
.beta-note strong { color: var(--ink); margin-right: 0.35rem; }

/* ---------- Phone frame ---------- */

.phone {
  margin: 0;
  width: min(100%, 18rem);
  justify-self: center;
  padding: 0.6rem;
  border-radius: 2.4rem;
  background: var(--ink);
  box-shadow: 0 1.5rem 3rem -1.5rem rgb(34 37 30 / 0.55);
}
.phone img {
  width: 100%;
  aspect-ratio: 590 / 1278;
  object-fit: cover;
  border-radius: 1.85rem;
  background: var(--olive-soft);
}
.phone figcaption {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@media (prefers-color-scheme: dark) {
  .phone { background: #0d0e0b; box-shadow: 0 0 0 1px var(--rule); }
}

/* ---------- Ladder strip (signature element) ---------- */

.ladder {
  border-block: 1px solid var(--rule);
  background: var(--paper-raised);
  padding: clamp(2rem, 5vw, 3.5rem) 0;
}
.ladder .wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.ladder h2 { font-size: var(--step-2); }
.ladder p { color: var(--ink-soft); max-width: 44ch; }
.ladder-chart { color: var(--ink-faint); margin: 0; }
.ladder-chart .grid line { stroke: var(--rule); stroke-width: 1; }
.ladder-chart .axis text,
.ladder-chart .vel text {
  fill: var(--ink-faint);
  font: 600 13px var(--font-sans);
  font-variant-numeric: tabular-nums;
}
.ladder-chart .vel text { fill: var(--ink-soft); }
.ladder-chart .trace { fill: none; stroke: var(--ink-soft); stroke-width: 2.5; }
.ladder-chart .pt { fill: var(--paper-raised); stroke: var(--ink); stroke-width: 2.5; }
.ladder-chart .node-band { fill: var(--blaze); opacity: 0.14; }
@media (prefers-color-scheme: dark) { .ladder-chart .node-band { opacity: 0.1; } }
.ladder-chart .node-pt { fill: var(--blaze); stroke: var(--blaze); }
.ladder-chart .node-label { fill: var(--blaze-text); font: 700 13px var(--font-sans); }
.chart-note { font-size: var(--step--1); color: var(--ink-faint); margin-top: 0.5rem; }

/* ---------- Features ---------- */

.features { padding: clamp(3rem, 7vw, 5.5rem) 0 1rem; }
.features-intro { max-width: var(--measure); margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.features-intro p { color: var(--ink-soft); font-size: var(--step-1); line-height: 1.45; }

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16rem;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(2rem, 5vw, 3.5rem) 0;
  border-top: 1px solid var(--rule);
}
.feature:nth-of-type(even) { grid-template-columns: 16rem minmax(0, 1fr); }
.feature:nth-of-type(even) .feature-text { order: 2; }
.feature .phone { width: 100%; }
.feature-text { max-width: 40rem; }
.feature-text h2 { font-size: var(--step-2); }
.feature-text > p { color: var(--ink-soft); }
.feature ul {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.5rem 1.75rem;
}
.feature li {
  position: relative;
  padding-left: 1.1rem;
  font-size: var(--step--1);
  line-height: 1.5;
}
.feature li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.45rem;
  height: 0.45rem;
  border: 2px solid var(--olive);
  border-radius: 50%;
}

/* ---------- Local-first band ---------- */

.local {
  margin-top: clamp(2rem, 5vw, 3rem);
  background: var(--olive);
  color: #f4f6ef;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}
.local h2 { max-width: 20ch; }
.local-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.5rem 2.5rem;
  margin-top: 1.5rem;
}
.local-grid h3 { font-size: var(--step-0); font-family: var(--font-sans); margin-bottom: 0.35rem; }
.local-grid p { font-size: var(--step--1); margin: 0; opacity: 0.92; }
.local a { color: inherit; }
.local-more { margin: 2rem 0 0; }
.help-more { margin-top: 3rem; }
@media (prefers-color-scheme: dark) {
  .local { background: #2f3828; }
}

/* ---------- Safety ---------- */

.safety { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.safety-box {
  border: 2px solid var(--blaze);
  padding: clamp(1.25rem, 3vw, 2rem);
  max-width: 52rem;
  background: var(--paper-raised);
}
.safety-box h2 { font-size: var(--step-1); font-family: var(--font-sans); font-stretch: normal; }
.safety-box p { margin-bottom: 0.6em; }
.safety-box p:last-child { margin-bottom: 0; }

/* ---------- Document pages (privacy, terms, support, help) ---------- */

.doc { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 7vw, 5rem); }
.doc-body { max-width: var(--measure); }
.doc h1 { font-size: var(--step-3); }
.doc h2 {
  font-size: var(--step-1);
  font-family: var(--font-sans);
  font-stretch: normal;
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.doc h3 { font-family: var(--font-sans); font-stretch: normal; font-size: var(--step-0); margin-top: 1.5rem; }
.doc ul, .doc ol { padding-left: 1.25rem; margin: 0 0 1em; }
.doc li { margin-bottom: 0.4em; }
.doc-meta { color: var(--ink-faint); font-size: var(--step--1); }
.doc .callout {
  border-left: 4px solid var(--blaze);
  background: var(--paper-raised);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.doc .callout p:last-child { margin-bottom: 0; }
.toc {
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 0;
  font-size: var(--step--1);
}
.toc ol,
.toc ul { margin: 0.25rem 0 0; columns: 2 14rem; column-gap: 2rem; }
.toc ul { list-style: none; padding-left: 0; }
.toc li { margin-bottom: 0.2em; break-inside: avoid; }

.email-big {
  display: inline-block;
  font-family: var(--font-display);
  font-stretch: condensed;
  font-weight: 800;
  font-size: var(--step-2);
  margin: 0.25rem 0 1rem;
  overflow-wrap: anywhere;
}

/* ---------- Help / video slots ---------- */

.doc .lessons { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 2.5rem; }
.lesson {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 2rem;
  align-items: start;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}
.lesson h2 { margin-top: 0; padding-top: 0; border-top: 0; }
.video-slot {
  aspect-ratio: 9 / 16;
  width: min(100%, 13rem);
  justify-self: start;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  border: 2px dashed var(--rule);
  border-radius: 1rem;
  background: var(--paper-raised);
  color: var(--ink-faint);
  font-size: var(--step--1);
  font-weight: 600;
}
.video-slot svg { width: 2.5rem; margin: 0 auto 0.5rem; color: var(--olive); }

/* ---------- 404 ---------- */

.notfound { padding: clamp(4rem, 12vw, 8rem) 0; }
.notfound h1 { font-size: var(--step-3); }

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 2.5rem;
  font-size: var(--step--1);
  color: var(--ink-faint);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer a { color: var(--ink-soft); }
.site-footer p { margin: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 52rem) {
  .hero .wrap,
  .ladder .wrap { grid-template-columns: 1fr; }
  .hero .phone { width: min(70%, 16rem); }
  .feature,
  .feature:nth-of-type(even) { grid-template-columns: 1fr; }
  .feature:nth-of-type(even) .feature-text { order: 0; }
  .feature .phone { width: min(70%, 15rem); }
  .lesson { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  .ladder-chart .trace {
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    animation: draw 1.4s 0.2s ease-out forwards;
  }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}

@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  body { background: #fff; color: #000; }
}
