/* ==========================================================================
   Design tokens
   ========================================================================== */

:root {
  color-scheme: light;
  --paper: #fbfbf8;
  --surface: #ffffff;
  --ink: #18201b;
  --muted: #5b655e;
  --line: #d9dfd8;
  --line-strong: #b7c0b7;
  --green: #006c4f;
  --green-dark: #064332;
  --red: #a61417;
  --blue: #11186c;
  --warm: #be6b2e;
  --focus: #11186c;
  --shadow: 0 18px 55px rgba(24, 32, 27, 0.11);
}

/* ==========================================================================
   Base
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--paper);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--green-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--red);
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  transform: translateY(-160%);
  background: var(--surface);
  border: 2px solid var(--focus);
  color: var(--ink);
  padding: 0.65rem 0.9rem;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 251, 248, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.header-shell,
.section-inner,
.footer-inner,
.legal-shell {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.header-shell {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

.brand img {
  width: 46px;
  height: 46px;
  border-radius: 4px;
}

.brand-title {
  display: block;
  font-weight: 750;
  line-height: 1.1;
}

.brand-subtitle {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

/* ==========================================================================
   Navigation and actions
   ========================================================================== */

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.nav-toggle-icon {
  width: 18px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  position: relative;
}

.nav-toggle-icon::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 3px;
  border-top: 2px solid currentColor;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: 6px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  padding: 0.45rem 0.75rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: #edf2ed;
  color: var(--green-dark);
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding-left: 0.85rem;
  border-left: 1px solid var(--line);
}

.language-switch a {
  min-height: 38px;
  padding: 0.35rem 0.55rem;
  font-size: 0.86rem;
  letter-spacing: 0;
}

.language-switch a[aria-current="page"] {
  background: var(--green-dark);
  color: #ffffff;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 6px;
  border: 1px solid var(--green-dark);
  background: var(--green-dark);
  color: #ffffff;
  font-weight: 760;
  text-decoration: none;
  padding: 0.7rem 1rem;
}

.button:hover {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
}

.button.secondary {
  background: transparent;
  color: var(--green-dark);
}

.button.secondary:hover {
  background: #f0f4f0;
  color: var(--red);
}

/* ==========================================================================
   Page sections
   ========================================================================== */

.hero {
  position: relative;
  min-height: 560px;
  height: calc(100svh - 116px);
  max-height: 690px;
  display: grid;
  align-items: center;
  isolation: isolate;
  overflow: clip;
  background-image: url("../img/hero-scanning-studio.jpg");
  background-image: image-set(
    url("../img/hero-scanning-studio.avif") type("image/avif"),
    url("../img/hero-scanning-studio.webp") type("image/webp"),
    url("../img/hero-scanning-studio.jpg") type("image/jpeg")
  );
  background-size: cover;
  background-position: center right;
  border-bottom: 1px solid var(--line);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(251, 251, 248, 0.64);
}

.hero-content {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 4rem 0 5rem;
}

.hero-copy {
  max-width: 640px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1rem;
  color: var(--green-dark);
  font-size: 0.92rem;
  font-weight: 780;
}

.eyebrow::before {
  content: "";
  width: 30px;
  border-top: 3px solid var(--red);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  font-weight: 780;
}

h1 {
  font-size: 3.25rem;
  max-width: 10ch;
}

h2 {
  font-size: 2.2rem;
}

h3 {
  font-size: 1.28rem;
}

p {
  margin: 0;
}

.lead {
  margin-top: 1.35rem;
  max-width: 58ch;
  color: #29342e;
  font-size: 1.17rem;
}

.hero .button-row {
  margin-top: 1.8rem;
}

.fact-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: -36px auto 0;
  padding: 0;
  list-style: none;
  width: min(1160px, calc(100% - 40px));
  position: relative;
  z-index: 2;
  background: var(--line);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.fact-strip > li {
  background: var(--surface);
  padding: 1.1rem;
}

.fact-strip strong {
  display: block;
  font-size: 1.25rem;
  line-height: 1.25;
}

.fact-strip span {
  display: block;
  color: var(--muted);
  margin-top: 0.25rem;
  font-size: 0.94rem;
}

.section {
  padding: 5.5rem 0;
}

.section.compact {
  padding-top: 3.8rem;
}

.section.tint {
  background: #f2f5f1;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-intro {
  max-width: 760px;
  margin-bottom: 2rem;
}

.section-intro p {
  color: var(--muted);
  margin-top: 0.9rem;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.service-card,
.proof-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.service-card picture,
.service-card img {
  width: 100%;
  aspect-ratio: 3 / 1;
  object-fit: cover;
}

.service-card-content,
.proof-card {
  padding: 1.25rem;
}

.service-card p {
  color: var(--muted);
  margin-top: 0.75rem;
}

.service-card ul {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--ink);
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  counter-reset: steps;
}

.proof-card {
  min-height: 190px;
}

.proof-card::before {
  counter-increment: steps;
  content: "0" counter(steps);
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--blue);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 780;
}

.proof-card p {
  color: var(--muted);
  margin-top: 0.65rem;
}

.tech-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 2rem;
  align-items: start;
}

.tech-media {
  margin: 0;
}

.tech-media picture,
.tech-media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

.tech-media figcaption {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.75rem;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
}

.spec-table th,
.spec-table td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0.95rem;
}

.spec-table th {
  width: 38%;
  color: var(--green-dark);
  font-weight: 780;
}

