/* Fonts are self-hosted (no requests to third parties) and subset to the
   characters Slovak needs. Recursive and Literata are under the SIL OFL,
   see fonts/OFL-*.txt. */

@font-face {
  font-family: "Recursive Casual";
  src: url("fonts/recursive-casual-latin.woff2") format("woff2");
  font-weight: 500 1000;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+2013-2014, U+2018-201E, U+2022, U+2026, U+2191, U+2193;
}
@font-face {
  font-family: "Recursive Casual";
  src: url("fonts/recursive-casual-latin-ext.woff2") format("woff2");
  font-weight: 500 1000;
  font-display: swap;
  unicode-range: U+0100-017F;
}
@font-face {
  font-family: "Recursive Mono";
  src: url("fonts/recursive-mono-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+2013-2014, U+2018-201E, U+2022, U+2026, U+2191, U+2193;
}
@font-face {
  font-family: "Recursive Mono";
  src: url("fonts/recursive-mono-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0100-017F;
}
@font-face {
  font-family: "Literata";
  src: url("fonts/literata-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+2013-2014, U+2018-201E, U+2022, U+2026, U+2191, U+2193;
}
@font-face {
  font-family: "Literata";
  src: url("fonts/literata-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0100-017F;
}

/* Tokens: cool form paper, ballpoint ink, highlighter. */
:root {
  --paper: #f2f4f7;
  --paper-raised: #fbfcfd;
  --ink: #17233f;
  --ink-soft: #4e5b73;
  --pen: #2343c4;
  --rule: #cbd3df;
  --hi: #ffe347;
  --hi-todo: #ff9cc6;

  --f-display: "Recursive Casual", ui-rounded, "Avenir Next", system-ui, sans-serif;
  --f-body: "Literata", Georgia, "Times New Roman", serif;
  --f-mono: "Recursive Mono", ui-monospace, Menlo, Consolas, monospace;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1626;
    --paper-raised: #162036;
    --ink: #e6eaf2;
    --ink-soft: #a3aec2;
    --pen: #9bb1ff;
    --rule: #2c3852;
    --hi: rgb(255 227 71 / 0.36);
    --hi-todo: rgb(255 156 198 / 0.4);
  }
}

/* Base */
*,
*::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 {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--f-body);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
}

dl,
dd {
  margin: 0;
}

p,
li,
dd {
  text-wrap: pretty;
}

a {
  color: var(--pen);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--pen);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 10;
  padding: 0.5rem 0.9rem;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font: 600 0.875rem/1.4 var(--f-mono);
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

/* Highlighter — the one loud thing on the page. Marks the facts a participant
   acts on: deadlines, what is optional, where to write. */
mark {
  margin: 0 -0.14em;
  padding: 0 0.14em;
  color: inherit;
  background-color: transparent;
  background-image: linear-gradient(
    100deg,
    transparent 0.08em,
    var(--hi) 0.22em,
    var(--hi) calc(100% - 0.2em),
    transparent calc(100% - 0.06em)
  );
  background-repeat: no-repeat;
  background-position: 0 75%;
  background-size: 100% 72%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Unresolved placeholder in the source document. */
mark.todo {
  --hi: var(--hi-todo);
  font-family: var(--f-mono);
  font-size: 0.875em;
}

@media (prefers-reduced-motion: no-preference) {
  .js mark:not(.todo) {
    background-size: 0% 72%;
    transition: background-size 0.8s cubic-bezier(0.3, 0.75, 0.25, 1);
  }

  .js mark.is-on {
    background-size: 100% 72%;
  }

  .js .hero h1 mark {
    transition-duration: 1.1s;
    transition-delay: 0.3s;
  }
}

/* Page frame */
.page {
  max-width: 74rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3.5rem);
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding-block: 1.5rem;
}

.wordmark {
  color: var(--ink);
  font-family: var(--f-display);
  font-weight: 900;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.masthead .wordmark {
  font-size: 1.3125rem;
  line-height: 1;
}

.masthead-link {
  font: 500 0.8125rem/1.4 var(--f-mono);
}

/* Hero */
.hero {
  padding-block: clamp(3rem, 10vw, 7.5rem) clamp(3rem, 7vw, 5.5rem);
}

.eyebrow {
  margin-bottom: 1.25rem;
  color: var(--ink-soft);
  font: 500 0.8125rem/1.4 var(--f-mono);
  letter-spacing: 0.02em;
}

.hero h1 {
  max-width: 10em;
  font-size: clamp(2.625rem, 1.25rem + 7vw, 7.25rem);
  font-weight: 950;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.hero h1 mark {
  background-position: 0 72%;
  background-size: 100% 50%;
}

@media (prefers-reduced-motion: no-preference) {
  .js .hero h1 mark {
    background-size: 0% 50%;
  }

  .js .hero h1 mark.is-on {
    background-size: 100% 50%;
  }
}

.hero-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1.25rem 2.5rem;
  max-width: 50rem;
  margin: clamp(2.5rem, 6vw, 4rem) 0 2.5rem;
}

.lede {
  max-width: 40rem;
  font-size: 1.1875rem;
  line-height: 1.6;
}

.lede p:last-child {
  margin-bottom: 0;
}

/* Form fields: label above, value written on the line. */
.fields > div {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.fields dt {
  color: var(--ink-soft);
  font: 500 0.75rem/1.3 var(--f-mono);
  letter-spacing: 0.03em;
}

.fields dd {
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* Two-column reading layout */
.layout {
  display: grid;
  grid-template-columns: minmax(13rem, 16rem) minmax(0, 42rem);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
  padding-bottom: clamp(4rem, 9vw, 7rem);
}

.toc {
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  padding-bottom: 1rem;
}

.toc-title {
  margin-bottom: 0.9rem;
  color: var(--ink-soft);
  font: 500 0.75rem/1.3 var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc ol {
  display: grid;
  gap: 0.05rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: grid;
  grid-template-columns: 1.85rem 1fr;
  align-items: baseline;
  padding: 0.3rem 0;
  color: var(--ink);
  font: 550 0.9rem/1.35 var(--f-display);
  text-decoration: none;
}

.toc a:hover .toc-label {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.toc-n {
  color: var(--pen);
  font: 500 0.75rem/1 var(--f-mono);
  font-variant-numeric: tabular-nums;
}

.toc-label {
  justify-self: start;
  margin: 0 -0.14em;
  padding: 0 0.14em;
  background: linear-gradient(var(--hi), var(--hi)) no-repeat 0 80% / 0% 70%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.toc a[aria-current] .toc-label {
  background-size: 100% 70%;
}

@media (prefers-reduced-motion: no-preference) {
  .toc-label {
    transition: background-size 0.35s ease-out;
  }
}

.toc-appendix {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule);
}

@media (max-width: 56rem) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    position: static;
    max-height: none;
    padding: 1.25rem 1.25rem 1rem;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: var(--paper-raised);
  }
}

/* Policy sections */
main section {
  scroll-margin-top: 1.5rem;
}

main section + section {
  margin-top: clamp(3.5rem, 8vw, 6rem);
}

.part {
  margin-bottom: 0.7rem;
  color: var(--pen);
  font: 500 0.8125rem/1 var(--f-mono);
  letter-spacing: 0.03em;
}

main h2 {
  margin-bottom: 1.5rem;
  font-size: clamp(1.625rem, 1.1rem + 1.6vw, 2.375rem);
}

main h3 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.005em;
}

main ul {
  margin: 0 0 1.25em;
  padding-left: 1.4em;
  list-style-type: "–\2002";
}

main li {
  margin-bottom: 0.3em;
}

main li::marker {
  color: var(--pen);
}

/* Section 1: the two organisations */
.parties {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.party {
  padding: 1.25rem 1.25rem 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper-raised);
}

.party h3 {
  margin: 0 0 1.1rem;
  font-size: 1.3125rem;
  font-weight: 800;
}

.party-role {
  margin-bottom: 0.4rem;
  color: var(--ink-soft);
  font: 500 0.75rem/1.4 var(--f-mono);
}

.party .fields {
  display: grid;
  gap: 0.9rem;
}

/* Section 4: legal bases */
.bases {
  display: grid;
  gap: 1.5rem;
  margin: 1.5rem 0 1.75rem;
}

.bases dt {
  margin-bottom: 0.25rem;
}

.ref {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--pen);
  font: 500 0.8125rem/1.3 var(--f-mono);
}

.bases strong {
  font: 750 1.125rem/1.3 var(--f-display);
}

/* Section 11 */
.postal {
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
}

/* Registration form texts */
.appendix .form-panel {
  padding: clamp(1.25rem, 3.5vw, 2rem);
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper-raised);
}

.form-panel h3:first-child {
  margin-top: 0;
}

.form-panel p:last-child {
  margin-bottom: 0;
}

.note {
  margin-top: 1.25rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* Footer */
.colophon {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 2rem;
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font: 500 0.8125rem/1.6 var(--f-mono);
}

.colophon p {
  margin: 0;
}

.colophon .wordmark {
  font-size: 0.9375rem;
}

/* Small screens */
@media (max-width: 40rem) {
  body {
    font-size: 1rem;
  }

  .lede {
    font-size: 1.0625rem;
  }

  main {
    -webkit-hyphens: auto;
    hyphens: auto;
    hyphenate-limit-chars: 8 4 4;
  }
}

/* Print / save as PDF */
@media print {
  :root {
    --paper: #fff;
    --paper-raised: #fff;
    --ink: #000;
    --ink-soft: #333;
    --pen: #000;
    --rule: #999;
    --hi: #ffe347;
    --hi-todo: #ff9cc6;
  }

  .skip,
  .masthead,
  .toc,
  .colophon p:last-child {
    display: none;
  }

  .layout {
    display: block;
  }

  .hero {
    padding-block: 0 2rem;
  }

  .hero h1 {
    font-size: 2.75rem;
  }

  mark {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .js mark:not(.todo) {
    background-size: 100% 72% !important;
  }

  .js .hero h1 mark {
    background-size: 100% 50% !important;
  }

  main a {
    color: inherit;
  }

  h2,
  h3 {
    break-after: avoid;
  }

  .party,
  .form-panel {
    break-inside: avoid;
  }
}
