/* SAPL Preview Theme - Light, clean, professional */

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

:root {
  /* Brand colors from SAPL logo */
  --color-primary: #028392;        /* teal — logo primary swoosh */
  --color-primary-hover: #026d79;  /* teal darker */
  --color-primary-light: #7bbdbc;  /* teal light — logo secondary swoosh */
  --color-accent: #8f9cc1;         /* slate blue — logo inner element */
  --color-accent-muted: #799cc1;   /* muted blue — logo connector */

  /* Page colors — muted cool grey */
  --color-bg: #e2e8f0;
  --color-bg-card: #edf2f7;
  --color-text: #1a1a2e;
  --color-text-secondary: #4a5568;
  --color-surface: #e2e8f0;
  --color-border: #cbd5e1;
  --color-code-bg: #1e1e2e;

  /* Shadows — teal-tinted, layered */
  --shadow-sm: 0 1px 2px rgba(2, 131, 146, 0.05);
  --shadow-md:
    0 1px 3px rgba(2, 131, 146, 0.06),
    0 4px 12px rgba(2, 131, 146, 0.04);
  --shadow-lg:
    0 2px 4px rgba(2, 131, 146, 0.04),
    0 8px 24px rgba(2, 131, 146, 0.06),
    0 24px 48px rgba(2, 131, 146, 0.04);

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  --max-width: 1100px;
}

/* Dark mode — aligned with sapl-vaadin-theme (styles-aura.css) */
[data-theme="dark"] {
  --color-bg: hsl(210, 10%, 12%);             /* #1b1e21 — aura-background-color-dark */
  --color-bg-card: hsl(210, 10%, 15%);        /* ~#222629 — 1 step lighter */
  --color-text: hsl(210, 10%, 90%);           /* #e3e4e6 */
  --color-text-secondary: hsl(210, 10%, 60%); /* #929699 */
  --color-surface: hsl(210, 10%, 18%);        /* ~#292c2f — 2 steps lighter */
  --color-border: rgba(255, 255, 255, 0.10);  /* lumo-contrast-10pct */
  --color-primary: hsl(179, 43%, 44%);        /* #3fa09e — aura-accent-color-dark */
  --color-primary-hover: hsl(179, 43%, 52%);  /* lighter on hover */

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md:
    0 1px 3px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg:
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 24px 48px rgba(0, 0, 0, 0.3);
}

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.35rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  transition: color 150ms ease, border-color 150ms ease;
}

.theme-toggle:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Show sun in dark mode, moon in light mode */
.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

