/* site.css - the one stylesheet; tokens follow DESIGN.md (checked by tokens.test.ts) */

:root {
  color-scheme: light dark;

  --color-background: #F8FAFD;
  --color-ink: #0B1530;
  --color-ink-secondary: #334058;
  --color-accent: #1E4FA3;
  --color-accent-hover: #173F85;
  --color-on-accent: #FFFFFF;
  --color-track: #ECF0F7;
  --color-component-border: #BCC8DA;
  --color-bar-outline: #6B7891;
  --color-focus-ring: #B45309;
  --color-layer-1: #DCE6F8;
  --color-layer-2: #D3DEF4;
  --color-layer-3: #DCDFF6;
  --color-layer-4: #E3E0F4;
  --color-layer-5: #DCE8F2;
  --color-layer-6: #E5EAF1;
  --color-badge-plate: #FFFFFF;

  --font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --font-name-display-size: 32px;
  --font-name-display-weight: 800;
  --font-name-display-line: 1.04;
  --font-name-display-tracking: -0.03em;
  --font-title-role-size: 15px;
  --font-title-role-weight: 700;
  --font-title-role-line: 1.3;
  --font-tagline-size: 15px;
  --font-tagline-weight: 400;
  --font-tagline-line: 1.45;
  --font-technology-line-size: 15px;
  --font-technology-line-weight: 700;
  --font-technology-line-line: 1.35;
  --font-heading-section-size: 24px;
  --font-heading-section-weight: 800;
  --font-heading-section-line: 1.1;
  --font-heading-section-tracking: -0.02em;
  --font-heading-context-size: 20px;
  --font-heading-context-weight: 800;
  --font-heading-context-line: 1.15;
  --font-heading-context-tracking: -0.01em;
  --font-heading-layer-size: 15px;
  --font-heading-layer-weight: 800;
  --font-heading-layer-line: 1.2;
  --font-heading-card-size: 15px;
  --font-heading-card-weight: 800;
  --font-heading-card-line: 1.25;
  --font-heading-legal-page-size: 32px;
  --font-heading-legal-page-weight: 800;
  --font-heading-legal-page-line: 1.08;
  --font-heading-legal-page-tracking: -0.03em;
  --font-heading-legal-sub-size: 16px;
  --font-heading-legal-sub-weight: 800;
  --font-heading-legal-sub-line: 1.25;
  --font-body-size: 15px;
  --font-body-weight: 400;
  --font-body-line: 1.55;
  --font-body-legal-desktop-size: 16px;
  --font-body-legal-desktop-weight: 400;
  --font-body-legal-desktop-line: 1.55;
  --font-body-strong-size: 15px;
  --font-body-strong-weight: 600;
  --font-body-strong-line: 1.4;
  --font-meta-org-size: 14px;
  --font-meta-org-weight: 600;
  --font-meta-org-line: 1.35;
  --font-meta-period-size: 13px;
  --font-meta-period-weight: 600;
  --font-meta-period-line: 1.35;
  --font-caption-cert-size: 13px;
  --font-caption-cert-weight: 600;
  --font-caption-cert-line: 1.35;
  --font-chip-size: 13px;
  --font-chip-weight: 600;
  --font-chip-line: 1.2;
  --font-label-size: 11px;
  --font-label-weight: 700;
  --font-label-line: 1.35;
  --font-label-tracking: 0.08em;
  --font-button-size: 15px;
  --font-button-weight: 700;
  --font-button-line: 1;
  --font-language-switch-size: 12.5px;
  --font-language-switch-weight: 700;
  --font-language-switch-line: 1;
  --font-stack-bar-size: 12px;
  --font-stack-bar-weight: 700;
  --font-stack-bar-line: 1;
  --font-layer-tag-size: 10.5px;
  --font-layer-tag-weight: 600;
  --font-layer-tag-line: 1;
  --font-small-size: 14px;
  --font-small-weight: 400;
  --font-small-line: 1.45;
  --font-back-link-size: 14px;
  --font-back-link-weight: 700;
  --font-back-link-line: 1.2;

  --radius-bar: 5px;
  --radius-sm: 6px;
  --radius-chip: 7px;
  --radius-plate: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --radius-photo-lg: 16px;

  --space-gutter: 16px;
  --space-gutter-desktop: 64px;
  --space-page-max: 1366px;
  --space-section-gap: 36px;
  --space-section-gap-desktop: 56px;
  --space-hero-column: 440px;
  --space-hero-column-gap: 64px;
  --space-text-measure: 36em;
  --space-legal-measure: 40em;
  --space-1: 2px;
  --space-2: 6px;
  --space-3: 10px;
  --space-4: 12px;
  --space-5: 14px;
  --space-6: 16px;
  --space-7: 18px;
  --space-8: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-background: #0A1222;
    --color-ink: #EDF1F8;
    --color-ink-secondary: #BFC9DA;
    --color-accent: #8DB4FF;
    --color-accent-hover: #B0CBFF;
    --color-on-accent: #0A1222;
    --color-track: #152036;
    --color-component-border: #34445F;
    --color-bar-outline: #6E80A0;
    --color-focus-ring: #FFB366;
    --color-layer-1: #142A4D;
    --color-layer-2: #172F57;
    --color-layer-3: #1C2A55;
    --color-layer-4: #232552;
    --color-layer-5: #172D45;
    --color-layer-6: #1C2638;
    --color-badge-plate: #FFFFFF;
  }
}

