/* R4 Office Suite — marketing site shared styles.
   Mirrors the app's dark slate palette so visitors moving from r4biuro.pl
   to app.r4biuro.pl don't experience visual whiplash. Pure CSS, no build
   step — Caddy file_server serves this directly. */

:root {
  --bg:        #020617;
  --surface:   #0f172a;
  --surface-2: #1e293b;
  --border:    rgba(148, 163, 184, 0.15);
  --text:      #f1f5f9;
  --muted:     #94a3b8;
  --dim:       #64748b;
  --brand:     #0ea5e9;
  --brand-2:   #6366f1;
  --accent:    #10b981;
  --max-width: 72rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(14, 165, 233, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: #38bdf8; text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Layout primitives ─────────────────────────────────────── */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* ── Top nav ───────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.875rem 1.5rem;
  max-width: var(--max-width); margin: 0 auto;
}
.brand-link { display: flex; align-items: center; gap: 0.625rem; color: var(--text); text-decoration: none; }
.brand-link:hover { text-decoration: none; color: var(--text); }
.brand-link img { width: 32px; height: 32px; border-radius: 6px; }
.brand-name { font-weight: 700; font-size: 0.95rem; }
.brand-name span { color: var(--brand); }

.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: var(--muted); font-size: 0.875rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--brand); color: #fff !important;
  padding: 0.625rem 1.125rem; border-radius: 0.625rem;
  font-weight: 600; font-size: 0.875rem;
  border: none; cursor: pointer;
  transition: background-color 0.15s;
}
.btn-primary:hover { background: #0284c7; text-decoration: none; color: #fff !important; }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--surface-2); color: var(--text) !important;
  padding: 0.625rem 1.125rem; border-radius: 0.625rem;
  font-weight: 600; font-size: 0.875rem;
  border: 1px solid var(--border); cursor: pointer;
  transition: background-color 0.15s;
}
.btn-secondary:hover { background: #334155; text-decoration: none; }

/* ── Hero ──────────────────────────────────────────────────── */
.hero { padding: 4rem 0 2rem; text-align: center; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800; line-height: 1.15;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, #f1f5f9 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero .subtitle {
  font-size: 1.125rem; color: var(--muted);
  max-width: 38rem; margin: 0 auto 2rem;
}
.hero-cta { display: flex; gap: 0.875rem; justify-content: center; flex-wrap: wrap; }

/* ── Feature grid ──────────────────────────────────────────── */
.features { padding: 4rem 0; }
.section-heading {
  font-size: 0.75rem; font-weight: 700;
  color: var(--dim); text-transform: uppercase;
  letter-spacing: 0.1em; text-align: center; margin-bottom: 0.5rem;
}
.section-title {
  font-size: 1.875rem; font-weight: 700;
  text-align: center; margin-bottom: 3rem;
}
.feature-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.75rem;
  transition: border-color 0.15s, transform 0.15s;
}
.feature-card:hover { border-color: rgba(14, 165, 233, 0.3); transform: translateY(-2px); }
.feature-icon {
  width: 2.5rem; height: 2.5rem; border-radius: 0.75rem;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.125rem; margin-bottom: 1rem;
}
.feature-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.875rem; color: var(--muted); }

/* ── CTA banner ────────────────────────────────────────────── */
.cta-banner {
  margin: 4rem auto;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(99, 102, 241, 0.05));
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 1rem;
  padding: 3rem 2rem; text-align: center;
}
.cta-banner h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.cta-banner p { color: var(--muted); margin-bottom: 1.5rem; }

/* ── Legal / blog page layout ─────────────────────────────── */
.page { padding: 3rem 0 5rem; max-width: 48rem; margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }
.page h1 { font-size: 1.875rem; font-weight: 700; margin-bottom: 0.25rem; }
.page .effective { font-size: 0.875rem; color: var(--dim); margin-bottom: 2.5rem; }

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.section h2 {
  font-size: 0.875rem; font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex; align-items: center; gap: 0.5rem;
  color: #cbd5e1;
}
.section h2 .marker {
  color: var(--brand);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.75rem; font-weight: 500;
}
.section p, .section .body {
  font-size: 0.875rem; color: var(--muted);
  line-height: 1.7; white-space: pre-line;
}

