/* applicai — public site
   Plain CSS. No framework, no build step, no external fonts, no third-party assets. */

/* ---------- Tokens ---------- */

:root {
  --accent:        #17697a;
  --accent-strong: #11515e;
  --accent-tint:   #f0f7f8;

  --ink:      #1b2227;
  --ink-soft: #55616b;
  --rule:     #dde3e6;
  --bg:       #ffffff;
  --bg-soft:  #f6f8f9;

  --measure: 68ch;
  --shell:   72rem;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent:        #58b8c9;
    --accent-strong: #8ed3df;
    --accent-tint:   #16262b;

    --ink:      #e8edf0;
    --ink-soft: #a8b4bc;
    --rule:     #2c363c;
    --bg:       #12181c;
    --bg-soft:  #171f24;
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 650;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: clamp(1.75rem, 1.25rem + 2vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.6rem); margin-top: 2.5rem; }
h3 { font-size: 1.125rem; margin-top: 2rem; }
h4 { font-size: 1rem;     margin-top: 1.5rem; }

p, ul, ol, dl { margin: 0 0 1.15rem; }
ul, ol { padding-left: 1.35rem; }
li { margin-bottom: 0.5rem; }
li > ul, li > ol { margin-top: 0.5rem; }

strong { font-weight: 650; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}
a:hover { color: var(--accent-strong); }

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

/* Programmatic focus on <main> should not draw a ring. */
main:focus { outline: none; }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  background: var(--bg);
  color: var(--accent);
  padding: 0.75rem 1rem;
  border: 2px solid var(--accent);
  border-radius: 0 0 4px 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Shell ---------- */

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

.prose { max-width: var(--measure); }

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

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.75rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }

/* The mark is decorative (alt=""), so the link's name comes from the text beside it. */
.brand-mark {
  width: 28px;
  height: 28px;
  display: block;
  flex-shrink: 0;
}

.site-nav {
  margin-left: auto;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav li { margin: 0; }
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  display: inline-block;
  padding-block: 0.15rem;
}
.site-nav a:hover { color: var(--accent); text-decoration: underline; }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* Log in: the one way from the site to the app. Same type as the nav, outlined in the accent so it
   reads as a control rather than another page. The icon is inline SVG, so it costs no request. */
.login {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.login:hover {
  background: var(--accent-tint);
  color: var(--accent-strong);
  border-color: var(--accent-strong);
}
.login-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  flex-shrink: 0;
}

/* Phones: brand and Log in share the top row; the page links drop to their own row below. */
@media (max-width: 40rem) {
  .login { order: 2; margin-left: auto; }
  .site-nav { order: 3; width: 100%; margin-left: 0; }
}

/* ---------- Main ---------- */

main {
  flex: 1 0 auto;
  padding-block: 2.75rem 4rem;
}

.page-title { margin-bottom: 0.35rem; }

.lede {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--ink);
  max-width: 60ch;
}

.meta {
  color: var(--ink-soft);
  font-size: 0.925rem;
  margin-bottom: 2rem;
}

section + section { margin-top: 0.5rem; }

/* ---------- Cards ---------- */

.cards {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}
.cards li {
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.25rem;
  background: var(--bg-soft);
}
.cards h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.cards p  { margin: 0; color: var(--ink-soft); }

/* ---------- Callout ---------- */

.callout {
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  background: var(--accent-tint);
  border-radius: 0 6px 6px 0;
  padding: 1.25rem 1.35rem 0.25rem;
  margin: 1.75rem 0;
  max-width: var(--measure);
}
.callout > :first-child { margin-top: 0; }
.callout h2, .callout h3 { margin-top: 0; }

/* ---------- Definition lists (HELP / STOP, contact blocks) ---------- */

dl.terms { margin-top: 1.25rem; }
dl.terms dt {
  font-weight: 650;
  margin-top: 1.25rem;
}
dl.terms dd {
  margin: 0.35rem 0 0;
  padding-left: 0;
}

.keyword {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95em;
  letter-spacing: 0.04em;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.05em 0.4em;
}

address {
  font-style: normal;
  line-height: 1.7;
}

/* ---------- Table of contents ---------- */

.toc {
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.1rem 1.35rem;
  background: var(--bg-soft);
  max-width: var(--measure);
  margin-bottom: 2.5rem;
}
.toc h2 {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.toc ol {
  margin: 0;
  padding-left: 1.25rem;
  columns: 2;
  column-gap: 2rem;
}
.toc li { margin-bottom: 0.3rem; break-inside: avoid; }

@media (max-width: 40rem) {
  .toc ol { columns: 1; }
}

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

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--rule);
  background: var(--bg-soft);
  padding-block: 2rem 2.5rem;
  font-size: 0.925rem;
  color: var(--ink-soft);
}
.site-footer p { margin-bottom: 0.75rem; }
.site-footer a { color: var(--accent); }

.footer-grid {
  display: grid;
  gap: 1.5rem 3rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-bottom: 1.5rem;
}
.footer-grid h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.6rem;
  color: var(--ink-soft);
}
.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-grid li { margin-bottom: 0.4rem; }

.colophon {
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
  margin: 0;
}

/* ---------- Print ---------- */

@media print {
  .skip-link, .site-nav, .login, .toc { display: none; }
  body { font-size: 11pt; color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
  .callout { border: 1pt solid #000; background: none; }
  main { padding-block: 0; }
}
