/* ===================================================================
   ReplayCI — Marketing Site Styles
   Premium dark mode. Fluid typography. Depth through layered shadows.
   Inspired by Vercel, Cursor, Anthropic, Linear.
   =================================================================== */

/* --- Fonts (self-hosted, variable) --- */
@font-face {
  font-family: 'Geist';
  src: url('fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --- Custom Properties --- */
:root {
  --bg: #000000;
  --bg-elevated: #0a0a0c;
  --surface: #111113;
  --surface-hover: #161618;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-primary: #fafafa;
  --text-secondary: rgba(250, 250, 250, 0.7);
  --text-tertiary: rgba(250, 250, 250, 0.45);
  --text-quaternary: rgba(250, 250, 250, 0.25);
  --pass: #34d399;
  --fail: #f87171;
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: 'Geist Mono', "SF Mono", "Fira Code", "Cascadia Code", monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 200ms;
  --duration-slow: 400ms;
  --section-gap: clamp(100px, 8vw + 40px, 200px);
  --site-margin: clamp(16px, 4vw, 24px);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

::selection {
  background: rgba(52, 211, 153, 0.25);
}

body {
  font-family: var(--font-sans);
  font-size: clamp(15px, 0.9rem + 0.2vw, 17px);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

/* --- Skip to content (accessibility) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  padding: 8px 16px;
  background: var(--text-primary);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  z-index: 1000;
  transition: top var(--duration-normal) var(--ease-out);
}

.skip-link:focus {
  top: 8px;
}

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--site-margin);
}

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

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

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--site-margin);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__wordmark {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #ffffff;
}

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

.nav__link {
  font-size: 14px;
  color: var(--text-tertiary);
  transition: color var(--duration-fast) ease;
}

.nav__link:hover,
.nav__link:focus-visible {
  color: var(--text-primary);
}

.nav__cta {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--bg);
  background: var(--text-primary);
  padding: 7px 16px;
  border-radius: 6px;
  transition: all var(--duration-fast) ease;
}

.nav__cta:hover {
  background: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
}

/* Keep .nav__links for backward compat (security/docs pages) */
.nav__links {
  display: flex;
  gap: 28px;
  list-style: none;
}

/* --- Fluid Typography --- */
.headline {
  font-size: clamp(2.5rem, 2rem + 2.5vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-wrap: balance;
}

.headline--page {
  font-size: clamp(2.25rem, 1.8rem + 2vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-align: center;
  text-wrap: balance;
  color: #ffffff;
}

.section__headline {
  font-size: clamp(2rem, 1.6rem + 1.5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-align: center;
  text-wrap: balance;
  color: var(--text-primary);
}

.subhead {
  font-size: clamp(1.1rem, 1rem + 0.25vw, 1.25rem);
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.6;
}

.text-muted { color: var(--text-secondary); }
.text-faint { color: var(--text-quaternary); }
.text-center { text-align: center; }

.label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-quaternary);
}

/* --- Sections --- */
.section {
  padding: var(--section-gap) 0;
}

.section--tight {
  padding: clamp(60px, 5vw + 30px, 120px) 0;
}

/* --- Hero --- */
.hero {
  padding: clamp(80px, 6vw + 20px, 140px) 0 var(--section-gap);
  text-align: center;
  position: relative;
}

.hero__label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-quaternary);
  margin-bottom: 24px;
}

.hero__headline {
  font-size: clamp(2.5rem, 2rem + 3vw, 4rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.08;
  text-wrap: balance;
  overflow-wrap: break-word;
  color: var(--text-primary);
}

.hero__headline-accent {
  background: linear-gradient(180deg, rgba(250, 250, 250, 0.8) 0%, rgba(250, 250, 250, 0.35) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subhead {
  font-size: clamp(1.05rem, 0.95rem + 0.3vw, 1.2rem);
  font-weight: 400;
  color: rgba(250, 250, 250, 0.5);
  line-height: 1.6;
  margin-top: 20px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.hero__ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}

.hero__terminal-wrapper {
  position: relative;
  max-width: 720px;
  margin: clamp(48px, 4vw + 16px, 72px) auto 0;
}

/* Glow behind the terminal */
.hero__terminal-wrapper::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 140%;
  background: radial-gradient(
    50% 50% at 50% 50%,
    rgba(52, 211, 153, 0.06) 0%,
    rgba(52, 211, 153, 0.02) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
}

.hero__micro-proof {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 32px;
  letter-spacing: 0.02em;
}

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 28px;
  background: #fafafa;
  color: #000000;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-smooth);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15),
              0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15),
              0 2px 8px rgba(0, 0, 0, 0.3),
              0 0 20px rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--pass);
  outline-offset: 2px;
}

.link-secondary {
  font-size: 14px;
  color: var(--text-tertiary);
  transition: color var(--duration-fast) ease;
}

.link-secondary:hover,
.link-secondary:focus-visible {
  color: var(--text-primary);
}

/* --- Terminal Window (realistic) --- */
.terminal {
  background: #0a0a0c;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05),
              0 4px 8px rgba(0, 0, 0, 0.3),
              0 12px 32px rgba(0, 0, 0, 0.4);
}

.terminal__header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal__dot:nth-child(1) { background: #ff5f57; }
.terminal__dot:nth-child(2) { background: #febc2e; }
.terminal__dot:nth-child(3) { background: #28c840; }

.terminal__title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-quaternary);
  letter-spacing: 0.02em;
  margin-right: 36px; /* offset for dots to center the title */
}

.terminal__body {
  padding: clamp(18px, 2vw + 6px, 28px) clamp(16px, 2vw + 4px, 24px);
  overflow-x: auto;
  text-align: left;
}

.terminal__body pre {
  font-family: var(--font-mono);
  font-size: clamp(12.5px, 0.75rem + 0.15vw, 14px);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre;
  margin: 0;
  -webkit-font-feature-settings: "calt" 0;
  font-feature-settings: "calt" 0;
}

/* Terminal text colors */
.t-muted   { color: var(--text-tertiary); }
.t-pass    { color: var(--pass); }
.t-fail    { color: var(--fail); }
.t-name    { color: var(--text-primary); }
.t-bold    { color: var(--text-primary); font-weight: 500; }
.t-url     { color: var(--text-secondary); }
.t-dim     { color: var(--text-quaternary); }
.t-prompt  { color: var(--text-tertiary); }
.t-cursor  { color: var(--text-primary); animation: blink 1s step-end infinite; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* --- Code Block (for YAML etc.) --- */
.code-block-wrapper {
  background: #0a0a0c;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05),
              0 4px 8px rgba(0, 0, 0, 0.3),
              0 12px 32px rgba(0, 0, 0, 0.4);
}

.code-block-wrapper__header {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-block-wrapper__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-quaternary);
}

.code-block-wrapper__body {
  padding: clamp(20px, 2vw + 8px, 28px) clamp(20px, 2vw + 8px, 28px);
  overflow-x: auto;
}

.code-block-wrapper__body pre {
  font-family: var(--font-mono);
  font-size: clamp(12.5px, 0.75rem + 0.15vw, 14px);
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre;
  margin: 0;
}

/* YAML syntax colors (monochrome) */
.y-comment { color: var(--text-quaternary); }
.y-key     { color: var(--text-secondary); }
.y-string  { color: var(--text-primary); }
.y-punct   { color: var(--text-quaternary); }

/* ===================================================================
   How It Works — Feature Rows
   =================================================================== */

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 5vw, 80px);
  align-items: center;
  padding: clamp(48px, 5vw, 80px) 0;
}

.feature-row + .feature-row {
  border-top: 1px solid var(--border);
}

.feature-row__step {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--pass);
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.feature-row__title {
  font-size: clamp(1.25rem, 1.1rem + 0.4vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.feature-row__desc {
  font-size: clamp(0.9rem, 0.88rem + 0.1vw, 1rem);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-top: 12px;
}

/* ===================================================================
   Visual: Editor (Define step)
   =================================================================== */

.visual-editor {
  background: #0a0a0c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05),
              0 4px 8px rgba(0, 0, 0, 0.3),
              0 12px 32px rgba(0, 0, 0, 0.4);
}

.visual-editor__header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.visual-editor__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.visual-editor__dot:nth-child(1) { background: #ff5f57; }
.visual-editor__dot:nth-child(2) { background: #febc2e; }
.visual-editor__dot:nth-child(3) { background: #28c840; }

.visual-editor__filename {
  margin-left: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-quaternary);
  letter-spacing: 0.02em;
}

.visual-editor__body {
  padding: clamp(16px, 2vw, 24px);
  overflow-x: auto;
}

.visual-editor__body pre {
  font-family: var(--font-mono);
  font-size: clamp(12px, 0.7rem + 0.15vw, 13.5px);
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre;
  margin: 0;
}

/* ===================================================================
   Visual: Compare (Test step) — side-by-side premium
   =================================================================== */

.visual-compare {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3),
              0 12px 32px rgba(0, 0, 0, 0.25);
}

.visual-compare__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.visual-compare__header-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.visual-compare__header-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-quaternary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.visual-compare__grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
}

.visual-compare__col {
  padding: 16px;
}

.visual-compare__col-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.visual-compare__provider-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.visual-compare__provider-model {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-quaternary);
}

.visual-compare__col-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.visual-compare__cell {
  font-family: var(--font-mono);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.visual-compare__cell span {
  flex-shrink: 0;
}

.visual-compare__cell--pass {
  color: var(--text-secondary);
}

.visual-compare__cell--pass span {
  color: var(--pass);
}

.visual-compare__cell--diff {
  color: var(--text-secondary);
  background: rgba(248, 113, 113, 0.06);
}

.visual-compare__cell--diff span {
  color: var(--fail);
}

.visual-compare__divider-v {
  width: 1px;
  background: var(--border);
}

.visual-compare__footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.015);
}

.visual-compare__footer-stat {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
}

.visual-compare__footer-stat--match {
  color: var(--pass);
  background: rgba(52, 211, 153, 0.1);
}

.visual-compare__footer-stat--diff {
  color: var(--fail);
  background: rgba(248, 113, 113, 0.1);
}

/* ===================================================================
   Visual: PR Checks (Gate step) — GitHub-style
   =================================================================== */

.visual-pr {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3),
              0 12px 32px rgba(0, 0, 0, 0.25);
}

.visual-pr__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid #21262d;
}