.freecalculatorerores { padding: 4rem 0; }

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--dim);
  margin-top: 3rem;
}
.footer-links {
  display: flex; gap: 1.5rem; justify-content: center;
  flex-wrap: wrap; margin-bottom: 1rem;
}
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* ── Back link ─────────────────────────────────────────────── */
.back-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.875rem; color: var(--muted);
  margin-bottom: 1.5rem;
}
.back-link:hover { color: var(--text); text-decoration: none; }

/* ── Empty-state cards (blog/news placeholders) ────────────── */
.empty-state {
  text-align: center; padding: 4rem 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 1rem;
  color: var(--muted);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h2 { color: var(--text); margin-bottom: 0.5rem; }

@media (max-width: 640px) {
  .nav-links a { display: none; }
  .nav-links a.btn-primary { display: inline-flex; }
  .hero { padding: 3rem 0; }
}

/* ── Cookie consent banner ─────────────────────────────────────
   Driven by /consent.js. Hidden by default; .is-visible fades it
   in once the script decides the visitor needs to choose. */
.cc-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  padding: 1.25rem 1.5rem;
  max-width: var(--max-width); margin: 0 auto;
  opacity: 0; transform: translateY(1rem);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.cc-banner.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.cc-inner { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.cc-text { flex: 1 1 22rem; min-width: 0; }
.cc-text strong { display: block; font-size: 0.95rem; margin-bottom: 0.25rem; color: var(--text); }
.cc-text p { font-size: 0.8125rem; color: var(--muted); line-height: 1.55; }
.cc-text a { color: var(--brand); }
.cc-actions { display: flex; gap: 0.625rem; flex-wrap: wrap; }
.cc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.625rem 1rem; border-radius: 0.625rem;
  font-weight: 600; font-size: 0.8125rem;
  border: 1px solid transparent; cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s, border-color 0.15s;
}
.cc-btn-primary { background: var(--brand); color: #fff; }
.cc-btn-primary:hover { background: #0284c7; }
.cc-btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.cc-btn-secondary:hover { background: #334155; }

@media (max-width: 640px) {
  .cc-banner { left: 0.5rem; right: 0.5rem; bottom: 0.5rem; padding: 1rem; }
  .cc-actions { width: 100%; }
  .cc-btn { flex: 1 1 auto; }
}

/* ── Blog/news listing cards ───────────────────────────────── */
.post-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.5rem; }
.post-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  padding: 1.25rem 1.5rem;
  color: var(--text); text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.post-card:hover {
  border-color: rgba(14, 165, 233, 0.4);
  transform: translateY(-1px);
  text-decoration: none; color: var(--text);
}
.post-card .post-meta {
  font-size: 0.75rem; color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.post-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.4rem; color: var(--text); }
.post-card p { font-size: 0.875rem; color: var(--muted); }

/* ── Article body (blog post / news entry) ─────────────────── */
.post-body { font-size: 0.95rem; line-height: 1.75; color: #cbd5e1; }
.post-body h2 {
  font-size: 1.25rem; font-weight: 700; color: var(--text);
  margin: 2rem 0 0.75rem;
}
.post-body h3 {
  font-size: 1.05rem; font-weight: 600; color: var(--text);
  margin: 1.5rem 0 0.5rem;
}
.post-body p { margin-bottom: 1rem; }
.post-body ul, .post-body ol { margin: 0 0 1rem 1.25rem; padding-left: 1rem; }
.post-body li { margin-bottom: 0.4rem; }
.post-body strong { color: var(--text); }
.post-body blockquote {
  border-left: 3px solid var(--brand);
  padding: 0.5rem 0 0.5rem 1rem;
  margin: 1.25rem 0;
  color: var(--muted); font-style: italic;
}
.post-meta-inline {
  font-size: 0.75rem; color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  margin-bottom: 1.5rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   Themes — driven by /prefs.js, synced with the SaaS via the r4_theme cookie
   on .r4biuro.pl. The :root vars above define the "default" palette; each
   html.theme-X selector overrides those vars so most layout rules need no
   per-theme branching. Theme-specific quirks (typography, sharp corners,
   bevels) live underneath each block.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Default — explicit so swatches match {default,atlas,blueprint,win31} ── */
html.theme-default { color-scheme: dark; }

/* ── Atlas — warm cream & teal (light theme) ─────────────────── */
html.theme-atlas {
  --bg:        #f7f5ef;
  --surface:   #ffffff;
  --surface-2: #ecf0e7;
  --border:    rgba(23, 33, 43, 0.12);
  --text:      #17212b;
  --muted:     #62707c;
  --dim:       #7a8a95;
  --brand:     #1a7f79;
  --brand-2:   #1a7f79;
  --accent:    #10b981;
  color-scheme: light;
}
html.theme-atlas body {
  background-image: none;
}
html.theme-atlas .topbar { background: rgba(247, 245, 239, 0.85); }
html.theme-atlas a:hover { color: #166e69; }
html.theme-atlas .feature-icon {
  background: rgba(26, 127, 121, 0.08);
  border-color: rgba(26, 127, 121, 0.25);
}
html.theme-atlas .feature-card:hover { border-color: rgba(26, 127, 121, 0.35); }
html.theme-atlas .cta-banner {
  background: linear-gradient(135deg, rgba(26, 127, 121, 0.10), rgba(99, 102, 241, 0.05));
  border-color: rgba(26, 127, 121, 0.25);
}
html.theme-atlas .btn-primary:hover { background: #166e69; }
html.theme-atlas .btn-secondary { background: var(--surface-2); }
html.theme-atlas .btn-secondary:hover { background: #e2e7de; }
html.theme-atlas .post-card:hover { border-color: rgba(26, 127, 121, 0.35); }
html.theme-atlas .hero h1 {
  background: linear-gradient(135deg, #17212b 0%, #62707c 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ── Blueprint — navy + cyan, technical drafting feel ────────── */
html.theme-blueprint {
  --bg:        #0a1628;
  --surface:   #0d1f3c;
  --surface-2: #143560;
  --border:    rgba(232, 240, 255, 0.15);
  --text:      #e8f0ff;
  --muted:     rgba(232, 240, 255, 0.55);
  --dim:       rgba(232, 240, 255, 0.35);
  --brand:     #5bc0eb;
  --brand-2:   #5bc0eb;
  --accent:    #5bc0eb;
  color-scheme: dark;
}
html.theme-blueprint body {
  font-family: 'IBM Plex Mono', 'Share Tech Mono', 'Consolas', monospace;
  background-image:
    linear-gradient(rgba(232, 240, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 240, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}
html.theme-blueprint h1,
html.theme-blueprint h2,
html.theme-blueprint h3 {
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
html.theme-blueprint .topbar { background: rgba(10, 22, 40, 0.85); }
html.theme-blueprint .feature-card,
html.theme-blueprint .feature-icon,
html.theme-blueprint .cta-banner,
html.theme-blueprint .post-card,
html.theme-blueprint .section,
html.theme-blueprint .empty-state,
html.theme-blueprint .btn-primary,
html.theme-blueprint .btn-secondary,
html.theme-blueprint .cc-banner,
html.theme-blueprint .cc-btn { border-radius: 0; }
html.theme-blueprint .feature-card:hover { border-color: rgba(91, 192, 235, 0.4); }
html.theme-blueprint .post-card:hover { border-color: rgba(91, 192, 235, 0.55); }
html.theme-blueprint .cta-banner {
  background: linear-gradient(135deg, rgba(91, 192, 235, 0.10), rgba(91, 192, 235, 0.04));
  border-color: rgba(91, 192, 235, 0.25);
}
html.theme-blueprint .btn-primary { color: #0a1628; background: #e8f0ff; }
html.theme-blueprint .btn-primary:hover { background: #5bc0eb; color: #0a1628; }
html.theme-blueprint .btn-secondary { background: transparent; }
html.theme-blueprint .btn-secondary:hover { background: rgba(91, 192, 235, 0.1); border-color: rgba(91, 192, 235, 0.4); }
html.theme-blueprint .hero h1 {
  background: linear-gradient(135deg, #e8f0ff 0%, #5bc0eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ── Win 3.1 — VGA window chrome ─────────────────────────────── */
html.theme-win31 {
  --bg:        #008080;
  --surface:   #C0C0C0;
  --surface-2: #C0C0C0;
  --border:    #808080;
  --text:      #000000;
  --muted:     #000000;
  --dim:       #404040;
  --brand:     #000080;
  --brand-2:   #800080;
  --accent:    #008000;
  color-scheme: light;
}
html.theme-win31 body {
  font-family: 'VT323', 'MS Sans Serif', Tahoma, sans-serif;
  font-size: 1.05rem;
  background-image: none;
}
/* Sharp corners across the board — Win 3.1 never had a curve. */
html.theme-win31 .topbar,
html.theme-win31 .feature-card,
html.theme-win31 .feature-icon,
html.theme-win31 .cta-banner,
html.theme-win31 .post-card,
html.theme-win31 .section,
html.theme-win31 .empty-state,
html.theme-win31 .btn-primary,
html.theme-win31 .btn-secondary,
html.theme-win31 .cc-banner,
html.theme-win31 .cc-btn,
html.theme-win31 .theme-toggle,
html.theme-win31 .theme-popover,
html.theme-win31 .theme-option { border-radius: 0; }
html.theme-win31 .topbar { background: #C0C0C0; backdrop-filter: none; }
html.theme-win31 a { color: #000080; }
html.theme-win31 a:hover { color: #0000cc; }
html.theme-win31 .feature-card,
html.theme-win31 .post-card,
html.theme-win31 .section,
html.theme-win31 .cta-banner,
html.theme-win31 .empty-state {
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #808080;
}
html.theme-win31 .btn-primary,
html.theme-win31 .btn-secondary,
html.theme-win31 .cc-btn {
  background: #C0C0C0; color: #000000 !important;
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #808080;
}
html.theme-win31 .btn-primary:hover,
html.theme-win31 .btn-secondary:hover,
html.theme-win31 .cc-btn:hover { background: #D4D4D4; }
html.theme-win31 .btn-primary:active,
html.theme-win31 .btn-secondary:active {
  border-color: #808080 #ffffff #ffffff #808080;
  box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #ffffff;
}
html.theme-win31 .feature-icon {
  background: #C0C0C0;
  border: 1px solid #808080;
  box-shadow: none;
}
html.theme-win31 .feature-card:hover,
html.theme-win31 .post-card:hover { transform: none; }
html.theme-win31 .hero h1 {
  background: none;
  -webkit-text-fill-color: initial;
  color: #000000;
}

/* ══════════════════════════════════════════════════════════════════════════
   Theme switcher — small palette button with a popover of the four themes,
   injected into the topbar by /prefs.js on every page.
   ══════════════════════════════════════════════════════════════════════════ */
.theme-toggle-wrapper { position: relative; display: inline-flex; }
.theme-toggle {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  display: inline-flex; align-items: center;
  border-radius: 0.5rem;
  font: inherit;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
.theme-toggle:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
}
.theme-popover {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  padding: 0.25rem;
  display: flex; flex-direction: column; gap: 0.125rem;
  min-width: 9.5rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  z-index: 60;
}
.theme-popover[hidden] { display: none; }
.theme-option {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8125rem;
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-radius: 0.375rem;
  cursor: pointer;
}
.theme-option:hover { background: var(--surface-2); }
.theme-option.is-active { color: var(--brand); font-weight: 600; }

/* On narrow screens the topbar hides plain text links but keeps CTAs;
   keep the theme toggle visible too — it's the whole point of the FAB. */
@media (max-width: 640px) {
  .nav-links .theme-toggle-wrapper { display: inline-flex; }
  .nav-links .lang-toggle { display: inline-flex; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Language toggle — pair of PL/EN buttons injected by /i18n.js. Mirrors
   the SaaS LanguageSwitcher visual contract (active = highlighted, inactive
   = dimmed) without pulling in flag-icons CSS for two flags.
   ══════════════════════════════════════════════════════════════════════════ */
.lang-toggle {
  display: inline-flex;
  gap: 0.125rem;
  padding: 0.125rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.lang-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
  min-width: 2rem;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.is-active {
  background: var(--surface);
  color: var(--brand);
}

/* ══════════════════════════════════════════════════════════════════════════
   Polish-only notice — long-form prose (legal terms, blog/news articles)
   stays in Polish for now; this banner shows up only when the visitor has
   chosen English so they aren't silently served untranslated content.
   ══════════════════════════════════════════════════════════════════════════ */
.pl-only-notice {
  display: none;
  margin: 0 0 1.5rem;
  padding: 0.875rem 1rem;
  border-radius: 0.625rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
}
html[lang="en"] .pl-only-notice { display: block; }

/* ══════════════════════════════════════════════════════════════════════════
   Audience selector — "choose your path" band between the hero and features.
   FN Herstal-style hover-to-expand panels. Each panel is a self-contained
   accent gradient (so it reads consistently across every theme, like a photo
   would), while the section heading uses the shared theme tokens. On narrow
   screens the panels stack and reveal their content. CSS-only: hover drives
   the expand on pointer devices; the stacked mobile layout covers touch.
   ══════════════════════════════════════════════════════════════════════════ */
.audience-section { padding: 1.5rem 1.5rem 3rem; }
.audience-section .section-title { margin-bottom: 0.75rem; }
.audience-sub {
  text-align: center; color: var(--muted);
  max-width: 42rem; margin: 0 auto 2.25rem; font-size: 1.0625rem;
}

.audience { display: flex; gap: 0.875rem; }

.apanel {
  position: relative; flex: 1 1 0; min-width: 0;
  height: clamp(420px, 56vh, 580px);
  border-radius: 1.25rem; overflow: hidden; isolation: isolate;
  border: 1px solid var(--border);
  text-decoration: none; color: #fff;
  transition: flex-grow 0.6s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.35s;
  /* per-panel accent — overridden by the colour modifier below */
  --p-strong: #38bdf8; --p-mid: #0ea5e9; --p-deep: #0b3a5e; --p-rgb: 56, 189, 248;
}
.apanel:hover { text-decoration: none; color: #fff; }
.apanel--cyan    { --p-strong: #38bdf8; --p-mid: #0ea5e9; --p-deep: #0b3a5e; --p-rgb: 56, 189, 248; }
.apanel--violet  { --p-strong: #a78bfa; --p-mid: #8b5cf6; --p-deep: #352a66; --p-rgb: 167, 139, 250; }
.apanel--emerald { --p-strong: #34d399; --p-mid: #10b981; --p-deep: #0c4435; --p-rgb: 52, 211, 153; }

.apanel-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(circle at 1.5px 1.5px, rgba(255,255,255,0.05) 1.3px, transparent 1.5px) 0 0 / 30px 30px,
    linear-gradient(157deg, #0a1322 0%, var(--p-deep) 52%, var(--p-mid) 100%);
}
/* chevron motif from the R4 wordmark, very subtle, upper-right */
.apanel-bg::after {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='320' viewBox='0 0 200 320'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.10' stroke-width='14' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M70 90 L140 160 L70 230'/%3E%3Cpath d='M110 90 L180 160 L110 230'/%3E%3C/g%3E%3C/svg%3E") no-repeat right 10% top 26% / 52% auto;
}
.apanel-tint {
  position: absolute; inset: 0; z-index: 1; transition: background 0.4s;
  background: linear-gradient(180deg, rgba(6,11,22,0.12) 0%, rgba(6,11,22,0.30) 42%, rgba(6,11,22,0.86) 100%);
}
.apanel-edge {
  position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07); transition: box-shadow 0.35s;
}
.apanel-body {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(18px, 2.1vw, 28px);
}
.apanel-top { display: flex; align-items: center; gap: 11px; }
.apanel-num {
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.62);
  border: 1px solid rgba(255,255,255,0.24); border-radius: 7px; padding: 3px 8px;
}
.apanel-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.78); }
.apanel-icon {
  width: 46px; height: 46px; border-radius: 13px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: rgba(var(--p-rgb), 0.20); border: 1px solid rgba(var(--p-rgb), 0.42);
}
.apanel-title { margin: 0; font-size: clamp(22px, 2.2vw, 29px); font-weight: 800; line-height: 1.1; color: #fff; }
.apanel-subtitle { margin: 8px 0 0; font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,0.72); }

.apanel-reveal {
  max-height: 0; overflow: hidden; opacity: 0; transform: translateY(8px);
  transition: max-height 0.55s cubic-bezier(0.22,0.61,0.36,1), opacity 0.4s ease, transform 0.45s ease;
  margin-top: 14px;
}
@media (hover: hover) { .apanel:hover .apanel-reveal { max-height: 380px; opacity: 1; transform: none; } }
.apanel:focus-visible .apanel-reveal { max-height: 380px; opacity: 1; transform: none; }
.apanel:focus-visible { outline: 2px solid var(--p-strong); outline-offset: 2px; }

.apanel-desc { margin: 0 0 14px; max-width: 32ch; font-size: 14px; line-height: 1.55; color: rgba(255,255,255,0.85); }
.apanel-features { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.apanel-features li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(255,255,255,0.92); }
.apanel-features .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--p-strong); box-shadow: 0 0 8px var(--p-strong); flex: none; }
.apanel-cta {
  display: inline-flex; align-items: center; gap: 9px; align-self: flex-start;
  background: #fff; color: #0b1322; font-weight: 700; font-size: 13.5px;
  padding: 10px 16px; border-radius: 11px; transition: gap 0.2s, background 0.2s, color 0.2s;
}
.apanel-cta svg { transition: transform 0.2s; }
.apanel:hover .apanel-cta { background: var(--p-strong); color: #06121f; gap: 12px; }

/* Hover-expand: the hovered panel grows, its siblings compress. */
@media (hover: hover) {
  .audience:hover .apanel { flex-grow: 0.72; }
  .audience .apanel:hover { flex-grow: 2.3; }
  .audience .apanel:hover .apanel-tint { background: linear-gradient(180deg, rgba(6,11,22,0.20) 0%, rgba(6,11,22,0.42) 42%, rgba(6,11,22,0.90) 100%); }
  .audience .apanel:hover .apanel-edge { box-shadow: inset 0 0 0 1.5px rgba(var(--p-rgb), 0.6), 0 0 60px rgba(var(--p-rgb), 0.16); }
}

@media (max-width: 860px) {
  .audience { flex-direction: column; gap: 12px; }
  .apanel { height: auto; min-height: 300px; }
  .apanel-reveal { max-height: none; opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .apanel, .apanel-reveal, .apanel-tint, .apanel-edge, .apanel-cta { transition: none; }
}

/* ── Theme tweaks (sharp corners / bevels match the page chrome) ── */
html.theme-blueprint .apanel,
html.theme-blueprint .apanel-cta { border-radius: 0; }
html.theme-win31 .apanel {
  border-radius: 0;
  border: 2px solid; border-color: #ffffff #808080 #808080 #ffffff;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #808080;
}
html.theme-win31 .apanel-edge { display: none; }
html.theme-win31 .apanel-cta { border-radius: 0; }
