/* Trigonify landing — dark-first, palette drawn from the app icon:
   teal ring #14B8A6 / #5EEAD4, amber marker #FBBF24, void #070809 */

:root {
  --bg: #070809;
  --bg-raised: #0d1214;
  --bg-inset: #0a0e10;
  --ink: #e8f4f2;
  --ink-soft: #9db4b0;
  --ink-faint: #5f7370;
  --teal: #5eead4;
  --teal-deep: #14b8a6;
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.14);
  --line: rgba(94, 234, 212, 0.16);
  --line-soft: rgba(94, 234, 212, 0.08);
  --glow: rgba(20, 184, 166, 0.22);
  --mono: "SF Mono", SFMono-Regular, ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-s: 6px;
  --radius-m: 14px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7faf9;
    --bg-raised: #ffffff;
    --bg-inset: #eef4f2;
    --ink: #10201d;
    --ink-soft: #40564f;
    --ink-faint: #6d827c;
    --teal: #0d9488;
    --teal-deep: #0f766e;
    --amber: #b45309;
    --amber-soft: rgba(180, 83, 9, 0.1);
    --line: rgba(15, 118, 110, 0.22);
    --line-soft: rgba(15, 118, 110, 0.1);
    --glow: rgba(13, 148, 136, 0.12);
    color-scheme: light;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1.0625rem;
  overflow-x: hidden;
}

/* graph-paper wash behind everything */
.paper {
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 44px 44px;
}

a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--amber); }

img { max-width: 100%; height: auto; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--amber); color: #070809; padding: 0.6rem 1rem;
  font-weight: 700; z-index: 99; border-radius: 0 0 var(--radius-s) 0;
}
.skip-link:focus { left: 0; }

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

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- header ---------- */
.site-head {
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}
.site-head .wrap {
  display: flex; align-items: center; gap: 0.75rem;
  min-height: 3.6rem;
}
.brand {
  display: flex; align-items: center; gap: 0.6rem;
  font-weight: 800; font-size: 1.15rem; color: var(--ink);
  text-decoration: none; letter-spacing: 0.01em;
}
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand:hover { color: var(--teal); }

.nav-toggle {
  margin-left: auto; display: none;
  background: none; border: 1px solid var(--line); border-radius: var(--radius-s);
  color: var(--ink); font: inherit; padding: 0.35rem 0.7rem; cursor: pointer;
}
.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; display: flex; gap: 1.4rem; }
.site-nav a {
  color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; font-weight: 600;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--teal); }

@media (max-width: 46rem) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg-raised); border-bottom: 1px solid var(--line);
    margin: 0; padding: 0.75rem 1.25rem 1rem; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0.7rem; }
}

/* ---------- hero ---------- */
.hero { padding: 4.5rem 0 3.5rem; position: relative; }
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 3rem; align-items: center;
}
@media (max-width: 52rem) {
  .hero { padding: 3rem 0 2.5rem; }
  .hero .wrap { grid-template-columns: 1fr; gap: 2rem; }
  .hero-art { order: -1; max-width: 17rem; margin: 0 auto; }
}

.status-line {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--amber);
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-bottom: 1.1rem;
}
.status-line::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 10px var(--amber);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.12; letter-spacing: -0.02em; font-weight: 800;
  margin-bottom: 1.1rem;
}
h1 .accent { color: var(--teal); }

.hero-sub { color: var(--ink-soft); font-size: 1.15rem; max-width: 34em; margin-bottom: 1.8rem; }

.hero-facts {
  list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem;
  font-family: var(--mono); font-size: 0.85rem; color: var(--ink-soft);
  margin-bottom: 2rem;
}
.hero-facts li::before { content: "∠ "; color: var(--teal-deep); }

.cta-row { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.play-badge { display: inline-block; line-height: 0; border-radius: 10px; }
.play-badge svg { border-radius: 10px; display: block; }
.play-badge:hover { box-shadow: 0 0 24px var(--glow); }
.cta-note { font-size: 0.85rem; color: var(--ink-faint); max-width: 16em; }

.hero-art { position: relative; }
.hero-art svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 0 34px var(--glow)); }

