/* ============================================================================
   AppMama — site styles

   The page is dressed as a build log, because that is what the app produces.
   Rules: hairlines instead of shadows, sharp corners instead of rounded cards,
   a monospace grid for anything structural, and one accent colour used as
   punctuation rather than decoration. Same palette and fonts as the app itself
   (ui/theme/Theme.kt), fonts self-hosted so the page makes no third-party
   request — the privacy page would otherwise be lying.
   ========================================================================== */

/* ── Fonts ────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-var.woff2") format("woff2-variations");
  font-weight: 300 700; font-style: normal; font-display: swap;
}

/* ── Tokens ───────────────────────────────────────────────────────────────── */

:root {
  --ink:        #060a07;   /* near-black with a green undertone */
  --ink-2:      #040705;
  --panel:      #0d130e;
  --panel-2:    #080d09;
  --edge:       #1b2a1d;   /* hairline */
  --edge-soft:  #121c14;
  --phos:       #4af078;   /* CRT green */
  --phos-dim:   #37955a;   /* lifted from the app's #2a7a44, same reason */
  --amber:      #ffb454;
  --fog:        #a8b8aa;   /* body text */
  --fog-hi:     #d7e3d8;
  --fog-dim:    #5c6b5e;
  --alarm:      #ff5d5d;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;

  --gutter: clamp(20px, 4.2vw, 56px);
  --rail: 138px;
  --measure: 62ch;
}

/* ── Reset-ish ────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--fog);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { max-width: 100%; }
a { color: var(--phos); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--phos); color: var(--ink); }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--phos); color: var(--ink);
  padding: 10px 16px; font: 700 12px/1 var(--mono); letter-spacing: 1.5px;
}
.skip:focus { left: 0; }

/* ── Shared primitives ────────────────────────────────────────────────────── */

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

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.dim  { color: var(--fog-dim); }
.hi   { color: var(--phos); }
.warn { color: var(--amber); }
.bad  { color: var(--alarm); }

.lede {
  font-size: clamp(17px, 1.9vw, 20px);
  line-height: 1.62;
  color: var(--fog);
  max-width: 54ch;
}

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

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  letter-spacing: 1.8px; text-transform: uppercase;
  padding: 14px 20px;
  border: 1px solid var(--phos);
  color: var(--ink); background: var(--phos);
  transition: background .16s linear, color .16s linear, border-color .16s linear;
}
.btn:hover { background: transparent; color: var(--phos); text-decoration: none; }
.btn--ghost {
  background: transparent; color: var(--fog); border-color: var(--edge);
}
.btn--ghost:hover { color: var(--phos); border-color: var(--phos-dim); background: transparent; }
.btn__k { opacity: .6; }
/* A button-shaped label for something you cannot click yet. */
.btn--soon {
  background: transparent; color: var(--phos);
  border-color: var(--phos-dim); cursor: default;
}
.btn--soon::before { content: "● "; opacity: .7; }

/* ── Header ───────────────────────────────────────────────────────────────── */

.top {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--edge);
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(10px);
}
.top__in {
  display: flex; align-items: center; gap: 24px;
  height: 58px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--fog-hi); }
.brand:hover { text-decoration: none; }
.brand svg { width: 21px; height: 21px; display: block; }
.brand b { font: 700 14px/1 var(--mono); letter-spacing: -.2px; }
.brand span { font: 400 11px/1 var(--mono); color: var(--fog-dim); letter-spacing: 1px; }

.top nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.top nav a {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--fog-dim);
}
.top nav a:hover { color: var(--phos); text-decoration: none; }
.top .btn { padding: 9px 14px; font-size: 11px; }
@media (max-width: 860px) { .top nav a.opt { display: none; } }
@media (max-width: 520px) { .brand span { display: none; } }

/* ── The rail: section nav, driven by scroll position ─────────────────────── */

.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: clamp(24px, 3.5vw, 56px);
}
@media (max-width: 1080px) { .shell { grid-template-columns: minmax(0, 1fr); } }

.rail { position: relative; }
.rail__in {
  position: sticky; top: 58px;
  height: calc(100vh - 58px);
  padding: 40px 0 40px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--edge-soft);
}
@media (max-width: 1080px) { .rail { display: none; } }

