/* cotoaga-ai-site — component styles (COT-108).
   Brand-blind: consumes --brand-* mapped tokens ONLY.
   Companions: _includes/components.njk (macros), assets/js/components.js. */

/* ---------- Section header ---------- */

.section-header {
  text-align: center;
  margin: var(--space-3xl) 0 var(--space-xl);
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--brand-accent);
  margin: 0 0 var(--space-xs);
}

/* ---------- Language switch ---------- */

.lang-switch {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-align: right;
  margin: 0 0 var(--space-lg);
}

.lang-switch a[aria-current="page"] {
  color: var(--brand-text-body);
  pointer-events: none;
  text-decoration: none;
}

/* ---------- Card grid ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols, 3), 1fr);
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
}

@media (max-width: 900px) {
  .card-grid { grid-template-columns: 1fr; }
}

/* ---------- Feature card ---------- */

.feature-card {
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius);
  background: var(--brand-surface);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover { box-shadow: var(--brand-hover-shadow); }

.feature-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--brand-border);
}

.feature-card-body {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.feature-card-body > * { margin: 0; }

.feature-card-title {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--brand-primary);
}

.feature-card-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-text-secondary);
}

.feature-card-accent { border-top: 3px solid var(--brand-primary); }
.feature-card-accent .feature-card-title { color: var(--brand-primary); }

.feature-card-warn { border-top: 3px solid var(--brand-warn); }
.feature-card-warn .feature-card-title { color: var(--brand-warn); }

.feature-card-muted .feature-card-title { color: var(--brand-text-secondary); }

/* ---------- Stat card (static, trend glyph) ----------
   Flip variant retired 2026-07-31 (ratified Kurt): only flip instance on
   the site, content was tap-gated, mobile pain. Rides .feature-card for
   border / surface / hover shadow. Glyph: the line carries direction,
   the printed values carry truth — one shared scale across all cards. */

.stat-glyph {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: var(--space-xs);
}

.stat-glyph-line { stroke: var(--brand-accent); stroke-width: 2; }
.stat-glyph-dot  { fill: var(--brand-accent); }
.stat-glyph-half-ok   { fill: var(--brand-primary); }
.stat-glyph-half-warn { fill: var(--brand-warn); }

.stat-glyph-val,
.stat-glyph-year {
  font-family: var(--font-mono);
  fill: var(--brand-text-secondary);
}

.stat-glyph-val  { font-size: 11px; }
.stat-glyph-year { font-size: 10px; }

.stat-card-heading { line-height: var(--leading-tight); }

.stat-card-number {
  display: block;
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--brand-text-body);
}

.stat-card-subtitle {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--brand-text-secondary);
}

.stat-card-lead {
  font-weight: 700;
  color: var(--brand-text-body);
}

.stat-card-text {
  font-size: 0.9375rem;
  line-height: var(--leading-normal);
  color: var(--brand-text-body);
}

/* ---------- Tabs contract (no macro — single use case, COT-108) ----------
   Markup contract, wired by components.js:
   <div data-tabs>
     <div role="tablist">
       <button role="tab" data-tab-target="ID" aria-selected="true|false">…</button>
     </div>
     <section role="tabpanel" data-tab-panel="ID">…</section>
   </div>
   No-JS fallback: all panels visible ([hidden] is applied by JS only). */

[data-tabs] [role="tablist"] {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  margin: var(--space-xl) 0 var(--space-lg);
}

[data-tabs] [role="tab"] {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius);
  background: var(--brand-surface);
  color: var(--brand-text-body);
  cursor: pointer;
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-tabs] [role="tab"][aria-selected="true"] {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: var(--brand-button-text);
}

/* ---------- Tab counter (binary, ornament, COT-120) ----------
   Dots L→R = bit2 bit1 bit0, state derived via :has() on the tabs
   contract above — no new data attributes. Leftmost dot (bit2) has
   no lit state with three tabs; headroom is intentional. */

.tab-counter {
  display: block;
  width: 56px;
  height: 16px;
  margin: 0 auto var(--space-lg);
}

.tab-counter-dot {
  fill: var(--brand-border);
  transition: fill 150ms;
}

[data-tabs]:has([data-tab-target="verstehen"][aria-selected="true"]) .tab-counter-dot-0,
[data-tabs]:has([data-tab-target="veraendern"][aria-selected="true"]) .tab-counter-dot-1,
[data-tabs]:has([data-tab-target="versichern"][aria-selected="true"]) .tab-counter-dot-1,
[data-tabs]:has([data-tab-target="versichern"][aria-selected="true"]) .tab-counter-dot-0 {
  fill: var(--brand-accent);
}

/* ---------- CTA card ---------- */

.cta-card {
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius);
  margin: var(--space-3xl) auto;
  max-width: 900px;
  background: var(--brand-tint-bg);
}

.cta-card-img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--brand-border);
}

.cta-card-body {
  padding: var(--space-xl);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
}

.cta-card-body > p { margin: 0; max-width: 60ch; }

.cta-card-title { margin: 0; }

.button-primary {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  padding: var(--space-sm) var(--space-lg);
  background: var(--brand-accent);
  color: var(--brand-button-text);
  border-radius: var(--brand-radius);
  text-decoration: none;
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.button-primary:hover {
  background: var(--brand-primary);
  color: var(--brand-button-text);
}

/* ---------- Seam (COT-119) ----------
   The tesseract, brand glyph replacing the dead Elementor circle. Division
   of labor: CSS drifts the container, the fold engine (tesseract.js) moves
   the geometry. See base.njk for the shared #tess symbol / no-JS fallback. */

.seam {
  display: grid;
  place-items: center;
  padding-block: var(--space-xl);
  color: var(--brand-primary);
}
.seam svg { width: 72px; height: 72px; }

@supports (animation-timeline: view()) {
  /* the tesseract turns exactly as far as you have scrolled it */
  .seam svg {
    animation: turn linear both;
    animation-timeline: view();
    animation-range: cover 0% cover 100%;
  }
}

/* Firefox doctrine: no causality yet, so the glyph gets time instead —
   the fold engine still folds it through scroll via getBoundingClientRect */
@supports not (animation-timeline: view()) {
  .seam svg { animation: spin 48s linear infinite; }
}

@keyframes turn { from { rotate: -28deg; } to { rotate: 28deg; } }

/* ---------- CTA (COT-119 · restyled in review, Kurt 2026-07-31) ----------
   Kills the naked underlined link for Standortbestimmung entry points.
   Same family as .button-primary (accent bg, white text, radius 0) and
   self-centering as a standalone block. Consolidating .cta into
   .button-primary is flagged on COT-119 — not done in this pass. */

.cta {
  display: block;
  width: fit-content;
  margin-inline: auto;
  font-family: var(--font-display);
  font-weight: 700;
  padding: var(--space-md) var(--space-lg);
  background: var(--brand-accent);
  color: var(--brand-button-text);
  text-decoration: none;
  border-radius: var(--brand-radius);
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.cta:hover { background: var(--brand-primary); color: var(--brand-button-text); }
.cta:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 3px; }

/* cards stagger by range offset, not by delay */
@supports (animation-timeline: view()) {
  .card-grid .feature-card:nth-child(1) { animation-range: entry 0%  entry 50%; }
  .card-grid .feature-card:nth-child(2) { animation-range: entry 12% entry 62%; }
  .card-grid .feature-card:nth-child(3) { animation-range: entry 24% entry 74%; }
}
