/* Quad99 website — design tokens follow Q99 Design Principles + "Disciplined Precision" spec. */

@font-face { font-family: "Space Grotesk"; src: url("/assets/fonts/SpaceGrotesk-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/assets/fonts/SpaceGrotesk-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/assets/fonts/SpaceGrotesk-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/assets/fonts/SpaceGrotesk-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --navy: #111C30;
  --navy-2: #1E2B45;
  --red: #C92D43;
  --red-hover: #B02438;
  --soft: #F7F8FA;
  --white: #FFFFFF;
  --slate-900: #334155;
  --slate-500: #64748B;
  --slate-300: #CBD5E1;
  --slate-200: #E2E8F0;
  --slate-100: #F1F5F9;

  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 4px;
  --r-lg: 8px;
  --maxw: 1200px;
  --pad: 32px;
  --section-y: 112px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--soft);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; color: var(--navy); }
p { margin: 0; }
::selection { background: var(--navy); color: var(--white); }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

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

.skip { position: absolute; left: -9999px; top: 8px; background: var(--navy); color: var(--white); padding: 8px 12px; border-radius: var(--r-sm); z-index: 100; }
.skip:focus { left: 8px; }

/* Type roles */
.eyebrow {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 16px;
}
.display { font-size: clamp(36px, 5vw, 52px); line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(28px, 3.2vw, 36px); line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
h3 { font-size: 17px; line-height: 1.4; font-weight: 600; letter-spacing: -0.005em; }
.lede { font-size: 18px; color: var(--slate-900); margin-top: 24px; max-width: 34em; }
.section-lede { font-size: 17px; color: var(--slate-900); margin-top: 16px; max-width: 46em; }
.note { margin-top: 20px; font-size: 14px; color: var(--slate-500); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 20px;
  border-radius: var(--r-sm); border: 1px solid transparent;
  font-family: var(--font-head); font-size: 15px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-accent { background: var(--red); color: var(--white); }
.btn-accent:hover { background: var(--red-hover); }
.btn-secondary { background: var(--white); color: var(--navy); border-color: var(--slate-300); }
.btn-secondary:hover { border-color: var(--navy); background: var(--soft); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--slate-200);
}
.header-inner { display: flex; align-items: center; gap: 40px; height: 68px; }
.brand img { height: 21px; width: auto; }
.nav { display: flex; gap: 32px; margin-left: auto; }
.nav a { text-decoration: none; font-size: 15px; font-weight: 500; color: var(--slate-900); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.active { color: var(--navy); border-bottom-color: var(--red); }
.menu-toggle { display: none; margin-left: auto; width: 40px; height: 40px; border: 1px solid var(--slate-300); border-radius: var(--r-sm); background: var(--white); cursor: pointer; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.menu-toggle span { display: block; width: 18px; height: 2px; background: var(--navy); }
.mobile-nav { border-top: 1px solid var(--slate-200); background: var(--white); padding: 12px var(--pad) 20px; display: flex; flex-direction: column; }
.mobile-nav[hidden] { display: none; }
.mobile-nav a:not(.btn) { padding: 12px 0; text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--slate-200); }
.mobile-nav .btn { margin-top: 16px; }

/* Hero */
.hero { background: var(--white); border-bottom: 1px solid var(--slate-200); padding: 96px 0 104px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; }

.flow { margin: 0; background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--r-lg); padding: 24px; }
.flow-cap { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-head); font-size: 13px; font-weight: 600; color: var(--slate-900); margin-bottom: 20px; }
.tag { font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--slate-500); border: 1px solid var(--slate-200); background: var(--slate-100); padding: 2px 8px; border-radius: var(--r-sm); }
.flow-stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; position: relative; }
.flow-stages li { position: relative; padding: 14px 12px 14px 0; border-top: 2px solid var(--navy); }
.flow-stages li:not(:last-child)::after {
  content: ""; position: absolute; top: -6px; right: 10px; width: 10px; height: 10px;
  border-top: 2px solid var(--navy); border-right: 2px solid var(--navy); transform: rotate(45deg);
  background: transparent;
}
.flow-stages li::before { content: ""; position: absolute; top: -6px; left: 0; width: 10px; height: 10px; background: var(--white); border: 2px solid var(--navy); border-radius: 2px; }
.flow-stages li:last-child::before { background: var(--red); border-color: var(--red); }
.stage-n { display: block; font-family: var(--font-head); font-weight: 600; font-size: 14px; }
.stage-t { display: block; font-size: 12.5px; line-height: 1.45; color: var(--slate-500); margin-top: 4px; }
.flow-out { margin-top: 20px; border: 1px solid var(--slate-200); border-radius: var(--r-lg); overflow: hidden; }
.out-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--navy); color: var(--white); }
.out-title { font-family: var(--font-head); font-size: 13px; font-weight: 600; }
.out-dot { width: 6px; height: 6px; background: var(--red); }
.out-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.out-table th { text-align: left; font-family: var(--font-head); font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--slate-900); background: var(--soft); padding: 8px 14px; border-bottom: 1px solid var(--slate-300); }
.out-table td { padding: 10px 14px; border-bottom: 1px solid var(--slate-200); color: var(--slate-900); }
.out-table tr:last-child td { border-bottom: 0; }
.ok { font-family: var(--font-head); font-size: 12px; font-weight: 500; color: var(--navy); }
.ok::before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--navy); margin-right: 6px; vertical-align: 1px; }