/* ---------- shared section chrome ---------- */
section { padding: 3.75rem 0; border-top: 1px solid var(--line-soft); }
.kicker {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--teal-deep); margin-bottom: 0.6rem;
}
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: -0.015em; margin-bottom: 0.8rem; }
.lede { color: var(--ink-soft); max-width: 44em; margin-bottom: 2.2rem; }

/* ---------- pledge strip ---------- */
.pledge { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.pledge > div { padding: 1.5rem 1.6rem; background: var(--bg-raised); }
.pledge > div + div { border-left: 1px solid var(--line-soft); }
.pledge strong { display: block; font-size: 1.05rem; margin-bottom: 0.3rem; color: var(--teal); }
.pledge p { font-size: 0.92rem; color: var(--ink-soft); }
@media (max-width: 46rem) {
  .pledge { grid-template-columns: 1fr; }
  .pledge > div + div { border-left: 0; border-top: 1px solid var(--line-soft); }
}

/* ---------- feature rows (alternating, not a card grid) ---------- */
.feature-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.5rem; align-items: center; padding: 2.2rem 0;
}
.feature-row + .feature-row { border-top: 1px dashed var(--line); }
@media (max-width: 52rem) {
  .feature-row { grid-template-columns: 1fr; gap: 1.4rem; }
  .feature-row .feature-fig { order: 2; }
}
.feature-copy h3 { font-size: 1.3rem; margin-bottom: 0.6rem; }
.feature-copy h3 .fn { font-family: var(--mono); color: var(--amber); font-size: 0.95em; }
.feature-copy p { color: var(--ink-soft); margin-bottom: 0.7rem; }
.feature-copy .detail {
  font-family: var(--mono); font-size: 0.82rem; color: var(--ink-faint);
}
.feature-fig {
  background: var(--bg-inset); border: 1px solid var(--line);
  border-radius: var(--radius-m); padding: 1.4rem;
}
.feature-fig svg { width: 100%; height: auto; display: block; }
.feature-fig figcaption {
  font-family: var(--mono); font-size: 0.75rem; color: var(--ink-faint);
  margin-top: 0.8rem; text-align: right;
}

/* ---------- toolkit list ---------- */
.toolkit { columns: 2; column-gap: 2.5rem; list-style: none; }
@media (max-width: 46rem) { .toolkit { columns: 1; } }
.toolkit li {
  break-inside: avoid; padding: 0.85rem 0 0.85rem 1.7rem; position: relative;
  border-bottom: 1px solid var(--line-soft);
}
.toolkit li::before {
  content: "∠"; position: absolute; left: 0; top: 0.8rem; color: var(--amber);
  font-family: var(--mono);
}
.toolkit strong { color: var(--ink); }
.toolkit span { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- audience ---------- */
.audience { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
@media (max-width: 52rem) { .audience { grid-template-columns: 1fr; } }
.audience article {
  border-left: 3px solid var(--teal-deep); padding: 0.2rem 0 0.2rem 1.2rem;
}
.audience article:nth-child(2) { border-left-color: var(--amber); }
.audience h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.audience p { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- languages ---------- */
.lang-note {
  border: 1px solid var(--line); border-radius: var(--radius-m);
  background: var(--bg-raised); padding: 1.8rem;
  display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: center;
}
@media (max-width: 46rem) { .lang-note { grid-template-columns: 1fr; } }
.lang-count {
  font-family: var(--mono); font-size: 2.6rem; font-weight: 700; color: var(--teal);
  line-height: 1;
}
.lang-count small { display: block; font-size: 0.75rem; color: var(--ink-faint); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 0.3rem; }
.lang-note p { color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- guides teaser ---------- */
.guide-list { list-style: none; counter-reset: guide; }
.guide-list li { counter-increment: guide; border-top: 1px solid var(--line-soft); }
.guide-list li:last-child { border-bottom: 1px solid var(--line-soft); }
.guide-list a {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1.2rem; align-items: baseline;
  padding: 1.1rem 0.4rem; text-decoration: none; color: var(--ink);
}
.guide-list a::before {
  content: "0" counter(guide); font-family: var(--mono); color: var(--amber); font-size: 0.9rem;
}
.guide-list a::after { content: "→"; color: var(--ink-faint); }
.guide-list a:hover { background: var(--line-soft); }
.guide-list a:hover::after { color: var(--amber); }
.guide-list .g-title { font-weight: 700; }
.guide-list .g-sub { display: block; font-size: 0.88rem; color: var(--ink-soft); font-weight: 400; }

/* ---------- FAQ ---------- */
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--bg-raised); margin-bottom: 0.7rem;
}
.faq summary {
  cursor: pointer; padding: 1rem 1.2rem; font-weight: 700; font-size: 1rem;
  list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--teal); font-size: 1.2rem; flex-shrink: 0; }
.faq details[open] summary::after { content: "−"; color: var(--amber); }
.faq .faq-a { padding: 0 1.2rem 1.1rem; color: var(--ink-soft); font-size: 0.98rem; }
.faq .faq-a a { color: var(--teal); }

/* ---------- closing CTA ---------- */
.closer { text-align: center; padding: 4.5rem 0; }
.closer h2 { margin-bottom: 0.6rem; }
.closer p { color: var(--ink-soft); margin-bottom: 1.8rem; }
.closer .cta-row { justify-content: center; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; font-size: 0.88rem; color: var(--ink-faint); }
.site-foot .foot-grid { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; margin-bottom: 1.6rem; }
.site-foot nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1.2rem; }
.site-foot a { color: var(--ink-soft); }
.site-foot .disclaimer { max-width: 60em; line-height: 1.6; }