/* Page layout breakpoint (spacing.breakpoint) */
@media (min-width: 760px) {
  :root {
    --font-heading-section-size: 30px;
    --font-heading-section-weight: 800;
    --font-heading-section-line: 1.1;
    --font-heading-section-tracking: -0.02em;
    --font-heading-context-size: 24px;
    --font-heading-context-weight: 800;
    --font-heading-context-line: 1.15;
    --font-heading-context-tracking: -0.01em;
    --font-heading-legal-page-size: 56px;
    --font-heading-legal-page-weight: 800;
    --font-heading-legal-page-line: 1.08;
    --font-heading-legal-page-tracking: -0.03em;
    --font-small-size: 15px;
    --font-small-weight: 400;
    --font-small-line: 1.45;
  }
}

/* Hero breakpoint (spacing.breakpoint-hero) */
@media (min-width: 1024px) {
  :root {
    --font-name-display-size: 72px;
    --font-name-display-weight: 800;
    --font-name-display-line: 1.04;
    --font-name-display-tracking: -0.03em;
    --font-title-role-size: 22px;
    --font-title-role-weight: 700;
    --font-title-role-line: 1.3;
    --font-tagline-size: 19px;
    --font-tagline-weight: 400;
    --font-tagline-line: 1.5;
    --font-technology-line-size: 17px;
    --font-technology-line-weight: 700;
    --font-technology-line-line: 1.35;
    --font-stack-bar-size: 14px;
    --font-stack-bar-weight: 700;
    --font-stack-bar-line: 1;
  }
}

/* Base page */

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

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-ink);
  font-family: var(--font-family);
  font-size: var(--font-body-size);
  font-weight: var(--font-body-weight);
  line-height: var(--font-body-line);
}

main,
footer {
  max-width: var(--space-page-max);
  margin-inline: auto;
  padding-inline: var(--space-gutter);
}

main {
  padding-block-start: var(--space-section-gap);
}

footer {
  display: flex;
  flex-direction: column;
  row-gap: var(--space-3);
  margin-block-start: var(--space-section-gap);
  padding-block: var(--space-6);
  border-top: 1.5px solid var(--color-component-border);
  color: var(--color-ink-secondary);
  font-size: var(--font-small-size);
  font-weight: var(--font-small-weight);
  line-height: var(--font-small-line);
}

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

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

p {
  margin: 0;
}

/* Hero: single column below the hero breakpoint, DOM order = reading order */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    'name'
    'title'
    'photo'
    'tagline'
    'focus'
    'actions';
  row-gap: var(--space-4);
}