.visual-pr__icon {
  color: #3fb950;
  flex-shrink: 0;
}

.visual-pr__title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: #e6edf3;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visual-pr__number {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #7d8590;
  flex-shrink: 0;
}

.visual-pr__checks {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.visual-pr__checks-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: #f85149;
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid #21262d;
}

.visual-pr__x-icon {
  color: #f85149;
  flex-shrink: 0;
}

.visual-pr__check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-family: var(--font-sans);
  font-size: 12px;
}

.visual-pr__check-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.visual-pr__check-dot--pass { background: #3fb950; }
.visual-pr__check-dot--fail { background: #f85149; }

.visual-pr__check-name {
  color: #e6edf3;
  font-weight: 500;
}

.visual-pr__check-detail {
  color: #7d8590;
  font-family: var(--font-mono);
  font-size: 11px;
  margin-left: auto;
}

.visual-pr__check-status {
  color: #7d8590;
  font-size: 11px;
  margin-left: auto;
}

.visual-pr__merge {
  padding: 14px 16px;
  border-top: 1px solid #21262d;
  display: flex;
  align-items: center;
  gap: 14px;
}

.visual-pr__merge-btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: default;
  opacity: 0.5;
}

.visual-pr__merge-blocked {
  font-family: var(--font-sans);
  font-size: 12px;
  color: #f85149;
  font-weight: 500;
}

/* ===================================================================
   Integration — setup steps + terminal
   =================================================================== */

.integration {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 5vw, 80px);
  align-items: center;
  margin-top: clamp(40px, 4vw, 72px);
}

