
/* =========================================================
   1. Design tokens and base styles
   ========================================================= */

:root {
  color-scheme: light;

  --color-text: #20242a;
  --color-muted: #58616c;
  --color-link: #0086b3;
  --color-link-hover: #005f80;
  --color-border: #dce2e7;
  --color-notice-bg: #fff8e7;
  --color-notice-border: #d9a441;

  --content-width: 960px;
  --page-gutter: 1rem;

  font-family: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--color-text);
  background: #fff;
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  color: #171b20;
  line-height: 1.25;
  text-wrap: balance;
}

h1 {
  margin: 0 0 2rem;
  font-size: clamp(1.8rem, 4vw, 2.35rem);
  letter-spacing: -0.025em;
}

h2 {
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--color-border);
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.12rem;
}

p,
ul {
  margin: 0 0 1rem;
}

ul {
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.65rem;
}

strong {
  font-weight: 700;
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  overflow-wrap: anywhere;
}

a:hover {
  color: var(--color-link-hover);
}

a:focus-visible {
  outline: 3px solid #f0b429;
  outline-offset: 3px;
  border-radius: 2px;
}


/* =========================================================
   2. Shared page container, masthead and footer
   ========================================================= */

.site-header,
.site-footer,
.page-content,
#magic-performance {
  width: min(
    calc(100% - 2 * var(--page-gutter)),
    var(--content-width)
  );
  margin-inline: auto;
}

.site-header {
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background: #fff;
}

.masthead-link {
  display: block;
  width: 100%;
}

.masthead {
  display: block;
  width: 100%;
  height: auto;
}

.page-content,
#magic-performance {
  padding-block: 2rem 3rem;
}

.site-footer {
  padding: 1.25rem 0;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  text-align: center;
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}


/* =========================================================
   3. Navigation
   ========================================================= */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  background: #333;
  margin-bottom: 1.5rem;
}

.site-nav a {
  display: block;
  padding: 0.9rem 1.2rem;
  color: #fff;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: #fff;
  background: #555;
}

.site-nav a[aria-current="page"] {
  background: #006699;
  font-weight: 700;
}


/* =========================================================
   4. General content components
   ========================================================= */

.notice {
  margin: 1.5rem 0 1rem;
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--color-notice-border);
  background: var(--color-notice-bg);
}

.download-callout {
  margin: 1.25rem 0;
}

.download-link {
  display: inline-block;
  padding: 0.7rem 1rem;
  border: 1px solid var(--color-link);
  border-radius: 0.35rem;
  font-weight: 650;
  text-decoration: none;
}

.download-link:hover {
  color: #fff;
  background: var(--color-link-hover);
  border-color: var(--color-link-hover);
}

.eu-flag {
  display: block;
  width: min(250px, 100%);
  margin: 1.5rem auto;
}

.funding-note {
  color: var(--color-muted);
}


/* =========================================================
   5. Performance page
   ========================================================= */

#magic-performance section {
  margin-block: 2rem;
}

#magic-performance .two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  align-items: start;
}

#magic-performance .column {
  min-width: 0;
}

#magic-performance figure {
  min-width: 0;
  margin: 0 0 1rem;
}

#magic-performance figure img {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
  margin-inline: auto;
}

#magic-performance figcaption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
}


/* =========================================================
   6. Responsive layout and accessibility
   ========================================================= */

@media (max-width: 700px) {
  #magic-performance .two-column {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 600px) {
  .site-header {
    padding-block: 1rem;
  }

  .page-content,
  #magic-performance {
    padding-block: 1.5rem 2rem;
  }

  h2 {
    margin-top: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
