/*
 * aptivus.io — the public site (docs/ENVIRONMENTS.md). Plain HTML and this one
 * stylesheet, no build and no script, so the strict CSP in vercel.json holds.
 *
 * The values are the app's (packages/ui/src/tokens.css): warm-white light
 * neutrals at 6400 K (D-064), an ink accent, colour only for status, Geist.
 * The home page is one narrow column of quiet type; its only drawing is done
 * with a pen — the mark sketching its own outline before it inks in, and a
 * scribbled underline — so the motion is two lines being drawn, nothing more.
 */

@font-face { font-family: "Geist"; src: url("/fonts/Geist-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/Geist-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/Geist-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: light dark;
  --page: #faf8f3;
  --card: #fffdf8;
  --subtle: #f4f2ed;
  --fg: #09090b;
  --fg-muted: #4b4a51;
  --fg-subtle: #75747a;
  --fg-faint: #b3b1b0;
  --line: #ebe9e4;
  --border: #e2e0df;
  --border-strong: #cfcdca;
  --live: #18a058;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e0e10;
    --card: #161619;
    --subtle: #1f1f23;
    --fg: #fafafa;
    --fg-muted: #a8a8b2;
    --fg-subtle: #85858f;
    --fg-faint: #4a4a52;
    --line: #232328;
    --border: #2a2a2f;
    --border-strong: #3a3a41;
    --live: #3dd68c;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--fg);
  font: 400 15px/1.6 var(--sans);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
p { margin: 0; }
::selection { background: var(--fg); color: var(--page); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 4px; }

/* ---- Home ----------------------------------------------------------------- */

.col { width: 100%; max-width: 35rem; margin: 0 auto; padding-inline: 24px; }
@media (max-width: 520px) { .col { padding-inline: 20px; } }

.intro { flex: 1; padding-top: clamp(3.5rem, 15vh, 10rem); padding-bottom: 3.5rem; }

.who { display: flex; align-items: center; gap: 14px; }
.who .name { font-weight: 500; line-height: 1.35; letter-spacing: -0.015em; }
.who .when { display: flex; align-items: center; gap: 7px; color: var(--fg-subtle); font-size: 14px; line-height: 1.4; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 18%, transparent); }

.mark { flex: none; overflow: visible; }
.sketch { width: 34px; height: 34px; color: var(--fg); }
.sketch path {
  fill: currentColor;
  fill-opacity: 0;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 760ms var(--ease-in-out) 120ms forwards, ink 360ms ease-out 760ms forwards;
}
.sketch path + path { animation-delay: 300ms, 900ms; }

.title {
  margin: 3.25rem 0 0;
  font-weight: 500;
  font-size: clamp(1.9rem, 1.45rem + 1.9vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.scribble { position: relative; display: inline-block; }
.scribble svg {
  position: absolute;
  left: -7%;
  bottom: -0.3em;
  width: 114%;
  height: 0.5em;
  overflow: visible;
  pointer-events: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
}
.scribble path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 640ms var(--ease-in-out) 900ms forwards; }
.scribble path + path { animation-duration: 440ms; animation-delay: 1400ms; }

.lede { max-width: 29rem; margin-top: 1.6rem; color: var(--fg-muted); font-size: 16px; line-height: 1.65; text-wrap: pretty; }

.ways { margin: 2.5rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.ways a {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.ways .k { font-weight: 500; }
.ways .v { color: var(--fg-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color 160ms ease; }
.ways .go { color: var(--fg-faint); transition: transform 200ms var(--ease-out), color 160ms ease; }
@media (hover: hover) {
  .ways a:hover .v { color: var(--fg); }
  .ways a:hover .go { color: var(--fg); transform: translateX(3px); }
}
@media (max-width: 420px) { .ways a { grid-template-columns: 6.5rem minmax(0, 1fr) auto; } }

/* A short rule rather than a full one, the way a letter is signed off. */
.end { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.75rem; padding-bottom: 2.5rem; color: var(--fg-subtle); font-size: 13px; }
.end::before { content: ""; position: absolute; top: 0; left: 24px; width: 3rem; height: 1px; background: var(--border-strong); }
@media (max-width: 520px) { .end::before { left: 20px; } }
.end nav { display: flex; gap: 1.25rem; }
.end a { text-decoration: none; }
.end a:hover { color: var(--fg); }

/* Each block arrives a beat after the one above it. */
.s1, .s2, .s3, .s4, .s5 { animation: rise 600ms var(--ease-out) both; }
.s2 { animation-delay: 60ms; }
.s3 { animation-delay: 120ms; }
.s4 { animation-delay: 180ms; }
.s5 { animation-delay: 260ms; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); filter: blur(2px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes ink { to { fill-opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .s1, .s2, .s3, .s4, .s5 { animation: none; }
  .sketch path, .scribble path { animation: none; stroke-dashoffset: 0; }
  .sketch path { fill-opacity: 1; }
  .ways .go { transition: none; }
}

/* ---- Policy pages ----------------------------------------------------------- */

.wrap { width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 24px; }
@media (max-width: 520px) { .wrap { padding: 0 20px; } }

.top { display: flex; align-items: center; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; letter-spacing: -0.015em; text-decoration: none; }
.brand .mark { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; stroke-width: 3; stroke-linejoin: round; }

main:not(.intro) { flex: 1; }
.doc { padding: 40px 0 88px; }
.doc .back { display: inline-flex; gap: 6px; margin-bottom: 32px; color: var(--fg-subtle); font-size: 14px; text-decoration: none; }
.doc .back:hover { color: var(--fg); }
.doc h1 { margin: 0; font-size: clamp(2rem, 1.6rem + 1.6vw, 2.6rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.035em; }
.doc .updated { margin: 14px 0 0; color: var(--fg-subtle); font: 400 12px/1.4 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
.doc .summary { margin: 32px 0 8px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.doc .summary p { margin: 0; }
.doc h2 { margin: 2.4em 0 0.5em; font-size: 1.2rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.3; }
.doc h3 { margin: 1.6em 0 0.3em; font-size: 1rem; font-weight: 500; }
.doc p, .doc li, .doc td { color: var(--fg-muted); }
.doc p { margin: 0.8em 0; }
.doc strong { color: var(--fg); font-weight: 500; }
.doc ul { margin: 0.6em 0; padding-left: 1.25em; }
.doc li { margin: 0.4em 0; padding-left: 0.2em; }
.doc li::marker { color: var(--fg-faint); }
.doc a { text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.doc a:hover { text-decoration-color: currentColor; }
.doc code { padding: 1px 5px; border: 1px solid var(--border); border-radius: 5px; background: var(--subtle); color: var(--fg); font: 400 0.88em var(--mono); }
.doc table { width: 100%; margin: 1em 0; border-collapse: collapse; font-size: 15px; }
.doc th { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border-strong); color: var(--fg-subtle); font: 400 12px var(--mono); letter-spacing: 0.06em; text-align: left; text-transform: uppercase; }
.doc td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc td:first-child { color: var(--fg); }

.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 28px 0 36px; border-top: 1px solid var(--line); color: var(--fg-subtle); font-size: 13px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--fg); }