/* Sections */
.section { padding: var(--section-y) 0; }
.section-alt { background: var(--white); border-top: 1px solid var(--slate-200); border-bottom: 1px solid var(--slate-200); }
.section-head { margin-bottom: 56px; }

.grid { display: grid; gap: 24px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--r-lg); padding: 28px; transition: border-color .15s ease; }
.card:hover { border-color: var(--slate-300); }
.card h3 { margin-top: 20px; }
.card p { margin-top: 10px; font-size: 15px; color: var(--slate-900); }
.card-idx { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 13px; font-weight: 600; color: var(--navy); border: 1px solid var(--slate-300); border-radius: var(--r-sm); }

/* Process */
.process { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--navy); }
.process li { padding: 28px 24px 0 0; position: relative; }
.process li + li { padding-left: 24px; border-left: 1px solid var(--slate-200); }
.step-n { display: block; font-family: var(--font-head); font-size: 14px; font-weight: 600; color: var(--red); font-variant-numeric: tabular-nums; margin-bottom: 14px; }
.process p { margin-top: 10px; font-size: 15px; color: var(--slate-900); }

/* Results (dark) */
.section-dark { background: var(--navy); color: var(--white); }
.section-dark h2 { color: var(--white); }
.section-dark .section-lede { color: #B8C1D3; }
.section-dark .eyebrow { color: #F0707F; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255,255,255,0.18); border-bottom: 1px solid rgba(255,255,255,0.18); }
.metric { padding: 40px 32px 40px 0; }
.metric + .metric { padding-left: 32px; border-left: 1px solid rgba(255,255,255,0.18); }
.metric-v { font-family: var(--font-head); font-size: clamp(36px, 4vw, 48px); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.metric-v span { display: block; font-size: 17px; font-weight: 500; letter-spacing: 0; color: #B8C1D3; margin-top: 8px; }
.metric-t { margin-top: 16px; font-size: 15px; color: #D5DBE6; max-width: 26em; }
.disclaimer { margin-top: 24px; font-size: 13px; color: #8E99AE; }

/* Use cases */
.usecases { display: grid; grid-template-columns: repeat(6, 1fr); gap: 24px; }
.usecase { grid-column: span 2; background: var(--white); border: 1px solid var(--slate-200); border-top: 2px solid var(--navy); border-radius: var(--r-sm); padding: 28px; transition: border-color .15s ease; }
.usecase:nth-child(4), .usecase:nth-child(5) { grid-column: span 3; }
.usecase:hover { border-color: var(--slate-300); border-top-color: var(--red); }
.usecase p { margin-top: 10px; font-size: 15px; color: var(--slate-900); }

/* About */
.about { display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px; align-items: start; }
.tagline { margin-top: 24px; font-family: var(--font-head); font-size: 15px; font-weight: 500; color: var(--red); }
.about-body p { font-size: 17px; color: var(--slate-900); }
.about-body p + p { margin-top: 20px; }

/* Pilot */
.pilot { display: grid; grid-template-columns: 1fr 1.25fr; gap: 64px; align-items: start; }
.pilot-note { margin-top: 32px; padding: 20px; font-size: 14px; color: var(--slate-900); background: var(--white); border: 1px solid var(--slate-200); border-left: 2px solid var(--red); border-radius: var(--r-sm); }
.form { padding: 32px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 20px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { font-family: var(--font-head); font-size: 13px; font-weight: 600; color: var(--slate-900); padding: 0; margin-bottom: 6px; }
fieldset.field legend { margin-bottom: 10px; }
.req { color: var(--red); }
.opt { font-weight: 400; color: var(--slate-500); }
.field input, .field textarea {
  font: inherit; font-size: 15px; color: var(--navy);
  background: var(--white); border: 1px solid var(--slate-300); border-radius: var(--r-sm);
  padding: 10px 12px; min-height: 44px; width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.field.invalid input, .field.invalid textarea { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; font-size: 14px; font-weight: 500; border: 1px solid var(--slate-300); border-radius: var(--r-sm); background: var(--white); color: var(--slate-900); transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
.choice:hover span { border-color: var(--navy); }
.choice input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--white); }
.choice input:focus-visible + span { outline: 2px solid var(--navy); outline-offset: 2px; }
.form-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.form-status { font-size: 14px; color: var(--slate-900); }
.form-status.error { color: var(--red); }

/* Footer */
.site-footer { background: var(--white); border-top: 1px solid var(--slate-200); padding: 64px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 2fr auto; gap: 40px; align-items: start; }
.footer-brand img { width: 200px; height: auto; }
.footer-brand p { margin-top: 16px; font-size: 14px; color: var(--slate-500); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 12px 28px; padding-top: 8px; }
.footer-nav a { text-decoration: none; font-size: 14px; font-weight: 500; color: var(--slate-900); }
.footer-nav a:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 4px; }
.footer-legal { margin-top: 48px; padding-top: 20px; padding-bottom: 24px; border-top: 1px solid var(--slate-200); }
.footer-legal p { font-size: 13px; color: var(--slate-500); }

/* Responsive */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(3, 1fr); row-gap: 32px; }
  .process li:nth-child(4) { padding-left: 0; border-left: 0; }
}
@media (max-width: 900px) {
  :root { --section-y: 80px; --pad: 24px; }
  .nav, .header-cta { display: none; }
  .menu-toggle { display: inline-flex; }
  .hero { padding: 64px 0 72px; }
  .hero-grid, .about, .pilot { grid-template-columns: 1fr; gap: 48px; }
  .usecases { grid-template-columns: 1fr 1fr; }
  .usecase, .usecase:nth-child(4), .usecase:nth-child(5) { grid-column: span 1; }
  .usecase:nth-child(5) { grid-column: span 2; }
  .metrics { grid-template-columns: 1fr; }
  .metric, .metric + .metric { padding: 28px 0; border-left: 0; }
  .metric + .metric { border-top: 1px solid rgba(255,255,255,0.18); }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 640px) {
  :root { --pad: 16px; --section-y: 64px; }
  .section-head { margin-bottom: 40px; }
  .grid-4, .usecases, .row-2 { grid-template-columns: 1fr; }
  .usecase:nth-child(5) { grid-column: span 1; }
  .process { grid-template-columns: 1fr; border-top: 0; }
  .process li, .process li + li, .process li:nth-child(4) { padding: 20px 0 20px 0; border-left: 0; border-top: 1px solid var(--slate-200); }
  .process li:first-child { border-top: 1px solid var(--navy); }
  .flow { padding: 18px; }
  .flow-stages { grid-template-columns: 1fr 1fr; row-gap: 20px; }
  .flow-stages li:nth-child(2)::after { display: none; }
  .form { padding: 20px; }
  .actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
.hero-grid > *, .about > *, .pilot > *, .grid > *, .usecases > * { min-width: 0; }