.hero-name {
  grid-area: name;
  margin: 0;
  font-size: var(--font-name-display-size);
  font-weight: var(--font-name-display-weight);
  line-height: var(--font-name-display-line);
  letter-spacing: var(--font-name-display-tracking);
  overflow-wrap: break-word;
}

.hero-title {
  grid-area: title;
  margin-block-start: calc(var(--space-2) - var(--space-4));
  color: var(--color-accent);
  font-size: var(--font-title-role-size);
  font-weight: var(--font-title-role-weight);
  line-height: var(--font-title-role-line);
}

/* Photo slot: Photo | stack map; the Photo top-aligned, the map centred vertically */

.hero-visual {
  grid-area: photo;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  column-gap: var(--space-4);
  align-items: start;
}

.hero-photo {
  width: 100px;
  height: 152px;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.hero-photo img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Stack map (Signature Idea, FR-11): equal-length bars, track behind, the layer tint as fill */
/* The count class stack-N carries the N-dependent stagger, gap, desktop bar height and phone rows */

.stack-map {
  --stack-gap: var(--space-1);
  --stack-bar-height: 24px;
  --stack-stagger: 100ms;
  --stack-rows: 6;
  align-self: center;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(var(--stack-rows), auto);
  grid-auto-columns: minmax(0, 1fr);
  row-gap: var(--stack-gap);
  column-gap: var(--space-1);
}

.stack-bar {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  min-height: var(--stack-bar-height);
  padding: 0 10px;
  border: 1.5px solid var(--color-bar-outline);
  border-radius: var(--radius-bar);
  background: var(--color-track);
  color: var(--color-ink);
  font-size: var(--font-stack-bar-size);
  font-weight: var(--font-stack-bar-weight);
  line-height: var(--font-stack-bar-line);
  text-decoration: none;
  overflow: hidden;
}

.stack-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--layer-fill);
  transform-origin: left center;
}

.stack-tag {
  flex: none;
  color: var(--color-ink-secondary);
  font-size: var(--font-layer-tag-size);
  font-weight: var(--font-layer-tag-weight);
  line-height: var(--font-layer-tag-line);
}

.stack-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stack-bar:hover {
  border-color: var(--color-accent-hover);
}

.stack-bar:hover .stack-label {
  text-decoration: underline;
}

.stack-bar:focus {
  z-index: 1;
}

.stack-bar:nth-child(1) { --stack-index: 0; }
.stack-bar:nth-child(2) { --stack-index: 1; }
.stack-bar:nth-child(3) { --stack-index: 2; }
.stack-bar:nth-child(4) { --stack-index: 3; }
.stack-bar:nth-child(5) { --stack-index: 4; }
.stack-bar:nth-child(6) { --stack-index: 5; }
.stack-bar:nth-child(7) { --stack-index: 6; }
.stack-bar:nth-child(8) { --stack-index: 7; }
.stack-bar:nth-child(9) { --stack-index: 8; }
.stack-bar:nth-child(10) { --stack-index: 9; }
.stack-bar:nth-child(11) { --stack-index: 10; }
.stack-bar:nth-child(12) { --stack-index: 11; }

/* Count classes, phone values: stagger 100ms for N up to 6, else floor(550 / (N - 1)) ms; gap 0 from N = 7; two columns of ceil(N / 2) rows from N = 9 */
.stack-1 { --stack-stagger: 100ms; --stack-gap: 2px; --stack-rows: 1; }
.stack-2 { --stack-stagger: 100ms; --stack-gap: 2px; --stack-rows: 2; }
.stack-3 { --stack-stagger: 100ms; --stack-gap: 2px; --stack-rows: 3; }
.stack-4 { --stack-stagger: 100ms; --stack-gap: 2px; --stack-rows: 4; }
.stack-5 { --stack-stagger: 100ms; --stack-gap: 2px; --stack-rows: 5; }
.stack-6 { --stack-stagger: 100ms; --stack-gap: 2px; --stack-rows: 6; }
.stack-7 { --stack-stagger: 91ms; --stack-gap: 0px; --stack-rows: 7; }
.stack-8 { --stack-stagger: 78ms; --stack-gap: 0px; --stack-rows: 8; }
.stack-9 { --stack-stagger: 68ms; --stack-gap: 0px; --stack-rows: 5; }
.stack-10 { --stack-stagger: 61ms; --stack-gap: 0px; --stack-rows: 5; }
.stack-11 { --stack-stagger: 55ms; --stack-gap: 0px; --stack-rows: 6; }
.stack-12 { --stack-stagger: 50ms; --stack-gap: 0px; --stack-rows: 6; }