.rail__steps { list-style: none; margin: 0; padding: 0; }
.rail__steps li { margin-bottom: 2px; }
.rail__steps a {
  display: grid; grid-template-columns: 22px 1fr; gap: 8px;
  padding: 5px 0;
  font: 400 10px/1.4 var(--mono); letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--fog-dim);
  border-left: 1px solid transparent; padding-left: 10px; margin-left: -11px;
}
.rail__steps a:hover { color: var(--fog); text-decoration: none; }
.rail__steps a[aria-current="true"] {
  color: var(--phos);
  border-left-color: var(--phos);
}
.rail__steps a[aria-current="true"] .n { color: var(--phos); }
.rail__steps .n { color: var(--fog-dim); opacity: .5; }

.rail__foot { margin-top: auto; font: 400 10px/1.7 var(--mono); letter-spacing: 1.2px; color: var(--fog-dim); }

/* Mobile: the rail collapses to a hairline progress bar under the header. */
.scrollbar {
  position: fixed; top: 58px; left: 0; right: 0; height: 1px; z-index: 49;
  background: transparent; display: none;
}
.scrollbar i { display: block; height: 100%; width: 0; background: var(--phos); }
@media (max-width: 1080px) { .scrollbar { display: block; } }

/* ── Section headers ──────────────────────────────────────────────────────── */

section { scroll-margin-top: 72px; }

.sec {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 30px;
  font: 700 11px/1 var(--mono); letter-spacing: 2px; text-transform: uppercase;
  color: var(--fog-hi);
}
.sec .n { color: var(--phos); }
.sec::after {
  content: ""; flex: 1 1 auto; height: 1px; background: var(--edge);
}

.band { padding: clamp(64px, 9vw, 128px) 0; border-top: 1px solid var(--edge-soft); }
.band:first-of-type { border-top: 0; }

h2.head {
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(28px, 4.2vw, 46px);
  line-height: 1.06; letter-spacing: -.03em;
  color: var(--fog-hi);
  margin: 0 0 18px;
  max-width: 20ch;
}
h3.sub {
  font: 700 13px/1.4 var(--mono); letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--fog-hi); margin: 0 0 10px;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero { position: relative; padding: clamp(52px, 8vw, 104px) 0 clamp(48px, 6vw, 80px); }
.hero::before {
  content: ""; position: absolute; inset: -120px 0 auto 0; height: 620px;
  background: radial-gradient(78% 52% at 24% 12%, rgba(74,240,120,.115), transparent 68%);
  pointer-events: none; z-index: -1;
}

.eyebrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  font: 400 11px/1 var(--mono); letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--fog-dim); margin-bottom: 26px;
}
.eyebrow .dot { color: var(--phos); }
.eyebrow s { text-decoration: none; color: var(--edge); }

h1 {
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(40px, 7vw, 92px);
  line-height: .96; letter-spacing: -.045em;
  color: var(--fog-hi);
  margin: 0 0 clamp(26px, 3.6vw, 44px);
}
h1 em { font-style: normal; color: var(--phos); }

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero__note { margin-top: 16px; font: 400 11px/1.7 var(--mono); letter-spacing: 1.1px; color: var(--fog-dim); }

.hero__grid {
  display: grid; grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr);
  gap: clamp(28px, 4vw, 56px); align-items: start;
}
@media (max-width: 940px) { .hero__grid { grid-template-columns: minmax(0, 1fr); } }

/* ── Phone screenshots ────────────────────────────────────────────────────── */

.phone {
  margin: 0;
  position: relative;
}
.phone img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--edge);
  border-radius: 18px;
  background: var(--panel-2);
  box-shadow: 0 0 0 1px rgba(74,240,120,.04), 0 30px 90px -50px rgba(74,240,120,.55);
}
.phone figcaption {
  margin-top: 14px;
  font: 400 11.5px/1.6 var(--mono); letter-spacing: .8px;
  color: var(--fog-dim);
}
/* The hero shot is a single tall phone; cap it so it never dwarfs the copy. */
.hero .phone { max-width: 316px; margin-inline: auto; }

/* ── Statement band ───────────────────────────────────────────────────────── */

.statement {
  font-family: var(--sans); font-weight: 300;
  font-size: clamp(26px, 4.4vw, 52px);
  line-height: 1.16; letter-spacing: -.03em;
  color: var(--fog-hi);
  max-width: 24ch;
  margin: 0;
}
.statement b { font-weight: 700; color: var(--phos); }
.statement__foot {
  margin-top: 28px; max-width: 46ch;
  font: 400 12px/1.85 var(--mono); color: var(--fog-dim); letter-spacing: .3px;
}

