@import url('./fonts/fonts.css');

/* =========================================================================
   OpsCodex marketing site — warm editorial enterprise
   Tokens mirror the app (var(--ops-*)). Green is the only saturated colour.
   ========================================================================= */
:root {
  /* surfaces */
  --ops-paper:        #FAF8F5;
  --ops-paper-deep:   #F4F0E8;
  --ops-surface:      #FFFFFF;
  /* ink */
  --ops-ink:          #1B1A17;
  --ops-ink-muted:    #5E5849;
  --ops-ink-faint:    #756B54; /* AA: ~5:1 on paper (was #857B66 ≈ 4:1, failed) */
  /* accent — deep forest green */
  --ops-accent:       #2A5C45;
  --ops-accent-hover: #234F3A;
  --ops-accent-press: #1A3D2D;
  --ops-accent-ink:   #142D20;
  --ops-success:      #DAE7DE;
  /* borders */
  --ops-border:        #E8E2D8;
  --ops-border-strong: #D6CEC0;
  --ops-border-muted:  #9B8F77;

  --ops-radius:    14px;
  --ops-radius-sm: 9px;
  --ops-maxw:      1120px;
  --ops-shadow:    0 1px 2px rgba(27,26,23,.04), 0 8px 28px rgba(27,26,23,.05);
  --ops-shadow-lg: 0 2px 6px rgba(27,26,23,.06), 0 20px 50px rgba(20,45,32,.08);

  --ops-font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --ops-font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ops-font-mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  font-family: var(--ops-font-body);
  background: var(--ops-paper);
  color: var(--ops-ink);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* safeguard against any sub-pixel horizontal scroll */
}

img, svg { display: block; max-width: 100%; }
a { color: var(--ops-accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ops-accent-hover); }

/* focus visibility — WCAG */
:focus-visible {
  outline: 2.5px solid var(--ops-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--ops-accent); color: var(--ops-paper);
  padding: 10px 16px; border-radius: var(--ops-radius-sm);
  font-weight: 600; z-index: 100; transition: top .15s ease;
}
.skip-link:focus { top: 12px; color: var(--ops-paper); }

/* ---------- layout primitives ---------- */
.wrap { width: 100%; max-width: var(--ops-maxw); margin-inline: auto; padding-inline: 24px; }
section { padding-block: clamp(64px, 9vw, 120px); }
.eyebrow {
  font-family: var(--ops-font-body);
  font-size: 13px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ops-accent);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 1.5px; background: var(--ops-border-muted);
}
h1, h2, h3 { font-family: var(--ops-font-display); font-weight: 600; line-height: 1.08; letter-spacing: -.01em; color: var(--ops-ink); }
h2 { font-size: clamp(30px, 4.2vw, 46px); }
h3 { font-size: 21px; line-height: 1.2; letter-spacing: 0; }
.lede { font-size: clamp(18px, 2.1vw, 21px); color: var(--ops-ink-muted); max-width: 56ch; }
.section-head { max-width: 64ch; margin-bottom: 56px; }
.section-head h2 { margin-top: 16px; }
.section-head p { margin-top: 18px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--ops-font-body); font-weight: 600; font-size: 16px;
  padding: 14px 26px; border-radius: var(--ops-radius-sm);
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.btn--primary { background: var(--ops-accent); color: var(--ops-paper); }
.btn--primary:hover { background: var(--ops-accent-hover); color: var(--ops-paper); transform: translateY(-1px); }
.btn--primary:active { background: var(--ops-accent-press); transform: translateY(0); }
.btn--ghost { background: transparent; color: var(--ops-accent); border-color: var(--ops-border-strong); }
.btn--ghost:hover { border-color: var(--ops-accent); background: rgba(42,92,69,.04); }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--ops-paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.site-header.is-stuck { border-bottom-color: var(--ops-border); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 24px; }
/* brand = typographic wordmark, mirrors the app's <Wordmark/>: Ops (roman) +
   Codex (italic) in Fraunces, with a 60%-width forest-green hairline. No icon. */
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand:hover { color: inherit; }
.wordmark {
  display: inline-block;
  font-family: var(--ops-font-display); color: var(--ops-accent-ink);
  font-size: 22px; line-height: 1.04; letter-spacing: -.01em; user-select: none;
  white-space: nowrap;
}
.wordmark > span { font-weight: 400; }
.wordmark .wm-codex { font-style: italic; }
.wordmark::after { content: ""; display: block; width: 60%; height: 1px; background: var(--ops-accent); margin-top: 3px; }

