/* DrillFlow landing — hand-rolled, reuses the app's design tokens.
   The landing IS the product's canvas: dotted grid background, floating
   island cards, Kalam for anything "drawn", JetBrains Mono for chrome. */

/* ---- Fonts (self-hosted, copied from @fontsource by build.mjs) ---- */
@font-face {
  font-family: 'Kalam';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/kalam-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Kalam';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/kalam-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-latin-600-normal.woff2') format('woff2');
}

/* ---- Design tokens — keep in sync with app/src/index.css ---- */
:root {
  --font-sketch: 'Kalam', cursive;
  --font-ui: 'JetBrains Mono', 'Courier New', monospace;

  --color-bg: #0f0f1a;
  --color-surface: #1a1a2e;
  --color-surface-2: #222240;
  --color-surface-3: #2a2a50;
  --color-border: #3a3a6a;
  --color-accent: #6c63ff;
  --color-accent-hover: #7d75ff;
  --color-text: #e8e8f4;
  --color-text-muted: #9090b8;
  --color-danger: #ff6b6b;
  --color-warning: #ffd166;
  --color-ok: #06d6a0;
  --color-edge: rgba(255, 255, 255, 0.6);
  --color-canvas-dots: #2a2a50;
  --color-node-border: rgba(255, 255, 255, 0.75);

  --radius: 6px;
  --radius-sm: 4px;
  --radius-island: 14px;
  --shadow-island: 0 4px 20px rgba(0, 0, 0, 0.3);
  --content-w: 1060px;
}

/* Light theme — same mechanism and values as the app's .theme-light class.
   A head script stamps it from localStorage 'df-theme', falling back to the
   OS preference; the header button toggles it. */
:root.theme-light {
  --color-bg: #f8f8ff;
  --color-surface: #ffffff;
  --color-surface-2: #f4f4fc;
  --color-surface-3: #e8e8f4;
  --color-border: #c8c8e0;
  --color-text: #1a1a2e;
  --color-text-muted: #5050a0;
  --color-accent: #5548e0;
  --color-accent-hover: #4438d0;
  --color-edge: rgba(30, 30, 100, 0.55);
  --color-canvas-dots: #c0c0dc;
  --color-node-border: rgba(30, 30, 80, 0.55);
  --shadow-island: 0 4px 20px rgba(30, 30, 80, 0.1);
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  /* The app's canvas: a dot grid. The landing lives on it too. */
  background-image: radial-gradient(var(--color-canvas-dots) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---- Island (the app's signature floating panel) ---- */
.island {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-island);
  box-shadow: var(--shadow-island);
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(var(--content-w), calc(100% - 24px));
  margin: 12px auto 0;
  padding: 8px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-island);
  box-shadow: var(--shadow-island);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-sketch);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: -0.01em;
  white-space: nowrap;
  /* Push the brand left so the nav + theme + hamburger group on the right
     (the header now has four direct children, not two). */
  margin-right: auto;
}
.brand:hover { color: var(--color-accent-hover); }
.brand-mark { flex-shrink: 0; margin-top: -1px; }

.site-nav { display: flex; align-items: center; gap: 12px; }

.nav-links { display: inline-flex; align-items: center; gap: 14px; }
.nav-links a {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.nav-links a:hover { color: var(--color-text); }

/* Hamburger: hidden on desktop, shown in the mobile media query below. */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-2);
  color: var(--color-text);
  cursor: pointer;
}
.nav-toggle:hover { background: var(--color-surface-3); }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  font-size: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface-2);
}
.lang-toggle a {
  padding: 2px 9px;
  border-radius: 999px;
  color: var(--color-text-muted);
}
.lang-toggle a:hover { color: var(--color-text); }
.lang-toggle a[aria-current="page"] {
  background: var(--color-surface-3);
  color: var(--color-text);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-2);
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--color-surface-3); color: var(--color-text); }
.btn-accent {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.btn-accent:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); color: #fff; }
.btn-big { padding: 11px 24px; font-size: 0.95rem; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  cursor: pointer;
}
.theme-toggle:hover { background: var(--color-surface-3); color: var(--color-text); }
/* The header clone only exists for mobile (see the media query); the in-nav
   toggle serves desktop. On mobile it sits beside the hamburger, so it matches
   the hamburger's box (34px, rounded square) rather than the round desktop pill
   — the two read as one control pair. */
