/* ============================================================
   TA Consulting GmbH — Design System
   Corporate Minimalism · Monochromatic · Flat Depth
   ============================================================ */

/* --- Reset -------------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- Custom Properties (Design Tokens) ---------------------- */
:root {
  /* Colors — Surfaces */
  --surface: #f8f9fa;
  --surface-dim: #d9dadb;
  --surface-bright: #f8f9fa;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f3f4f5;
  --surface-container: #edeeef;
  --surface-container-high: #e7e8e9;
  --surface-container-highest: #e1e3e4;
  --on-surface: #191c1d;
  --on-surface-variant: #4c4546;
  --inverse-surface: #2e3132;
  --inverse-on-surface: #f0f1f2;
  --outline: #7e7576;
  --outline-variant: #cfc4c5;
  --border-subtle: #dee2e6;
  --surface-white: #ffffff;

  /* Colors — Brand */
  --primary: #000000;
  --on-primary: #ffffff;
  --primary-container: #1b1b1b;
  --secondary: #5e5e5e;
  --on-secondary: #ffffff;
  --secondary-container: #e1dfdf;

  /* Colors — Status */
  --status-active: #28a745;
  --status-alert: #dc3545;
  --error: #ba1a1a;
  --on-error: #ffffff;
  --error-container: #ffdad6;

  /* Typography — Families */
  --font-display: 'Hanken Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Typography — Scales */
  --display-lg-size: 56px;
  --display-lg-weight: 700;
  --display-lg-lh: 64px;
  --display-lg-ls: -0.025em;

  --headline-lg-size: 32px;
  --headline-lg-weight: 600;
  --headline-lg-lh: 40px;

  --headline-lg-mobile-size: 24px;
  --headline-lg-mobile-weight: 600;
  --headline-lg-mobile-lh: 32px;

  --headline-md-size: 20px;
  --headline-md-weight: 600;
  --headline-md-lh: 28px;

  --body-lg-size: 18px;
  --body-lg-weight: 400;
  --body-lg-lh: 28px;

  --body-md-size: 16px;
  --body-md-weight: 400;
  --body-md-lh: 24px;

  --label-sm-size: 12px;
  --label-sm-weight: 600;
  --label-sm-lh: 16px;
  --label-sm-ls: 0.05em;

  /* Spacing */
  --space-base: 8px;
  --space-section: 80px;
  --space-gutter: 24px;
  --container-max: 1280px;

  /* Shapes */
  --rounded-sm: 0.125rem;
  --rounded: 0.25rem;
  --rounded-md: 0.375rem;
  --rounded-lg: 0.5rem;
  --rounded-xl: 0.75rem;
  --rounded-full: 9999px;
}

/* --- Base ---------------------------------------------------- */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--body-md-size);
  font-weight: var(--body-md-weight);
  line-height: var(--body-md-lh);
  color: var(--on-surface);
  background-color: var(--surface-white);
}

a {
  color: inherit;
  text-decoration: none;
}

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

ul, ol {
  list-style: none;
}

/* --- Typography ---------------------------------------------- */
.display-lg {
  font-family: var(--font-display);
  font-size: var(--display-lg-size);
  font-weight: var(--display-lg-weight);
  line-height: var(--display-lg-lh);
  letter-spacing: var(--display-lg-ls);
  color: var(--primary);
}

.headline-lg {
  font-family: var(--font-display);
  font-size: var(--headline-lg-size);
  font-weight: var(--headline-lg-weight);
  line-height: var(--headline-lg-lh);
  color: var(--primary);
}

.headline-md {
  font-family: var(--font-display);
  font-size: var(--headline-md-size);
  font-weight: var(--headline-md-weight);
  line-height: var(--headline-md-lh);
  color: var(--primary);
}

.body-lg {
  font-size: var(--body-lg-size);
  font-weight: var(--body-lg-weight);
  line-height: var(--body-lg-lh);
}

.body-md {
  font-size: var(--body-md-size);
  font-weight: var(--body-md-weight);
  line-height: var(--body-md-lh);
}