.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  color: var(--ops-ink-muted); text-decoration: none; font-size: 15px; font-weight: 500;
  position: relative; padding-block: 4px;
  transition: color .12s cubic-bezier(.2,0,.2,1);
}
.nav-links a:hover { color: var(--ops-ink); }
/* active section — 2px forest-green underline + heavier weight, like the app nav */
.nav-links a.is-active { color: var(--ops-ink); font-weight: 600; }
.nav-links a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px;
  height: 2px; background: var(--ops-accent); border-radius: 1px;
}
.nav-cta { display: flex; align-items: center; gap: 18px; }
.nav-login { color: var(--ops-ink-muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-login:hover { color: var(--ops-ink); }
.nav-toggle { display: none; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(48px, 7vw, 88px); padding-bottom: clamp(56px, 8vw, 104px); position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(40px, 6.4vw, 76px); margin-top: 22px; overflow-wrap: break-word; }
.hero h1 .accent { color: var(--ops-accent); font-style: italic; }
.hero .lede { margin-top: 26px; }
.hero-actions { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-note { margin-top: 22px; font-size: 14px; color: var(--ops-ink-faint); display: flex; align-items: center; gap: 9px; }
.hero-note svg { flex: none; }

/* hero diagram card */
.hero-figure {
  background: var(--ops-surface);
  border: 1px solid var(--ops-border);
  border-radius: var(--ops-radius);
  box-shadow: var(--ops-shadow-lg);
  padding: 26px 26px 22px;
}
.hero-figure figcaption {
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ops-ink-faint); margin-bottom: 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.hero-figure .pill {
  font-family: var(--ops-font-mono); font-size: 11px; letter-spacing: 0; text-transform: none;
  color: var(--ops-accent); background: var(--ops-success); padding: 3px 9px; border-radius: 20px; font-weight: 500;
  white-space: nowrap;
}

/* ---------- problem / generic prose band ---------- */
.band-deep { background: var(--ops-paper-deep); border-block: 1px solid var(--ops-border); }
.problem-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.pain-list { list-style: none; display: grid; gap: 18px; }
.pain-list li { display: flex; gap: 14px; align-items: flex-start; font-size: 16px; color: var(--ops-ink-muted); }
.pain-list .dash { flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--ops-surface); border: 1px solid var(--ops-border-strong); display: grid; place-items: center; color: var(--ops-border-muted); margin-top: 2px; }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.step {
  background: var(--ops-surface); border: 1px solid var(--ops-border);
  border-radius: var(--ops-radius); padding: 26px 24px 28px; position: relative;
  display: flex; flex-direction: column; gap: 12px;
}
.step .step-no {
  font-family: var(--ops-font-mono); font-size: 13px; color: var(--ops-accent);
  font-weight: 500; letter-spacing: .04em;
}
.step .step-ico { color: var(--ops-accent); margin-bottom: 4px; }
.step h3 { font-family: var(--ops-font-body); font-weight: 700; font-size: 17px; letter-spacing: -.005em; }
.step p { font-size: 15px; color: var(--ops-ink-muted); line-height: 1.6; }

/* ---------- governance ---------- */
.gov-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(36px, 5vw, 72px); align-items: center; }
/* let grid items shrink below content width so scroll containers (audit log) self-contain */
.hero-grid > *, .problem-grid > *, .gov-grid > * { min-width: 0; }
.gov-points { list-style: none; display: grid; gap: 22px; margin-top: 30px; }
.gov-points li { display: flex; gap: 14px; align-items: flex-start; }
.gov-points .tick { flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--ops-success); color: var(--ops-accent-press); display: grid; place-items: center; margin-top: 1px; }
.gov-points strong { display: block; color: var(--ops-ink); font-weight: 600; font-size: 16px; }
.gov-points span { color: var(--ops-ink-muted); font-size: 15px; }

