/* ==========================================================================
   Stratoblitz: design tokens
   ========================================================================== */

:root {
  --bg: #14171B;
  --surface: #191D22;
  --surface-alt: #1D2228;
  --surface-raised: #21272E;
  --border: #2B323B;
  --border-soft: #22282F;

  --text: #ECEDEF;
  --text-muted: #9BA3AD;
  --text-faint: #7B8590;

  --accent: #C17A3E;
  --accent-strong: #E0975C;
  --accent-soft: rgba(193, 122, 62, 0.14);
  --accent-line: rgba(193, 122, 62, 0.35);

  --font-sans: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;

  --content-width: 1160px;
  --content-width-narrow: 720px;

  --radius-sm: 3px;
  --radius-md: 6px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ==========================================================================
   Reset
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }

ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

img, svg { display: block; max-width: 100%; }

button { font-family: inherit; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #14171B;
  padding: 12px 18px;
  z-index: 200;
  font-weight: 600;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

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

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

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20, 23, 27, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.wordmark img {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.wordmark-footer img {
  width: 22px;
  height: 22px;
}

.site-nav {
  display: flex;
  gap: 32px;
  margin-right: auto;
  margin-left: 56px;
}
.site-nav a {
  color: var(--text-muted);
  font-size: 0.93rem;
  font-weight: 500;
  transition: color 0.18s var(--ease);
}
.site-nav a:hover { color: var(--text); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  font-size: 0.94rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #16110B;
}
.btn-primary:hover { background: var(--accent-strong); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent-line); color: var(--accent-strong); }

.btn-header {
  padding: 10px 18px;
  font-size: 0.88rem;
  background: transparent;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.btn-header:hover { border-color: var(--accent-line); color: var(--accent-strong); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding: 96px 0 108px;
  border-bottom: 1px solid var(--border-soft);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.85fr;
  gap: 64px;
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(2.5rem, 4.4vw, 3.6rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.02em;
  max-width: 12.5ch;
}

.hero-sub {
  margin-top: 26px;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 46ch;
}

.hero-actions {
  margin-top: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-diagram { width: 100%; }

.pipeline-svg {
  width: 100%;
  height: auto;
}

.pl-spine {
  stroke: var(--border);
  stroke-width: 1.5;
}

.pl-node circle {
  fill: var(--surface-raised);
  stroke: var(--text-faint);
  stroke-width: 1.5;
}
.pl-node-final circle {
  fill: var(--accent);
  stroke: var(--accent);
}

.pl-node text {
  fill: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
}
.pl-node-final text {
  fill: var(--text);
  font-weight: 600;
}

.pl-pulse {
  fill: var(--accent);
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .pl-pulse {
    animation: pulse-travel 6s linear infinite;
  }
  /*
    The dot travels the full 265px path (Lead to Booked job) at a constant
    speed. Keyframe stops sit proportionally to the real distance between
    each node (70px, 70px, 70px, 55px), so the perceived speed is identical
    across every segment. It then holds briefly at the final node, fades
    out, and resets position while invisible.
  */
  @keyframes pulse-travel {
    0%     { opacity: 0; transform: translateY(0); }
    3%     { opacity: 1; transform: translateY(0); }
    22.5%  { transform: translateY(70px); }
    42%    { transform: translateY(140px); }
    61.5%  { transform: translateY(210px); }
    75%    { opacity: 1; transform: translateY(265px); }
    88%    { opacity: 1; transform: translateY(265px); }
    91%    { opacity: 0; transform: translateY(265px); }
    100%   { opacity: 0; transform: translateY(0); }
  }
}

/* ==========================================================================
   Section shell
   ========================================================================== */

.section {
  padding: 96px 0;
  border-bottom: 1px solid var(--border-soft);
}

.section-alt { background: var(--surface); }
.section-dark { background: #101317; }

.section-head { max-width: 640px; }
.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.18;
}
.section-sub {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ==========================================================================
   Problem
   ========================================================================== */

.problem-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 64px;
}

.problem-body p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 58ch;
}

.leak-list {
  margin: 30px 0;
  border-top: 1px solid var(--border-soft);
}
.leak-list li {
  padding: 18px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 1.02rem;
  color: var(--text-muted);
  max-width: 58ch;
}
.leak-list li span {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}

.problem-close { color: var(--text-muted); }

/* ==========================================================================
   Mechanism / pipeline steps
   ========================================================================== */

.pipeline-steps {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  position: relative;
}

.pipeline-steps::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.pipeline-steps li {
  padding: 0 22px 0 0;
  position: relative;
}

.pipeline-steps li:first-child { padding-left: 0; }

.step-num {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--surface);
  width: fit-content;
  padding-right: 10px;
  position: relative;
  z-index: 2;
}
.section-alt .step-num { background: var(--surface); }

.pipeline-steps h3 {
  margin-top: 22px;
  font-size: 1.1rem;
  font-weight: 600;
}

.pipeline-steps p {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

.process-steps {
  grid-template-columns: repeat(4, 1fr);
}

/* ==========================================================================
   Differentiation
   ========================================================================== */

.diff-grid {
  margin-top: 52px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.diff-card h3 {
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.diff-card p {
  margin-top: 14px;
  color: var(--text-muted);
  max-width: 46ch;
}

.stack-diagram {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  max-width: 340px;
}
.stack-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.stack-strato {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stack-strato-label {
  color: var(--accent-strong);
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 0.9rem;
}
.stack-strato-functions {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.stack-arrow {
  color: var(--text-faint);
  font-size: 0.9rem;
  padding-left: 16px;
}

.scope-diagram { margin-top: 34px; }
.scope-track {
  display: flex;
  height: 46px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.scope-segment {
  display: flex;
  align-items: center;
  padding: 0 14px;
}
.scope-segment-narrow {
  flex: 0 0 26%;
  background: var(--surface-raised);
  border-right: 1px solid var(--border);
}
.scope-segment-wide {
  flex: 1;
  background: var(--accent-soft);
}
.scope-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.3;
}
.scope-segment-wide .scope-label { color: var(--accent-strong); font-weight: 500; }

/* ==========================================================================
   Existing stack / CRM
   ========================================================================== */

.stack-section-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 64px;
  align-items: center;
}

/* ==========================================================================
   Economics
   ========================================================================== */

.economics-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.6fr;
  gap: 72px;
  align-items: start;
}

.economics-copy h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.16;
  max-width: 16ch;
}

.serif-quote {
  margin-top: 26px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.22rem;
  line-height: 1.55;
  color: #D7DADE;
  max-width: 40ch;
}

.economics-copy > p:last-child {
  margin-top: 22px;
  color: var(--text-muted);
  max-width: 48ch;
}

.ledger {
  border-top: 1px solid var(--border);
}
.ledger-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.98rem;
  color: var(--text-muted);
}
.ledger-final {
  color: var(--accent-strong);
  font-weight: 600;
  border-bottom-color: var(--accent-line);
}

/* ==========================================================================
   Audience
   ========================================================================== */

.audience-list {
  margin-top: 44px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 40px;
}
.audience-list li {
  padding-left: 20px;
  border-left: 2px solid var(--accent-line);
  font-size: 1.02rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   Final CTA
   ========================================================================== */

.cta-section { border-bottom: none; }

.cta-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}

.cta-centered h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.cta-centered p {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 1.03rem;
}

.cta-centered .btn { margin-top: 30px; }

.cta-reassurance {
  margin-top: 22px;
  color: var(--text-faint);
  font-size: 0.88rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding: 48px 0;
  border-top: 1px solid var(--border-soft);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.wordmark-footer { color: var(--text-muted); font-size: 0.95rem; }
/* .wordmark-footer svg { color: var(--text-faint); } */

.footer-brand p {
  margin-top: 10px;
  color: var(--text-faint);
  font-size: 0.88rem;
}

.footer-meta {
  text-align: right;
}
.footer-meta a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.18s var(--ease);
}
.footer-meta a:hover { color: var(--accent-strong); }
.footer-meta p {
  margin-top: 10px;
  color: var(--text-faint);
  font-size: 0.82rem;
}

/* ==========================================================================
   Reveal animation (single orchestrated entrance per section)
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  }
  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr; gap: 56px; }
  .hero-diagram { max-width: 420px; }
  .problem-grid { grid-template-columns: 1fr; gap: 32px; }
  .diff-grid { grid-template-columns: 1fr; gap: 44px; }
  .stack-section-grid { grid-template-columns: 1fr; gap: 40px; }
  .stack-diagram { max-width: 420px; }
  .economics-grid { grid-template-columns: 1fr; gap: 40px; }
  .ledger { max-width: 420px; }
  .pipeline-steps { grid-template-columns: repeat(3, 1fr); row-gap: 40px; }
  .process-steps { grid-template-columns: repeat(2, 1fr); }
  .pipeline-steps::before { display: none; }
  .pipeline-steps li { padding-left: 0 !important; }
}

@media (max-width: 768px) {
  .wrap { padding: 0 20px; }
  .site-nav { display: none; }
  .header-inner { height: 60px; }
  .hero { padding: 56px 0 64px; }
  .section { padding: 64px 0; }
  .hero-copy h1 { max-width: none; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .btn-header { width: auto; }
  .pipeline-steps { grid-template-columns: repeat(2, 1fr); }
  .process-steps { grid-template-columns: 1fr 1fr; }
  .audience-list { grid-template-columns: 1fr; }
  .scope-track { flex-direction: column; height: auto; }
  .scope-segment-narrow { border-right: none; border-bottom: 1px solid var(--border); padding: 12px 14px; }
  .scope-segment-wide { padding: 12px 14px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-meta { text-align: left; }
}

@media (max-width: 480px) {
  .pipeline-steps { grid-template-columns: 1fr 1fr; }
}
