/* FIATECH landing page. Direction and reasons: see DESIGN.md. */

/* ---------- Fonts: IBM Plex (SIL Open Font License 1.1), served from this site, so no visitor
   data goes to a font CDN. Latin and Cyrillic subsets as published by Google Fonts. ---------- */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-400-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-500-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ---------- Tokens ---------- */
:root {
  --paper: #f4f2ec;
  --surface: #fbfaf6;
  --ink: #12161b;
  --graphite: #4f5761;
  --rule: #d3cec2;
  --rule-strong: #a39d90;
  --control: #857f72;
  --accent: #17694a;
  --accent-hover: #0f5139;
  --on-accent: #ffffff;
  --band: #12161b;
  --band-ink: #f1eee6;
  --band-muted: #b9bfc6;
  --band-rule: #2e353d;
  --band-accent: #4fc28f;
  --error: #9a3412;
  --focus: #17694a;

  /* The hero sits on video in both themes, so it has its own fixed dark palette. */
  --hero-shade: 9 12 15;
  --hero-ink: #f3f1ea;
  --hero-muted: #d3d7dc;

  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 64px;
  --ruler-h: 7px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1317;
    --surface: #151a1f;
    --ink: #ece9e1;
    --graphite: #a6aeb7;
    --rule: #2a3138;
    --rule-strong: #4c5560;
    --control: #66707c;
    --accent: #4fc28f;
    --accent-hover: #74d5a9;
    --on-accent: #0b1a12;
    --band: #182027;
    --band-ink: #ece9e1;
    --band-muted: #aab2bb;
    --band-rule: #2f3943;
    --error: #f4a37f;
    --focus: #4fc28f;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #0f1317;
  --surface: #151a1f;
  --ink: #ece9e1;
  --graphite: #a6aeb7;
  --rule: #2a3138;
  --rule-strong: #4c5560;
  --control: #66707c;
  --accent: #4fc28f;
  --accent-hover: #74d5a9;
  --on-accent: #0b1a12;
  --band: #182027;
  --band-ink: #ece9e1;
  --band-muted: #aab2bb;
  --band-rule: #2f3943;
  --error: #f4a37f;
  --focus: #4fc28f;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  /* Sections carry their own top padding, so anchors land right under the ruler. */
  scroll-padding-top: calc(var(--header-h) + var(--ruler-h));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

a { color: inherit; }

a[href], button, summary, label[for], select { cursor: pointer; }
button:disabled { cursor: not-allowed; }

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

::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

[hidden] { display: none !important; }

.wrap {
  width: min(100% - 2 * var(--gutter), 1200px);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 8px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus-visible { transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
}

.header-row {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 8px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink);
}

.site-nav { margin-left: auto; }

.nav-links {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-weight: 500;
  text-decoration: none;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
  border-radius: 2px;
}
.nav-links a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.nav-links a:active { color: var(--accent); }

.menu-button { display: none; }

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.lang-switch {
  display: flex;
  border: 1px solid var(--control);
  border-radius: 2px;
}

.lang-switch button {
  min-width: 44px;
  min-height: 42px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 500 0.875rem/1 var(--mono);
}
.lang-switch button + button { border-left: 1px solid var(--control); }
.lang-switch button:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.lang-switch button:active { transform: translateY(1px); }

.theme-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--control);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
}
.theme-button:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.theme-button:active { transform: translateY(1px); }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

html:not(.js) .header-tools { display: none; }

/* Ruler: header baseline with ticks; the fill shows reading progress. */
.ruler {
  position: relative;
  height: var(--ruler-h);
  border-top: 1px solid var(--rule-strong);
  background-image:
    repeating-linear-gradient(to right, var(--rule-strong) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(to right, var(--rule-strong) 0 1px, transparent 1px 40px);
  background-size: 100% 3px, 100% 6px;
  background-repeat: no-repeat;
}

.ruler-fill {
  position: absolute;
  left: 0;
  top: -1px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(var(--progress, 0));
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 2px;
  font: 600 1rem/1.2 var(--sans);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.button:active { transform: translateY(1px); }
.button:disabled { opacity: 0.55; }

.button-primary { background: var(--accent); color: var(--on-accent); }
.button-primary:hover { background: var(--accent-hover); }

.button-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--control);
}
.button-quiet:hover { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }

/* Outline button for the dark video hero. */
.button-ghost {
  background: rgb(var(--hero-shade) / 0.3);
  color: var(--hero-ink);
  border-color: rgb(243 241 234 / 0.62);
}
.button-ghost:hover { border-color: var(--hero-ink); background: rgb(243 241 234 / 0.1); }