.chain {
  background: var(--ops-accent-ink); border-radius: var(--ops-radius);
  padding: 30px 28px; box-shadow: var(--ops-shadow-lg); color: var(--ops-paper);
}
.chain-title { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: color-mix(in srgb, var(--ops-paper) 62%, transparent); margin-bottom: 22px; }
.chain-row { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.role {
  flex: 1; background: color-mix(in srgb, var(--ops-paper) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--ops-paper) 16%, transparent);
  border-radius: var(--ops-radius-sm); padding: 14px 12px; text-align: center;
}
.role .role-name { font-weight: 600; font-size: 14px; color: var(--ops-paper); }
.role .role-sub { font-size: 11px; color: color-mix(in srgb, var(--ops-paper) 60%, transparent); margin-top: 3px; }
.role .role-dot { width: 8px; height: 8px; border-radius: 50%; background: #7FB89B; margin: 0 auto 8px; }
.chain-arrow { flex: none; color: color-mix(in srgb, var(--ops-paper) 45%, transparent); }
.audit-log {
  font-family: var(--ops-font-mono); font-size: 12.5px; line-height: 1.9;
  background: color-mix(in srgb, #000 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--ops-paper) 12%, transparent);
  border-radius: var(--ops-radius-sm); padding: 14px 16px; color: color-mix(in srgb, var(--ops-paper) 80%, transparent);
  overflow-x: auto; max-width: 100%;
}
.audit-log .ts { color: #7FB89B; }
.audit-log .lock { color: color-mix(in srgb, var(--ops-paper) 50%, transparent); }

/* ---------- security / trust ---------- */
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.trust-card {
  background: var(--ops-surface); border: 1px solid var(--ops-border);
  border-radius: var(--ops-radius); padding: 26px 24px;
}
.trust-card .t-ico { color: var(--ops-accent); margin-bottom: 16px; }
.trust-card h3 { font-family: var(--ops-font-body); font-weight: 700; font-size: 17px; margin-bottom: 8px; }
.trust-card p { font-size: 15px; color: var(--ops-ink-muted); line-height: 1.6; }

/* ---------- outcomes ---------- */
.outcomes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.outcome { border-top: 2px solid var(--ops-accent); padding-top: 20px; }
.outcome .o-k { font-family: var(--ops-font-display); font-weight: 600; font-size: clamp(28px, 3.4vw, 38px); color: var(--ops-ink); line-height: 1; }
.outcome .o-v { margin-top: 12px; color: var(--ops-ink-muted); font-size: 15.5px; }

/* ---------- proof ---------- */
.proof { text-align: center; }
.proof .q { font-family: var(--ops-font-display); font-weight: 500; font-size: clamp(24px, 3.4vw, 36px); line-height: 1.3; max-width: 22ch; margin: 0 auto; letter-spacing: -.01em; }
.proof .src { margin-top: 26px; font-size: 14px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ops-ink-faint); }

/* ---------- CTA band ---------- */
.cta-band { background: var(--ops-accent-ink); color: var(--ops-paper); border-radius: 0; }
.cta-inner { text-align: center; display: grid; gap: 26px; justify-items: center; }
.cta-band h2 { color: var(--ops-paper); max-width: 18ch; }
.cta-band p { color: color-mix(in srgb, var(--ops-paper) 72%, transparent); max-width: 52ch; font-size: 18px; }
.cta-band .btn--primary { background: var(--ops-paper); color: var(--ops-accent-ink); }
.cta-band .btn--primary:hover { background: #fff; color: var(--ops-accent-ink); }

/* ---------- footer ---------- */
.site-footer { background: var(--ops-paper-deep); border-top: 1px solid var(--ops-border); padding-block: 52px; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; align-items: flex-start; }
.footer-brand { display: grid; gap: 10px; max-width: 30ch; }
.footer-brand .wordmark { font-size: 19px; }
.footer-brand p { font-size: 14px; color: var(--ops-ink-muted); }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ops-ink-faint); margin-bottom: 14px; }
.footer-col a, .footer-col span { display: block; color: var(--ops-ink-muted); text-decoration: none; font-size: 14.5px; margin-bottom: 9px; }
.footer-col a:hover { color: var(--ops-accent); }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--ops-border); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: 13.5px; color: var(--ops-ink-faint); }

