@font-face {
  font-family: "Instrument Sans";
  src: url("font/InstrumentSans-VariableFont.ttf") format("truetype");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("font/InstrumentSans-Italic-VariableFont.ttf") format("truetype");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-style: italic;
  font-display: swap;
}

/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
*:not(dialog) {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  font-family: "Instrument Sans", system-ui, sans-serif;
  /* 4. Increase line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input,
button,
textarea,
select {
  font: inherit;
}

/* 8. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

/*
    10. Create a root stacking context
  */
#root,
#__next {
  isolation: isolate;
}

:root {
  --nav-height: 5.75rem;
  --content-max: 1360px;
  --card-bg: #ffffff;
  --brand: #3f7cb8;
  --brand-dark: #2f6294;
  --brand-soft: #eaf2fa;
  --ink: #1e2430;
  --muted: #64707d;
  --border: #e3e9f0;
}

@media (min-width: 768px) {
  :root {
    --nav-height: 5.75rem;
  }
}

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

body {
  hyphens: auto;
  display: flex;
  flex-flow: column;
  justify-content: flex-start;
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-top: var(--nav-height);
  background: var(--card-bg);
  color: var(--ink);

  @media (min-width: 1100px) {
    padding-top: 0;
  }

  @media (min-width: 1440px) {
    margin-block: 2.5rem;
  }
}

@media (min-width: 962px) {
  body {
    flex-flow: row;
    justify-content: space-between;
    align-items: flex-start;
    height: auto;
    min-height: 100vh;
  }
}

.main-wrapper {
  padding: 3rem 1rem 3rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;

  @media (min-width: 962px) {
    padding: 2rem;
    flex: 1 1 55%;
    width: auto;
    max-width: 55%;
    height: auto;
    min-height: 100vh;
  }
}

.main-content {
  margin-bottom: 3.5rem;

  @media (min-width: 768px) {
    margin-bottom: 3rem;
  }
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  box-sizing: border-box;
  padding: 0.875rem 1rem;
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--card-bg);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;

  @media (min-width: 1100px) {
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    width: auto;
    max-width: none;
    margin-inline: 0;
    margin-bottom: 3rem;
    padding: 0;
    justify-content: flex-start;
    gap: 3.5rem;
  }
}

.nav--scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 6px 20px rgb(15 23 42 / 6%);
}

.nav-brand {
  display: block;
  text-decoration: none;
  z-index: 30;
  flex-shrink: 0;
  line-height: 0;
}

.nav-brand img {
  display: block;
  height: 4rem;
  width: auto;
  transition: height 0.25s ease;

  @media (min-width: 1100px) {
    height: 3rem;
  }
}

.nav--scrolled .nav-brand img {
  height: 2.5rem;

  @media (min-width: 1100px) {
    height: 3rem;
  }
}

.nav-brand:hover {
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  .nav-brand img {
    transition: none;
  }
}

.nav-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.35rem;
  margin: -0.35rem;
  width: auto;
  height: auto;
  min-height: 2.75rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  z-index: 30;
  font: inherit;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;

  @media (min-width: 1100px) {
    display: none;
  }
}

.nav-toggle__icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  width: 1.5rem;
}

.nav-toggle__bar {
  display: block;
  flex: none;
  width: 1.5rem;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s ease;
}

.nav.is-open .nav-toggle__bar:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.nav.is-open .nav-toggle__bar:nth-child(2) {
  transform: translateY(-5px) rotate(-45deg);
}

.nav-toggle__label {
  display: block;
}

.nav-panel {
  @media (max-width: 1099px) {
    position: fixed;
    inset: 0;
    z-index: 20;
    height: 100dvh;
    overflow-y: auto;
    background: var(--card-bg);
    padding: calc(var(--nav-height) + 1rem) 1rem 1.5rem;
    opacity: 0;
    transform: translateY(-1.5rem);
    visibility: hidden;
    transition:
      opacity 0.3s ease,
      transform 0.3s ease,
      visibility 0.3s ease;
  }

  @media (min-width: 1100px) {
    position: static;
    opacity: 1;
    transform: none;
    visibility: visible;
    padding: 0;
  }
}

