/* ==========================================================================
   Agent Setup — Design System / theme.css
   New visual identity: warm editorial-technical, signal-orange accent.
   REPLACES the old dark-cyan theme.
   ========================================================================== */

/* ---------- 1. GOOGLE FONTS ---------- */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Hanken+Grotesk:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- 2. DESIGN TOKENS ---------- */
:root {
  /* Palette */
  --c-base:        #F6F3EC;   /* warm off-white page background */
  --c-surface:     #FFFFFF;   /* card / elevated surface */
  --c-surface-2:   #FBF9F4;   /* subtle surface lift */
  --c-ink:         #16150F;   /* primary text */
  --c-muted:       #6B6657;   /* secondary / body text */
  --c-faint:       #9C9485;   /* placeholder / tertiary */
  --c-border:      #E4DFD3;   /* hairline rule */
  --c-border-strong: #C8C2B5; /* stronger rule */
  --c-accent:      #E8500E;   /* signal-orange — primary CTA */
  --c-accent-dark: #C23F09;   /* orange hover / pressed */
  --c-accent-light:#F5855A;   /* orange tint */
  --c-accent-wash: rgba(232,80,14,0.07); /* subtle orange fill */

  /* Typography */
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body:    'Hanken Grotesk', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Type scale */
  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 16px;
  --text-md:   18px;
  --text-lg:   22px;
  --text-xl:   28px;
  --text-2xl:  36px;
  --text-3xl:  48px;
  --text-4xl:  64px;
  --text-hero: 80px;

  /* Font weights */
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-extrabold:800;

  /* Spacing scale (8-pt grid) */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;
  --sp-32: 128px;

  /* Radii */
  --radius-sm:  6px;
  --radius:     12px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-pill:9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(22,21,15,0.06);
  --shadow-sm: 0 2px 8px rgba(22,21,15,0.08);
  --shadow-md: 0 4px 24px rgba(22,21,15,0.10);
  --shadow-lg: 0 12px 48px rgba(22,21,15,0.12);
  --shadow-xl: 0 24px 80px rgba(22,21,15,0.16);

  /* Layout */
  --page-max: 1200px;
  --page-pad: 32px;
}

/* ---------- 3. RESET & BASE ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--c-base);
  color: var(--c-ink);
  font-family: var(--font-body);
  font-weight: var(--fw-regular);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--c-accent);
  color: #fff;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; }

/* ---------- 4. LAYOUT ---------- */
.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.section-pad { padding: var(--sp-24) 0; }

.section-head {
  max-width: 720px;
  margin-bottom: var(--sp-12);
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 54px);
  font-weight: var(--fw-bold);
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--c-ink);
}

.section-head h2 em {
  font-style: italic;
  font-weight: var(--fw-extrabold);
  color: var(--c-accent);
}

/* ---------- 5. TEXTURE & DECORATIVE ELEMENTS ---------- */

/* Subtle dotted-grid background utility class */
.dot-grid {
  position: relative;
}
.dot-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--c-border) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}
.dot-grid > * { position: relative; z-index: 1; }

/* Hairline divider */
.divider {
  height: 1px;
  background: var(--c-border);
}

/* ---------- 6. TYPOGRAPHY UTILITIES ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 18px;
}

.eyebrow::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-accent);
  flex-shrink: 0;
}

.eyebrow.ink {
  color: var(--c-muted);
}
.eyebrow.ink::before {
  background: var(--c-muted);
}

.display {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--c-ink);
}

.body-copy {
  font-size: var(--text-md);
  font-weight: var(--fw-regular);
  line-height: 1.65;
  color: var(--c-muted);
}

/* ---------- 7. BUTTONS ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.01em;
  border-radius: var(--radius-pill);
  padding: 12px 26px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
}

/* Primary — solid orange */
.btn-primary {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
  box-shadow: var(--shadow-sm), 0 0 0 0 rgba(232,80,14,0);
}
.btn-primary:hover {
  background: var(--c-accent-dark);
  border-color: var(--c-accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 20px rgba(232,80,14,0.22);
}

/* Ghost — ink border */
.btn-ghost {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-border-strong);
}
.btn-ghost:hover {
  border-color: var(--c-ink);
  transform: translateY(-2px);
}

/* Ghost light — for use on white surfaces */
.btn-ghost-light {
  background: transparent;
  color: var(--c-muted);
  border-color: var(--c-border);
}
.btn-ghost-light:hover {
  color: var(--c-ink);
  border-color: var(--c-border-strong);
}