.spec-table tr:last-child th,
.spec-table tr:last-child td {
  border-bottom: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.gallery-grid figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.gallery-grid picture {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-grid figcaption {
  padding: 0.8rem 0.9rem 0.95rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 2rem;
  align-items: start;
}

.contact-list,
.route-list,
.legal-list {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.contact-list div,
.route-list div,
.legal-list div {
  display: grid;
  gap: 0.25rem;
}

.contact-list dt,
.route-list dt,
.legal-list dt {
  color: var(--green-dark);
  font-weight: 780;
}

.contact-list dd,
.route-list dd,
.legal-list dd {
  margin: 0;
  color: var(--muted);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.note {
  border-left: 4px solid var(--warm);
  padding: 0.95rem 0 0.95rem 1rem;
  color: var(--muted);
  margin-top: 1.5rem;
}

.map-consent {
  display: grid;
  min-height: 300px;
  margin-top: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(251, 251, 248, 0.88), rgba(251, 251, 248, 0.88)),
    image-set(
      url("../img/historische-karte-laudenburg.avif") type("image/avif"),
      url("../img/historische-karte-laudenburg.webp") type("image/webp"),
      url("../img/historische-karte-laudenburg.jpg") type("image/jpeg")
    );
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.map-consent-body {
  place-self: center;
  width: min(420px, calc(100% - 32px));
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(24, 32, 27, 0.12);
}

.map-consent-body p {
  margin: 0.65rem 0 1rem;
  color: var(--muted);
}

.map-consent iframe {
  width: 100%;
  min-height: 360px;
  border: 0;
}

/* ==========================================================================
   Footer and legal pages
   ========================================================================== */

.site-footer {
  background: #17201b;
  color: #edf2ed;
  padding: 3rem 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: start;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.75rem;
}

.footer-brand img {
  width: 42px;
  height: 42px;
  border-radius: 4px;
}

.site-footer p,
.site-footer a {
  color: #d6ded7;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: flex-end;
}

.footer-links a {
  font-weight: 700;
}

.legal-main {
  padding: 4.5rem 0 5.5rem;
}

.legal-shell {
  max-width: 860px;
}

.legal-shell h1 {
  max-width: none;
  font-size: 2.65rem;
}

.legal-section {
  padding-top: 2.25rem;
  margin-top: 2.25rem;
  border-top: 1px solid var(--line);
}

.legal-section h2 {
  font-size: 1.45rem;
  margin-bottom: 0.85rem;
}

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

.legal-section ul {
  margin: 0.9rem 0 0;
  padding-left: 1.25rem;
}

.legal-section li + li {
  margin-top: 0.35rem;
}

.muted {
  color: var(--muted);
}

/* ==========================================================================
   Responsive behavior
   ========================================================================== */

@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    display: none;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 35px rgba(24, 32, 27, 0.12);
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav {
    gap: 0;
  }

  .site-nav ul {
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
    padding: 0.8rem 0 0.2rem;
    display: grid;
    gap: 0.2rem;
  }

  .site-nav a {
    width: 100%;
  }

  .language-switch {
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
    padding: 0.45rem 0 1rem;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .language-switch a {
    width: auto;
    min-width: 48px;
    justify-content: center;
  }

  .hero {
    min-height: 540px;
    height: auto;
    background-image: url("../img/hero-scanning-studio-small.jpg");
    background-image: image-set(
      url("../img/hero-scanning-studio-small.avif") type("image/avif"),
      url("../img/hero-scanning-studio-small.webp") type("image/webp"),
      url("../img/hero-scanning-studio-small.jpg") type("image/jpeg")
    );
    background-position: center right 28%;
  }

  h1 {
    font-size: 2.65rem;
  }

  h2 {
    font-size: 1.9rem;
  }

  .fact-strip,
  .service-grid,
  .proof-grid,
  .tech-layout,
  .contact-layout {
    grid-template-columns: 1fr 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .header-shell,
  .section-inner,
  .footer-inner,
  .legal-shell,
  .hero-content,
  .fact-strip {
    width: min(100% - 28px, 1160px);
  }

  .brand-subtitle {
    display: none;
  }

  .hero {
    min-height: 500px;
    background-position: center right 38%;
  }

  .hero::before {
    background: rgba(251, 251, 248, 0.78);
  }

  .hero-content {
    padding: 4rem 0;
  }

  h1 {
    font-size: 2.25rem;
    max-width: 11ch;
  }

  h2,
  .legal-shell h1 {
    font-size: 1.75rem;
  }

  .lead {
    font-size: 1.05rem;
  }

  .section {
    padding: 4rem 0;
  }

  .fact-strip,
  .service-grid,
  .proof-grid,
  .tech-layout,
  .contact-layout,
  .gallery-grid,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .fact-strip {
    margin-top: 0;
    box-shadow: none;
    border-left: 0;
    border-right: 0;
    width: 100%;
  }

  .fact-strip > li {
    padding-left: 14px;
    padding-right: 14px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .gallery-grid figcaption {
    min-height: 2.6rem;
    padding: 0.65rem 0.7rem;
    font-size: 0.86rem;
  }

  .spec-table,
  .spec-table tbody,
  .spec-table tr,
  .spec-table th,
  .spec-table td {
    display: block;
    width: 100%;
  }

  .spec-table th {
    border-bottom: 0;
    padding-bottom: 0.25rem;
  }

  .spec-table td {
    padding-top: 0.25rem;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