/* Layer arrival cue: a static outline; it fades only under no-preference (below) */
.layer:has(> .layer-heading:target) {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Motion: the one-time fill, the smooth jump and the arrival-cue fade exist only here (NFR-4) */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .stack-bar::before {
    animation: stack-fill 0.45s ease-out calc(var(--stack-index, 0) * var(--stack-stagger)) both;
  }

  .layer:has(> .layer-heading:target) {
    animation: layer-arrival 1.2s ease-out forwards;
  }

  @keyframes stack-fill {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
  }

  @keyframes layer-arrival {
    from { outline-color: var(--color-accent); }
    to { outline-color: transparent; }
  }
}

.hero-tagline {
  grid-area: tagline;
  max-width: var(--space-text-measure);
  color: var(--color-ink-secondary);
  font-size: var(--font-tagline-size);
  font-weight: var(--font-tagline-weight);
  line-height: var(--font-tagline-line);
}

.hero-focus {
  grid-area: focus;
  font-size: var(--font-technology-line-size);
  font-weight: var(--font-technology-line-weight);
  line-height: var(--font-technology-line-line);
}

.hero-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.hero-actions .button-primary {
  flex: 1 1 auto;
}

.label {
  margin-inline-end: var(--space-2);
  color: var(--color-accent);
  font-size: var(--font-label-size);
  font-weight: var(--font-label-weight);
  line-height: var(--font-label-line);
  letter-spacing: var(--font-label-tracking);
  text-transform: uppercase;
}

/* Buttons: native links styled as the Contact Action and the LinkedIn Link */

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  font-size: var(--font-button-size);
  font-weight: var(--font-button-weight);
  line-height: var(--font-button-line);
  text-align: center;
  text-decoration: none;
}

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

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

.button-secondary {
  border: 2px solid var(--color-ink);
  background: transparent;
  color: var(--color-ink);
}

.button-secondary:hover {
  background: var(--color-track);
}

/* Section headings (Skills, Certifications) */

.skills,
.certifications {
  margin-block-start: var(--space-section-gap);
}

.section-heading {
  margin: 0 0 var(--space-4);
  font-size: var(--font-heading-section-size);
  font-weight: var(--font-heading-section-weight);
  line-height: var(--font-heading-section-line);
  letter-spacing: var(--font-heading-section-tracking);
}

/* Skills: one tinted layer per Skill Category; chips below the heading on the phone */

.skills-layers {
  display: grid;
  gap: var(--space-2);
}

.layer {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--layer-fill);
  color: var(--color-ink);
}

.tint-1 { --layer-fill: var(--color-layer-1); }
.tint-2 { --layer-fill: var(--color-layer-2); }
.tint-3 { --layer-fill: var(--color-layer-3); }
.tint-4 { --layer-fill: var(--color-layer-4); }
.tint-5 { --layer-fill: var(--color-layer-5); }
.tint-6 { --layer-fill: var(--color-layer-6); }

.layer-heading {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
  font-size: var(--font-heading-layer-size);
  font-weight: var(--font-heading-layer-weight);
  line-height: var(--font-heading-layer-line);
  overflow-wrap: anywhere;
  scroll-margin-top: 24px;
}

.layer-tag {
  flex: none;
  color: var(--color-ink-secondary);
  font-size: 11px;
  font-weight: var(--font-layer-tag-weight);
  line-height: var(--font-layer-tag-line);
}