.theme-toggle--header {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
}
/* Icon shows what the button switches TO: sun while dark, moon while light. */
.theme-toggle .icon-moon { display: none; }
:root.theme-light .theme-toggle .icon-sun { display: none; }
:root.theme-light .theme-toggle .icon-moon { display: block; }

/* ---- Sections ---- */
main { display: block; }

.section {
  width: min(var(--content-w), calc(100% - 24px));
  margin: 0 auto;
  padding: 72px 0 8px;
  /* Clear the sticky header (~46px tall + 12px top gap) when jumped to via a
     header nav anchor, so the heading isn't hidden underneath. */
  scroll-margin-top: 72px;
}

/* Section eyebrow: a breadcrumb trail — the product's own navigation metaphor
   doubles as the page's wayfinding. */
.crumb-trail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.crumb-trail .chip {
  padding: 2px 9px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
}
.crumb-trail .sep { color: var(--color-border); }
.crumb-trail .chip-here { color: var(--color-accent); border-color: var(--color-accent); }

.section > h2 {
  font-family: var(--font-sketch);
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 6px;
}
.section-sub {
  max-width: 560px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

/* ---- Hero ---- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 48px;
  align-items: center;
  width: min(var(--content-w), calc(100% - 24px));
  margin: 0 auto;
  padding: 84px 0 24px;
}

.hero h1 {
  font-family: var(--font-sketch);
  font-size: clamp(2.5rem, 6vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 18px;
}
.hero h1 em {
  font-style: normal;
  color: var(--color-accent);
}

.hero-sub {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-bottom: 28px;
  max-width: 46ch;
}

.hero-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-cta-hint { font-size: 0.75rem; color: var(--color-text-muted); }

/* ================= Hero demo =================
   A miniature DrillFlow window that plays the product's one trick on loop:
   click a node → drill into its sub-diagram → breadcrumbs grow → drill back.
   Pure CSS. Decorative (aria-hidden); the hero copy carries the meaning. */

.demo {
  position: relative;
  padding: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-island);
  box-shadow: var(--shadow-island);
  user-select: none;
}

/* Mini crumbs island, like the app's top-left corner */
.demo-crumbs {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px 12px;
  font-size: 0.72rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 999px;
}
.demo-crumbs .demo-logo { color: var(--color-accent); flex-shrink: 0; }
.demo-crumb { color: var(--color-text-muted); white-space: nowrap; }
.demo-crumb-root { position: relative; padding: 1px 7px; border-radius: 999px; }
.demo-crumb-sep { color: var(--color-border); }

.demo-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background-color: var(--color-bg);
  background-image: radial-gradient(var(--color-canvas-dots) 1px, transparent 1px);
  background-size: 18px 18px;
}

.demo-scene { position: absolute; inset: 0; }
.demo-edges { position: absolute; inset: 0; width: 100%; height: 100%; }
.demo-edges path {
  stroke: var(--color-edge);
  stroke-width: 1.6px;
  vector-effect: non-scaling-stroke;
  fill: none;
}
.demo-edges .demo-arrowhead { fill: var(--color-edge); stroke: none; }

.demo-node {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 5px 14px;
  font-family: var(--font-sketch);
  font-size: 0.9rem;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-node-border);
  border-radius: var(--radius);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}
