/* BastionFX marketing site
   Hand-written, no framework, no build step. Deploys as static files.
   Palette is restrained on purpose: traders are sold to by loud, badly designed
   sites constantly, so looking like infrastructure is a differentiator. */

:root {
  --bg:            #0a0f16;
  --bg-raised:     #111925;
  --surface:       #151f2e;
  --surface-hover: #1b2739;
  --border:        #22303f;
  --border-bright: #33465c;

  --text:          #e8eef6;
  --text-muted:    #8fa3ba;
  --text-dim:      #63758c;

  --accent:        #4f8ef7;
  --accent-hover:  #6ba0ff;
  --accent-dim:    rgba(79, 142, 247, 0.12);
  --up:            #2dd4a7;
  --warn:          #f5b544;

  --radius:   10px;
  --radius-lg: 14px;
  --maxw:     1080px;

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

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

html { scroll-behavior: smooth; }

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

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5em; font-weight: 650; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.1rem; }
p  { margin: 0 0 1rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

code, .mono { font-family: var(--mono); font-size: 0.9em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

section { padding: 80px 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }

.lede { font-size: 1.15rem; color: var(--text-muted); max-width: 62ch; }
.eyebrow {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 0.75rem;
}

/* --- skip link (a11y) ----------------------------------------------------- */

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: #fff; padding: 12px 20px; z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; top: 0; }

/* --- header --------------------------------------------------------------- */

header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 15, 22, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 32px; height: 64px; }

.logo {
  font-weight: 700; font-size: 1.15rem; letter-spacing: -0.03em;
  color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 9px;
}
.logo:hover { text-decoration: none; color: var(--text); }
.logo svg { flex-shrink: 0; }
.logo b { color: var(--accent); font-weight: 700; }

.nav-links { display: flex; gap: 26px; margin-left: auto; align-items: center; }
.nav-links a {
  color: var(--text-muted); font-size: 0.93rem; font-weight: 500; text-decoration: none;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius);
  font-weight: 600; font-size: 0.95rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { border-color: var(--border-bright); color: var(--text); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }

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

.hero { padding: 92px 0 72px; border-bottom: 1px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 48px; align-items: center; }
/* balance keeps "Even when it would have." off a third line with an orphan word */
.hero h1 { margin-bottom: 20px; text-wrap: balance; font-size: clamp(1.9rem, 4.2vw, 2.85rem); }
.hero h1 .accent { color: var(--accent); }
.hero .lede { margin-bottom: 32px; font-size: 1.2rem; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.hero-note { font-size: 0.88rem; color: var(--text-dim); }

/* Terminal mock: shows the watchdog doing its job. This is the product. */
.mock {
  background: #060a10; border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45);
}
.mock-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px; background: var(--bg-raised); border-bottom: 1px solid var(--border);
}
.mock-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-bright); }
.mock-title {
  margin-left: 8px; font-family: var(--mono); font-size: 0.76rem; color: var(--text-dim);
}
.mock-body {
  padding: 16px; font-family: var(--mono); font-size: 0.775rem; line-height: 1.85;
  overflow-x: auto; white-space: pre; color: var(--text-muted);
}
.mock-body .t  { color: var(--text-dim); }
.mock-body .ok { color: var(--up); }
.mock-body .wn { color: var(--warn); }
.mock-body .ac { color: var(--accent); }

/* --- generic cards -------------------------------------------------------- */

.cards { display: grid; gap: 20px; margin-top: 44px; }
.cards.c3 { grid-template-columns: repeat(3, 1fr); }
.cards.c4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 26px;
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-muted); font-size: 0.93rem; margin: 0; }
.card .num {
  font-family: var(--mono); font-size: 0.8rem; color: var(--accent);
  background: var(--accent-dim); border-radius: 6px;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; font-weight: 600;
}

/* --- failure-mode list ---------------------------------------------------- */

.fails { display: grid; gap: 14px; margin-top: 40px; }
.fail {
  display: grid; grid-template-columns: auto 1fr; gap: 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius); padding: 20px 24px;
}
.fail-icon { font-family: var(--mono); color: var(--warn); font-weight: 700; font-size: 0.95rem; }
.fail h3 { margin-bottom: 4px; font-size: 1rem; }
.fail p { margin: 0; color: var(--text-muted); font-size: 0.93rem; }