.layer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  padding: 6px 10px;
  border: 1.5px solid var(--color-component-border);
  border-radius: var(--radius-chip);
  background: var(--color-background);
  color: var(--color-ink);
  font-size: var(--font-chip-size);
  font-weight: var(--font-chip-weight);
  line-height: var(--font-chip-line);
  overflow-wrap: anywhere;
}

/* Certifications: 2 columns on the phone, cards left-aligned and never stretched */

.cert-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cert {
  padding: var(--space-4);
  border: 1.5px solid var(--color-component-border);
  border-radius: var(--radius-xl);
  background: transparent;
}

.cert-figure {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
}

.cert-plate {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 84px;
  border-radius: var(--radius-plate);
  background: var(--color-badge-plate);
}

.cert-plate img {
  display: block;
  height: auto;
  object-fit: contain;
}

.badge-square {
  max-width: 64px;
  max-height: 64px;
}

.badge-wide {
  max-width: min(128px, 100%);
}

.cert-name {
  font-size: var(--font-caption-cert-size);
  font-weight: var(--font-caption-cert-weight);
  line-height: var(--font-caption-cert-line);
  overflow-wrap: anywhere;
}

/* Context Section: About, Experience, Education, Languages; subordinate to Skills and Certifications, no tints */

.context-section,
.context-pair {
  margin-block-start: var(--space-section-gap);
}

.context-pair > .context-section {
  margin-block-start: 0;
}

.context-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: var(--space-section-gap);
}

.context-heading {
  margin: 0 0 var(--space-4);
  font-size: var(--font-heading-context-size);
  font-weight: var(--font-heading-context-weight);
  line-height: var(--font-heading-context-line);
  letter-spacing: var(--font-heading-context-tracking);
}

.about-text {
  max-width: var(--space-text-measure);
  color: var(--color-ink-secondary);
  font-size: var(--font-body-size);
  font-weight: var(--font-body-weight);
  line-height: var(--font-body-line);
}

.experience-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.experience-card {
  padding: 12px 14px;
  border: 1.5px solid var(--color-component-border);
  border-radius: var(--radius-xl);
  background: transparent;
}

.experience-role {
  margin: 0 0 var(--space-1);
  font-size: var(--font-heading-card-size);
  font-weight: var(--font-heading-card-weight);
  line-height: var(--font-heading-card-line);
  overflow-wrap: anywhere;
}

.experience-org {
  font-size: var(--font-meta-org-size);
  font-weight: var(--font-meta-org-weight);
  line-height: var(--font-meta-org-line);
  overflow-wrap: anywhere;
}

.experience-period {
  color: var(--color-ink-secondary);
  font-size: var(--font-meta-period-size);
  font-weight: var(--font-meta-period-weight);
  line-height: var(--font-meta-period-line);
}

.education-text {
  overflow-wrap: anywhere;
}

.language-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Interests line: label then items, no heading; small, small-desktop from the breakpoint */

.interests {
  margin-block-start: var(--space-section-gap);
  color: var(--color-ink-secondary);
  font-size: var(--font-small-size);
  font-weight: var(--font-small-weight);
  line-height: var(--font-small-line);
}

/* Text link ("Imprint & Privacy") */

