:root {
  --bg: #0c111b;
  --bg-elevated: #121925;
  --bg-soft: #161e2c;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.22);

  --txt: #d7dee8;
  --txt-dim: #9aa8b8;
  --txt-mute: #6f7f91;
  --accent: #00a599;
  --mc-green: #00a599;
  --mc-green-deep: #173e45;

  --radius: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --content-max: 880px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.6;
  color: var(--txt);
  background:
    radial-gradient(90% 55% at 100% 0%, rgba(90, 120, 150, 0.08), transparent 55%),
    radial-gradient(70% 45% at 0% 100%, rgba(70, 100, 120, 0.06), transparent 50%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: #33c4b8;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Header ───────────────────────────────────────────────────────── */

.site-header {
  border-bottom: 1px solid var(--line);
  padding: 1.15rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--txt);
  text-decoration: none;
}

.site-title:hover {
  color: #fff;
}

.back-link {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--txt-dim);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 25, 37, 0.55);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.back-link:hover {
  color: var(--mc-green);
  border-color: rgba(0, 165, 153, 0.4);
  background: rgba(0, 165, 153, 0.08);
}

/* ── Hero ─────────────────────────────────────────────────────────── */

.hero {
  padding: 4.5rem 0 3rem;
}

.hero-eyebrow {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--txt-mute);
}

.hero-brand-inline {
  color: var(--mc-green);
  font-weight: 700;
}

.hero-brand {
  margin: 0 0 1rem;
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #f1f4f8;
}

.hero-lead {
  margin: 0;
  max-width: 34rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--txt-dim);
}

/* ── Resources ────────────────────────────────────────────────────── */

.resources {
  padding-bottom: 3rem;
}

.section-heading,
.page-heading {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #eef2f6;
}

.page-heading {
  margin-top: 2.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.5rem, 3vw, 1.85rem);
}

.lead {
  margin: 0 0 1.5rem;
  color: var(--txt-dim);
}

.resource-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 25, 37, 0.55);
  overflow: hidden;
}

.resource-list li + li {
  border-top: 1px solid var(--line);
}

.resource-list li.group-heading {
  border-top: none;
  padding: 0.85rem 1.15rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt-mute);
  background: transparent;
}

.resource-list li.group-heading + li {
  border-top: 1px solid var(--line);
}

.resource-list li.group-heading:first-child {
  padding-top: 0.65rem;
}

.resource-list a {
  display: block;
  padding: 1rem 1.15rem;
  color: inherit;
  text-decoration: none;
  transition: background 0.2s var(--ease);
}

.resource-list a:hover {
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
}

.resource-list .title {
  display: block;
  font-weight: 600;
  color: #e8eef4;
}

.resource-list a:hover .title {
  color: #fff;
}

.resource-list .summary {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--txt-mute);
}

.resource-list .credit {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--txt-mute);
  opacity: 0.85;
}

/* ── Messages ─────────────────────────────────────────────────────── */

.message {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--txt-dim);
}

.message.error {
  border-color: rgba(180, 100, 110, 0.4);
  background: rgba(80, 30, 40, 0.25);
  color: #d9b0b6;
}

/* ── Markdown ─────────────────────────────────────────────────────── */

.markdown-body {
  margin-bottom: 3rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin-top: 1.6rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  color: #eef2f6;
}

.markdown-body h1:first-child,
.markdown-body h2:first-child,
.markdown-body h3:first-child {
  margin-top: 0;
}

.markdown-body h1 {
  font-size: 1.6rem;
}

.markdown-body h2 {
  font-size: 1.25rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.markdown-body h3 {
  font-size: 1.1rem;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--txt-dim);
}

.markdown-body strong {
  color: var(--txt);
  font-weight: 600;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.4rem;
}

.markdown-body li + li {
  margin-top: 0.3rem;
}

.markdown-body blockquote {
  padding: 0 0 0 0.9rem;
  color: var(--txt-mute);
  border-left: 2px solid var(--line-strong);
}

.markdown-body code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;
  font-size: 0.85em;
  padding: 0.15em 0.35em;
  color: #c5d4df;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.markdown-body pre {
  padding: 1rem 1.05rem;
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.markdown-body pre code {
  padding: 0;
  color: var(--txt);
  background: transparent;
  border: none;
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.markdown-body a {
  color: var(--mc-green);
  text-decoration: underline;
  text-decoration-color: rgba(0, 165, 153, 0.35);
  text-underline-offset: 0.15em;
}

.markdown-body a:hover {
  color: #33c4b8;
  text-decoration-color: rgba(51, 196, 184, 0.55);
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.markdown-body .embed {
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
}

.markdown-body .embed iframe,
.markdown-body .embed object,
.markdown-body .embed video {
  display: block;
  width: 100%;
  border: 0;
}

.markdown-body .embed-video iframe,
.markdown-body .embed-video video {
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 360px;
  background: #000;
}

.markdown-body .embed-pdf iframe,
.markdown-body .embed-pdf object {
  height: 70vh;
  min-height: 480px;
  background: var(--bg);
}

.markdown-body .embed-fallback {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--txt-mute);
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
}

/* ── Footer ───────────────────────────────────────────────────────── */

.site-footer {
  margin-top: auto;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--txt-mute);
}

.funding {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
  max-width: 40rem;
}

.eu-logo {
  display: block;
  width: min(100%, 14rem);
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

.funding-text {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--txt-mute);
}

.footer-meta {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--txt-mute);
}

.site-footer a {
  color: var(--txt-mute);
}

.site-footer a:hover {
  color: var(--txt-dim);
}

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .container {
    padding: 0 1.1rem;
  }

  .hero {
    padding: 3rem 0 2.25rem;
  }

  .markdown-body .embed-video iframe,
  .markdown-body .embed-video video {
    min-height: 220px;
  }

  .markdown-body .embed-pdf iframe,
  .markdown-body .embed-pdf object {
    height: 60vh;
    min-height: 320px;
  }
}