.label-sm {
  font-family: var(--font-body);
  font-size: var(--label-sm-size);
  font-weight: var(--label-sm-weight);
  line-height: var(--label-sm-lh);
  letter-spacing: var(--label-sm-ls);
  text-transform: uppercase;
  color: var(--secondary);
}

/* --- Layout -------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-gutter);
  padding-right: var(--space-gutter);
}

.section {
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
}

/* --- Navigation ---------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 0 var(--border-subtle);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav__logo-icon {
  width: 36px;
  height: 36px;
}

.nav__logo-text {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__link {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface);
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--primary);
  transition: width 0.25s ease;
}

.nav__link:hover::after,
.nav__link--active::after {
  width: 100%;
}

.nav__link:hover {
  color: var(--primary);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Mobile menu toggle */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.nav__toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--primary);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* --- Buttons ------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 12px 24px;
  border-radius: var(--rounded);
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease,
              color 0.2s ease,
              border-color 0.2s ease,
              transform 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

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

.btn--primary:hover {
  background-color: var(--primary-container);
}

.btn--secondary {
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn--secondary:hover {
  background-color: var(--primary);
  color: var(--on-primary);
}

.btn--tertiary {
  background-color: transparent;
  color: var(--primary);
  padding: 12px 0;
  position: relative;
}

.btn--tertiary::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--primary);
  transition: width 0.25s ease;
}

.btn--tertiary:hover::after {
  width: 100%;
}

/* --- Hero ---------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  min-height: calc(100svh - 72px);
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  padding: 96px 0;
  background-color: var(--surface-white);
}

/* Radial gradient glow */
.hero::after {
  content: '';
  position: absolute;
  z-index: -2;
  top: 50%;
  left: 50%;
  width: min(90vw, 1100px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 0, 0, 0.018) 0%, transparent 65%);
  pointer-events: none;
}

/* Hexagonal background container */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* Interactive hexagonal grid canvas — faded in the centre so the headline stays legible */
.hero__hexgrid {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 900ms ease;
  -webkit-mask-image: radial-gradient(ellipse 92% 88% at 50% 50%,
    rgba(0, 0, 0, 0.08) 0%,
    rgba(0, 0, 0, 0.08) 24%,
    rgba(0, 0, 0, 0.55) 42%,
    #000 60%,
    #000 74%,
    transparent 100%);
  mask-image: radial-gradient(ellipse 92% 88% at 50% 50%,
    rgba(0, 0, 0, 0.08) 0%,
    rgba(0, 0, 0, 0.08) 24%,
    rgba(0, 0, 0, 0.55) 42%,
    #000 60%,
    #000 74%,
    transparent 100%);
}

.hero__hexgrid--ready {
  opacity: 1;
}

.hero__grid {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr;
  align-items: center;
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 44px;
  gap: 32px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero__title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-display);
  font-size: var(--display-lg-size);
  font-weight: var(--display-lg-weight);
  line-height: var(--display-lg-lh);
  letter-spacing: var(--display-lg-ls);
  color: var(--primary);
}

.hero__title-brand {
  color: var(--secondary);
  font-family: var(--font-body);
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.hero__title-focus {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
}

.hero__title-outlook {
  color: var(--on-surface-variant);
  font-family: var(--font-display);
  font-size: 0.85em;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-top: 2px;
}

.hero__description {
  font-size: var(--body-lg-size);
  line-height: var(--body-lg-lh);
  color: var(--secondary);
  max-width: 600px;
  text-align: center;
}

.service-stories {
  display: flex;
  flex-direction: column;
}

.service-stories > #digitalisierung {
  order: 1;
}

.service-stories > #individualsoftware {
  order: 2;
}