html { font-size: 16px; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.site-header {
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 1.5rem;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  color: var(--color-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo img {
  height: 56px;
  width: auto;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.logo-subtitle {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  letter-spacing: 0.04em;
}

/* Logo theme swap — light is default, dark only with explicit attribute */
.logo img.logo-dark { display: none; }
.logo img.logo-light { display: block; }
html[data-theme="dark"] .logo img.logo-dark { display: block; }
html[data-theme="dark"] .logo img.logo-light { display: none; }

.nav-links { display: flex; gap: 1.5rem; align-items: center; }

.nav-links a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 150ms ease;
}

.nav-links a:hover { color: var(--color-primary); }

/* Nav dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  cursor: pointer;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  padding-top: 0.5rem;
  width: 340px;
  z-index: 100;
}

.nav-dropdown-menu-inner {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.nav-dropdown-menu-inner::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 24px;
  transform: rotate(45deg);
  width: 12px;
  height: 12px;
  background: var(--color-bg-card);
  border-left: 1px solid var(--color-border);
  border-top: 1px solid var(--color-border);
}

.nav-dropdown-scroll {
  max-height: 70vh;
  overflow-y: auto;
  padding: 0.4rem;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-group-label {
  padding: 0.5rem 0.8rem 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
}

.nav-dropdown-group-label:not(:first-child) {
  margin-top: 0.3rem;
  border-top: 1px solid var(--color-border);
  padding-top: 0.6rem;
}

.nav-dropdown-item {
  display: block;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 150ms ease;
}

.nav-dropdown-item:hover {
  background: var(--color-surface);
  color: inherit;
  text-decoration: none;
}

.nav-dropdown-item strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text);
}

.nav-dropdown-item span {
  display: block;
  font-size: 0.72rem;
  color: var(--color-text-secondary);
  line-height: 1.3;
}

.nav-dropdown-footer {
  display: block;
  padding: 0.5rem 0.8rem;
  margin-top: 0.3rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
}

.nav-dropdown-footer:hover {
  text-decoration: underline;
}

/* Main content */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Prose — styles for Markdown-rendered content */
main > h1, main > h2, main > h3, main > h4 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

main > p, main > ul, main > ol {
  margin-bottom: 1rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

main > ul, main > ol {
  padding-left: 1.5rem;
}

main > li + li {
  margin-top: 0.25rem;
}

main > blockquote {
  border-left: 3px solid var(--color-primary);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  color: var(--color-text-secondary);
  background: var(--color-bg-card);
  border-radius: 0 8px 8px 0;
}

main img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}

main pre {
  background: #f8fafc;
  color: #1a1a2e;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 1rem 0;
}

main .highlight {
  margin: 1rem 0;
}

main .highlight pre {
  margin: 0;
}

main code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-surface);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

main pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* Rouge syntax highlighting — light mode */
main .highlight, main pre.highlight { background: #f8fafc; color: #1a1a2e; }
main .highlight pre { background: #f8fafc; }
main .highlight .hll { background: #e8ecf1; }
main .highlight .c, main .highlight .cm, main .highlight .cp, main .highlight .c1, main .highlight .cs { color: #8290a3; font-style: italic; }
main .highlight .k, main .highlight .kc, main .highlight .kd, main .highlight .kn, main .highlight .kp, main .highlight .kr, main .highlight .kt { color: #7c3aed; }
main .highlight .l, main .highlight .s, main .highlight .sb, main .highlight .sc, main .highlight .sd, main .highlight .s2, main .highlight .se, main .highlight .sh, main .highlight .si, main .highlight .sx, main .highlight .s1, main .highlight .ld { color: #16803c; }
main .highlight .m, main .highlight .mf, main .highlight .mh, main .highlight .mi, main .highlight .mo, main .highlight .il { color: #c2410c; }
main .highlight .na, main .highlight .py { color: #b45309; }
main .highlight .nb, main .highlight .nc, main .highlight .no, main .highlight .nd, main .highlight .ni, main .highlight .ne, main .highlight .nl, main .highlight .nv, main .highlight .bp, main .highlight .vc, main .highlight .vg { color: #b45309; }
main .highlight .nf, main .highlight .nn, main .highlight .nx { color: #1d4ed8; }
main .highlight .nt { color: #be123c; }
main .highlight .vi { color: #be123c; }
main .highlight .sr, main .highlight .ss { color: #0e7490; }
main .highlight .o, main .highlight .p, main .highlight .n, main .highlight .w { color: #1a1a2e; }
main .highlight .err { color: #be123c; background: none; }
main .highlight .ge { font-style: italic; }
main .highlight .gs { font-weight: 700; }
main .highlight .ow { font-weight: 700; }
main .highlight .gd { color: #be123c; }
main .highlight .gi { color: #16803c; }
main .highlight .gu { color: #8290a3; }

/* Rouge syntax highlighting — dark mode */
[data-theme="dark"] main pre { background: var(--color-code-bg); color: #dee2f7; border-color: rgba(255,255,255,0.06); }
[data-theme="dark"] main pre code { color: #dee2f7; }
[data-theme="dark"] main .highlight, [data-theme="dark"] main pre.highlight { background: var(--color-code-bg); color: #dee2f7; }
[data-theme="dark"] main .highlight pre { background: var(--color-code-bg); }
[data-theme="dark"] main .highlight .hll { background: #313340; }
[data-theme="dark"] main .highlight .c, [data-theme="dark"] main .highlight .cm, [data-theme="dark"] main .highlight .cp, [data-theme="dark"] main .highlight .c1, [data-theme="dark"] main .highlight .cs { color: #63677e; }
[data-theme="dark"] main .highlight .k, [data-theme="dark"] main .highlight .kc, [data-theme="dark"] main .highlight .kd, [data-theme="dark"] main .highlight .kn, [data-theme="dark"] main .highlight .kp, [data-theme="dark"] main .highlight .kr, [data-theme="dark"] main .highlight .kt { color: #c792ea; }
[data-theme="dark"] main .highlight .l, [data-theme="dark"] main .highlight .s, [data-theme="dark"] main .highlight .sb, [data-theme="dark"] main .highlight .sc, [data-theme="dark"] main .highlight .sd, [data-theme="dark"] main .highlight .s2, [data-theme="dark"] main .highlight .se, [data-theme="dark"] main .highlight .sh, [data-theme="dark"] main .highlight .si, [data-theme="dark"] main .highlight .sx, [data-theme="dark"] main .highlight .s1, [data-theme="dark"] main .highlight .ld { color: #c3e88d; }
[data-theme="dark"] main .highlight .m, [data-theme="dark"] main .highlight .mf, [data-theme="dark"] main .highlight .mh, [data-theme="dark"] main .highlight .mi, [data-theme="dark"] main .highlight .mo, [data-theme="dark"] main .highlight .il { color: #f78c6c; }
[data-theme="dark"] main .highlight .na, [data-theme="dark"] main .highlight .py { color: #ffcb6b; }
[data-theme="dark"] main .highlight .nb, [data-theme="dark"] main .highlight .nc, [data-theme="dark"] main .highlight .no, [data-theme="dark"] main .highlight .nd, [data-theme="dark"] main .highlight .ni, [data-theme="dark"] main .highlight .ne, [data-theme="dark"] main .highlight .nl, [data-theme="dark"] main .highlight .nv, [data-theme="dark"] main .highlight .bp, [data-theme="dark"] main .highlight .vc, [data-theme="dark"] main .highlight .vg { color: #ffcb6b; }
[data-theme="dark"] main .highlight .nf, [data-theme="dark"] main .highlight .nn, [data-theme="dark"] main .highlight .nx { color: #82aaff; }
[data-theme="dark"] main .highlight .nt { color: #f07178; }
[data-theme="dark"] main .highlight .vi { color: #f07178; }
[data-theme="dark"] main .highlight .sr, [data-theme="dark"] main .highlight .ss { color: #89ddff; }
[data-theme="dark"] main .highlight .o, [data-theme="dark"] main .highlight .p, [data-theme="dark"] main .highlight .n, [data-theme="dark"] main .highlight .w { color: #dee2f7; }
[data-theme="dark"] main .highlight .err { color: #f07178; background: none; }
[data-theme="dark"] main .highlight .gd { color: #f07178; }
[data-theme="dark"] main .highlight .gi { color: #c3e88d; }
[data-theme="dark"] main .highlight .gu { color: #63677e; }

main a {
  color: var(--color-primary);
  text-decoration: none;
}

main a:hover {
  text-decoration: underline;
}

main > table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

main > table th, main > table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  text-align: left;
}

main > table th {
  background: var(--color-bg-card);
  font-weight: 600;
}

main > hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* Section blocks */
.section {
  padding: 4rem 0;
}

.section + .section {
  border-top: 1px solid var(--color-border);
}

/* Hero */
.hero {
  padding: 4rem 0 2rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.hero .subtitle {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.5;
}

/* CTA buttons */
.cta-group { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 150ms ease;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-bg-card);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  background: var(--color-bg-card);
}

/* Editor embed — dark card with subtle ambient glow */
.editor-embed {
  margin: 2rem auto;
  max-width: 800px;
  position: relative;
}

.editor-embed::before {
  content: "";
  position: absolute;
  top: -20%;
  left: -10%;
  width: 120%;
  height: 140%;
  background: radial-gradient(
    50% 50% at 50% 50%,
    rgba(2, 131, 146, 0.08) 0%,
    rgba(123, 189, 188, 0.03) 50%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] .editor-embed::before {
  background: radial-gradient(
    50% 50% at 50% 50%,
    rgba(91, 190, 197, 0.15) 0%,
    rgba(123, 189, 188, 0.05) 50%,
    transparent 100%
  );
}

.editor-embed sapl-code,
.editor-embed sapl-demo {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.08),
    var(--shadow-lg);
}

/* Feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.feature {
  background: var(--color-bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.feature:hover {
  border-color: rgba(2, 131, 146, 0.3);
  box-shadow: var(--shadow-md);
}

.feature h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.feature p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.feature-meta {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  opacity: 0.7;
  margin-top: 0.5rem;
}

.feature a {
  color: var(--color-primary);
  text-decoration: none;
}

.feature a:hover { text-decoration: underline; }

/* Integration tiers */
.integration-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.integration-tiers a {
  color: var(--color-primary);
  text-decoration: none;
}

.integration-tiers a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .integration-tiers { grid-template-columns: 1fr; }
}

.integration-note {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-align: center;
  margin-top: 0.5rem;
}

/* Code tabs */
.code-tabs {
  margin-top: 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-code-bg);
}

.tab-bar {
  display: flex;
  gap: 0;
  background: #181825;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  overflow-x: auto;
}

.tab {
  background: none;
  border: none;
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #6c7086;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
  white-space: nowrap;
  font-family: var(--font-sans);
}

.tab:hover { color: #e2e8f0; }

.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-content {
  display: none;
  padding: 0;
}

.tab-content.active { display: block; }

/* Fallback before CodeMirror loads */
.tab-content pre.cm-source {
  margin: 0;
  padding: 1.25rem 1.5rem;
  background: var(--color-code-bg);
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
}

.tab-content pre.cm-source code {
  font-family: inherit;
  background: none;
}

/* CodeMirror in tabs */
.tab-content .cm-editor {
  font-size: 0.85rem;
  border-radius: 0;
  padding: 0.5rem 0;
}

.tab-content .cm-gutters {
  background: transparent;
  border-right: none;
}

/* Terminal output */
.terminal {
  background: #0c0c0c;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

.test-output {
  margin: 0;
  padding: 1rem 1.5rem;
  background: #0c0c0c;
  color: #cccccc;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.7;
  overflow-x: auto;
}

.test-output code { font-family: inherit; background: none; }
.term-prompt { color: #6c7086; }
.term-bold { color: #e0e0e0; font-weight: 700; }
.test-pass { color: #4ec751; }
.test-pass-bold { color: #4ec751; font-weight: 700; }
.test-dim { color: #555555; }

/* Testing demo layout */
.testing-demo { margin-top: 1.5rem; }

.testing-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.testing-col {
  background: var(--color-code-bg);
  min-width: 0;
}

.testing-label {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6c7086;
  background: #181825;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.testing-code { overflow-x: auto; }

.testing-code pre.cm-source {
  margin: 0;
  padding: 1rem 1.25rem;
  background: var(--color-code-bg);
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
}

.testing-code pre.cm-source code { font-family: inherit; background: none; }

.testing-code .cm-editor {
  font-size: 0.8rem;
  border-radius: 0;
  padding: 0.25rem 0;
}

.testing-code .cm-gutters {
  background: transparent;
  border-right: none;
}

.testing-output {
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

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

/* Project logos */
.project-logo {
  height: 36px;
  width: auto;
  display: block;
  margin-bottom: 0.5rem;
}

/* Partner logos */
.partner-logos {
  margin-top: 2rem;
}

.partner-logos h3 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}

.logo-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.5rem 2.5rem;
}

.logo-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 150ms ease, box-shadow 150ms ease;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.04);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .logo-grid a {
  background: rgba(255, 255, 255, 0.65);
}

.logo-grid a:hover { opacity: 1; }

.logo-grid img {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.logo-text-fallback {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

/* EU funding acknowledgment */
.eu-funding {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.eu-flag {
  flex-shrink: 0;
  width: 64px;
  height: auto;
}

.eu-funding p {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0;
}

.eu-funding a {
  color: var(--color-primary);
  text-decoration: none;
}

.eu-funding a:hover { text-decoration: underline; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 1.5rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

/* Typography */
h1, h2, h3, h4 { letter-spacing: -0.03em; }

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

h3 { font-size: 1.1rem; }
p + p { margin-top: 1rem; }

/* ── Media page ── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.media-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
}

/* Lazy-loading YouTube player */
.yt-lazy {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}

.yt-lazy img {
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
  transition: filter 0.3s ease;
}

.yt-lazy:hover img {
  filter: brightness(75%);
}

.yt-lazy .yt-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 68px; height: 48px;
  background: rgba(0,0,0,0.7);
  border-radius: 12px;
  pointer-events: none;
  transition: background 0.2s ease;
}

.yt-lazy:hover .yt-play {
  background: #dc2626;
}

.yt-lazy .yt-play::after {
  content: '';
  position: absolute;
  top: 50%; left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 9px 0 9px 16px;
  border-color: transparent transparent transparent #fff;
}

.yt-lazy iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
}

.media-caption {
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
}


.publications {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.publication {
  padding: 1.25rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.pub-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

.pub-meta {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ── Streaming Demo ── */
.sd-code-panels {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  margin-top: 1.5rem;
}

.sd-code-panel {
  background: var(--color-code-bg);
  display: flex;
  flex-direction: column;
}

.sd-code-label {
  padding: 0.45rem 1rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6c7086;
  background: #181825;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sd-code-panel pre.cm-source {
  margin: 0;
  padding: 0.75rem 1.1rem;
  background: var(--color-code-bg);
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.65;
  overflow-x: auto;
  flex: 1;
}
.sd-code-panel pre.cm-source code { font-family: inherit; background: none; }
.sd-code-panel > div:has(.cm-editor) { flex: 1; display: flex; flex-direction: column; }
.sd-code-panel .cm-editor { font-size: 0.72rem; border-radius: 0; padding: 0.25rem 0; flex: 1; }
.sd-code-panel .cm-gutters { background: transparent; border-right: none; }
.sd-code-panel .cm-scroller { overflow: auto; }

/* Flow container — always dark */
.sd-flow {
  display: grid;
  grid-template-columns: 0.8fr 28px 0.6fr 28px 1.8fr;
  grid-template-rows: 1fr;
  border: 1px solid var(--color-border);
  border-top: none;
  background: #1e1e2e;
  color: #e2e8f0;
  height: 240px;
}

.sd-panel { display: flex; flex-direction: column; overflow: hidden; }

.sd-panel-header {
  padding: 0.45rem 1rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6c7086;
  background: #181825;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sd-panel-body {
  flex: 1;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Connectors */
.sd-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #1e1e2e;
  padding-top: 28px;
}

.sd-track {
  position: absolute;
  top: calc(50% + 14px); left: 0; right: 0;
  height: 2px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}

.sd-pulse {
  position: absolute;
  top: 0; left: -40%;
  width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, #059669, transparent);
  animation: sdFlow 1.2s linear infinite;
}
.sd-pulse-warn { background: linear-gradient(90deg, transparent, #d97706, transparent); }
.sd-pulse-deny { background: linear-gradient(90deg, transparent, #dc2626, transparent); animation: none; opacity: 0.4; left: 30%; }
[data-theme="dark"] .sd-pulse { background: linear-gradient(90deg, transparent, #34d399, transparent); }
[data-theme="dark"] .sd-pulse-warn { background: linear-gradient(90deg, transparent, #fbbf24, transparent); }
[data-theme="dark"] .sd-pulse-deny { background: linear-gradient(90deg, transparent, #f87171, transparent); }

@keyframes sdFlow { from { left: -40%; } to { left: 100%; } }

.sd-arrow {
  position: relative; z-index: 1;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #1e1e2e;
  border: 1.5px solid #059669;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 300ms, color 300ms;
  color: #059669;
}
.sd-arrow-warn  { border-color: #d97706; color: #d97706; }
.sd-arrow-deny  { border-color: #dc2626; color: #dc2626; }
[data-theme="dark"] .sd-arrow { border-color: #34d399; color: #34d399; }
[data-theme="dark"] .sd-arrow-warn { border-color: #fbbf24; color: #fbbf24; }
[data-theme="dark"] .sd-arrow-deny { border-color: #f87171; color: #f87171; }
.sd-arrow svg { width: 10px; height: 10px; }

/* Source panel */
.sd-source-label {
  font-size: 0.72rem;
  color: #6c7086;
  font-family: var(--font-mono);
  margin-bottom: 0.75rem;
}

.sd-toggle {
  display: flex;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 250ms;
}
.sd-toggle-low      { border-color: #d97706; }
.sd-toggle-high     { border-color: #059669; }
.sd-toggle-critical { border-color: #dc2626; }
[data-theme="dark"] .sd-toggle-low      { border-color: #fbbf24; }
[data-theme="dark"] .sd-toggle-high     { border-color: #34d399; }
[data-theme="dark"] .sd-toggle-critical { border-color: #f87171; }

.sd-btn {
  padding: 0.5rem 0.7rem;
  border: none;
  background: #292c2f;
  color: #6c7086;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms;
}
.sd-btn:hover { color: #e2e8f0; }
.sd-btn + .sd-btn { border-left: 1px solid rgba(255,255,255,0.1); }
.sd-btn-active-low      { background: rgba(217,119,6,0.08); color: #d97706; font-weight: 600; }
.sd-btn-active-high     { background: rgba(5,150,105,0.08); color: #059669; font-weight: 600; }
.sd-btn-active-critical { background: rgba(220,38,38,0.08); color: #dc2626; font-weight: 600; }
[data-theme="dark"] .sd-btn-active-low      { color: #fbbf24; background: rgba(251,191,36,0.1); }
[data-theme="dark"] .sd-btn-active-high     { color: #34d399; background: rgba(52,211,153,0.1); }
[data-theme="dark"] .sd-btn-active-critical { color: #f87171; background: rgba(248,113,113,0.1); }

.sd-hint { font-size: 0.68rem; color: #6c7086; margin-top: 0.6rem; }

/* Decision badge */
.sd-badge {
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  padding: 0.65rem 1.4rem; border-radius: 8px;
  font-family: var(--font-mono); font-weight: 600;
  transition: all 300ms;
}
.sd-badge-main { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; }
.sd-badge-sub {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.6rem; font-weight: 500;
  opacity: 0; max-height: 0; overflow: hidden; transition: all 300ms;
}
.sd-badge-sub-visible { opacity: 0.8; max-height: 1.5em; }
.sd-badge-sub svg { width: 11px; height: 11px; flex-shrink: 0; }

.sd-badge-permit { background: rgba(5,150,105,0.08); color: #059669; box-shadow: 0 0 0 1px #059669, 0 0 12px rgba(5,150,105,0.25); }
.sd-badge-warn   { background: rgba(217,119,6,0.08); color: #d97706; box-shadow: 0 0 0 1px #d97706, 0 0 12px rgba(217,119,6,0.25); }
.sd-badge-deny   { background: rgba(220,38,38,0.08); color: #dc2626; box-shadow: 0 0 0 1px #dc2626, 0 0 12px rgba(220,38,38,0.25); }
[data-theme="dark"] .sd-badge-permit { color: #34d399; box-shadow: 0 0 0 1px #34d399, 0 0 12px rgba(52,211,153,0.2); background: rgba(52,211,153,0.1); }
[data-theme="dark"] .sd-badge-warn   { color: #fbbf24; box-shadow: 0 0 0 1px #fbbf24, 0 0 12px rgba(251,191,36,0.2); background: rgba(251,191,36,0.1); }
[data-theme="dark"] .sd-badge-deny   { color: #f87171; box-shadow: 0 0 0 1px #f87171, 0 0 12px rgba(248,113,113,0.2); background: rgba(248,113,113,0.1); }

.sd-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: currentColor;
  animation: sdPulse 2s ease-in-out infinite;
}
@keyframes sdPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.8); } }

/* App panel */
.sd-panel-app .sd-panel-body { align-items: stretch; justify-content: flex-start; padding: 0; overflow: hidden; }

.sd-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--font-mono); font-size: 0.68rem;
}
.sd-table th {
  padding: 0.35rem 0.6rem; text-align: left;
  font-size: 0.6rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: #6c7086; background: #181825;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sd-table td {
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: #c0c4cc; white-space: nowrap;
}
.sd-table tr { animation: sdRowIn 0.3s ease; }
@keyframes sdRowIn { from { opacity: 0; background: rgba(255,255,255,0.04); } to { opacity: 1; background: transparent; } }

.sd-dim { color: #555; }
.sd-m-get    { color: #34d399; }
.sd-m-post   { color: #82aaff; }
.sd-m-put    { color: #ffcb6b; }
.sd-m-patch  { color: #c792ea; }
.sd-m-delete { color: #f78c6c; }
.sd-s-ok  { color: #34d399; }
.sd-s-err { color: #ffcb6b; }
.sd-redacted { color: #d97706; opacity: 0.8; }
[data-theme="dark"] .sd-redacted { color: #fbbf24; }

/* Overlay */
.sd-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem;
  opacity: 0; pointer-events: none; transition: opacity 0.4s ease; z-index: 5;
}
.sd-overlay.active { opacity: 1; pointer-events: auto; }
.sd-overlay-icon {
  width: 36px; height: 36px; border: 2.5px solid #dc2626; border-radius: 50%;
  position: relative; opacity: 0.85; margin-bottom: 0.25rem;
}
.sd-overlay-icon::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 65%; height: 2.5px; background: #dc2626;
  transform: translate(-50%, -50%) rotate(-45deg);
}
[data-theme="dark"] .sd-overlay-icon { border-color: #f87171; }
[data-theme="dark"] .sd-overlay-icon::after { background: #f87171; }
.sd-overlay-title { font-weight: 600; font-size: 0.85rem; color: #fff; }
.sd-overlay-msg { font-size: 0.75rem; color: rgba(255,255,255,0.65); }

/* Event log */
.sd-log {
  border: 1px solid var(--color-border); border-top: none;
  border-radius: 0 0 12px 12px; overflow: hidden; background: #0c0c0c;
}
.sd-log-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.35rem 1rem;
  background: #181825; border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #6c7086;
}
.sd-log-status { display: flex; align-items: center; gap: 0.35rem; color: #059669; font-weight: 500; }
[data-theme="dark"] .sd-log-status { color: #34d399; }
.sd-log-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: sdPulse 2s ease-in-out infinite; }
.sd-log-entries {
  padding: 0.6rem 1rem; height: 140px; overflow-y: auto;
  font-family: var(--font-mono); font-size: 0.66rem; line-height: 1.85; color: #888;
}
.sd-log-entry { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: sdEntryIn 0.25s ease; }
@keyframes sdEntryIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
.sd-log-entry .lp { color: #555; }
.sd-log-entry .lk { color: #82aaff; }
.sd-log-entry .ls { color: #c3e88d; }
.sd-log-entry .ln { color: #f78c6c; }
.sd-log-entry .lr { color: #fbbf24; }
.sd-log-entry.sd-suspend { color: #f87171; }
.sd-log-entry.sd-restore { color: #38bdf8; }

/* Start overlay */
.sd-wrapper { position: relative; }
.sd-start-overlay {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-radius: 0 0 12px 12px; transition: opacity 0.5s ease;
}
.sd-start-overlay.hidden { opacity: 0; pointer-events: none; }
.sd-start-btn {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.75rem 1.6rem;
  background: var(--color-primary); color: #fff; border: none; border-radius: 8px;
  font-family: var(--font-sans); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: all 200ms;
  box-shadow: 0 2px 12px rgba(2,131,146,0.3);
}
.sd-start-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(2,131,146,0.4); }
.sd-start-btn svg { width: 18px; height: 18px; }

/* Responsive */
@media (max-width: 768px) {
  .sd-code-panels { grid-template-columns: 1fr; }
  .sd-flow { grid-template-columns: 1fr; min-height: auto; }
  .sd-connector { height: 28px; padding-top: 0; }
  .sd-track { top: 50%; }
  .sd-arrow { transform: rotate(90deg); }
}

@media (max-width: 640px) {
  .hero { padding: 2.5rem 0 1.5rem; }
  .hero .subtitle { font-size: 1rem; }
  .section { padding: 2.5rem 0; }
  .features { grid-template-columns: 1fr; }
  .nav-links { gap: 0.75rem; }
  .nav-links a { font-size: 0.8rem; }
}