/* Accent text link style */
.btn-text {
  background: none;
  border: none;
  color: var(--c-accent);
  padding: 0;
  font-weight: var(--fw-semibold);
  letter-spacing: 0;
  border-radius: 0;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.btn-text:hover {
  color: var(--c-accent-dark);
}

/* ---------- 8. NAV ---------- */

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  border-bottom: 1px solid transparent;
}

nav.scrolled {
  background: rgba(246,243,236,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--c-border);
  box-shadow: var(--shadow-xs);
}

.nav-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 18px var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo .wordmark { height: 24px; display: block; }
.foot-brand .logo .wordmark { height: 28px; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--c-muted);
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}
.nav-link:hover { color: var(--c-ink); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

/* ---------- 9. CARDS ---------- */

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
  border-color: var(--c-border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ---------- 10. PROCESS CARDS ---------- */

.pcard {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.3s ease;
}
.pcard:hover {
  border-color: var(--c-border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.pcard .step {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-accent);
  font-weight: var(--fw-medium);
  margin-bottom: var(--sp-4);
}

.pcard h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: var(--sp-3);
  color: var(--c-ink);
}

.pcard p {
  font-size: var(--text-base);
  color: var(--c-muted);
  line-height: 1.6;
}

/* ---------- 11. SCROLL REVEAL ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

.reveal-diag { opacity: 0; transition: opacity 0.5s ease; }
.reveal-diag > * {
  clip-path: polygon(-40% 0, 2% 0, -30% 100%, -40% 100%);
  transition: clip-path 1s cubic-bezier(0.16,1,0.3,1);
}
.reveal-diag > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-diag > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-diag.in { opacity: 1; }
.reveal-diag.in > * {
  clip-path: polygon(-40% 0, 140% 0, 140% 100%, -40% 100%);
}

/* ---------- 12. FOOTER ---------- */

footer {
  background: var(--c-surface-2);
  border-top: 1px solid var(--c-border);
  padding: var(--sp-20) 0 var(--sp-12);
}

.foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: var(--sp-10);
  margin-bottom: var(--sp-16);
}

.foot-brand p {
  font-size: var(--text-sm);
  color: var(--c-muted);
  max-width: 32ch;
  line-height: 1.65;
  margin-top: var(--sp-5);
}

.foot-col h4 {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-ink);
  font-weight: var(--fw-medium);
  margin-bottom: var(--sp-5);
}

.foot-col a {
  display: block;
  font-size: var(--text-sm);
  color: var(--c-muted);
  margin-bottom: var(--sp-3);
  transition: color 0.2s ease;
}
.foot-col a:hover { color: var(--c-accent); }

.foot-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--c-border);
  padding-top: var(--sp-8);
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.foot-bottom .copy {
  font-size: var(--text-xs);
  color: var(--c-faint);
  letter-spacing: 0.02em;
}

.foot-bottom .legal {
  display: flex;
  gap: var(--sp-6);
}

.foot-bottom .legal a {
  font-size: var(--text-xs);
  color: var(--c-faint);
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}
.foot-bottom .legal a:hover { color: var(--c-ink); }

/* ---------- 13. PROSE / ARTICLE STYLES (blog posts) ---------- */

.prose {
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.75;
  color: var(--c-ink);
  max-width: 68ch;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--c-ink);
  margin-top: 2.2em;
  margin-bottom: 0.6em;
}

.prose h1 { font-size: clamp(28px, 3.5vw, 42px); }
.prose h2 { font-size: clamp(22px, 2.5vw, 32px); }
.prose h3 { font-size: var(--text-xl); }
.prose h4 { font-size: var(--text-lg); }

.prose p { margin-bottom: 1.4em; }
.prose p:last-child { margin-bottom: 0; }

.prose a {
  color: var(--c-accent);
  text-decoration: underline;
  text-decoration-color: rgba(232,80,14,0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}
.prose a:hover { text-decoration-color: var(--c-accent); }

.prose strong { font-weight: var(--fw-semibold); color: var(--c-ink); }
.prose em { font-style: italic; }

.prose ul, .prose ol {
  margin-left: 1.5em;
  margin-bottom: 1.4em;
}
.prose li { margin-bottom: 0.5em; }

.prose blockquote {
  border-left: 3px solid var(--c-accent);
  margin: 1.8em 0;
  padding: 0.6em 1.4em;
  background: var(--c-accent-wash);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--c-muted);
  font-style: italic;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  color: var(--c-accent);
}