/* --- Individual Software / Scroll Story --------------------- */
.custom-software-scroll {
  position: relative;
  height: 340vh;
  background: var(--surface-container-low);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

/* Digitalisation — clean canvas, no window chrome */
.custom-software-scroll--digitalisation {
  background: #fcfcfc;
}

/* Canvas without container chrome */
.custom-software-scroll--digitalisation .custom-software-scroll__stage {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.custom-software-scroll--digitalisation .custom-software-scroll__stage-glow {
  display: none;
}

.custom-software-scroll__sticky {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  min-height: 620px;
  overflow: hidden;
}

.custom-software-scroll__container {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  row-gap: clamp(16px, 3vh, 36px);
  align-items: center;
  padding-top: clamp(24px, 4vh, 56px);
  padding-bottom: clamp(24px, 4vh, 56px);
}

.custom-software-scroll__intro {
  grid-column: 1 / -1;
  align-self: start;
  max-width: 640px;
  z-index: 2;
  transition: opacity 180ms linear, transform 180ms linear;
}

.custom-software-scroll__eyebrow,
.custom-software-scroll__points-label {
  color: var(--secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 16px;
  text-transform: uppercase;
}

.custom-software-scroll__intro h2 {
  max-width: 600px;
  margin-top: 8px;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.custom-software-scroll__intro > p:last-child {
  max-width: 500px;
  margin-top: 14px;
  color: var(--secondary);
  font-size: 16px;
  line-height: 24px;
}

.custom-software-scroll__stage {
  --custom-stage-opacity: 0;
  --custom-stage-scale: 0.965;
  position: relative;
  z-index: 1;
  justify-self: center;
  align-self: center;
  width: auto;
  height: 100%;
  max-width: 100%;
  min-height: 0;
  aspect-ratio: 1280 / 724;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--rounded-xl);
  background: var(--surface-white);
  box-shadow: 0 8px 24px rgba(25, 28, 29, 0.06), 0 32px 80px rgba(25, 28, 29, 0.08);
  opacity: var(--custom-stage-opacity);
  transform: scale(var(--custom-stage-scale));
  transform-origin: center center;
  transition: opacity 180ms linear, transform 180ms linear;
}

.custom-software-scroll__stage-bar {
  display: none;
}

.custom-software-scroll__stage-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.custom-software-scroll__stage-status {
  margin-left: auto;
  color: var(--status-active);
}

.custom-software-scroll__fallback,
.custom-software-scroll__stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.custom-software-scroll__fallback {
  position: absolute;
  inset: 0;
  opacity: 1;
}

.custom-software-scroll__stage canvas {
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity 400ms ease;
}

.custom-software-scroll__stage canvas.custom-software-canvas--loaded {
  opacity: 1;
}

.custom-software-scroll__stage-glow {
  position: absolute;
  right: -12%;
  bottom: -28%;
  width: 52%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  filter: blur(32px);
  pointer-events: none;
}

.custom-software-scroll__points-wrap {
  align-self: end;
}

.custom-software-scroll__points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.custom-software-point {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-content: start;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  opacity: 0.32;
  transition: opacity 220ms ease, border-color 220ms ease;
}

.custom-software-point:first-child {
  padding-left: 0;
}

.custom-software-point:last-child {
  padding-right: 0;
  border-right: none;
}

.custom-software-point[data-state='past'] {
  opacity: 0.58;
}

.custom-software-point[data-state='future'] {
  opacity: 0.2;
}

.custom-software-point[data-state='active'] {
  opacity: 1;
  border-bottom-color: var(--primary);
}

.custom-software-point__number {
  color: var(--secondary);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  line-height: 24px;
}

.custom-software-point[data-state='active'] .custom-software-point__number {
  color: var(--primary);
}

.custom-software-point h3 {
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.custom-software-point p {
  margin-top: 4px;
  color: var(--secondary);
  font-size: 14px;
  line-height: 21px;
}

.custom-software-scroll__progress {
  height: 2px;
  margin-top: 24px;
  overflow: hidden;
  background: var(--border-subtle);
  opacity: 1;
  transition: opacity 320ms ease, visibility 0s linear 0s;
}

.custom-software-scroll__progress--complete {
  opacity: 0;
  visibility: hidden;
  transition: opacity 320ms ease, visibility 0s linear 320ms;
}

.custom-software-scroll__progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left center;
}

.custom-software-scroll__screen-reader-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

[data-theme='dark'] .custom-software-scroll--digitalisation {
  background: var(--surface-white);
}

[data-theme='dark'] .custom-software-scroll__stage {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 32px 80px rgba(0, 0, 0, 0.28);
}

[data-theme='dark'] .custom-software-scroll__stage-glow {
  background: rgba(255, 255, 255, 0.07);
}

/* --- Services / Kernkompetenzen ----------------------------- */
.services {
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
}

.services__header {
  margin-bottom: 48px;
}

.services__title {
  font-family: var(--font-display);
  font-size: var(--headline-lg-size);
  font-weight: var(--headline-lg-weight);
  line-height: var(--headline-lg-lh);
  color: var(--primary);
  margin-bottom: 16px;
}

.services__subtitle {
  font-size: var(--body-lg-size);
  line-height: var(--body-lg-lh);
  color: var(--secondary);
  max-width: 640px;
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-gutter);
}

.service-card {
  background-color: var(--surface-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--rounded-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.service-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.service-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--rounded);
  color: var(--primary);
  flex-shrink: 0;
}

.service-card__icon svg {
  width: 22px;
  height: 22px;
}

.service-card__title {
  font-family: var(--font-display);
  font-size: var(--headline-md-size);
  font-weight: var(--headline-md-weight);
  line-height: var(--headline-md-lh);
  color: var(--primary);
}

.service-card__description {
  font-size: var(--body-md-size);
  line-height: var(--body-md-lh);
  color: var(--secondary);
}

/* --- Page Header (Impressum / Datenschutz) ------------------- */
.page-header {
  padding-top: 56px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-subtle);
}

.page-header__title {
  font-family: var(--font-display);
  font-size: var(--display-lg-size);
  font-weight: var(--display-lg-weight);
  line-height: var(--display-lg-lh);
  letter-spacing: var(--display-lg-ls);
  color: var(--primary);
  margin-bottom: 16px;
}

.page-header__subtitle {
  font-size: var(--body-lg-size);
  line-height: var(--body-lg-lh);
  color: var(--secondary);
  max-width: 640px;
}

/* --- Not Found Page ----------------------------------------- */
.not-found-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.not-found-page main {
  flex: 1;
  display: flex;
}

.not-found {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: calc(100svh - 72px - 97px);
  padding: 96px 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(0, 0, 0, 0.06), transparent 34%),
    var(--surface-white);
}

