/* Core: fonts, design tokens, reset, typography, shared atoms, reveal animation. */

@font-face {
  font-family: "Commissioner";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/commissioner-latin.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/dm-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/dm-sans-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/dm-sans-latin-600-normal.woff2") format("woff2");
}

:root {
  /* Palette */
  --blue: #4b8ca8;
  --blue-deep: #3b7893;
  --navy: #10303e;
  --navy-soft: #3d5a67;
  --mist: #dcebf2;
  --mist-line: #c4dde8;
  --paper: #f4f9fb;
  --white: #fff;
  --accent: #ea375c;
  --accent-deep: #c9244a;
  --accent-wash: #fde5eb;
  --gold: #ffc94d;
  --on-dark: #eef6fa;
  --on-dark-soft: #b9d3df;
  --danger: #b4233f;
  --success: #1f7a52;

  /* Type */
  --ff-head: "Commissioner", "Segoe UI", system-ui, sans-serif;
  --ff-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-hero: clamp(2.375rem, 1.5rem + 3.8vw, 4.25rem);
  --fs-h1: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  --fs-h2: clamp(1.625rem, 1.3rem + 1.3vw, 2.375rem);
  --fs-h3: clamp(1.1875rem, 1.1rem + 0.35vw, 1.375rem);
  --fs-lead: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
  --fs-body: 1.0625rem;
  --fs-read: clamp(1.0625rem, 1rem + 0.2vw, 1.15rem);
  --fs-small: 0.9375rem;
  --fs-tiny: 0.8125rem;

  /* Space */
  --band: clamp(3rem, 2rem + 4vw, 6rem);

  /* Layout */
  --wrap: 72rem;
  --gutter: clamp(1rem, 0.4rem + 2.4vw, 2.25rem);
  --navbar-h: 4.25rem;

  /* Shape and motion */
  --radius-s: 10px;
  --radius: 18px;
  --radius-l: 30px;
  --shadow: 0 22px 44px -26px rgba(16, 48, 62, 0.55);
  --shadow-s: 0 10px 24px -16px rgba(16, 48, 62, 0.5);
  --ease: 0.25s cubic-bezier(0.3, 0.7, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  min-height: 100vh;
  margin: 0;
  background-color: var(--blue);
  background-image: linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--navy);
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--ff-head);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
  /* Long Finnish compounds must not overflow narrow screens. */
  overflow-wrap: break-word;
  hyphens: auto;
}

p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- Atoms ---------- */

.skip {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip:focus {
  transform: none;
}

.tag {
  display: inline-block;
  margin-bottom: 0.875rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent-deep);
  font-family: var(--ff-head);
  font-size: var(--fs-tiny);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tag--light {
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
}

.tag--gold {
  background: var(--gold);
  color: var(--navy);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: var(--ff-head);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--ease),
    color var(--ease),
    border-color var(--ease),
    transform var(--ease);
}

.btn:active {
  transform: scale(0.97);
}

.btn--accent {
  background: var(--accent);
  box-shadow: 0 10px 22px -12px rgba(201, 36, 74, 0.9);
  color: var(--white);
}

.btn--accent:hover {
  background: var(--accent-deep);
}

.btn--ghost {
  border-color: rgba(255, 255, 255, 0.7);
  color: var(--white);
}

.btn--ghost:hover {
  background: var(--white);
  color: var(--navy);
}

.btn .arrow {
  transition: transform var(--ease);
}

.btn:hover .arrow {
  transform: translateX(3px);
}

.more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-deep);
  font-family: var(--ff-head);
  font-weight: 700;
  text-decoration: none;
}

.more-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.callout {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  border-left: 5px solid var(--accent);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  background: var(--accent-wash);
  font-size: var(--fs-small);
}

.sheet {
  padding: clamp(1.25rem, 0.75rem + 2.4vw, 2.5rem);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-s);
}

/* Publisher details image (footer, documents). Shown at its natural size, never upscaled. */
.publisher {
  width: 100%;
  max-width: 305px;
}

/* White-background card inside a document. */
.prose .publisher--card {
  max-width: calc(303px + 2rem + 6px);
  margin-block: 1.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--mist-line);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius-s);
}

/* ---------- Long-form text ---------- */

.prose {
  font-size: var(--fs-read);
  line-height: 1.75;
}

.prose > * + * {
  margin-top: 1rem;
}

.prose h2 {
  margin-top: 2.25rem;
  font-size: var(--fs-h3);
}

.prose h3 {
  margin-top: 1.5rem;
  font-size: 1.0625rem;
}

.prose ul,
.prose ol {
  display: grid;
  gap: 0.4rem;
  padding-left: 1.4rem;
}

.prose li::marker {
  color: var(--accent);
  font-weight: 700;
}

.prose a {
  color: var(--accent-deep);
  text-underline-offset: 3px;
}

/* ---------- Scroll reveal (assets/js/reveal.js) ---------- */

.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js-reveal [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js-reveal [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* Cookiebot dialog on small screens: inset bottom sheet. */
@media (max-width: 600px) {
  div#CybotCookiebotDialog {
    position: fixed !important;
    top: auto !important;
    right: 8px !important;
    bottom: 8px !important;
    left: 8px !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: 75dvh !important;
    margin: 0 !important;
    transform: none !important;
    scale: 1 !important;
    border-radius: 16px !important;
    overflow-y: auto !important;
  }
}