.text-link {
  color: var(--color-accent);
  font-weight: 700;
  text-decoration-line: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.text-link:hover {
  color: var(--color-accent-hover);
  text-decoration-thickness: 2.5px;
}

/* Footer and the Readable email */

.footer-email {
  overflow-wrap: anywhere;
}

.readable-email {
  color: var(--color-ink);
  font-weight: 600;
}

/* Legal Page and 404: one text column of 46em (legal paragraph size) plus the gutters */
.topbar,
.legal,
.legal-footer,
.notfound,
.notfound-footer {
  max-width: calc(46 * var(--font-body-size) + 2 * var(--space-gutter));
}

.topbar {
  margin-inline: auto;
  padding: var(--space-6) var(--space-gutter) 0;
}

/* Top bar: back link left (Legal Page), Language Switch right */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

/* Page top bar: page width, the switch alone at the right, the Hero close below it (mock bar 8px, hero 4px) */
.topbar.page-topbar {
  max-width: var(--space-page-max);
  justify-content: flex-end;
  padding-block-start: 8px;
}

.page-topbar + main {
  padding-block-start: 4px;
}

/* Language Switch (FR-19): codes EN DE ES, each at least 30 x 28px; the current one a filled pill */
.lang-switch {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-inline-start: auto;
}

.lang-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 28px;
  padding-inline: var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--color-ink-secondary);
  font-size: var(--font-language-switch-size);
  font-weight: var(--font-language-switch-weight);
  line-height: var(--font-language-switch-line);
  text-decoration: none;
}

.lang-link[aria-current='page'] {
  background: var(--color-ink);
  color: var(--color-background);
}

.lang-link:not([aria-current]):hover {
  color: var(--color-ink);
  text-decoration: underline;
}

/* Back link: a text link at the back-link size, at least 24px tall */
.back-link {
  display: inline-block;
  padding-block: 4px;
  font-size: var(--font-back-link-size);
  font-weight: var(--font-back-link-weight);
  line-height: var(--font-back-link-line);
}

.legal-heading,
.notfound-code {
  margin: 0;
  font-size: var(--font-heading-legal-page-size);
  font-weight: var(--font-heading-legal-page-weight);
  line-height: var(--font-heading-legal-page-line);
  letter-spacing: var(--font-heading-legal-page-tracking);
  overflow-wrap: break-word;
}

/* Binding-version note (en/es only): track tint, ink text, the "Deutsche Fassung" text link */
.binding-note {
  max-width: var(--space-legal-measure);
  margin-block-start: var(--space-6);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--color-track);
  color: var(--color-ink);
  font-size: var(--font-small-size);
  font-weight: var(--font-small-weight);
  line-height: var(--font-small-line);
}

.binding-link {
  white-space: nowrap;
}

.legal-section {
  margin-block-start: var(--space-section-gap);
}

.legal-section-heading {
  margin: 0 0 var(--space-4);
  font-size: var(--font-heading-section-size);
  font-weight: var(--font-heading-section-weight);
  line-height: var(--font-heading-section-line);
  letter-spacing: var(--font-heading-section-tracking);
}

/* Impressum: accent labels left, semibold values right */
.impressum-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 6px 14px;
  margin: 0;
}

.impressum-list dt {
  color: var(--color-accent);
  font-size: var(--font-label-size);
  font-weight: var(--font-label-weight);
  line-height: 1.9;
  letter-spacing: var(--font-label-tracking);
  text-transform: uppercase;
}