.not-found__content {
  max-width: 720px;
}

.not-found__code {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: clamp(96px, 18vw, 220px);
  font-weight: 700;
  line-height: 0.82;
  letter-spacing: -0.08em;
  color: var(--border-subtle);
}

.not-found__title {
  max-width: 680px;
  margin-bottom: 20px;
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--primary);
}

.not-found__copy {
  max-width: 560px;
  margin-bottom: 32px;
  font-size: var(--body-lg-size);
  line-height: var(--body-lg-lh);
  color: var(--secondary);
}

.not-found__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* --- Legal Sections (Impressum) ------------------------------ */
.legal {
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
}

.legal__grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

.legal-card {
  background-color: var(--surface-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--rounded-lg);
  padding: 32px;
}

.legal-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.legal-card__header svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
  flex-shrink: 0;
}

.legal-card__header h2 {
  font-family: var(--font-display);
  font-size: var(--headline-md-size);
  font-weight: var(--headline-md-weight);
  line-height: var(--headline-md-lh);
  color: var(--primary);
}

.legal-card__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.legal-card__group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legal-card__columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.legal-card__label {
  font-size: var(--label-sm-size);
  font-weight: var(--label-sm-weight);
  line-height: var(--label-sm-lh);
  letter-spacing: var(--label-sm-ls);
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 8px;
}

.legal-card__value {
  font-size: var(--body-md-size);
  line-height: var(--body-md-lh);
  color: var(--on-surface);
}