.integration__steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.integration__step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.integration__step:first-child {
  border-top: 1px solid var(--border);
}

.integration__step-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--pass);
  background: rgba(52, 211, 153, 0.08);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 2px;
}

.integration__step-title {
  font-size: clamp(0.95rem, 0.9rem + 0.15vw, 1.05rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.integration__step-desc {
  font-size: clamp(0.825rem, 0.8rem + 0.1vw, 0.9rem);
  color: var(--text-secondary);
  line-height: 1.65;
  margin-top: 4px;
}

/* ===================================================================
   Contract Preview
   =================================================================== */

.contract {
  text-align: center;
}

.contract__title {
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-wrap: balance;
  color: var(--text-primary);
}

.contract__subtitle {
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
  font-weight: 400;
  color: var(--text-tertiary);
  margin-top: 4px;
  letter-spacing: -0.02em;
}

.contract__code {
  max-width: 560px;
  margin: clamp(32px, 3vw, 56px) auto 0;
  text-align: left;
}

.contract__link {
  margin-top: 32px;
}

/* --- CTA Section --- */
.cta-section {
  padding: var(--section-gap) 0;
  text-align: center;
  position: relative;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.cta-section__headline {
  font-size: clamp(1.75rem, 1.5rem + 1.2vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: var(--text-primary);
}

.cta-section__body {
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.15rem);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 16px;
}

.cta-section__button {
  margin-top: 36px;
}

/* ===================================================================
   Security Page — Layer Stack
   =================================================================== */

.layer-stack {
  max-width: 840px;
  margin: clamp(48px, 4vw, 80px) auto 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3),
              0 12px 32px rgba(0, 0, 0, 0.25);
}

.layer {
  background: var(--surface);
  padding: clamp(16px, 1.5vw + 8px, 24px) clamp(20px, 2vw + 8px, 28px);
  display: flex;
  align-items: baseline;
  gap: 16px;
  transition: background var(--duration-fast) ease;
}

.layer:hover {
  background: var(--surface-hover);
}

.layer__number {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-quaternary);
  flex-shrink: 0;
  min-width: 20px;
}

.layer__name {
  font-size: clamp(0.95rem, 0.9rem + 0.15vw, 1.05rem);
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.layer__sep {
  color: var(--text-quaternary);
  flex-shrink: 0;
}

.layer__desc {
  font-size: clamp(0.8rem, 0.78rem + 0.1vw, 0.9rem);
  color: var(--text-secondary);
}

/* Security paragraphs */
.security-details {
  max-width: 720px;
  margin: clamp(60px, 5vw, 100px) auto 0;
}

.security-detail {
  margin-top: clamp(36px, 3vw, 56px);
}

.security-detail:first-child {
  margin-top: 0;
}

.security-detail__heading {
  font-size: clamp(1.2rem, 1.1rem + 0.4vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.security-detail__body {
  font-size: clamp(0.9rem, 0.88rem + 0.1vw, 1rem);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-top: 10px;
}

/* ===================================================================
   Docs Page — Doc Cards
   =================================================================== */

.doc-cards {
  max-width: 640px;
  margin: clamp(48px, 4vw, 80px) auto 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: clamp(20px, 2vw + 4px, 28px);
  transition: all var(--duration-normal) var(--ease-smooth);
}

.doc-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
              0 8px 24px rgba(0, 0, 0, 0.25);
}

.doc-card:focus-visible {
  outline: 2px solid var(--pass);
  outline-offset: 2px;
}

.doc-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.doc-card__title {
  font-size: clamp(0.95rem, 0.9rem + 0.15vw, 1.05rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.doc-card__arrow {
  color: var(--text-quaternary);
  font-size: 16px;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.doc-card:hover .doc-card__arrow {
  color: var(--text-secondary);
  transform: translateX(2px);
}

.doc-card__desc {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* ===================================================================
   Page Header (shared by security, docs)
   =================================================================== */

.page-header {
  text-align: center;
  padding: clamp(80px, 6vw + 20px, 120px) 0 0;
}

.page-header__subhead {
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.15rem);
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 14px;
}

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

.footer {
  position: relative;
  padding: clamp(48px, 4vw, 80px) 0;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--site-margin);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.footer__left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer__right {
  display: flex;
  gap: 28px;
}

.footer__wordmark {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__link {
  font-size: 13px;
  color: var(--text-tertiary);
  transition: color var(--duration-fast) ease;
}

.footer__link:hover,
.footer__link:focus-visible {
  color: var(--text-primary);
}

.footer__copyright {
  font-size: 12px;
  color: var(--text-quaternary);
}

/* ===================================================================
   Doc Content Pages (quickstart, writing-tests, cli)
   =================================================================== */

.doc-content {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(48px, 4vw, 80px) var(--site-margin) var(--section-gap);
}

.doc-section {
  margin-top: clamp(40px, 3vw, 56px);
}

.doc-section:first-child {
  margin-top: clamp(32px, 3vw, 48px);
}

.doc-h2 {
  font-size: clamp(1.3rem, 1.15rem + 0.5vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 16px;
  padding-top: 8px;
}

.doc-h3 {
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.15rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-top: 28px;
  margin-bottom: 12px;
}

.doc-p {
  font-size: clamp(0.9rem, 0.88rem + 0.1vw, 1rem);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-top: 12px;
  margin-bottom: 12px;
}

.doc-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.doc-list li {
  font-size: clamp(0.9rem, 0.88rem + 0.1vw, 1rem);
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: 20px;
  position: relative;
  margin-top: 6px;
}

.doc-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-quaternary);
}

.doc-list li strong {
  color: var(--text-primary);
  font-weight: 600;
}

.doc-code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.doc-link {
  color: var(--pass);
  transition: color var(--duration-fast) ease;
}

.doc-link:hover {
  color: #6ee7b7;
}

.doc-table-wrapper {
  margin: 16px 0;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.8rem, 0.78rem + 0.1vw, 0.9rem);
}

.doc-table thead {
  background: rgba(255, 255, 255, 0.03);
}

.doc-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.doc-table td {
  color: var(--text-secondary);
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: top;
}

.doc-table tbody tr:last-child td {
  border-bottom: none;
}

.doc-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.doc-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--pass);
  background: rgba(52, 211, 153, 0.08);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  margin-right: 10px;
  vertical-align: middle;
}

/* Spacing between code blocks and text in doc pages */
.doc-content .code-block-wrapper,
.doc-content .terminal {
  margin: 16px 0;
}

/* ===================================================================
   Focus Visible
   =================================================================== */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--pass);
  outline-offset: 2px;
}

/* ===================================================================
   Animations
   =================================================================== */

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease-out),
              transform 0.6s var(--ease-out);
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.fade-in-stagger > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease-out),
              transform 0.5s var(--ease-out);
}