.button-on-dark { background: var(--band-accent); color: #0b1a12; }
.button-on-dark:hover { background: #74d5a9; }

/* ---------- Hero: full-width video with the headline on a dark shade ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: max(520px, calc(100svh - var(--header-h) - var(--ruler-h)));
  overflow: hidden;
  background: rgb(var(--hero-shade));
  color: var(--hero-ink);
  --focus: var(--band-accent);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 50%;
}

/* Shade: dense behind the text on the left, lighter where the hands and drawings are. */
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgb(var(--hero-shade) / 0.9) 0%, rgb(var(--hero-shade) / 0.76) 44%, rgb(var(--hero-shade) / 0.3) 100%),
    linear-gradient(0deg, rgb(var(--hero-shade) / 0.5) 0%, rgb(var(--hero-shade) / 0) 42%);
}

.hero-inner {
  align-self: end;
  padding-block: clamp(32px, 8svh, 120px) clamp(44px, 9svh, 96px);
}

.hero-title {
  margin: 0 0 clamp(16px, 3svh, 28px);
  max-width: 18ch;
  font-weight: 600;
  font-size: clamp(2rem, min(5.2vw, 7.6svh), 4.75rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}
/* Bulgarian words are longer: a wider measure keeps the headline to three or four lines. */
.hero-title:lang(bg) { max-width: 21ch; }

.hero-lede {
  margin: 0 0 clamp(20px, 4svh, 36px);
  max-width: 54ch;
  color: var(--hero-muted);
  font-size: clamp(1.0625rem, 0.98rem + 0.45vw, 1.25rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Sections ---------- */
.services {
  padding-block: clamp(56px, 10vw, 120px) clamp(56px, 9vw, 104px);
}

.section-head {
  display: grid;
  gap: 12px;
  margin-bottom: clamp(28px, 5vw, 56px);
}

h2 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(1.875rem, 1.35rem + 2.1vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.section-head p {
  margin: 0;
  max-width: 52ch;
  color: var(--graphite);
  font-size: 1.0625rem;
}

.group-label {
  margin: 0 0 6px;
  color: var(--graphite);
  font: 500 0.8125rem/1.5 var(--mono);
}

.index-no {
  color: var(--accent);
  font: 500 0.875rem/1.5 var(--mono);
}

/* Core practice: three large rows. */
.core-list {
  margin: 0 0 clamp(44px, 6vw, 80px);
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--ink);
}

.core-row {
  position: relative;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 8px 12px;
  padding-block: clamp(20px, 3vw, 34px);
}

.core-row::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: var(--ink);
  transform-origin: left;
}

.core-row .index-no { padding-top: 0.45em; }

.core-row h3 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.core-row p {
  grid-column: 2;
  margin: 0;
  max-width: 60ch;
  color: var(--graphite);
}

/* Supporting services: a denser grid, no cards. */
.support-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: clamp(24px, 3vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.support-item {
  position: relative;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  align-content: start;
  gap: 4px 10px;
  padding-block: 20px 22px;
}

.support-item::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: var(--rule-strong);
  transform-origin: left;
}

.support-item .index-no { font-size: 0.8125rem; padding-top: 0.2em; }

.support-item h3 {
  margin: 0;
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.35;
}

.support-item p {
  grid-column: 2;
  margin: 0;
  color: var(--graphite);
  font-size: 0.975rem;
}

.inline-link {
  grid-column: 2;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: -10px;
  color: var(--accent);
  font-weight: 500;
  text-underline-offset: 4px;
}
.inline-link:hover { color: var(--accent-hover); }

/* EU band: the one dark, asymmetric break in the page rhythm. */
.eu-band {
  background: var(--band);
  color: var(--band-ink);
  padding-block: clamp(56px, 9vw, 112px);
  --focus: var(--band-accent);
}

.eu-grid {
  display: grid;
  gap: 20px 48px;
}

.eu-band h2 { max-width: 15ch; }

.eu-body > p {
  margin: 0 0 20px;
  max-width: 56ch;
  color: var(--band-muted);
  font-size: 1.125rem;
}

.eu-list {
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--band-rule);
  counter-reset: eu;
}

/* Sub-items lettered a to d, like sub-clauses on a spec sheet. */
.eu-list li {
  position: relative;
  padding: 14px 0 14px 32px;
  border-bottom: 1px solid var(--band-rule);
  counter-increment: eu;
}

.eu-list li::before {
  content: counter(eu, lower-alpha);
  position: absolute;
  left: 0;
  top: 14px;
  color: var(--band-accent);
  font: 500 0.875rem/1.7 var(--mono);
}

/* ---------- Contact: one centred column with the request form ---------- */
.contact {
  padding-block: clamp(64px, 10vw, 128px);
}

.contact-wrap {
  width: min(100% - 2 * var(--gutter), 46rem);
  margin-inline: auto;
}

.contact-head {
  margin-bottom: clamp(28px, 4vw, 40px);
  text-align: center;
}

.contact h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 1.3rem + 2.8vw, 3.5rem);
}