.legal-card__value strong {
  font-weight: 600;
}

.legal-card__value a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s ease;
}

.legal-card__value a:hover {
  opacity: 0.7;
}

/* Contact variant */
.legal-card--contact {
  background-color: var(--surface);
  border-color: transparent;
}

.legal-card--contact .legal-card__header {
  border-bottom-color: var(--surface-dim);
}

/* Legal row (Registereintrag, Identifikationsnummern) */
.legal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.legal-info {
  padding-top: 32px;
}

.legal-info__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.legal-info__header svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
  flex-shrink: 0;
}

.legal-info__header h2 {
  font-family: var(--font-display);
  font-size: var(--headline-md-size);
  font-weight: var(--headline-md-weight);
  line-height: var(--headline-md-lh);
  color: var(--primary);
}

.legal-info__table {
  width: 100%;
}

.legal-info__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.legal-info__row:last-child {
  border-bottom: none;
}

.legal-info__key {
  font-size: var(--body-md-size);
  color: var(--secondary);
}

.legal-info__val {
  font-size: var(--body-md-size);
  font-weight: 600;
  color: var(--on-surface);
}

.legal-info__badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 6px 16px;
  background-color: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--rounded);
  color: var(--on-surface);
}

/* --- Privacy / Datenschutz ----------------------------------- */
.privacy {
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
}

.privacy__section {
  margin-bottom: 48px;
}

.privacy__section:last-child {
  margin-bottom: 0;
}

.privacy__section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.privacy__section-header svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
  flex-shrink: 0;
}

.privacy__section-header h2 {
  font-family: var(--font-display);
  font-size: var(--headline-lg-size);
  font-weight: var(--headline-lg-weight);
  line-height: var(--headline-lg-lh);
  color: var(--primary);
}

.privacy__block {
  margin-bottom: 32px;
}

.privacy__block:last-child {
  margin-bottom: 0;
}

.privacy__block-title {
  font-family: var(--font-display);
  font-size: var(--headline-md-size);
  font-weight: var(--headline-md-weight);
  line-height: var(--headline-md-lh);
  color: var(--primary);
  margin-bottom: 12px;
}

.privacy__block p {
  font-size: var(--body-md-size);
  line-height: var(--body-md-lh);
  color: var(--on-surface);
  margin-bottom: 12px;
}

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

.privacy__block strong {
  font-weight: 600;
}

.privacy__callout {
  background-color: var(--surface);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--rounded) var(--rounded) 0;
  padding: 24px 28px;
  margin-top: 16px;
  margin-bottom: 16px;
}

.privacy__callout p {
  margin-bottom: 8px;
}

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

.privacy__sub-title {
  font-family: var(--font-body);
  font-size: var(--body-md-size);
  font-weight: 600;
  line-height: var(--body-md-lh);
  color: var(--primary);
  margin-bottom: 8px;
}

/* --- Call to Action ------------------------------------------ */
.cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: 80px 0;
  background-color: var(--surface-white);
  border-top: 1px solid var(--border-subtle);
}

.cta__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  text-align: center;
}

.cta__title {
  max-width: 760px;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.cta__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.cta__actions .btn {
  padding: 18px 40px;
  font-size: 15px;
}

/* --- Footer -------------------------------------------------- */
.footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border-subtle);
  padding: 32px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer__brand-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}

.footer__brand-copy {
  font-size: 13px;
  color: var(--secondary);
}

.footer__links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer__link {
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer__link:hover {
  color: var(--primary);
}

.footer__link--active {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- Screen Reader Only -------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Focus & Accessibility ----------------------------------- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--rounded-sm);
}

/* Skip-to-content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 200;
  padding: 12px 20px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--rounded);
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 8px;
}

/* --- Scroll Reveal Animation --------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* Staggered child reveals */
.reveal-item {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--reveal-delay, 0) * 130ms + 200ms);
}

.reveal--visible .reveal-item {
  opacity: 1;
  transform: translateY(0);
}