.demo-node-target { border-color: var(--color-accent); }
/* Subflow badge: the logo mark on the node that owns a sub-diagram */
.demo-node-badge {
  position: absolute;
  top: 2px;
  right: 3px;
  color: var(--color-accent);
}
/* Click-pulse ring (animated only) */
.demo-node-target::after,
.demo-crumb-root::after {
  content: '';
  position: absolute;
  inset: -5px;
  border: 2px solid var(--color-accent);
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
}
.demo-crumb-root::after { border-radius: 999px; }

.demo-cursor {
  position: absolute;
  z-index: 3;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-accent) 45%, transparent);
  border: 1.5px solid var(--color-accent);
  display: none; /* only shown when animating */
  pointer-events: none;
}

/* Static (reduced-motion / no-animation) frame shows the *drilled-in* end
   state — sub-diagram open, breadcrumb trail grown: the USP as a still. */
.demo-scene-top { opacity: 0; }
.demo-scene-sub { opacity: 1; }

/* Demo timeline — every @keyframes below shares the same 14s loop so the
   percentages line up. Phase map:
     0–18%   top level idle; cursor glides onto the "Checkout" node
    18–22%   click: pulse ring on the target node
    22–30%   drill in: top scene scales up & fades out (origin = target node),
             sub scene scales in; breadcrumb chip slides in
    30–58%   dwell in the sub-diagram; cursor drifts to the root crumb
    58–62%   click: pulse on the root breadcrumb chip
    62–70%   drill back out (mirror of 22–30)
    70–100%  top level dwell; cursor returns to its start */
@media (prefers-reduced-motion: no-preference) {
  .demo-scene-top,
  .demo-scene-sub { will-change: transform, opacity; }

  .demo-scene-top {
    /* origin = the Checkout node's center, so the zoom dives into it */
    transform-origin: 55% 30%;
    animation: demo-scene-top 14s ease-in-out infinite;
  }
  .demo-scene-sub {
    transform-origin: 55% 30%;
    animation: demo-scene-sub 14s ease-in-out infinite;
  }
  .demo-crumb-drill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    animation: demo-crumb-in 14s ease-in-out infinite;
  }
  .demo-node-target::after { animation: demo-pulse-node 14s ease-out infinite; }
  .demo-crumb-root::after { animation: demo-pulse-crumb 14s ease-out infinite; }
  .demo-cursor { display: block; animation: demo-cursor 14s ease-in-out infinite; }

  @keyframes demo-scene-top {
    0%, 22% { transform: scale(1); opacity: 1; }
    30%, 62% { transform: scale(2.2); opacity: 0; }
    70%, 100% { transform: scale(1); opacity: 1; }
  }
  @keyframes demo-scene-sub {
    0%, 22% { transform: scale(0.55); opacity: 0; }
    30%, 62% { transform: scale(1); opacity: 1; }
    70%, 100% { transform: scale(0.55); opacity: 0; }
  }
  @keyframes demo-crumb-in {
    0%, 23% { opacity: 0; transform: translateX(-6px); }
    30%, 60% { opacity: 1; transform: translateX(0); }
    68%, 100% { opacity: 0; transform: translateX(-6px); }
  }
  @keyframes demo-pulse-node {
    0%, 17% { opacity: 0; transform: scale(0.7); }
    18.5% { opacity: 0.9; transform: scale(0.8); }
    23%, 100% { opacity: 0; transform: scale(1.25); }
  }
  @keyframes demo-pulse-crumb {
    0%, 57% { opacity: 0; transform: scale(0.7); }
    58.5% { opacity: 0.9; transform: scale(0.85); }
    63%, 100% { opacity: 0; transform: scale(1.3); }
  }
  /* Cursor waypoints — left/top in % of .demo, measured against the real
     element centres (see the measure-and-align note in home.html). */
  @keyframes demo-cursor {
    0% { left: 32%; top: 90%; }
    14%, 24% { left: 54.7%; top: 38.7%; } /* onto the Checkout node, click */
    34% { left: 52%; top: 65%; }          /* drift while inside the subflow */
    52%, 64% { left: 14.5%; top: 7.2%; }  /* up to the root crumb, click */
    82%, 100% { left: 32%; top: 90%; }    /* back to rest */
  }
}