.contact-text {
  margin: 0 auto;
  max-width: 46ch;
  color: var(--graphite);
}

.form-panel {
  border-top: 1.5px solid var(--ink);
  padding-top: 20px;
}

/* Spacing by margins rather than grid gap, so the hidden spam check adds no empty row. */
form.contact-form > * + * { margin-top: 20px; }

.form-hint,
.form-noscript {
  margin: 0;
  color: var(--graphite);
  font: 400 0.8125rem/1.5 var(--mono);
}

.field-pair {
  display: grid;
  gap: 20px;
}

.field {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.field label {
  font-weight: 500;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.optional {
  margin-left: 4px;
  color: var(--graphite);
  font: 400 0.8125rem/1 var(--mono);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--control);
  border-radius: 2px;
  background: var(--surface);
  color: var(--ink);
  font: 400 1rem/1.4 var(--sans);
  transition: border-color 0.15s ease;
}

.field textarea {
  min-height: 9.5rem;
  resize: vertical;
  line-height: 1.5;
}

.field select {
  appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--ink); }

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline-offset: 0;
  border-color: var(--focus);
}

.field [aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: inset 0 0 0 1px var(--error);
}

.field-hint,
.field-error {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
}
.field-hint { color: var(--graphite); }
.field-error { color: var(--error); font-weight: 500; }

/* Spam trap: kept out of sight and out of the tab order. */
.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* The spam check is invisible unless it needs a click; until then it takes no room in the form. */
.contact-form > .captcha { margin-top: 0; }
.contact-form > .captcha.is-visible { margin-top: 20px; }

.form-privacy {
  margin: 0;
  max-width: 62ch;
  color: var(--graphite);
  font-size: 0.875rem;
  line-height: 1.5;
}
.form-privacy a {
  color: var(--ink);
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}
.form-privacy a:hover { color: var(--accent); }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

/* The mail-app route, kept to one line beside the button. */
.form-alt {
  margin: 0;
  color: var(--graphite);
  font-size: 0.9375rem;
}
.form-alt a {
  color: var(--ink);
  font-weight: 500;
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}
.form-alt a:hover { color: var(--accent); }

.submit-button { min-width: 12rem; }
.submit-button[aria-busy="true"] { opacity: 0.75; cursor: progress; }

.contact-form > .form-status {
  margin-top: 12px;
  margin-bottom: 0;
  font-size: 0.9375rem;
}
.contact-form > .form-status:empty { display: none; }
.form-status.is-error { color: var(--error); font-weight: 500; }
.form-status a { color: inherit; text-underline-offset: 3px; }

.form-success {
  padding: 24px 0 8px;
}
.form-success:focus { outline: none; }
.form-success-title {
  margin: 0 0 8px;
  font-weight: 600;
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.875rem);
  line-height: 1.2;
}
.form-success-title::before {
  content: "\2713";
  display: inline-block;
  margin-right: 10px;
  color: var(--accent);
}
.form-success-text {
  margin: 0 0 24px;
  max-width: 52ch;
  color: var(--graphite);
}

html:not(.js) .contact-form { display: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 16px;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
}

.footer-legal {
  margin: 0;
  padding-block: 10px;
  color: var(--graphite);
  font-size: 0.9375rem;
}
.footer-legal a { text-underline-offset: 3px; }
.footer-legal a:hover { color: var(--accent); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
  text-underline-offset: 4px;
}
.footer-links a:hover { color: var(--accent); }

/* ---------- Privacy notice ---------- */
.legal {
  width: min(100% - 2 * var(--gutter), 46rem);
  margin-inline: auto;
  padding-block: clamp(40px, 7vw, 88px) clamp(56px, 9vw, 112px);
}

/* With JavaScript, only the article in the chosen language shows (main.js adds .is-current). */
html.js [data-lang-block]:not(.is-current) { display: none; }
html:not(.js) .legal-text + .legal-text {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--rule-strong);
}

