/* SAIHM site base styles
   Brief §8 (visual system): light/calm palette, Notion/Linear/Stripe-leaning.
   External per brief §9 #1 (CSP forbids inline <style> without nonces). */

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --ink-primary: #FFFFFF;
  --ink-muted: #94a3b8;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --success: #22c55e;
  --warn: #f59e0b;
  --border: #2a2a2a;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Mono', 'Menlo', monospace;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: #1a1a1a;
  padding: 1px 6px;
  border-radius: 4px;
}

.container { max-width: 880px; margin: 0 auto; padding: 0 24px; }

nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
nav .container { display: flex; align-items: center; gap: 16px; }
nav img { height: 56px; width: auto; }
nav .crumb { color: var(--ink-muted); font-size: 0.95rem; }
nav .links { margin-left: auto; display: flex; gap: 18px; font-size: 0.95rem; }
nav .links a { color: var(--ink-muted); }
nav .links a:hover { color: var(--accent); }

main { padding: 48px 0 96px; }
section { margin-bottom: 32px; }

section.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
h2 { font-size: 1.35rem; font-weight: 600; line-height: 1.3; margin-bottom: 12px; }
h3 { font-size: 1.05rem; font-weight: 600; margin: 16px 0 8px; }

p { margin-bottom: 12px; max-width: 64ch; }
p.muted { color: var(--ink-muted); }
ul { padding-left: 20px; margin-bottom: 12px; }
ul li { margin-bottom: 6px; }

dl.kv {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px 16px;
  margin: 8px 0;
}
dl.kv dt { color: var(--ink-muted); font-size: 0.92rem; }
dl.kv dd { font-size: 0.95rem; word-break: break-all; }

.mono { font-family: var(--font-mono); font-size: 0.88rem; }

.badge {
  display: inline-block;
  font-size: 0.78rem;
  padding: 2px 8px;
  background: #052e16;
  color: var(--success);
  border-radius: 999px;
  font-weight: 600;
}
/* Free-tier activation success confirmation — green success state. */
#free-step-done h3 {
  color: var(--success);
}
.badge-warn {
  background: #422006;
  color: var(--warn);
}
.badge-down {
  background: #450a0a;
  color: #f87171;
}

.cta {
  display: inline-block;
  background: var(--accent);
  color: #FFFFFF;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: background 0.15s;
}
.cta:hover { background: var(--accent-hover); color: #FFFFFF; text-decoration: none; }

.hero { padding: 24px 0 16px; }
.hero h1 {
  font-size: 2.5rem;
  line-height: 1.15;
  max-width: 18ch;
}
.hero p.tagline {
  font-size: 1.15rem;
  color: var(--ink-muted);
  max-width: 56ch;
  margin-bottom: 24px;
}

footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 32px 0;
  color: var(--ink-muted);
  font-size: 0.88rem;
}
footer p { max-width: none; margin-bottom: 16px; }
footer p.footer-cta-row { margin-top: 8px; margin-bottom: 0; }

/* §13 chatbot hero-mark (IMG_6097, /chat only) */
.hero-mark {
  display: block;
  height: 96px;
  width: auto;
  margin: 0 0 24px 0;
}

/* §6 audience-tile strip */
.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 32px 0;
}
@media (max-width: 720px) {
  .tiles { grid-template-columns: 1fr 1fr; }
}
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: block;
  color: var(--ink-primary);
  transition: border-color 0.15s, transform 0.15s;
}
.tile:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}
.tile h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--ink-primary);
}
.tile p {
  font-size: 0.92rem;
  color: var(--ink-muted);
  margin: 0;
  max-width: none;
}

/* §8 receipts strip */
.receipts {
  background: #141414;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 32px 0;
}
.receipts h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 0 0 8px 0;
  font-weight: 600;
}
.receipts ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.receipts li { color: var(--ink-muted); margin: 0; }
.receipts li a { color: var(--ink-muted); }
.receipts li a:hover { color: var(--accent); }

/* code blocks for /developers */
pre {
  background: #050505;
  color: #E5E7EB;
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.5;
  margin-bottom: 16px;
}
pre code { background: transparent; color: inherit; padding: 0; font-size: inherit; }

/* tables (developers / enterprise) */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 8px 0 16px 0;
}
table th, table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
table th { color: var(--ink-muted); font-weight: 600; font-size: 0.85rem; }

/* ─── form inputs (used on /tools) ──────────────────────────────────────── */
.input, input[type=text] {
  width: 100%;
  max-width: 480px;
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-primary);
}
.input:focus, input[type=text]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
form label { display: inline-block; margin-bottom: 4px; font-size: 0.9rem; color: var(--ink-muted); }
form button.cta { font-family: inherit; cursor: pointer; border: 0; }

/* ─── Pre-launch gate ────────────────────────────────────────────────────── */
body.gate { min-height: 100vh; display: flex; flex-direction: column; }
.gate-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 0; }
.gate-container { text-align: center; }
.gate-logo {
  display: block;
  margin: 0 auto 24px;
  height: 240px;
  width: auto;
  max-width: 70vw;
  animation: gate-fade-in 1s ease-out both;
}
.gate-title {
  font-size: 3rem;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin-bottom: 12px;
}
.gate-tagline {
  font-size: 1.2rem;
  color: var(--ink-muted);
  max-width: 56ch;
  margin: 0 auto 36px;
}
.gate-clock {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 12px 0 24px;
}
.gate-unit {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  min-width: 96px;
  box-shadow: var(--shadow);
}
.gate-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.1;
}
.gate-lbl {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-top: 4px;
}
.gate-eta { font-size: 0.95rem; }
.gate-footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--ink-muted); font-size: 0.82rem; text-align: left; }
@keyframes gate-fade-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ─── Page-load splash (1s) — IMG_6096 wordmark overlay ─────────────────── */
/* Single LARGE centered logo for 1s, then fades out cleanly.
 * Nav <img> stays hidden until the splash completes so only ONE wordmark
 * is visible at any moment (no double-image during the fade). */