.prose pre {
  background: var(--c-ink);
  color: #F6F3EC;
  border-radius: var(--radius);
  padding: var(--sp-6);
  overflow-x: auto;
  margin: 1.6em 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.7;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 2.4em 0;
}

.prose img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1.6em 0;
  border: 1px solid var(--c-border);
}

/* ---------- 14. STATS STRIP ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
}

.stat {
  padding: var(--sp-12) var(--sp-8);
  border-right: 1px solid var(--c-border);
}
.stat:last-child { border-right: none; }

.stat .num {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.5vw, 46px);
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--c-ink);
  margin-bottom: var(--sp-3);
}
.stat .num .unit { color: var(--c-accent); }
.stat .label {
  font-size: var(--text-sm);
  color: var(--c-muted);
  letter-spacing: 0.01em;
}

/* ---------- 15. SCROLL PROGRESS BAR ---------- */

#scrollProgress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--c-accent);
  z-index: 200;
  pointer-events: none;
  transition: width 0.1s linear;
}

/* ---------- 16. PAGE SKEW ---------- */

.page-skew { will-change: transform; transform-origin: 50% 50%; }

/* ---------- 17. FAQ ---------- */

.faq-list { border-top: 1px solid var(--c-border); }
.faq-item { border-bottom: 1px solid var(--c-border); }

.faq-q {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--c-ink);
  font-family: var(--font-display);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 26px 4px;
  text-align: left;
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}
.faq-q:hover { color: var(--c-accent); }

.faq-q .plus {
  flex-shrink: 0;
  width: 22px; height: 22px;
  position: relative;
  transition: transform 0.3s ease;
}
.faq-q .plus::before, .faq-q .plus::after {
  content: '';
  position: absolute;
  background: var(--c-border-strong);
  transition: background 0.2s ease;
}
.faq-q .plus::before { top: 10px; left: 0; width: 22px; height: 2px; }
.faq-q .plus::after  { left: 10px; top: 0; width: 2px; height: 22px; }

.faq-item.open .plus { transform: rotate(135deg); }
.faq-item.open .plus::before,
.faq-item.open .plus::after { background: var(--c-accent); }

.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.faq-a p {
  font-size: var(--text-base);
  color: var(--c-muted);
  padding: 0 4px var(--sp-8);
  max-width: 70ch;
  line-height: 1.65;
}

/* ---------- 18. TRUST MARQUEE ---------- */

.trust {
  text-align: center;
  padding: var(--sp-12) 0 var(--sp-6);
}

.trust p {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--fw-medium);
  letter-spacing: -0.02em;
  color: var(--c-muted);
}

.trust-marquee {
  overflow: hidden;
  margin-top: var(--sp-10);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.trust-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: marquee 30s linear infinite;
}

.trust-track img {
  height: 24px;
  width: auto;
  margin: 0 32px;
  opacity: 0.45;
  filter: grayscale(1) brightness(0.3);
  transition: opacity 0.3s ease, filter 0.3s ease;
}
.trust-track img:hover {
  opacity: 0.75;
  filter: grayscale(0.5) brightness(0.6);
}
.trust-marquee:hover .trust-track { animation-play-state: paused; }

@keyframes marquee { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  .trust-track { animation: none; width: auto; flex-wrap: wrap; justify-content: center; }
  .trust-track img[aria-hidden] { display: none; }
}

/* ---------- 19. RESPONSIVE OVERRIDES ---------- */

@media (max-width: 900px) {
  :root { --page-pad: 20px; }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    background: rgba(246,243,236,0.97);
    backdrop-filter: blur(16px);
    padding: 28px var(--page-pad);
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-md);
  }
  .nav-menu.open { display: flex; }
  .nav-toggle { display: block; }
  .nav-inner { padding: 14px var(--page-pad); }

  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--c-border); }
}

@media (max-width: 600px) {
  .section-pad { padding: var(--sp-16) 0; }
  .section-head { margin-bottom: var(--sp-8); }

  .foot-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stat { border-right: none; border-bottom: 1px solid var(--c-border); }
  .stat:last-child { border-bottom: none; }

  .faq-q { font-size: var(--text-md); }
}
