/* Ternaria — landing page
   Palette is defined light-first on :root, overridden for dark. */

:root {
  --bg:        #fbfbfa;
  --bg-raised: #ffffff;
  --fg:        #16171a;
  --fg-muted:  #5c6069;
  --fg-faint:  #8a8f99;
  --line:      #e3e3e0;
  --accent:    #0f6f5c;
  --accent-fg: #ffffff;
  --neg:       #b4453a;
  --zero:      #8a8f99;
  --pos:       #0f6f5c;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
          "Helvetica Neue", Arial, sans-serif;

  --measure: 68ch;
  --page: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0e0f11;
    --bg-raised: #16181b;
    --fg:        #e9eaec;
    --fg-muted:  #a0a5ad;
    --fg-faint:  #6d727b;
    --line:      #26292e;
    --accent:    #4ec9a8;
    --accent-fg: #0e0f11;
    --neg:       #e8776a;
    --zero:      #6d727b;
    --pos:       #4ec9a8;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--page);
  margin: 0 auto;
  padding: 1.5rem 1.5rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg);
  text-decoration: none;
}
.wordmark::before {
  content: "▚ ";
  color: var(--accent);
}

.topbar nav { display: flex; gap: 1.5rem; }
.topbar nav a {
  font-size: 0.9rem;
  color: var(--fg-muted);
  text-decoration: none;
}
.topbar nav a:hover { color: var(--fg); }

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

main {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}

section { padding: 4.5rem 0; }
section + section { border-top: 1px solid var(--line); }

h1, h2, h3 { line-height: 1.25; text-wrap: balance; }

h2 {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-faint);
  margin: 0 0 1.75rem;
}

/* ---------- hero ---------- */

.hero { padding-top: 3rem; }

.trits {
  font-family: var(--mono);
  font-size: 2rem;
  letter-spacing: 0.35em;
  margin-bottom: 1.75rem;
  user-select: none;
}
.trits .t-neg  { color: var(--neg); }
.trits .t-zero { color: var(--zero); }
.trits .t-pos  { color: var(--pos); }

.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  font-weight: 650;
  letter-spacing: -0.022em;
  margin: 0 0 1.5rem;
  max-width: 22ch;
}

.lede {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--fg-muted);
  max-width: var(--measure);
  margin: 0 0 2rem;
}
.lede em { color: var(--fg); font-style: italic; }

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--fg-muted);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  margin: 0;
}
.status-line .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* ---------- why ---------- */

.section-lede {
  font-size: 1.1rem;
  max-width: var(--measure);
  margin: 0 0 2.5rem;
  color: var(--fg-muted);
}
.section-lede strong { color: var(--fg); font-weight: 600; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.cards article {
  background: var(--bg-raised);
  padding: 1.75rem;
}
.cards h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
  letter-spacing: -0.01em;
}
.cards p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--fg-muted);
}

.footnote {
  margin: 2rem 0 0;
  font-size: 0.9rem;
  color: var(--fg-faint);
  font-family: var(--mono);
  max-width: var(--measure);
}

/* ---------- pillars ---------- */

.pillar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2.75rem;
}
.pillar-list li {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1rem;
  align-items: start;
}
.pillar-list .num {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  padding-top: 0.35rem;
  letter-spacing: 0.05em;
}
.pillar-list h3 {
  font-size: 1.35rem;
  font-weight: 620;
  letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
}
.pillar-list p {
  margin: 0;
  color: var(--fg-muted);
  max-width: var(--measure);
}

/* Closing claim for the pillars section — a statement of ambition, not a
   footnote, so it reads at full weight rather than faint small print. */
.also {
  margin: 3rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  font-size: 1.1rem;
  color: var(--fg-muted);
  max-width: var(--measure);
}
.also em {
  color: var(--fg);
  font-style: italic;
}

/* ---------- cta ---------- */

.cta p {
  max-width: var(--measure);
  color: var(--fg-muted);
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}
.btn {
  display: inline-block;
  padding: 0.65rem 1.35rem;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--fg);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}
.btn:hover { border-color: var(--fg-faint); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.btn.primary:hover { opacity: 0.9; }

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

footer {
  max-width: var(--page);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--fg-faint);
}
footer p { margin: 0; }

/* ---------- small screens ---------- */

@media (max-width: 34rem) {
  body { font-size: 16px; }
  section { padding: 3rem 0; }
  .pillar-list li { grid-template-columns: 1fr; gap: 0.35rem; }
  .pillar-list .num { padding-top: 0; }
}