/* ---- Features ---- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.feature-card {
  padding: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-island);
  box-shadow: var(--shadow-island);
}
.feature-card h3 {
  font-family: var(--font-sketch);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.feature-card p { font-size: 0.85rem; color: var(--color-text-muted); }

/* ---- Pricing ---- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 420px));
  gap: 16px;
}
.price-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-island);
  box-shadow: var(--shadow-island);
}
.price-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.price-card h3 {
  font-family: var(--font-sketch);
  font-size: 1.5rem;
  font-weight: 700;
}
.price-tag {
  padding: 2px 10px;
  font-size: 0.72rem;
  border-radius: 999px;
  white-space: nowrap;
  background: color-mix(in srgb, var(--color-ok) 18%, transparent);
  color: var(--color-ok);
  border: 1px solid color-mix(in srgb, var(--color-ok) 45%, transparent);
}
.price-card ul { list-style: none; margin-bottom: 20px; }
.price-card li {
  position: relative;
  padding: 4px 0 4px 24px;
  font-size: 0.85rem;
}
.price-card li::before {
  content: '✓';
  position: absolute;
  left: 2px;
  color: var(--color-ok);
  font-weight: 600;
}
.price-card .btn { margin-top: auto; align-self: flex-start; }

.price-card-soon { border-style: dashed; box-shadow: none; }
.price-card-soon h3, .price-card-soon li { color: var(--color-text-muted); }
.price-card-soon li::before { color: var(--color-text-muted); content: '·'; font-size: 1.2em; line-height: 1.1; }
.price-card-soon .price-tag {
  background: color-mix(in srgb, var(--color-warning) 14%, transparent);
  color: var(--color-warning);
  border-color: color-mix(in srgb, var(--color-warning) 40%, transparent);
}
.pricing-note {
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  max-width: 62ch;
}

/* ---- FAQ ---- */
.faq-list { display: grid; gap: 10px; max-width: 780px; }
.faq-list details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-island);
  box-shadow: var(--shadow-island);
  padding: 0 18px;
}
.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: '+';
  flex-shrink: 0;
  font-family: var(--font-sketch);
  font-size: 1.3rem;
  color: var(--color-accent);
  line-height: 1;
}
.faq-list details[open] summary::after { content: '–'; }
.faq-list details p {
  padding: 0 0 16px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  max-width: 68ch;
}

/* ---- Closing CTA ---- */
.closing {
  text-align: center;
  padding: 88px 0 40px;
}
.closing h2 {
  font-family: var(--font-sketch);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 22px;
}

/* ---- Legal pages ---- */
.legal {
  width: min(760px, calc(100% - 24px));
  margin: 0 auto;
  padding: 56px 0 24px;
}
.legal article {
  padding: 32px clamp(20px, 5vw, 44px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-island);
  box-shadow: var(--shadow-island);
}
.legal h1 {
  font-family: var(--font-sketch);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 20px;
}
.legal h2 {
  font-family: var(--font-sketch);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 28px 0 8px;
}
.legal p, .legal li { font-size: 0.88rem; margin-bottom: 10px; }
.legal ul { padding-left: 22px; margin-bottom: 10px; }
.legal p, .legal ul { color: var(--color-text); }

