/* Solve f(x) — site-wide styles. Same brand system as the iOS app:
   cream/navy/burnt-orange, monospaced "technical readout" labels, no
   third-party fonts or CDN dependencies. */

:root {
  color-scheme: light dark;
  --bg: #FAF9F6;
  --bg-deep: #F1EEE6;
  --surface: #FFFFFF;
  --ink: #1B2A4A;
  --accent: #E8590C;
  --secondary: #6B7585;
  --line: rgba(27, 42, 74, 0.12);
  --shadow: rgba(27, 42, 74, 0.08);

  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  --measure: 720px;
  --wide: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10182C;
    --bg-deep: #0B1120;
    --surface: #1A2340;
    --ink: #F5F1E8;
    --accent: #FF7A3D;
    --secondary: #9CA0AC;
    --line: rgba(245, 241, 232, 0.12);
    --shadow: rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: var(--font-display);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:hover { opacity: 0.85; }

h1, h2, h3 { line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 800; letter-spacing: -0.01em; margin: 0 0 0.5rem; }
h2 { font-size: 1.5rem; font-weight: 700; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.05rem; font-weight: 700; margin: 1.5rem 0 0.35rem; }

p { margin: 1em 0; }

/* -------------------------------------------------------------- */
/* Header                                                          */
/* -------------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
  margin-right: auto;
}
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-mark .fx-axis { stroke: var(--ink); stroke-width: 26; }
.brand-mark .fx-curve { stroke: var(--ink); stroke-width: 46; fill: none; }
.brand-mark .fx-cross { stroke: var(--accent); stroke-width: 46; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--secondary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
}
.site-nav a:hover, .site-nav a.is-current { color: var(--ink); opacity: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  line-height: 1.3;
}
.btn:hover { opacity: 0.9; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

/* -------------------------------------------------------------- */
/* Main / hero                                                     */
/* -------------------------------------------------------------- */
main { max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem; }

.hero {
  padding: clamp(2rem, 5vw, 3.5rem) 0 1rem;
  text-align: center;
}
.hero .lede {
  max-width: 640px;
  margin: 0 auto;
  font-size: 1.15rem;
  color: var(--secondary);
  line-height: 1.6;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.eyebrow::before, .eyebrow::after {
  content: "";
  width: 0.45em; height: 0.45em;
  border-radius: 50%;
  background: var(--accent);
}

/* -------------------------------------------------------------- */
/* Prose sections                                                   */
/* -------------------------------------------------------------- */
.prose { max-width: var(--measure); margin: 0 auto; padding: 2rem 0 3rem; }
.prose h2:first-child { margin-top: 0; }

table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
th, td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); }
th { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--secondary); font-weight: 600; }

/* -------------------------------------------------------------- */
/* Footer                                                           */
/* -------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
}
.footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-inner nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer-inner nav a { color: var(--secondary); text-decoration: none; font-size: 0.88rem; }
.footer-inner nav a:hover { color: var(--ink); opacity: 1; }
.footer-copyright {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--secondary);
}

/* -------------------------------------------------------------- */
/* Simple content pages (privacy / terms / support)                 */
/* -------------------------------------------------------------- */
.page-prose { max-width: var(--measure); margin: 0 auto; padding: 2.5rem 1.5rem 3rem; }
.page-prose .subtitle { color: var(--secondary); margin-top: -0.25rem; }

@media (max-width: 720px) {
  .site-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .header-inner.is-open .site-nav {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem 1.5rem;
    gap: 0.9rem;
  }
  .header-inner { position: relative; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .site-nav a { transition: opacity 120ms ease; }
}