/* --- pricing -------------------------------------------------------------- */

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; }
.plan {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 30px 26px; display: flex; flex-direction: column;
  position: relative;
}
.plan.featured { border-color: var(--accent); background: var(--bg-raised); }
.plan-tag {
  position: absolute; top: -11px; left: 26px;
  background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 10px; border-radius: 5px;
}
.plan h3 { font-size: 1.05rem; margin-bottom: 4px; }
.plan .price { font-size: 2.3rem; font-weight: 700; letter-spacing: -0.03em; margin: 14px 0 2px; }
.plan .price span { font-size: 0.95rem; font-weight: 500; color: var(--text-dim); }
.plan .for { font-size: 0.88rem; color: var(--text-muted); min-height: 2.9em; margin-bottom: 18px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 24px; font-size: 0.91rem; }
.plan li { padding: 7px 0; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.plan li:last-child { border-bottom: none; }
.plan li b { color: var(--text); font-weight: 600; }
.plan .btn { margin-top: auto; width: 100%; }

.price-note {
  margin-top: 28px; padding: 18px 22px;
  background: var(--accent-dim); border: 1px solid rgba(79, 142, 247, 0.25);
  border-radius: var(--radius); font-size: 0.92rem; color: var(--text-muted);
}
.price-note b { color: var(--text); }

/* Screen-reader-only: table captions that shouldn't render visually. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- tables --------------------------------------------------------------- */

.table-wrap { overflow-x: auto; margin-top: 40px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); }
th {
  font-size: 0.76rem; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-dim); font-weight: 600;
}
td { color: var(--text-muted); }
td:first-child { color: var(--text); font-weight: 500; }
td .ms { font-family: var(--mono); color: var(--up); }

/* --- honest callout ------------------------------------------------------- */

.honest {
  margin-top: 36px; padding: 26px 28px;
  background: var(--surface); border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
}
.honest h3 { margin-bottom: 10px; }
.honest p { color: var(--text-muted); margin-bottom: 0; font-size: 0.95rem; }
.honest p + p { margin-top: 12px; }

/* --- faq ------------------------------------------------------------------ */

.faq { margin-top: 40px; display: grid; gap: 12px; }
details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0 22px;
}
details[open] { background: var(--bg-raised); }
summary {
  cursor: pointer; padding: 18px 0; font-weight: 600; font-size: 0.98rem;
  list-style: none; display: flex; justify-content: space-between; gap: 16px;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; color: var(--accent); font-weight: 400; font-size: 1.3rem; line-height: 1; }
details[open] summary::after { content: '\2212'; }
details p { color: var(--text-muted); font-size: 0.93rem; padding-bottom: 18px; margin: 0; }
details p + p { padding-top: 0; margin-top: -8px; padding-bottom: 18px; }

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

.cta-band { text-align: center; padding: 88px 0; }
.cta-band h2 { margin-bottom: 14px; }
.cta-band .lede { margin: 0 auto 30px; }
.cta-band .hero-cta { justify-content: center; }

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

footer { padding: 56px 0 40px; border-top: 1px solid var(--border); background: var(--bg-raised); }
.foot-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 36px; }
.foot-grid h4 {
  font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-dim); margin: 0 0 14px; font-weight: 600;
}
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin-bottom: 9px; }
.foot-grid a { color: var(--text-muted); font-size: 0.91rem; }
.foot-grid a:hover { color: var(--text); text-decoration: none; }
.foot-about p { color: var(--text-dim); font-size: 0.88rem; max-width: 34ch; }
.foot-bottom {
  margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--text-dim);
}
.risk {
  margin-top: 18px; font-size: 0.8rem; color: var(--text-dim);
  line-height: 1.6; max-width: 90ch;
}

/* --- auth + dashboard ----------------------------------------------------- */

.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px; max-width: 480px; width: 100%;
}
.auth-card h1 { margin-bottom: 10px; }

.dash-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 32px;
}
.dash-value { font-size: 1.35rem; color: var(--text); margin: 6px 0 12px; }

.status-row { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.95rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.dot-warn { background: var(--warn); }
.dot-ok   { background: var(--up); }

.dash-form { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-form input {
  flex: 1 1 200px; min-width: 0;
  background: var(--bg); border: 1px solid var(--border-bright); color: var(--text);
  border-radius: var(--radius); padding: 11px 14px; font: inherit; font-size: 0.93rem;
}
.dash-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.dash-msg { margin-top: 12px; font-size: 0.88rem; color: var(--text-muted); }
.dash-msg.ok  { color: var(--up); }
.dash-msg.bad { color: #f87171; }

/* --- responsive ----------------------------------------------------------- */

@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .cards.c3, .cards.c4, .plans { grid-template-columns: 1fr 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 620px) {
  section { padding: 56px 0; }
  .hero { padding: 56px 0 48px; }
  .cards.c3, .cards.c4, .plans { grid-template-columns: 1fr; }
  .fail { grid-template-columns: 1fr; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
  * { transition: none !important; }
}