/* 404 page (dist/404.{de,en}.html, served by Caddy's handle_errors) */
.notfound {
  width: min(560px, calc(100% - 24px));
  margin: 0 auto;
  padding: clamp(56px, 12vh, 120px) 0 64px;
  text-align: center;
}
.notfound-code {
  font-family: var(--font-sketch);
  font-size: clamp(3.4rem, 12vw, 5.2rem);
  font-weight: 700;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.5;
}
.notfound h1 {
  font-family: var(--font-sketch);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin: 12px 0 10px;
}
.notfound-sub {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 26px;
}
.notfound-cta {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Changelog page (generated from CHANGELOG.md) */
.release { margin-top: 26px; }
.release-date {
  margin-left: 8px;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

.legal-note {
  margin-bottom: 20px;
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-warning);
  border-radius: var(--radius);
  background: var(--color-surface-2);
}

/* ---- Docs page ---- */
.docs {
  width: min(var(--content-w), calc(100% - 24px));
  margin: 0 auto;
  padding: 56px 0 24px;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.docs-toc {
  position: sticky;
  top: 84px; /* clears the sticky header */
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.docs-toc-title {
  font-family: var(--font-sketch);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.docs-toc a {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}
.docs-toc a:hover {
  color: var(--color-accent);
  background: var(--color-surface-2);
}
.docs-body {
  padding: 32px clamp(20px, 5vw, 44px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-island);
  box-shadow: var(--shadow-island);
}
.docs-body h1 {
  font-family: var(--font-sketch);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 12px;
}
.docs-intro { color: var(--color-text-muted); margin-bottom: 12px; }
.docs-body section {
  scroll-margin-top: 84px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--color-border);
}
.docs-body h2 {
  font-family: var(--font-sketch);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.docs-body section:target h2 { color: var(--color-accent); }
.docs-body h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 16px 0 6px;
}
.docs-body p, .docs-body li { font-size: 0.88rem; margin-bottom: 10px; }
.docs-body ul { padding-left: 22px; margin-bottom: 10px; }
.docs-body p, .docs-body ul { color: var(--color-text); }
.docs-body kbd {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  padding: 1px 6px;
  border: 1px solid var(--color-border);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
}

/* Docs vignettes — tiny static scenes in the hero demo's visual language
   (same tokens, no animation). Decorative: the prose carries the meaning. */
.docs-fig {
  max-width: 460px;
  margin: 4px 0 16px;
  user-select: none;
}
.fig-crumbs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 3px 11px;
  font-size: 0.7rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 999px;
}
.fig-crumbs svg { color: var(--color-accent); flex-shrink: 0; }
.fig-crumb { color: var(--color-text-muted); white-space: nowrap; }
.fig-crumb-here { color: var(--color-text); }
.fig-crumb-sep { color: var(--color-border); }
.fig-stage {
  position: relative;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background-color: var(--color-bg);
  background-image: radial-gradient(var(--color-canvas-dots) 1px, transparent 1px);
  background-size: 16px 16px;
}
.fig-edges { position: absolute; inset: 0; width: 100%; height: 100%; }
.fig-edges path {
  stroke: var(--color-edge);
  stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
  fill: none;
}
.fig-edges .fig-arrowhead { fill: var(--color-edge); stroke: none; }
.fig-node {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 3px 11px;
  font-family: var(--font-sketch);
  font-size: 0.76rem;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-node-border);
  border-radius: var(--radius);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}
.fig-node--accent { border-color: var(--color-accent); }
.fig-node--circle { border-radius: 999px; }
.fig-badge { position: absolute; top: 1px; right: 2px; color: var(--color-accent); }
/* Diamond = rotated square; its label is a separate overlay at the same spot. */
.fig-diamond {
  position: absolute;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--color-surface);
  border: 1.5px solid var(--color-node-border);
  border-radius: 4px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}
