/* 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; }
html { scroll-behavior: smooth; }
/* keep anchored sections clear of the sticky nav */
[id] { scroll-margin-top: 84px; }
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: center;
  gap: 0;
}
.logo img {
  height: 43px;
  width: auto;
  display: block;
}
.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);
}

/* contact form */
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-field { display: flex; flex-direction: column; gap: 7px; }
.contact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.contact-input {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 12px 14px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.contact-input::placeholder { color: var(--ink-4); }
.contact-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.contact-textarea { resize: vertical; min-height: 130px; line-height: 1.5; }
.contact-note { font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); letter-spacing: 0.04em; }
.contact-form .btn-primary[disabled] { cursor: progress; }

/* ---- blog ---- */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;   /* exactly 2 per row */
  gap: 28px;
}
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.blog-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-soft);
  box-shadow: 0 1px 0 rgba(20,20,15,0.02), 0 24px 48px -28px rgba(20,20,15,0.28);
}
.blog-cover {
  height: 180px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 16px 18px;
}
.blog-cover-cat, .blog-cover-read {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: #F2EFE5;
  background: rgba(0,0,0,0.22);
  padding: 4px 9px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}
.blog-card-body { padding: 24px 24px 22px; display: flex; flex-direction: column; flex: 1; }
.blog-card-title {
  font-family: var(--font-display);
  font-size: 27px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: var(--ink);
}
.blog-card-excerpt { color: var(--ink-3); font-size: 14.5px; line-height: 1.55; margin: 0 0 22px; }
.blog-card-meta { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.blog-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 3px var(--accent-soft); }
.blog-meta-text { display: flex; flex-direction: column; line-height: 1.3; }
.blog-author { font-size: 13px; color: var(--ink); font-weight: 500; }
.blog-date { font-size: 11px; color: var(--ink-4); letter-spacing: 0.04em; }
.blog-arrow { margin-left: auto; color: var(--accent); font-size: 18px; transition: transform 0.2s ease; }
.blog-card:hover .blog-arrow { transform: translateX(4px); }

/* single post */
.blog-back { font-size: 12px; color: var(--ink-3); letter-spacing: 0.06em; }
.blog-back:hover { color: var(--accent); }
.blog-post-meta { display: flex; align-items: center; gap: 12px; padding-bottom: 8px; }
.blog-body { margin-top: 8px; }
.blog-body p { color: var(--ink-2); font-size: 18px; line-height: 1.65; margin: 0 0 22px; }
.blog-body h2 { font-family: var(--font-display); font-size: 30px; letter-spacing: -0.02em; margin: 36px 0 14px; color: var(--ink); }
.blog-post-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line);
}

/* 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
   Inline styles are the desktop baseline; these class hooks +
   !important overrides collapse layouts down through tablet & phone.
   ============================================================ */

/* prevent any stray horizontal scroll without breaking sticky nav */
body { overflow-x: clip; }
img, svg { max-width: 100%; }

/* hamburger + mobile menu are hidden on desktop */
.nav-toggle { display: none; }
.nav-mobile { display: none; }

/* ---- large laptop / small desktop ---- */
@media (max-width: 1100px) {
  .section-head h2 { font-size: 54px; }
}