/* --- Mobile Nav Overlay -------------------------------------- */
.nav__overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 64px;
  background: rgba(0, 0, 0, 0.3);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav__overlay--visible {
  display: block;
  opacity: 1;
}

/* Hamburger → X animation */
.nav__toggle--active .nav__toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle--active .nav__toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav__toggle--active .nav__toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Responsive ---------------------------------------------- */

/* Tablet (≤ 900px) */
@media (max-width: 900px) {
  :root {
    --space-section: 48px;
    --space-gutter: 20px;
  }

  .hero {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero__title {
    font-size: 36px;
    line-height: 44px;
  }

  .hero__visual {
    max-height: 280px;
  }

  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .custom-software-scroll {
    height: 310vh;
  }

  .custom-software-scroll__sticky {
    top: 56px;
    height: calc(100vh - 56px);
    min-height: 640px;
  }

  .custom-software-scroll__container {
    row-gap: 20px;
  }

  .custom-software-point {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    padding: 16px 20px;
  }

  .custom-software-scroll__intro h2 {
    font-size: 36px;
  }

  .legal__grid {
    grid-template-columns: 1fr;
  }

  .legal__row {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .legal-card__columns {
    grid-template-columns: 1fr;
  }

  .page-header__title {
    font-size: 36px;
    line-height: 44px;
  }
}

/* Mobile (≤ 600px) */
@media (max-width: 600px) {
  :root {
    --space-section: 32px;
    --space-gutter: 16px;
  }

  /* Nav mobile */
  .nav__inner {
    height: 56px;
  }

  .nav__links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--surface-white);
    border-bottom: 1px solid var(--border-subtle);
    padding: 20px var(--space-gutter);
    gap: 4px;
    z-index: 95;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  }

  .nav__links--open {
    display: flex;
  }

  .nav__link {
    display: block;
    padding: 14px 0;
    font-size: 16px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .nav__link:last-child {
    border-bottom: none;
  }

  .nav__link::after {
    display: none;
  }

  .nav__toggle {
    display: flex;
  }

  .nav__overlay {
    top: 56px;
  }

  .nav__actions .btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .nav__logo-text {
    font-size: 13px;
    letter-spacing: 0.08em;
  }

  /* Hero mobile */
  .hero {
    min-height: calc(100svh - 56px);
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .hero__content {
    padding: 0 24px;
    gap: 24px;
  }

  .hero__title {
    font-size: 34px;
    line-height: 42px;
    letter-spacing: -0.01em;
  }

  .hero__description {
    font-size: 15px;
    line-height: 24px;
  }

  .hero__visual {
    max-height: 200px;
    aspect-ratio: 16 / 9;
  }

  .hero__visual-logo span {
    font-size: 16px;
    letter-spacing: 0.1em;
  }

  .hero__visual-logo svg {
    width: 48px;
    height: 48px;
  }

  /* Individual software scroll story mobile */
  .custom-software-scroll {
    height: 285vh;
  }

  .custom-software-scroll__sticky {
    top: 56px;
    height: calc(100vh - 56px);
    min-height: 650px;
  }

  .custom-software-scroll__container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 18px;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .custom-software-scroll__intro {
    flex: 0 0 auto;
  }

  .custom-software-scroll__intro h2 {
    font-size: 28px;
    line-height: 1.12;
  }

  .custom-software-scroll__intro > p:last-child {
    margin-top: 10px;
    font-size: 14px;
    line-height: 21px;
  }

  .custom-software-scroll__stage {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    max-height: 42vh;
  }

  .custom-software-scroll__points-wrap {
    flex: 0 0 auto;
  }

  .custom-software-scroll__points {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 10px;
  }

  .custom-software-point {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    padding: 13px 0;
    border-right: none;
  }

  .custom-software-point:first-child,
  .custom-software-point:last-child {
    padding-left: 0;
    padding-right: 0;
  }

  .custom-software-point h3 {
    font-size: 17px;
    line-height: 23px;
  }

  .custom-software-point p {
    display: block;
    font-size: 13px;
    line-height: 19px;
  }

  .custom-software-scroll__progress {
    margin-top: 14px;
  }

  /* Services mobile */
  .services__grid {
    grid-template-columns: 1fr;
  }

  .services__title {
    font-size: var(--headline-lg-mobile-size);
    line-height: var(--headline-lg-mobile-lh);
  }

  .services__subtitle {
    font-size: 15px;
  }

  .service-card {
    padding: 24px 20px;
  }

  /* Page header mobile */
  .page-header {
    padding-top: 32px;
    padding-bottom: 24px;
  }

  .page-header__title {
    font-size: 28px;
    line-height: 36px;
    letter-spacing: -0.01em;
  }

  .page-header__subtitle {
    font-size: 15px;
    line-height: 22px;
  }

  /* Legal mobile */
  .legal-card {
    padding: 24px 20px;
  }

  .legal-info__row {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }

  /* Privacy mobile */
  .privacy__section-header h2 {
    font-size: var(--headline-lg-mobile-size);
    line-height: var(--headline-lg-mobile-lh);
  }

  .privacy__block-title {
    font-size: 18px;
  }

  .privacy__callout {
    padding: 20px;
  }

  .privacy__block p,
  .privacy__sub-title {
    font-size: 15px;
    line-height: 23px;
  }

  /* Footer mobile */
  .footer {
    padding: 28px 0;
  }

  .cta {
    min-height: 100svh;
    padding: 64px 0;
  }

  .cta__inner {
    gap: 28px;
  }

  .cta__actions {
    width: 100%;
  }

  .cta__actions .btn {
    width: 100%;
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .footer__links {
    flex-wrap: wrap;
    gap: 16px;
  }

  /* Buttons: ensure 48px min touch target */
  .btn {
    min-height: 48px;
    padding: 14px 24px;
  }
}

/* Small phones (≤ 375px) */
@media (max-width: 375px) {
  :root {
    --space-gutter: 12px;
  }

  .hero__title {
    font-size: 28px;
    line-height: 36px;
  }

  .page-header__title {
    font-size: 24px;
    line-height: 32px;
  }

  .nav__logo-text {
    font-size: 12px;
  }

  .nav__actions .btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .service-card {
    padding: 20px 16px;
  }

  .legal-card {
    padding: 20px 16px;
  }

  .footer__links {
    gap: 12px;
  }
}

/* --- Reduced Motion ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .reveal-item {
    opacity: 1;
    transform: none;
  }
}

/* --- Print --------------------------------------------------- */
@media print {
  .nav,
  .nav__overlay,
  .footer__links {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .hero__visual {
    display: none;
  }

  .service-card,
  .legal-card {
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 10pt;
    color: #666;
  }

  .footer {
    border-top: 1px solid #ccc;
    background: none;
  }
}

/* --- Logo Images --------------------------------------------- */
.nav__logo-img {
  height: 28px;
  width: auto;
  display: block;
}

.nav__logo-img--dark {
  display: none;
}

.hero__visual-logo-img {
  max-height: 64px;
  width: auto;
  opacity: 0.5;
}

.hero__visual-logo-img--dark {
  display: none;
}

/* --- Theme Toggle -------------------------------------------- */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--rounded);
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--primary);
  background-color: var(--surface);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle__icon--moon {
  display: block;
}

.theme-toggle__icon--sun {
  display: none;
}

/* --- Dark Mode ----------------------------------------------- */
[data-theme="dark"] {
  --surface: #141516;
  --surface-dim: #2a2b2c;
  --surface-bright: #1e1f20;
  --surface-container-lowest: #0f1011;
  --surface-container-low: #1a1b1c;
  --surface-container: #1e1f20;
  --surface-container-high: #252627;
  --surface-container-highest: #2d2e2f;
  --on-surface: #e2e3e4;
  --on-surface-variant: #b0a9aa;
  --inverse-surface: #e2e3e4;
  --inverse-on-surface: #2e3132;
  --outline: #9a9192;
  --outline-variant: #4a4142;
  --border-subtle: #333536;
  --surface-white: #111213;
  --primary: #ffffff;
  --on-primary: #000000;
  --primary-container: #d0d0d0;
  --secondary: #a0a0a0;
  --on-secondary: #000000;
  --secondary-container: #3a3838;
  --error: #ffb4ab;
  --on-error: #690005;
  --error-container: #93000a;
  --on-error-container: #ffdad6;
  --background: #111213;
  --on-background: #e2e3e4;
  --surface-variant: #333536;
  --status-active: #4ade80;
  --status-alert: #f87171;
}

[data-theme="dark"] body {
  background-color: var(--surface-white);
  color: var(--on-surface);
}

[data-theme="dark"] .hero::after {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.015) 0%, transparent 65%);
}