.fade-in-stagger.is-visible > *:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0ms; }
.fade-in-stagger.is-visible > *:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 80ms; }
.fade-in-stagger.is-visible > *:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 160ms; }
.fade-in-stagger.is-visible > *:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 240ms; }

/* Hero loads immediately (no intersection observer needed) */
.hero .fade-in-immediate {
  animation: fadeSlideUp 0.7s var(--ease-out) forwards;
}

.hero .fade-in-immediate:nth-child(1) { animation-delay: 0ms; }
.hero .fade-in-immediate:nth-child(2) { animation-delay: 100ms; }
.hero .fade-in-immediate:nth-child(3) { animation-delay: 200ms; }
.hero .fade-in-immediate:nth-child(4) { animation-delay: 350ms; }
.hero .fade-in-immediate:nth-child(5) { animation-delay: 450ms; }

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 768px) {
  .hero__headline {
    font-size: clamp(2rem, 1.5rem + 3vw, 2.75rem);
  }

  .hero__ctas {
    flex-direction: column;
    gap: 12px;
  }

  .btn-primary--mobile-full {
    width: 100%;
    text-align: center;
  }

  .terminal__body {
    padding: 16px;
  }

  .code-block-wrapper__body {
    padding: 16px;
  }

  /* Feature rows stack on mobile */
  .feature-row {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .feature-row__visual {
    order: 1;
  }

  .feature-row__content {
    order: 2;
  }

  /* Integration stacks on mobile */
  .integration {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* Visual compare: stack columns vertically */
  .visual-compare__grid {
    grid-template-columns: 1fr;
  }

  .visual-compare__divider-v {
    width: 100%;
    height: 1px;
  }

  /* Contract section */
  .contract__title,
  .contract__subtitle {
    font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  }

  .cta-section__headline {
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  }

  .cta-section__body {
    font-size: clamp(0.9rem, 0.88rem + 0.1vw, 1rem);
  }

  .layer {
    flex-direction: column;
    gap: 6px;
    padding: 16px 20px;
  }

  .layer__sep {
    display: none;
  }

  /* Footer stacks on mobile */
  .footer__inner {
    flex-direction: column;
    gap: 24px;
  }

  .footer__right {
    flex-wrap: wrap;
    gap: 16px 24px;
  }

  /* Nav */
  .nav__right {
    gap: 16px;
  }

  .nav__links {
    gap: 16px;
  }

  .page-header {
    padding: clamp(60px, 4vw + 20px, 80px) 0 0;
  }

  .doc-table th,
  .doc-table td {
    padding: 8px 12px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .hero__headline {
    font-size: clamp(1.75rem, 1.2rem + 3vw, 2.25rem);
  }

  .nav__right {
    gap: 10px;
  }

  .nav__link {
    font-size: 13px;
  }

  .nav__cta {
    font-size: 12px;
    padding: 6px 12px;
  }

  .nav__links {
    gap: 12px;
  }

  .nav__link {
    font-size: 13px;
  }

  .terminal__body pre,
  .code-block-wrapper__body pre,
  .visual-editor__body pre {
    font-size: 11.5px;
  }

  .terminal__header {
    padding: 10px 14px;
  }

  .terminal__dot,
  .visual-editor__dot {
    width: 8px;
    height: 8px;
  }
}

/* ===================================================================
   Prefers reduced motion
   =================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .fade-in,
  .fade-in-stagger > * {
    opacity: 1;
    transform: none;
  }

  .hero .fade-in-immediate {
    animation: none;
    opacity: 1;
  }
}