.legal-text h1 {
  margin: 0 0 8px;
  font-weight: 600;
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.legal-text .legal-updated {
  margin: 0 0 28px;
  color: var(--graphite);
  font: 400 0.8125rem/1.5 var(--mono);
}

.legal-text h2 {
  margin: 36px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.legal-text p,
.legal-text li { max-width: 68ch; }
.legal-text p { margin: 0 0 14px; }
.legal-text ul { margin: 0 0 14px; padding-left: 1.25rem; }
.legal-text li + li { margin-top: 6px; }
.legal-text a {
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.legal-text a:hover { color: var(--accent); }

/* ---------- Width states ---------- */

/* Phones: menu instead of the link row, tighter header, shade over the whole video. */
@media (max-width: 759px) {
  .header-row { gap: 6px; }
  .wordmark { font-size: 1.0625rem; letter-spacing: 0.04em; }
  .header-tools { margin-left: 0; gap: 6px; }

  html.js .menu-button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--control);
    border-radius: 2px;
    background: transparent;
    color: var(--ink);
    font: 500 0.9375rem/1 var(--sans);
  }
  html.js .menu-button:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
  html.js .menu-button[aria-expanded="true"] { background: var(--ink); color: var(--paper); }

  html.js .nav-links {
    display: none;
    position: absolute;
    top: calc(var(--header-h) + var(--ruler-h));
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 4px var(--gutter) 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--rule-strong);
    /* The panel sits above the page, so it carries the only shadow on the site. */
    box-shadow: 0 16px 24px -16px rgb(0 0 0 / 0.35);
  }
  html.js .nav-links.is-open { display: flex; }
  html.js .nav-links a {
    display: flex;
    min-height: 52px;
    padding: 0;
    border-bottom: 1px solid var(--rule);
    font-size: 1.0625rem;
  }
  html.js .nav-links li:last-child a { border-bottom: 0; }

  html:not(.js) .header-row { height: auto; flex-wrap: wrap; padding-block: 8px; }

  .button { flex: 1 1 auto; }

  .hero { min-height: clamp(500px, calc(100svh - var(--header-h) - var(--ruler-h)), 760px); }
  .hero-media::after {
    background: linear-gradient(180deg, rgb(var(--hero-shade) / 0.5) 0%, rgb(var(--hero-shade) / 0.8) 45%, rgb(var(--hero-shade) / 0.9) 100%);
  }
  /* Type is sized so both buttons stay on the first screen. */
  .hero-inner { padding-block: 40px 44px; }
  .hero-title { margin-bottom: 14px; font-size: clamp(1.75rem, 7.6vw, 2.25rem); }
  .hero-lede { margin-bottom: 20px; font-size: 1rem; line-height: 1.45; }
}

/* Very narrow phones (under 360px): smaller gutter and header so the tools fit. */
@media (max-width: 359px) {
  :root { --gutter: 12px; }
  .wordmark { font-size: 0.95rem; letter-spacing: 0.02em; }
  .header-row,
  .header-tools { gap: 4px; }
  html.js .menu-button { padding: 0 9px; }
  .hero-inner { padding-top: 32px; }
  .hero-title { font-size: 1.625rem; }
  .hero-lede { font-size: 0.9375rem; margin-bottom: 16px; }
}

/* Phones: number and title share a line, the description takes the full width below,
   and section spacing tightens so the page reads in fewer screens. */
@media (max-width: 639px) {
  .services { padding-block: 44px 40px; }
  .section-head { margin-bottom: 20px; }
  .core-list { margin-bottom: 28px; }
  .core-row { grid-template-columns: 2.25rem minmax(0, 1fr); gap: 6px 8px; padding-block: 16px; }
  .core-row .index-no { padding-top: 0.35em; }
  .core-row h3 { font-size: 1.3125rem; }
  .core-row p,
  .support-item p { grid-column: 1 / -1; }
  .support-item { grid-template-columns: 2.25rem minmax(0, 1fr); gap: 4px 8px; padding-block: 14px 16px; }
  .inline-link { grid-column: 1 / -1; }

  .eu-band { padding-block: 44px; }
  .eu-band h2 { max-width: none; font-size: 1.75rem; }
  .eu-body > p { font-size: 1.0625rem; }
  .eu-list li { padding-block: 11px; }
  .eu-list li::before { top: 11px; }

  .contact { padding-block: 44px 40px; }
  .contact-head { margin-bottom: 24px; }
  .contact h2 { font-size: 1.875rem; }
  form.contact-form > * + * { margin-top: 16px; }
  .field-pair { gap: 16px; }
}