/* Logo swap */
[data-theme="dark"] .nav__logo-img--light {
  display: none;
}

[data-theme="dark"] .nav__logo-img--dark {
  display: block;
}

[data-theme="dark"] .hero__visual-logo-img--light {
  display: none;
}

[data-theme="dark"] .hero__visual-logo-img--dark {
  display: block;
}

/* Toggle icon swap */
[data-theme="dark"] .theme-toggle__icon--moon {
  display: none;
}

[data-theme="dark"] .theme-toggle__icon--sun {
  display: block;
}

/* Dark nav */
[data-theme="dark"] .nav {
  background-color: rgba(17, 18, 19, 0.85);
  border-bottom-color: transparent;
  box-shadow: 0 1px 0 var(--border-subtle);
}

/* Dark hero visual */
[data-theme="dark"] .hero__visual {
  background-color: var(--surface-container);
  border-color: var(--border-subtle);
}

/* Dark cards */
[data-theme="dark"] .service-card {
  background-color: var(--surface-container-low);
  border-color: var(--border-subtle);
}

[data-theme="dark"] .service-card:hover {
  border-color: var(--outline);
}

[data-theme="dark"] .service-card__icon {
  border-color: var(--border-subtle);
}

/* Dark legal cards */
[data-theme="dark"] .legal-card {
  background-color: var(--surface-container-low);
  border-color: var(--border-subtle);
}