.claim {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .6fr);
  gap: clamp(28px, 4vw, 72px); align-items: end;
}
@media (max-width: 900px) { .claim { grid-template-columns: minmax(0, 1fr); align-items: start; } }
.claim .statement__foot { margin-top: 0; }

/* ── Two-column layout used by most sections ──────────────────────────────── */

.cols {
  display: grid; grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr);
  gap: clamp(28px, 4vw, 64px); align-items: start;
}
@media (max-width: 900px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.cols p { max-width: var(--measure); }

/* Where the right column is much taller, the left one rides along with it. */
@media (min-width: 901px) {
  .cols--sticky > :first-child { position: sticky; top: 96px; align-self: start; }
}

/* ── Steps list ───────────────────────────────────────────────────────────── */

.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px;
  padding: 18px 0; border-top: 1px solid var(--edge-soft);
}
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps li::before {
  counter-increment: s; content: counter(s, decimal-leading-zero);
  font: 700 11px/1.9 var(--mono); letter-spacing: 1.5px; color: var(--phos-dim);
}
.steps h4 {
  margin: 0 0 4px; font: 700 13px/1.5 var(--mono);
  letter-spacing: 1.1px; text-transform: uppercase; color: var(--fog-hi);
}
.steps p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--fog); }
.steps code { font-size: 12.5px; }

/* ── Code blocks ──────────────────────────────────────────────────────────── */

code {
  font-family: var(--mono); font-size: .86em;
  color: var(--fog-hi); background: var(--panel);
  border: 1px solid var(--edge-soft); padding: .1em .4em;
}
pre {
  margin: 0; overflow-x: auto;
  border: 1px solid var(--edge); background: var(--panel-2);
  padding: 18px clamp(14px, 2vw, 20px);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.8;
  color: var(--fog);
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
pre .c { color: var(--fog-dim); }
pre .g { color: var(--phos); }
pre .a { color: var(--amber); }
pre .r { color: var(--alarm); }
pre .w { color: var(--fog-hi); }

.pre-label {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--edge); border-bottom: 0; background: var(--panel);
  padding: 8px 14px;
  font: 400 10px/1 var(--mono); letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--fog-dim);
}
.pre-label + pre { border-top: 0; }

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

.tbl-scroll { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
}
th, td { text-align: left; padding: 13px 18px 13px 0; vertical-align: top; }
thead th {
  font-size: 10px; letter-spacing: 1.7px; text-transform: uppercase;
  color: var(--fog-dim); font-weight: 400;
  border-bottom: 1px solid var(--phos-dim); padding-bottom: 9px;
}
tbody tr { border-bottom: 1px solid var(--edge-soft); }
tbody th { font-weight: 700; color: var(--fog-hi); white-space: nowrap; }
td { color: var(--fog); }
td .dim { display: block; margin-top: 3px; }

/* Spec list (label / value pairs) ------------------------------------------ */
.spec { margin: 0; display: grid; grid-template-columns: 190px minmax(0, 1fr); }
@media (max-width: 640px) { .spec { grid-template-columns: minmax(0, 1fr); } }
.spec dt {
  padding: 13px 20px 13px 0; border-top: 1px solid var(--edge-soft);
  font: 400 10px/1.7 var(--mono); letter-spacing: 1.7px; text-transform: uppercase;
  color: var(--fog-dim);
}
.spec dd {
  margin: 0; padding: 13px 0; border-top: 1px solid var(--edge-soft);
  font-family: var(--mono); font-size: 13px; color: var(--fog-hi);
}
@media (max-width: 640px) {
  .spec dt { border-top: 1px solid var(--edge-soft); padding-bottom: 0; }
  .spec dd { border-top: 0; padding-top: 4px; }
}
.spec dd small { display: block; color: var(--fog-dim); font-size: 11.5px; letter-spacing: .2px; }

/* ── Caveats ──────────────────────────────────────────────────────────────── */

.caveats { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--edge-soft); }
.caveats li { background: var(--ink); padding: 20px 0 20px 22px; border-left: 2px solid var(--amber); }
.caveats h4 {
  margin: 0 0 6px; font: 700 12px/1.5 var(--mono); letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--amber);
}
.caveats p { margin: 0; max-width: var(--measure); font-size: 15.5px; color: var(--fog); }
.caveats p + p { margin-top: 8px; }

/* ── Privacy at a glance ──────────────────────────────────────────────────── */