/* ---------- legal / prose pages (Impressum, Datenschutz) ---------- */
.legal { padding-block: clamp(48px, 7vw, 88px); }
.legal .wrap { max-width: 760px; }
.legal-head { margin-bottom: clamp(32px, 5vw, 56px); }
.legal-head h1 { font-size: clamp(34px, 5vw, 52px); margin-top: 18px; }
.legal-head .updated { margin-top: 16px; font-size: 14px; color: var(--ops-ink-faint); }
.legal-back { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; color: var(--ops-ink-muted); text-decoration: none; margin-bottom: 22px; }
.legal-back:hover { color: var(--ops-accent); }
.legal-back .arrow { transition: transform .15s ease; }
.legal-back:hover .arrow { transform: translateX(-3px); }

.legal-body h2 { font-size: clamp(22px, 3vw, 28px); margin-top: clamp(36px, 5vw, 52px); margin-bottom: 14px; }
.legal-body h3 { font-family: var(--ops-font-body); font-weight: 700; font-size: 17px; margin-top: 28px; margin-bottom: 8px; }
.legal-body p, .legal-body li { color: var(--ops-ink-muted); font-size: 16px; line-height: 1.7; }
.legal-body p { margin-top: 14px; }
.legal-body p:first-child { margin-top: 0; }
.legal-body a { font-weight: 500; }
.legal-body ul { margin-top: 14px; padding-left: 22px; display: grid; gap: 8px; }
.legal-body strong { color: var(--ops-ink); font-weight: 600; }

/* definition-list style address block (Impressum) */
.legal-dl { margin-top: 18px; display: grid; gap: 4px; }
.legal-dl dt { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ops-ink-faint); margin-top: 16px; }
.legal-dl dt:first-child { margin-top: 0; }
.legal-dl dd { color: var(--ops-ink-muted); font-size: 16px; line-height: 1.6; }

/* placeholder — owner must fill before publishing real text. Visually unmistakable. */
.ph {
  background: #FCEBD2; color: #7A4B12;
  border: 1px dashed #C9912F; border-radius: 5px;
  padding: 1px 7px; font-family: var(--ops-font-mono); font-size: 13px;
  font-weight: 500; white-space: normal;
}

/* privacy-plus callout (no cookies / no tracking) */
.legal-note {
  margin-top: 20px; background: var(--ops-success);
  border: 1px solid color-mix(in srgb, var(--ops-accent) 22%, transparent);
  border-radius: var(--ops-radius-sm); padding: 18px 20px;
}
.legal-note p { color: var(--ops-accent-ink); margin-top: 0; }
.legal-note strong { color: var(--ops-accent-ink); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .problem-grid, .gov-grid { grid-template-columns: 1fr; }
  .hero-figure { order: -1; }
  .gov-grid .chain { order: -1; }
  .steps { grid-template-columns: 1fr 1fr; }
  .trust-grid { grid-template-columns: 1fr; }
  .outcomes { grid-template-columns: 1fr; gap: 28px; }
  .nav-links { display: none; }
  .nav-login { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero h1 { font-size: clamp(32px, 8.6vw, 42px); }
  .steps { grid-template-columns: 1fr; }
  .chain-row { flex-wrap: wrap; }
  .chain-arrow { transform: rotate(90deg); margin: 2px auto; }
  .role { flex-basis: 100%; }
  .btn { width: 100%; }
  .hero-actions { gap: 12px; }
}
