/*
 * inverist — public site (root domain).
 *
 * Shared by the landing page and the legal pages. Self-contained: no web
 * fonts, no CDN, no third-party requests of any kind. That is a deliberate
 * constraint, not an oversight — the privacy notice states that the site
 * makes no third-party requests, and adding one would make it untrue.
 *
 * Brand tokens mirror _BRAND_CSS in serve_templates.py. Keep in sync.
 */

/* ------------------------------------------------------------------ tokens */

:root {
  --brand: #9a5033;
  --brand-strong: #83432b;
  --brand-soft: #faf1ec;
  --brand-border: rgba(154, 80, 51, .35);
  --brand-mark-fg: #ffffff;
  --btn-fg: #ffffff;

  --bg: #ffffff;
  --bg-alt: #faf8f7;
  --fg: #17120e;
  --muted: #6b6560;
  --rule: rgba(23, 18, 14, .12);

  --measure: 34rem;
  --radius: 7px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #cf8a66;
    --brand-strong: #c07a56;
    --brand-soft: #3d241a;
    --brand-border: rgba(207, 138, 102, .40);
    --brand-mark-fg: #17120e;
    --btn-fg: #17120e;

    --bg: #17120e;
    --bg-alt: #1e1814;
    --fg: #f3ece8;
    --muted: #a29892;
    --rule: rgba(243, 236, 232, .14);
  }
}

/* An explicit choice must beat the media query in both directions. */
:root[data-theme="light"] {
  --brand: #9a5033; --brand-strong: #83432b; --brand-soft: #faf1ec;
  --brand-border: rgba(154, 80, 51, .35);
  --brand-mark-fg: #ffffff; --btn-fg: #ffffff;
  --bg: #ffffff; --bg-alt: #faf8f7; --fg: #17120e; --muted: #6b6560;
  --rule: rgba(23, 18, 14, .12);
}
:root[data-theme="dark"] {
  --brand: #cf8a66; --brand-strong: #c07a56; --brand-soft: #3d241a;
  --brand-border: rgba(207, 138, 102, .40);
  --brand-mark-fg: #17120e; --btn-fg: #17120e;
  --bg: #17120e; --bg-alt: #1e1814; --fg: #f3ece8; --muted: #a29892;
  --rule: rgba(243, 236, 232, .14);
}

/* ------------------------------------------------------------------- reset */

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

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

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

a {
  color: var(--brand);
  text-underline-offset: .18em;
}
a:hover { color: var(--brand-strong); }

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

/* -------------------------------------------------------------- skip link */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: .6rem 1rem;
  background: var(--brand);
  color: var(--btn-fg);
  font-weight: 600;
  text-decoration: none;
  z-index: 10;
}
.skip:focus {
  left: .5rem;
  top: .5rem;
  color: var(--btn-fg);
}

/* ------------------------------------------------------------------ layout */

.wrap {
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main { flex: 1 0 auto; }

/* ------------------------------------------------------------------ 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;
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
}
.brand-mark { display: block; flex-shrink: 0; }
.brand-word {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--fg);
}

/* A status word in the header, not a link — there is nothing to click yet. */
.tag {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--brand);
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  padding: .3rem .75rem;
  white-space: nowrap;
}

/* -------------------------------------------------------------- buttons */

.btn {
  display: inline-block;
  padding: .6rem 1.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn-primary {
  background: var(--brand);
  color: var(--btn-fg);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--brand-strong);
  color: var(--btn-fg);
}
.btn-quiet {
  background: transparent;
  border-color: var(--rule);
  color: var(--fg);
}
.btn-quiet:hover, .btn-quiet:focus-visible {
  border-color: var(--brand);
  color: var(--fg);
}
.btn-lg { padding: .75rem 1.7rem; font-size: 1rem; }

/* --------------------------------------------------------------- landing */

.hero {
  padding: clamp(4rem, 16vh, 9rem) 0 clamp(3rem, 10vh, 5rem);
  text-align: center;
}
.hero .wordmark {
  margin: 0;
  font-size: clamp(2.4rem, 9vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1;
}
.hero .rule {
  width: 2.25rem;
  height: 2px;
  margin: 2.25rem auto;
  border: 0;
  background: var(--brand);
}
.hero .lede {
  max-width: var(--measure);
  margin: 0 auto;
  font-size: 1.05rem;
  color: var(--muted);
  text-wrap: balance;
}
.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: center;
  margin-top: 2.5rem;
}

.status-band {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--bg-alt);
  padding: 2.5rem 0;
}
.status-band dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.75rem;
  margin: 0;
}
.status-band dt {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: .3rem;
}
.status-band dd {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
}

/* ------------------------------------------------------------- principles */

.principles { padding: clamp(3rem, 9vh, 5rem) 0; }

.section-title {
  margin: 0 0 2rem;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.75rem;
}
.card {
  padding: 1.6rem 1.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-alt);
}
.card h3 {
  margin: 0 0 .6rem;
  font-size: 1.02rem;
  letter-spacing: -.01em;
}
.card h3::before {
  content: "";
  display: block;
  width: 1.4rem;
  height: 2px;
  margin-bottom: .9rem;
  background: var(--brand);
}
.card p {
  margin: 0;
  font-size: .94rem;
  color: var(--muted);
}

/* ------------------------------------------------------------ legal pages */

.doc {
  max-width: 44rem;
  margin: 0 auto;
  padding: 3.5rem 0 4.5rem;
}
.doc h1 {
  font-size: 1.85rem;
  letter-spacing: -.02em;
  margin: 0 0 .4rem;
}
.doc .meta {
  color: var(--muted);
  font-size: .87rem;
  margin: 0 0 2.5rem;
}
.doc h2 {
  font-size: 1.12rem;
  letter-spacing: -.01em;
  margin: 2.75rem 0 .6rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.doc h2:first-of-type { border-top: 0; padding-top: 0; }
.doc h3 {
  font-size: .98rem;
  margin: 1.75rem 0 .4rem;
}
.doc p, .doc li { color: var(--fg); }
.doc ul, .doc ol { padding-left: 1.25rem; }
.doc li { margin-bottom: .45rem; }
.doc dl { margin: 0 0 1.5rem; }
.doc dt { font-weight: 600; margin-top: 1rem; }
.doc dd { margin: 0; color: var(--muted); }

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: .93rem;
}
.doc th, .doc td {
  text-align: left;
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.doc th { font-weight: 600; }
.table-scroll { overflow-x: auto; }

.callout {
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: .95rem;
}
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* An unfilled deployment placeholder must be impossible to overlook. */
.todo {
  background: #ffe8e8;
  color: #8a1c1c;
  border-radius: 3px;
  padding: 0 .3em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  .todo { background: #4a1414; color: #ffbaba; }
}

/* ------------------------------------------------------------------ footer */

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--rule);
  padding: 2rem 0;
  font-size: .87rem;
  color: var(--muted);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.site-footer a {
  color: var(--muted);
  text-decoration: none;
}
.site-footer a:hover { color: var(--fg); text-decoration: underline; }
.site-footer .disclaimer {
  flex-basis: 100%;
  margin: 0;
  padding-top: .75rem;
  border-top: 1px solid var(--rule);
  font-size: .8rem;
  line-height: 1.55;
}

/* ------------------------------------------------------------------- misc */

.center { text-align: center; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