.nav.is-open .nav-panel {
  @media (max-width: 1099px) {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-toggle__bar,
  .nav-panel {
    transition: none;
  }
}

body.nav-open {
  @media (max-width: 1099px) {
    overflow: hidden;
  }
}

.nav-list {
  padding: 0;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0;

  @media (min-width: 1100px) {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }

  @media (min-width: 1200px) {
    gap: 1.5rem;
  }
}

.nav-item {
  list-style: none;
}

.nav-item a {
  text-decoration: none;
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 500;
  display: block;
  transition: color 0.2s ease;

  @media (max-width: 1099px) {
    text-align: center;
    padding: 1.1rem 0.5rem;
  }

  @media (min-width: 1100px) {
    font-size: 0.9375rem;
    font-weight: inherit;
    display: inline;
  }

  @media (min-width: 1200px) {
    font-size: inherit;
  }
}

.nav-item a:hover {
  color: var(--brand);
}

.nav-item a[aria-current="page"] {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.meta-headline {
  font-size: 1.375rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 120%;

  @media (min-width: 768px) {
    font-size: 1.75rem;
  }
  @media (min-width: 960px) {
    font-size: 2.125rem;
  }
}

.main-title {
  font-size: 2.5rem;
  line-height: 110%;
  color: var(--brand);
  @media (min-width: 768px) {
    font-size: 3.25rem;
  }
  @media (min-width: 960px) {
    font-size: 4.5rem;
  }
}

.main-lead {
  display: block;
  margin-top: 1.25rem;
  max-width: 48rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 140%;
  color: var(--muted);

  @media (min-width: 768px) {
    margin-top: 1.5rem;
    max-width: 36rem;
    font-size: 1.125rem;
  }

  @media (min-width: 960px) {
    max-width: 44rem;
    font-size: 1.25rem;
  }
}

.trust-badge {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;

  @media (min-width: 768px) {
    font-size: 0.875rem;
  }
}

.trust-badge::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--brand);
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.75rem;

  @media (min-width: 768px) {
    margin-top: 2rem;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 24px -10px rgb(63 124 184 / 55%);
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.footer {
  padding: 0;
  display: none;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 1.5rem;
  min-width: 0;
  @media (min-width: 962px) {
    display: flex;
    margin-top: auto;
    padding-top: 2rem;
  }
}
.footer-mobile {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  padding: 1rem;
  gap: 1rem;
  min-width: 0;
  @media (min-width: 962px) {
    display: none;
  }
}
.footer-list {
  padding: 0;
  display: flex;
  gap: 0.75rem;

  @media (min-width: 768px) {
    gap: 1.5rem;
  }
}

.footer-item {
  list-style: none;
  font-size: 0.875rem;

  @media (min-width: 768px) {
    font-size: 0.875rem;
  }
}
.footer-item a {
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s ease;
}

.footer-item a:hover {
  color: var(--brand);
}

.footer-item a[aria-current="page"] {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.impressum-facts a {
  color: inherit;
  text-decoration: none;
}

.impressum-facts a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.legal-content {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 140%;
  color: var(--ink);

  @media (min-width: 768px) {
    font-size: 1.125rem;
  }
}

.legal-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 120%;
  color: var(--brand);
  margin-bottom: 0.75rem;

  @media (min-width: 768px) {
    font-size: 1.25rem;
  }
}

.legal-section p + p,
.legal-section ul {
  margin-top: 0.75rem;
}

.legal-section ul {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.legal-section a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.error-text {
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 140%;
  color: var(--ink);

  @media (min-width: 768px) {
    font-size: 1.125rem;
  }
}

.error-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.error-link {
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 0.2em;

  @media (min-width: 768px) {
    font-size: 1.125rem;
  }
}

.error-link:hover {
  opacity: 0.85;
}
.copyright {
  font-size: 0.875rem;
  min-width: 0;

  @media (min-width: 768px) {
    font-size: 0.875rem;
  }
}
.aside {
  height: auto;
  width: 100%;
  min-width: 0;
  padding: 1rem;

  @media (min-width: 962px) {
    flex: 0 1 45%;
    width: auto;
    max-width: 45%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: safe center;
    min-height: 100vh;
  }
}

/* Sticky image column on desktop — skip Kontakt (map should scroll with page) */
body:not(.page-kontakt) .aside {
  @media (min-width: 962px) {
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }
}

.aside-image {
  width: 100%;
  height: auto;

  object-fit: cover;
  object-position: center 20%;
  margin-bottom: 0.75rem;
  border-radius: 8px;

  @media (min-width: 560px) and (max-width: 670px) {
    max-height: 550px;
  }

  @media (min-width: 671px) and (max-width: 961px) {
    max-height: 650px;
  }

  @media (min-width: 768px) {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center 20%;
    margin-bottom: 0.75rem;
  }
}

body.page-leistungen .aside-image {
  object-position: center 45%;
}

body.page-leistungen .aside-image,
body.page-lebenslauf .aside-image {
  @media (min-width: 1100px) {
    height: 90vh;
    max-height: 90vh;
  }
}

body.page-home .aside-image {
  @media (min-width: 900px) {
    min-height: 700px;
  }
}

.aside-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  @media (min-width: 768px) {
    flex-direction: row;
    gap: 2rem;
  }
}

.aside-title {
  width: 100%;
  font-size: 1.5rem;
  line-height: 120%;
  color: var(--brand);
  @media (min-width: 768px) {
    font-size: 1.75rem;
  }
  @media (min-width: 960px) {
    font-size: 2rem;
    line-height: 120%;
  }
}
.aside-subtitle {
  width: 100%;
  font-size: 1.125rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 120%;
  @media (min-width: 768px) {
    font-size: 1.25rem;
  }
  @media (min-width: 960px) {
    width: 50%;
    font-size: 1.5rem;
  }
}
.aside-text {
  width: 100%;
  font-size: 1rem;
  font-weight: 500;
  line-height: 140%;
  @media (min-width: 768px) {
    font-size: 1.125rem;
  }
  @media (min-width: 960px) {
    font-size: 1.125rem;
  }
}

.page-title {
  font-size: 2rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 120%;
  margin-bottom: 1.5rem;

  @media (min-width: 768px) {
    font-size: 2.5rem;
  }

  @media (min-width: 960px) {
    font-size: 3rem;
  }
}

.services-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 140%;
  color: var(--ink);

  @media (min-width: 640px) {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  @media (min-width: 768px) {
    font-size: 1.125rem;
    gap: 1rem;
  }
}

.services-list li {
  padding: 0.9rem 1rem 0.9rem 2.5rem;
  position: relative;
  background: var(--brand-soft);
  border-radius: 8px;
}

.services-list li::before {
  content: "✓";
  position: absolute;
  left: 1rem;
  top: 0.9rem;
  color: var(--brand);
  font-weight: 700;
}

.cv-facts,
.cv-timeline {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 140%;
  color: var(--ink);

  @media (min-width: 768px) {
    font-size: 1.125rem;
    gap: 0.75rem;
  }
}

.cv-facts {
  margin-bottom: 2rem;
}

.cv-timeline {
  position: relative;
  padding-left: 1.75rem;
}

.cv-timeline::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 0.55em;
  bottom: 0.55em;
  width: 1px;
  background: #cfcfcf;
}

.cv-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 120%;
  color: var(--muted);
  margin-bottom: 1rem;

  @media (min-width: 768px) {
    font-size: 1.5rem;
  }
}