.claims { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 18px; }
.claims li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; }
.claims .m { color: var(--phos); font: 700 14px/1.5 var(--mono); }
.claims b { display: block; color: var(--fog-hi); font-family: var(--sans); font-weight: 700; font-size: 17px; }
.claims span { font-size: 15.5px; }

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

.foot { border-top: 1px solid var(--edge); padding: 48px 0 60px; margin-top: 40px; }
.foot__grid {
  display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 32px;
}
@media (max-width: 760px) { .foot__grid { grid-template-columns: minmax(0, 1fr); } }
.foot h6 {
  margin: 0 0 14px; font: 400 10px/1 var(--mono); letter-spacing: 1.8px;
  text-transform: uppercase; color: var(--fog-dim);
}
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 9px; }
.foot li a { font: 400 12px/1.5 var(--mono); color: var(--fog); }
.foot li a:hover { color: var(--phos); }
.foot__legal { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--edge-soft); }
.foot__legal p {
  margin: 0 0 8px; max-width: 78ch;
  font: 400 11px/1.85 var(--mono); letter-spacing: .2px; color: var(--fog-dim);
}

/* ── Document pages (privacy, terms) ──────────────────────────────────────── */

.doc { padding: clamp(44px, 6vw, 80px) 0 40px; max-width: 74ch; }
.doc h1 {
  font-size: clamp(34px, 5.2vw, 56px); margin-bottom: 14px; letter-spacing: -.04em;
}
.doc__meta {
  font: 400 11px/1.9 var(--mono); letter-spacing: 1.3px; text-transform: uppercase;
  color: var(--fog-dim); margin: 0 0 34px; padding-bottom: 26px;
  border-bottom: 1px solid var(--edge);
}
.doc h2 {
  display: flex; align-items: baseline; gap: 12px;
  margin: 52px 0 16px;
  font-family: var(--sans); font-weight: 700; font-size: clamp(21px, 2.6vw, 27px);
  letter-spacing: -.02em; color: var(--fog-hi);
}
.doc h2 .n { font: 700 12px/1 var(--mono); letter-spacing: 1.5px; color: var(--phos); flex: none; }
.doc h3 {
  margin: 30px 0 10px;
  font: 700 12px/1.5 var(--mono); letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--fog-hi);
}
.doc p, .doc li { font-size: 16.5px; line-height: 1.72; }
.doc p { margin: 0 0 16px; }
.doc ul { margin: 0 0 18px; padding-left: 0; list-style: none; }
.doc ul li { position: relative; padding-left: 22px; margin-bottom: 10px; }
.doc ul li::before {
  content: "—"; position: absolute; left: 0; top: 0;
  color: var(--phos-dim); font-family: var(--mono); font-size: 13px;
}
.doc table { margin: 6px 0 24px; }
.doc .callout {
  border-left: 2px solid var(--phos); background: var(--panel-2);
  padding: 16px 20px; margin: 0 0 24px;
}
.doc .callout p:last-child { margin-bottom: 0; }
.doc .callout--warn { border-left-color: var(--amber); }

.toc { border: 1px solid var(--edge); padding: 20px 22px; margin: 0 0 40px; background: var(--panel-2); }
.toc h6 { margin: 0 0 12px; font: 400 10px/1 var(--mono); letter-spacing: 1.8px; text-transform: uppercase; color: var(--fog-dim); }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: t;
  columns: 2; column-gap: 28px; }
@media (max-width: 620px) { .toc ol { columns: 1; } }
.toc li { margin-bottom: 7px; break-inside: avoid; }
.toc a { font: 400 12px/1.5 var(--mono); color: var(--fog); }
.toc a::before { counter-increment: t; content: counter(t, decimal-leading-zero) "  "; color: var(--phos-dim); }
.toc a:hover { color: var(--phos); }

/* Placeholder the maintainer must replace before publishing. */
.todo {
  color: var(--amber); border-bottom: 1px dashed var(--amber);
  font-family: var(--mono); font-size: .9em;
}

/* ── Print ────────────────────────────────────────────────────────────────── */

@media print {
  :root { --ink: #fff; --fog: #222; --fog-hi: #000; --fog-dim: #555; --edge: #ccc; --edge-soft: #e5e5e5; --phos: #0a6b30; --phos-dim: #0a6b30; }
  body { background: #fff; color: #222; }
  .top, .rail, .scrollbar, .hero::before { display: none !important; }
  .doc { max-width: none; }
  a { color: #0a6b30; }
}