/* ---- tablet landscape ---- */
@media (max-width: 1024px) {
  .hero-grid       { grid-template-columns: 1fr !important; gap: 48px !important; }
  .logocloud-grid  { grid-template-columns: 1fr !important; gap: 24px !important; }
  .testimonial-grid{ grid-template-columns: 1fr !important; gap: 40px !important; }
  .monitor-body    { grid-template-columns: 1fr !important; gap: 28px !important; }
  .dash-body       { grid-template-columns: 1fr !important; }
  .dash-side       { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; }
  .feat-card       { grid-column: span 6 !important; }
  .contact-grid    { grid-template-columns: 1fr !important; gap: 40px !important; }
}

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

  /* nav → hamburger */
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 40px; padding: 0 10px;
    border: 1px solid var(--line-2); border-radius: 8px; background: var(--paper); cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-mobile {
    display: block; overflow: hidden; max-height: 0;
    transition: max-height .3s ease;
    background: rgba(246,243,236,0.98); backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--line);
  }
  .nav-mobile.open { max-height: 520px; }
  .nav-mobile-inner { display: flex; flex-direction: column; padding: 8px 20px 20px; }
  .nav-mobile a { padding: 14px 4px; font-size: 16px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
  .nav-mobile .btn { margin-top: 14px; justify-content: center; padding: 13px 18px; }
  .nav-mobile .btn-link { border-bottom: 1px solid var(--line); margin-top: 0; }

  /* grids */
  .integrations-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .integrations-grid > div { border-right: 0 !important; }
  .integrations-grid > div:nth-child(odd) { border-right: 1px solid var(--line) !important; }
  .dash-metrics { grid-template-columns: repeat(2, 1fr) !important; }

  /* footer */
  .footer-cols { grid-template-columns: repeat(3, 1fr) !important; gap: 32px !important; }
  .footer-cols > div:first-child { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column !important; gap: 8px; }
}

/* ---- how-it-works stacks ---- */
@media (max-width: 860px) {
  .how-grid { grid-template-columns: 1fr !important; }
  .how-step { border-right: 0 !important; border-bottom: 1px solid var(--line); min-height: 0 !important; }
  .how-step:last-child { border-bottom: 0; }
}

/* ---- phones ---- */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  section { padding: 56px 0; }
  .section-head h2 { font-size: 34px; }
  .section-head p { font-size: 16px; }
  .display { font-size: clamp(40px, 12vw, 64px) !important; }
  .hero-h1 { font-size: clamp(38px, 11vw, 64px) !important; }

  .hero-meta { flex-wrap: wrap; gap: 24px !important; }
  .hero-ctas { flex-wrap: wrap; }
  .hero-ctas .btn { flex: 1 1 auto; justify-content: center; }

  .feat-card { grid-column: span 12 !important; min-height: 0 !important; }

  /* dashboard */
  .dash-head { flex-direction: column; gap: 16px; }
  .dash-filters { flex-wrap: wrap; }
  .dash-table { overflow-x: auto !important; overflow-y: hidden !important; -webkit-overflow-scrolling: touch; }
  .dash-row { min-width: 600px; }

  /* monitor */
  .monitor-header { flex-direction: column; align-items: flex-start !important; gap: 10px; }
  .monitor-header > div:first-child { flex-wrap: wrap; gap: 8px !important; }
  .service-row { grid-template-columns: 1fr auto !important; }
  .service-row > *:nth-child(2), .service-row > *:nth-child(3) { display: none !important; }

  /* testimonial stats side-by-side */
  .testimonial-stats { flex-direction: row !important; flex-wrap: wrap; gap: 20px 32px !important; }
  .testimonial-stats > div { flex: 1 1 40%; }

  /* faq */
  .faq-q { padding: 18px 16px !important; }
  .faq-q-text { font-size: 18px !important; }
  .faq-a { padding: 0 16px 20px 16px !important; font-size: 15px !important; }

  /* cta */
  .cta-btns { flex-direction: column; }
  .cta-btns .btn { justify-content: center; }

  .contact-row { grid-template-columns: 1fr !important; }

  .blog-grid { grid-template-columns: 1fr !important; gap: 20px; }
  .blog-card-title { font-size: 23px; }
  .blog-body p { font-size: 16px; }
  .blog-body h2 { font-size: 25px; }
  .blog-post-foot .btn { flex: 1 1 auto; justify-content: center; }

  .footer-cols { grid-template-columns: repeat(2, 1fr) !important; }
  .footer-bottom { font-size: 10px; }
}

/* ---- small phones ---- */
@media (max-width: 400px) {
  .logo img { height: 36px; }
  .dash-metrics { grid-template-columns: 1fr 1fr !important; }
  .hero-ctas .btn { flex-basis: 100%; }
}