body:not(.gate)::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--bg) url('/img/IMG_6096.png') no-repeat center / clamp(240px, 45vw, 480px) auto;
  z-index: 9999;
  pointer-events: none;
  animation: splash 1s ease-out forwards;
}
@keyframes splash {
  0%   { opacity: 1; }
  90%  { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}
body:not(.gate) nav img {
  animation: nav-img-reveal 1.05s ease-out both;
}
@keyframes nav-img-reveal {
  0%, 95% { opacity: 0; }
  100%    { opacity: 1; }
}

/* ─── AnythingLLM chat-widget custom branding (SAIHM text logo) ─── */
/* Move launcher inward from corner; widget defaults to bottom:0 right:0 mb-4. */
.allm-fixed.allm-bottom-0.allm-z-50:not(.allm-h-full):not(.allm-bg-white):not(.allm-inset-0) {
  bottom: 28px !important;
  right: 28px !important;
  margin-bottom: 0 !important;
  margin-right: 0 !important;
}
/* Replace launcher button with SAIHM text logo, larger size. */
.allm-fixed.allm-bottom-0.allm-z-50 button.allm-bg-transparent.allm-rounded-2xl {
  width: 112px !important;
  height: 112px !important;
  background-image: url('/img/IMG_6097.png') !important;
  background-color: #0a0a0a !important;
  background-size: 86% auto !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  border: 2px solid #1a4cff !important;
  border-radius: 18px !important;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.4) !important;
  transition: transform 0.15s ease, border-color 0.15s ease !important;
}
.allm-fixed.allm-bottom-0.allm-z-50 button.allm-bg-transparent.allm-rounded-2xl:hover {
  transform: scale(1.06) !important;
  border-color: #4a7cff !important;
}
/* Hide widget's default chat icon (SVG) so only our background-image shows. */
.allm-fixed.allm-bottom-0.allm-z-50 button.allm-bg-transparent.allm-rounded-2xl > * {
  display: none !important;
}

/* ─── Two-row nav + dropdown ─── */
nav .container { flex-direction: column; align-items: stretch; gap: 8px; }
nav .nav-row { display: flex; align-items: center; gap: 16px; }
nav .nav-row.top .links { margin-left: auto; }
nav .nav-row.bottom { justify-content: center; gap: 22px; padding: 6px 0 4px; border-top: 1px solid #1a1a1a; font-size: 0.92rem; flex-wrap: wrap; }
nav .nav-row.bottom a { color: var(--ink-muted); }
nav .nav-row.bottom a:hover { color: var(--accent); }
details.nav-dropdown { display: inline-block; position: relative; }
details.nav-dropdown > summary { cursor: pointer; list-style: none; display: inline-block; }
details.nav-dropdown > summary::-webkit-details-marker { display: none; }
details.nav-dropdown > summary::after { content: " \25BE"; font-size: 0.85em; }
details.nav-dropdown[open] > summary::after { content: " \25B4"; }
details.nav-dropdown > .dropdown-menu {
  position: absolute; top: 100%; right: 0;
  background: #0a0a0a; border: 1px solid #333; border-radius: 6px;
  padding: 8px 0; min-width: 200px; z-index: 100;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
details.nav-dropdown > .dropdown-menu a {
  display: block; padding: 6px 16px; white-space: nowrap;
}

details.nav-dropdown.left > .dropdown-menu { right: auto; left: 0; }

/* Accepted-methods strip (Join payment step) */
.paymarks-label { margin: .6em 0 .2em; }
.paymarks {
  display: flex; flex-wrap: wrap; gap: .55em; align-items: center;
  list-style: none; padding: 0; margin: .2em 0 0;
}
.paymarks li { display: flex; align-items: center; }
.paymarks img {
  height: 24px; width: auto; display: block;
  background: #fff; border-radius: 4px; padding: 3px 5px;
}
.paymarks img.pm-dark { background: #000; }

/* Stripe Embedded Checkout: contain the (Stripe-controlled, light) iframe so it
   reads as a deliberate card on the dark page rather than an edge-to-edge white slab.
   The iframe interior is cross-origin and cannot be themed from here — true dark
   theming is a Stripe Dashboard branding setting or a Payment Element migration. */
#checkout {
  max-width: 480px; margin: 14px auto 0;
  padding: 10px; background: #fff; border-radius: 12px;
  box-shadow: 0 0 0 1px #2a2a2a, 0 8px 28px rgba(0,0,0,.55);
}

/* On-brand text emphasis (Architect 2026-07-13: "a little on-brand text coloring where
   appropriate") — brand-accent inline emphasis for key positioning/differentiator phrases.
   Also styles the pre-existing .savings span on /pricing (was referenced, never defined). */
.accent-text, .savings { color: var(--accent); font-weight: 600; }