.fig-diamond-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font-sketch);
  font-size: 0.68rem;
  color: var(--color-text);
}
/* Pin: dangling arrow endpoint left on empty canvas */
.fig-pin {
  position: absolute;
  width: 9px;
  height: 9px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 22%, transparent);
}
.fig-edge-label {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0 4px;
  font-family: var(--font-sketch);
  font-size: 0.66rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border-radius: 3px;
}
/* Side-by-side pair (tool ring vs. toolbar) with mini captions */
.fig-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fig-duo .fig-stage { aspect-ratio: 4 / 3; }
.fig-caption {
  margin: 6px 0 0;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  text-align: center;
}
.fig-ringbox {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 124px;
  height: 124px;
  transform: translate(-50%, -50%);
}
.fig-ring {
  position: absolute;
  inset: 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 50%;
}
.fig-ring-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--color-accent);
}
.fig-tool {
  position: absolute;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-family: var(--font-sketch);
  font-size: 0.72rem;
  line-height: 1;
}
.fig-tool--active { color: var(--color-accent); border-color: var(--color-accent); }
.fig-bar {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}
.fig-bar .fig-tool { position: static; transform: none; }
/* Embedded demo videos (mp4 + poster; click-to-play, no autoplay) */
.docs-video { max-width: 640px; }
.docs-video video {
  display: block;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
}

/* Unfilled legal placeholders — deliberately loud until real details land. */
mark.placeholder {
  padding: 0 5px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-warning) 26%, transparent);
  border: 1px dashed var(--color-warning);
  color: inherit;
}

/* ---- Footer ---- */
.site-footer {
  width: min(var(--content-w), calc(100% - 24px));
  margin: 72px auto 20px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 18px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-island);
  box-shadow: var(--shadow-island);
}
.footer-nav { display: flex; align-items: center; gap: 16px; }
.footer-nav a { color: var(--color-text-muted); }
.footer-nav a:hover { color: var(--color-text); }

/* ---- Contact form ---- */
.contact-form {
  max-width: 520px;
  /* Left-aligned with the section heading (not centered) — a centered narrow
     form under a left-aligned heading reads as misplaced. */
  margin: 28px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact-input {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.contact-input::placeholder { color: var(--color-text-muted); }
.contact-input:focus {
  outline: none;
  border-color: var(--color-accent);
}
.contact-textarea { resize: vertical; min-height: 120px; }
/* Honeypot: present in the DOM for bots, but zero-size and clipped so it can
   never render or take layout space (canonical visually-hidden). */
.contact-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.contact-form .btn { align-self: flex-start; margin-top: 2px; }
.contact-status {
  margin: 0;
  font-size: 0.86rem;
  color: var(--color-text);
}
.contact-fallback {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

/* ---- Responsive ---- */
@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: 56px;
  }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: 1fr; }
  .section { padding-top: 56px; }

  /* Mobile: header collapses to brand + hamburger; the nav becomes a dropdown
     panel (links + lang/theme/CTA) anchored under the sticky header. */
  .nav-toggle { display: inline-flex; }
  /* Swap toggles: header clone shows, the in-menu one hides. */
  .theme-toggle--header { display: inline-flex; }
  .site-nav .theme-toggle { display: none; }
  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-island);
    box-shadow: var(--shadow-island);
    display: none;
  }
  .site-nav.open { display: flex; }
  /* Links stack; a divider separates them from the lang/theme/CTA cluster. */
  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
  }
  .nav-links a { padding: 6px 2px; }
  /* The DE/EN pill keeps its natural width — the menu's align-items:stretch
     would otherwise blow it across the full menu width. */
  .site-nav .lang-toggle { align-self: flex-start; }

  /* Docs: single column; the TOC unsticks and becomes a chip row on top. */
  .docs { grid-template-columns: 1fr; gap: 16px; }
  .docs-toc {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  .docs-toc-title { width: 100%; margin-bottom: 2px; }
  .docs-toc a {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 999px;
    padding: 3px 10px;
  }
}
@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
  .hero-cta .btn-big { width: 100%; justify-content: center; }
  .footer-inner { flex-direction: column; align-items: flex-start; }

  /* Docs tool-selector duo: tighter chips so the toolbar pill fits its panel */
  .fig-bar { gap: 4px; padding: 5px 7px; }
  .fig-bar .fig-tool { width: 18px; height: 18px; font-size: 0.64rem; }
}
