/* qafactory.ai — design tokens & globals — v3 polished maroon */
:root {
  --bg: #F6F3EC;
  --bg-2: #EDEAE0;
  --paper: #FCFAF4;
  --ink: #1A1410;
  --ink-2: #332924;
  --ink-3: #5C4F47;
  --ink-4: #8E8278;
  --line: #E5DFD0;
  --line-2: #D6CEBA;

  /* single confident accent — deep maroon */
  --accent: #6B1220;
  --accent-2: #4D0A17;
  --accent-3: #8E2030;
  --accent-soft: #E8C9CE;
  --accent-tint: #F4E5E8;
  --accent-glow: rgba(107, 18, 32, 0.12);

  --warn: #B8550E;
  --danger: #A8331F;

  --radius: 6px;
  --radius-lg: 14px;

  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --container: 1240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

/* type scale */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 16px var(--accent-glow);
}

h1, h2, h3, h4 { font-weight: 400; letter-spacing: -0.02em; margin: 0; }
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 0.96;
}
.display em {
  font-style: italic;
  color: var(--accent);
}

/* nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  background: rgba(246, 243, 236, 0.78);
  border-bottom: 1px solid var(--line);
}
.nav-inner::before {
  content: "";
  position: absolute;
  left: 32px; right: 32px; bottom: -1px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent-soft), transparent);
  opacity: 0.6;
  pointer-events: none;
}
.nav-inner { position: relative; }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 0;
}
.logo .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: var(--ink);
  color: var(--bg);
  margin-right: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  align-self: center;
  letter-spacing: 0;
}
.logo .dot { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--ink-2);
}
.nav-links a:hover { color: var(--accent); }
.nav-cta {
  display: flex; gap: 8px; align-items: center;
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.18s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 6px 14px -8px rgba(20, 20, 15, 0.4);
}
.btn-primary:hover {
  background: var(--accent);
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 8px 24px -8px var(--accent);
}
.btn-ghost {
  color: var(--ink-2);
  border-color: var(--line-2);
  background: var(--paper);
}
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-link {
  color: var(--ink);
  padding: 10px 0;
}
.btn-link:hover { color: var(--accent); }
.btn .arrow { transition: transform 0.2s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* sections */
section {
  position: relative;
  padding: 112px 0;
  border-top: 1px solid var(--line);
}
section:first-of-type { border-top: 0; }
section + section { border-top-color: var(--line); }

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 64px;
  max-width: 880px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
  padding-bottom: 0.08em;
}
.section-head p {
  color: var(--ink-3);
  font-size: 18px;
  max-width: 620px;
  margin: 0;
}

/* index marker */
.idx {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-4);
  text-transform: uppercase;
}

/* status pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}
.pill .dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  position: relative;
}
.pill .dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.35;
  animation: pulse 2s ease-out infinite;
}
.pill:hover { border-color: var(--accent-soft); }
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.3; }
  70% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* card */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

/* grid lines */
.gridlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: calc((100% - 64px) / 12) 100%;
  background-position: 32px 0;
  opacity: 0.4;
  mask-image: linear-gradient(to bottom, transparent, black 80px, black calc(100% - 80px), transparent);
}

/* hero atmosphere */
.aurora {
  position: absolute;
  pointer-events: none;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}
.aurora::before {
  content: "";
  position: absolute;
  width: 720px; height: 720px;
  top: -260px; left: -180px;
  background: radial-gradient(circle at center, rgba(107,18,32,0.10), transparent 60%);
  filter: blur(40px);
}
.aurora::after {
  content: "";
  position: absolute;
  width: 540px; height: 540px;
  bottom: -200px; right: -120px;
  background: radial-gradient(circle at center, rgba(232,154,139,0.18), transparent 60%);
  filter: blur(50px);
}

/* noise */
.noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* utility */
.mono { font-family: var(--font-mono); }
.muted { color: var(--ink-3); }
.tabular { font-variant-numeric: tabular-nums; }

/* keyframes used by inline components */
@keyframes flow {
  0% { stroke-dashoffset: 200; }
  100% { stroke-dashoffset: 0; }
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
@keyframes scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(2200%); }
}
@keyframes barRise {
  from { transform: scaleY(0.05); }
  to { transform: scaleY(1); }
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ticker {
  0%, 5% { opacity: 0; transform: translateY(8px); }
  10%, 30% { opacity: 1; transform: translateY(0); }
  35%, 100% { opacity: 0; transform: translateY(-8px); }
}

/* selection */
::selection {
  background: var(--accent);
  color: #F7E8C7;
}

/* link underline */
a.underline-on-hover { background-image: linear-gradient(to right, var(--accent), var(--accent)); background-size: 0 1px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size 0.3s ease; }
a.underline-on-hover:hover { background-size: 100% 1px; }

/* responsive trim */
@media (max-width: 900px) {
  .container { padding: 0 20px; }
  section { padding: 72px 0; }
  .section-head { margin-bottom: 40px; }
  .section-head h2 { font-size: 44px; }
}