.cv-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem 1.5rem;

  @media (min-width: 768px) {
    grid-template-columns: 11rem 1fr;
  }
}

.cv-timeline .cv-row {
  position: relative;
}

.cv-timeline .cv-row::before {
  content: "";
  position: absolute;
  left: -1.55rem;
  top: 0.45em;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px #fff;
}

.cv-row dt {
  color: var(--muted);
  font-weight: 500;
}

.cv-row dd {
  margin: 0;
}

.contact-block {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 140%;
  color: var(--ink);
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  border-radius: 8px;
  background: var(--brand-soft);

  @media (min-width: 768px) {
    font-size: 1.125rem;
    padding: 1.75rem;
  }
}

.contact-block a {
  color: inherit;
  text-decoration: none;
}

.contact-block a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.contact-email {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.contact-hours {
  font-size: 1rem;
  font-weight: 500;
  line-height: 140%;
  color: var(--ink);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);

  @media (min-width: 768px) {
    font-size: 1.125rem;
    padding: 1.75rem;
  }
}

.contact-hours-title {
  font-size: inherit;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.directions-map {
  display: block;
  margin-bottom: 1.5rem;
  text-decoration: none;
}

.directions-map__frame {
  position: relative;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border);
}

.directions-map img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.directions-map__attribution {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 0.25rem 0.4rem;
  background: rgb(255 255 255 / 90%);
  color: var(--ink);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.2;
}

.directions-map__hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-dark);
  text-align: center;
}

.directions-map__hint::after {
  content: "↗";
}

.directions-map:hover img {
  transform: scale(1.03);
}

.directions-map:hover .directions-map__hint {
  color: var(--brand);
}

.directions-title {
  font-size: 1.5rem;
  line-height: 120%;
  color: var(--brand);
  font-weight: 600;
  margin-bottom: 1rem;

  @media (min-width: 768px) {
    font-size: 1.75rem;
  }

  @media (min-width: 960px) {
    font-size: 2rem;
  }
}

.directions-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.directions-tab {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 140%;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  padding: 0.5rem 1rem;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;

  @media (min-width: 768px) {
    font-size: 0.9375rem;
  }
}

.directions-tab:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.directions-tab[aria-selected="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.directions-panel {
  font-size: 1rem;
  font-weight: 500;
  line-height: 140%;
  color: var(--ink);

  @media (min-width: 768px) {
    font-size: 1.125rem;
  }
}