/* ---------- guide pages ---------- */
.crumbs { font-size: 0.85rem; color: var(--ink-faint); margin: 1.8rem 0 0; font-family: var(--mono); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.crumbs li + li::before { content: "/"; margin-right: 0.4rem; color: var(--ink-faint); }
.crumbs a { color: var(--ink-soft); }

.article { padding: 1.5rem 0 3.5rem; }
.article .wrap { max-width: 46rem; }
.article h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin: 0.7rem 0 0.9rem; }
.article .byline { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-faint); margin-bottom: 2.2rem; }
.article h2 { font-size: 1.45rem; margin: 2.4rem 0 0.8rem; }
.article h3 { font-size: 1.12rem; margin: 1.8rem 0 0.6rem; }
.article p { margin-bottom: 1.05rem; }
.article ul, .article ol { margin: 0 0 1.05rem 1.4rem; }
.article li { margin-bottom: 0.4rem; }
.article table {
  width: 100%; border-collapse: collapse; margin: 1.2rem 0 1.4rem;
  font-family: var(--mono); font-size: 0.88rem;
}
.article .table-scroll { overflow-x: auto; }
.article th, .article td { border: 1px solid var(--line); padding: 0.5rem 0.7rem; text-align: center; }
.article th { background: var(--bg-raised); color: var(--teal); font-weight: 600; }
.article .formula {
  font-family: var(--mono); background: var(--bg-inset); border: 1px solid var(--line);
  border-left: 3px solid var(--teal-deep); border-radius: var(--radius-s);
  padding: 0.9rem 1.1rem; margin: 1.2rem 0; overflow-x: auto; font-size: 0.95rem;
}
.article .callout {
  border: 1px solid var(--line); border-left: 3px solid var(--amber);
  background: var(--amber-soft); border-radius: var(--radius-s);
  padding: 1rem 1.2rem; margin: 1.4rem 0; font-size: 0.97rem;
}
.article .callout strong { color: var(--amber); }
.app-tie {
  border: 1px solid var(--line); border-radius: var(--radius-m);
  background: var(--bg-raised); padding: 1.5rem 1.6rem; margin: 2.4rem 0 0;
}
.app-tie h2 { margin-top: 0; font-size: 1.25rem; }
.related { margin-top: 2.6rem; border-top: 1px dashed var(--line); padding-top: 1.4rem; }
.related h2 { font-size: 1rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); }
.related ul { list-style: none; margin-left: 0; }
.related li { margin-bottom: 0.5rem; }