/* Two columns once single-column fields and entries get too wide. */
@media (min-width: 640px) {
  .support-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Wide: split layouts and three-column supporting grid. */
@media (min-width: 900px) {
  .section-head {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: end;
  }
  .core-row {
    grid-template-columns: 4.5rem minmax(0, 5fr) minmax(0, 7fr);
    align-items: baseline;
  }
  .core-row .index-no { padding-top: 0; }
  .core-row p { grid-column: 3; }
  .eu-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
  }
}

@media (min-width: 980px) {
  .support-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- One section per screen on laptops and desktops ----------
   Each section fills the space under the header and its content is sized from the screen height,
   so a section is seen whole and anchors land exactly on it. Phones keep a natural scroll:
   nine services cannot fit one phone screen. */
@media (min-width: 900px) and (min-height: 600px) {
  /* Scrolling always settles on a whole section; the footer is the last stop. */
  html { scroll-snap-type: y mandatory; }
  .site-footer { scroll-snap-align: end; }

  .hero,
  .services,
  .eu-band,
  .contact {
    min-height: calc(100svh - var(--header-h) - var(--ruler-h));
    scroll-snap-align: start;
  }

  .services,
  .eu-band,
  .contact {
    display: grid;
    align-content: center;
    padding-block: clamp(12px, 2.4svh, 64px);
  }

  h2 { font-size: clamp(1.75rem, 4.8svh, 3rem); }

  /* Services */
  .section-head { margin-bottom: clamp(12px, 2.6svh, 40px); }
  .section-head p { font-size: 1rem; }
  .group-label { margin-bottom: 2px; }
  .core-list { margin-bottom: clamp(10px, 2svh, 48px); }
  .core-row { padding-block: clamp(7px, 1.3svh, 24px); grid-template-columns: 3.5rem minmax(0, 4fr) minmax(0, 8fr); }
  .core-row h3 { font-size: clamp(1.25rem, 3.3svh, 2rem); }
  .core-row p { font-size: clamp(0.875rem, 2.3svh, 0.975rem); line-height: 1.5; }
  .support-item { padding-block: clamp(7px, 1.3svh, 20px); gap: 2px 10px; grid-template-columns: 2rem minmax(0, 1fr); }
  .support-item h3 { font-size: clamp(0.95rem, min(2.5svh, 1.55vw), 1.0625rem); }
  .support-item p { font-size: clamp(0.8125rem, min(2.2svh, 1.4vw), 0.9375rem); line-height: 1.45; }
  .inline-link { min-height: 32px; margin-bottom: -6px; }

  /* EU projects */
  .eu-body > p { font-size: 1.0625rem; margin-bottom: clamp(12px, 2svh, 20px); }
  .eu-list { margin-bottom: clamp(16px, 3svh, 32px); }
  .eu-list li { padding-block: clamp(8px, 1.4svh, 14px); }
  .eu-list li::before { top: clamp(8px, 1.4svh, 14px); }

  /* Contact */
  .contact h2 { font-size: clamp(1.75rem, 5svh, 3.5rem); margin-bottom: 8px; }
  .contact-head { margin-bottom: clamp(12px, 2.6svh, 40px); }
  .contact-text { max-width: 62ch; }
  .form-panel { padding-top: clamp(12px, 2.2svh, 20px); }
  form.contact-form > * + * { margin-top: clamp(12px, 2.2svh, 20px); }
  .field-pair { gap: clamp(12px, 2.2svh, 20px); }
  .field input,
  .field select { min-height: 44px; padding-block: 9px; }
  .field textarea { height: clamp(4rem, calc(26svh - 5.75rem), 9.5rem); min-height: 4rem; }
  .form-privacy { max-width: none; }
  .contact-form > .captcha { margin-top: 0; }
  .contact-form > .form-status { margin-top: 10px; }
}

/* ---------- Motion (MOTION 2, see DESIGN.md) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Hero copy rises once on load to introduce the focal point. */
  .rise {
    opacity: 0;
    transform: translateY(14px);
    animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  }
  .hero-copy > .rise:nth-child(2) { animation-delay: 0.12s; }
  .hero-copy > .rise:nth-child(3) { animation-delay: 0.24s; }

  /* Rows and blocks reveal in reading order as they enter (JS adds .motion). */
  .motion .reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: var(--delay, 0s);
  }
  .motion .core-row::before,
  .motion .support-item::before {
    transform: scaleX(0);
    transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: calc(var(--delay, 0s) + 0.1s);
  }
  .motion .reveal.is-in { opacity: 1; transform: none; }
  .motion .reveal.is-in::before { transform: scaleX(1); }

  .ruler-fill { transition: transform 0.1s linear; }
}

@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .lang-switch button, .theme-button, .field input, .field select, .field textarea { transition: none; }
}