[data-theme="dark"] .legal-card--contact {
  background-color: var(--surface-container);
  border-color: transparent;
}

/* Dark callout */
[data-theme="dark"] .privacy__callout {
  background-color: var(--surface-container);
  border-left-color: var(--outline);
}

/* Dark page header */
[data-theme="dark"] .page-header {
  border-bottom-color: var(--border-subtle);
}

/* Dark privacy section header */
[data-theme="dark"] .privacy__section-header {
  border-bottom-color: var(--border-subtle);
}

/* Dark footer */
[data-theme="dark"] .footer {
  background-color: var(--surface-container-lowest);
  border-top-color: var(--border-subtle);
}

/* Dark legal info */
[data-theme="dark"] .legal-info__row {
  border-bottom-color: var(--border-subtle);
}

[data-theme="dark"] .legal-info__badge {
  background-color: var(--surface-container);
  border-color: var(--border-subtle);
}

/* Dark buttons */
[data-theme="dark"] .btn--primary {
  background-color: var(--on-surface);
  color: var(--surface-white);
}

[data-theme="dark"] .btn--primary:hover {
  background-color: #c8c9ca;
}

[data-theme="dark"] .btn--secondary {
  border-color: var(--on-surface);
  color: var(--on-surface);
}

[data-theme="dark"] .btn--secondary:hover {
  background-color: var(--on-surface);
  color: var(--surface-white);
}

/* Dark links */
[data-theme="dark"] .privacy__callout a {
  color: var(--on-surface);
}

[data-theme="dark"] .legal-card__value a {
  color: var(--on-surface);
}

/* Dark print override — force light for printing */
@media print {
  [data-theme="dark"] body {
    background: #fff;
    color: #000;
  }
}