.impressum-list dd {
  margin: 0;
  color: var(--color-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.legal-topic {
  margin-block-start: var(--space-8);
}

.legal-subheading {
  margin: 0 0 var(--space-2);
  font-size: var(--font-heading-legal-sub-size);
  font-weight: var(--font-heading-legal-sub-weight);
  line-height: var(--font-heading-legal-sub-line);
  overflow-wrap: break-word;
}

.legal-text {
  max-width: var(--space-legal-measure);
  font-size: var(--font-body-size);
  font-weight: var(--font-body-weight);
  line-height: var(--font-body-line);
  overflow-wrap: break-word;
}

.legal-text + .legal-text {
  margin-block-start: var(--space-4);
}

/* 404: the code, then one block per language */
.notfound-block {
  margin-block-start: var(--space-section-gap);
}

.notfound-heading {
  margin: 0 0 var(--space-2);
  font-size: var(--font-heading-context-size);
  font-weight: var(--font-heading-context-weight);
  line-height: var(--font-heading-context-line);
  letter-spacing: var(--font-heading-context-tracking);
}

.notfound-text {
  color: var(--color-ink-secondary);
}

.notfound-link {
  margin-block-start: var(--space-2);
}

.notfound-link .text-link {
  display: inline-block;
  padding-block: 2px;
}

@media (min-width: 760px) {
  .topbar,
  .legal,
  .legal-footer,
  .notfound,
  .notfound-footer {
    max-width: calc(46 * var(--font-body-legal-desktop-size) + 2 * var(--space-gutter-desktop));
  }

  .topbar {
    padding-inline: var(--space-gutter-desktop);
  }

  .topbar.page-topbar {
    padding-block-start: var(--space-8);
  }

  .page-topbar + main {
    padding-block-start: var(--space-8);
  }

  .legal-section,
  .notfound-block {
    margin-block-start: var(--space-section-gap-desktop);
  }

  .legal-text {
    font-size: var(--font-body-legal-desktop-size);
    font-weight: var(--font-body-legal-desktop-weight);
    line-height: var(--font-body-legal-desktop-line);
  }
}

@media (min-width: 760px) {
  main,
  footer {
    padding-inline: var(--space-gutter-desktop);
  }

  main {
    padding-block-start: var(--space-section-gap-desktop);
  }

  footer {
    margin-block-start: var(--space-section-gap-desktop);
  }

  .skills,
  .certifications,
  .context-section,
  .context-pair,
  .interests {
    margin-block-start: var(--space-section-gap-desktop);
  }

  .context-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
  }

  .experience-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  footer {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    column-gap: var(--space-8);
  }

  .layer {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: center;
    column-gap: var(--space-2);
    padding: 14px 18px;
  }

  .layer-heading {
    align-self: start;
    margin: var(--space-2) 0 0;
    scroll-margin-top: 32px;
  }

  .cert-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .cert-plate {
    height: 120px;
  }

  .badge-square {
    max-width: 88px;
    max-height: 88px;
  }

  .badge-wide {
    max-width: min(159px, 100%);
  }
}

/* Two-column hero (spacing.breakpoint-hero) */
@media (min-width: 1024px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) var(--space-hero-column);
    grid-template-rows: repeat(4, auto) 1fr;
    grid-template-areas:
      'name photo'
      'title photo'
      'tagline photo'
      'focus photo'
      'actions photo';
    column-gap: var(--space-hero-column-gap);
    align-items: start;
  }

  .hero-visual {
    grid-template-columns: 152px minmax(0, 1fr);
    column-gap: var(--space-6);
  }

  .hero-photo {
    width: 152px;
    height: 220px;
    border-radius: var(--radius-photo-lg);
  }

  /* Count classes, two-column hero: one column, 5px gap, 32px bars up to N = 6, else max(24, floor((220 - 5(N - 1)) / N)) px */
  .stack-1 { --stack-gap: 5px; --stack-bar-height: 32px; --stack-rows: 1; }
  .stack-2 { --stack-gap: 5px; --stack-bar-height: 32px; --stack-rows: 2; }
  .stack-3 { --stack-gap: 5px; --stack-bar-height: 32px; --stack-rows: 3; }
  .stack-4 { --stack-gap: 5px; --stack-bar-height: 32px; --stack-rows: 4; }
  .stack-5 { --stack-gap: 5px; --stack-bar-height: 32px; --stack-rows: 5; }
  .stack-6 { --stack-gap: 5px; --stack-bar-height: 32px; --stack-rows: 6; }
  .stack-7 { --stack-gap: 5px; --stack-bar-height: 27px; --stack-rows: 7; }
  .stack-8 { --stack-gap: 5px; --stack-bar-height: 24px; --stack-rows: 8; }
  .stack-9 { --stack-gap: 5px; --stack-bar-height: 24px; --stack-rows: 9; }
  .stack-10 { --stack-gap: 5px; --stack-bar-height: 24px; --stack-rows: 10; }
  .stack-11 { --stack-gap: 5px; --stack-bar-height: 24px; --stack-rows: 11; }
  .stack-12 { --stack-gap: 5px; --stack-bar-height: 24px; --stack-rows: 12; }

  .hero-actions .button-primary {
    flex: 0 0 auto;
    padding: 0 28px;
  }
}
