/* ========================================
   CSS Custom Properties
   ======================================== */
:root {
  --c-accent: #A0603A;
  --c-accent-light: #C17A4A;
  --c-accent-dark: #875030;
  --c-accent-subtle: rgba(160,96,58,0.1);
  --c-accent-glow: rgba(160,96,58,0.2);

  --c-bg: #FAFAF8;
  --c-bg-alt: #EBE8E2;
  --c-bg-card: #FFFFFF;
  --c-text: #1A1A18;
  --c-text-secondary: #5C5C58;
  --c-text-muted: #706F6A;
  --c-border: #C0BDB3;
  --c-divider: #E8E6E0;

  --c-avatar-bg: #EDE3D8;

  --font-sans: 'Segoe UI',system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
  --font-serif: Georgia,'Times New Roman',serif;

  --fs-xs: clamp(0.75rem,0.7rem + 0.25vw,0.8125rem);
  --fs-sm: clamp(0.8125rem,0.775rem + 0.25vw,0.9375rem);
  --fs-base: clamp(0.9375rem,0.9rem + 0.25vw,1.0625rem);
  --fs-lg: clamp(1.125rem,1rem + 0.5vw,1.3125rem);
  --fs-xl: clamp(1.5rem,1.25rem + 1vw,2rem);
  --fs-2xl: clamp(2rem,1.5rem + 2vw,3rem);
  --fs-3xl: clamp(2.75rem,2rem + 3vw,4.25rem);

  --ease-out: cubic-bezier(0.16,1,0.3,1);
  --ease-in-out: cubic-bezier(0.65,0,0.35,1);

  --max-w: 72rem;
  --section-py: clamp(4rem,8vw,7rem);
  --radius: 0.75rem;

  color-scheme: light dark;
}

[data-theme="dark"] {
  --c-bg: #141413;
  --c-bg-alt: #1C1C1A;
  --c-bg-card: #222220;
  --c-text: #EDEDEB;
  --c-text-secondary: #A8A8A3;
  --c-text-muted: #8A8A85;
  --c-border: #333330;
  --c-divider: #2A2A28;
  --c-accent: #DCA070;
  --c-accent-light: #E8BB94;
  --c-accent-dark: #C17A4A;
  --c-accent-subtle: rgba(220,160,112,0.1);
  --c-accent-glow: rgba(220,160,112,0.15);
  --c-avatar-bg: #2A2520;
}

/* ========================================
   Language Toggle (CSS-driven)
   ======================================== */
[data-lang="de"] [data-i18n="en"] { display: none; }
[data-lang="en"] [data-i18n="de"] { display: none; }

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,svg { display: block; max-width: 100%; }
a { color: var(--c-accent); text-decoration: none; }

::selection {
  background: var(--c-accent);
  color: #fff;
}

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

/* ========================================
   Visually Hidden (Accessibility)
   ======================================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========================================
   Text Link (reusable underline animation)
   ======================================== */
.text-link {
  position: relative;
  display: inline-block;
  font-weight: normal;
}
.text-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}
.text-link:hover::after,
.hero-cert-inner:hover .text-link::after {
  transform: scaleX(1);
}

/* ========================================
   Layout
   ======================================== */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem,4vw,2.5rem);
}

section {
  padding: var(--section-py) 0;
}

.bg-alt { background: var(--c-bg-alt); }

/* ========================================
   Navigation
   ======================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--c-bg) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-divider);
  height: 4rem;
}

.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  color: var(--c-accent);
  display: inline-flex;
  align-items: center;
}
.nav-logo-mark {
  /* logo.svg used as mask so the signet takes the accent color; fixed integer size keeps it on the pixel grid */
  display: block;
  height: 39px;
  width: 39px;
  background-color: currentColor;
  -webkit-mask: url("/logo.svg?t=1791900734") center / contain no-repeat;
  mask: url("/logo.svg?t=1791900734") center / contain no-repeat;
}
/* Hover fill in the text color (black/white), revealed as a circle; clipped to the signet by the mask.
   Only the radius (--signet-r) transitions, so the origin jumps straight to the pointer position. */
@property --signet-r {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}
.nav-logo-mark::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: var(--c-text);
  --signet-r: 0%;
  clip-path: circle(var(--signet-r) at var(--cx, 50%) var(--cy, 50%));
  transition: --signet-r 0.55s cubic-bezier(0.33,1,0.68,1);
}
.nav-logo:hover .nav-logo-mark::after,
.nav-logo:focus-visible .nav-logo-mark::after {
  --signet-r: 150%;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--c-border);
  color: var(--c-text-secondary);
  cursor: pointer;
  border-radius: 999px;
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: 600;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.nav-btn:hover {
  color: var(--c-accent);
  border-color: var(--c-accent);
}

.lang-toggle {
  padding: 0.3rem 0.75rem;
  gap: 0.25rem;
}

.lang-toggle .lang-opt {
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.lang-toggle .lang-opt.active {
  color: var(--c-accent);
}

.lang-sep {
  color: var(--c-text-muted);
  margin: 0 0.1rem;
}

.theme-toggle {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
}

.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
  transition: transform 0.4s var(--ease-out);
}

.theme-toggle:hover svg {
  transform: rotate(30deg);
}

.icon-sun, .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: block; }

/* ========================================
   Hero
   ======================================== */
.hero {
  min-height: calc(100svh - 4rem);
  display: flex;
  align-items: center;
  padding: clamp(2rem,6vw,4rem) 0;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem,5vw,4rem);
  align-items: center;
  width: 100%;
}

.hero-text {
  order: 1;
}

.hero-label {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-accent);
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: var(--fs-3xl);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--c-text);
  margin-bottom: 0.5rem;
}
.hero-former-name {
  color: var(--c-text-muted);
  text-decoration: none;
  position: relative;
  display: inline-block;
}
.hero-former-name::after {
  content: '';
  position: absolute;
  left: -0.04em;
  right: -0.04em;
  top: 55%;
  height: 0.06em;
  background: currentColor;
  transform-origin: left;
}

.hero-former {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--fs-lg);
  color: var(--c-text-secondary);
  font-weight: 500;
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.hero-services {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hero-services li {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.3;
}

.hero-divider {
  width: clamp(3rem,20%,6rem);
  height: 2px;
  background: var(--c-accent);
  margin: 1.5rem 0;
  border: none;
}

.hero-social {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.hero-email {
  font-size: var(--fs-sm);
}

.hero-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--fs-sm);
}

.hero-linkedin-icon {
  width: 1.1em;
  height: 1.1em;
}

.hero-visual {
  order: 2;
  display: flex;
  justify-content: center;
  align-items: center;
}

.avatar-container {
  width: clamp(440px,36vw,540px);
  /* No overflow clipping: the portrait is transparent and floats a few pixels beyond its box */
  position: relative;
  /* Cursor parallax (values -1..1 set by main.js); uses `translate` so it composes with transform animations */
  translate: calc(var(--px, 0) * 10px) calc(var(--py, 0) * 8px);
}

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

/* ========================================
   About Section
   ======================================== */
.about-content {
  max-width: 42rem;
}

.section-heading {
  font-family: var(--font-serif);
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  line-height: 1.15;
}

.section-heading .accent {
  color: var(--c-accent);
}

.about-content p {
  color: var(--c-text-secondary);
  font-size: var(--fs-base);
  line-height: 1.75;
  margin-bottom: 1rem;
}

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

/* ========================================
   Services
   ======================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}

.service-card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), border-color 0.25s;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  border-color: var(--c-accent);
}

[data-theme="dark"] .service-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.service-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--c-accent);
  margin-bottom: 1rem;
}

.service-card h3 {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.service-card p {
  color: var(--c-text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

/* ========================================
   Tech Stack
   ======================================== */
.tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 2rem;
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-text-secondary);
  transition: transform 0.2s var(--ease-out), color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.tech-badge:hover {
  transform: scale(1.06);
  color: var(--c-accent);
  border-color: var(--c-accent);
}

/* ========================================
   Contact
   ======================================== */
.contact {
  text-align: center;
}

.contact-email {
  display: inline-block;
  transform: translate(var(--tx,0px), var(--ty,0px));
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--c-accent);
  letter-spacing: -0.01em;
  position: relative;
  margin-top: 1rem;
  transition: color 0.2s, transform 0.35s var(--ease-out);
}

.contact-email::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--c-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}

.contact-email:hover::after {
  transform: scaleX(1);
}

.contact p {
  color: var(--c-text-secondary);
  max-width: 28rem;
  margin: 0 auto;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  border-top: 1px solid var(--c-divider);
  padding: 2rem 0;
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

.footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  color: var(--c-text-muted);
}

.footer-links a:hover {
  color: var(--c-accent);
}

/* ========================================
   Certification
   ======================================== */
.hero-cert {
  margin-top: 1rem;
}
.hero-cert-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.hero-cert-badge {
  height: 6rem;
  width: auto;
}
.hero-cert-label {
  font-size: var(--fs-sm);
}

.cert-content {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  max-width: 42rem;
}
.cert-badge {
  flex-shrink: 0;
  width: clamp(5rem, 10vw, 7rem);
  height: auto;
}
.cert-text p {
  color: var(--c-text-secondary);
  font-size: var(--fs-base);
  line-height: 1.75;
  margin-bottom: 1rem;
}
.cert-link {
  font-size: var(--fs-sm);
}

/* ========================================
   FAQ
   ======================================== */
.faq-list {
  max-width: 42rem;
  margin-top: 2rem;
}
.faq-item {
  border-bottom: 1px solid var(--c-divider);
  padding: 1.25rem 0;
}
.faq-item summary {
  font-size: var(--fs-lg);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--c-text);
  transition: color 0.2s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--c-accent);
  flex-shrink: 0;
  margin-left: 1rem;
  transition: transform 0.3s var(--ease-out);
}
.faq-item[open] summary::after {
  content: '\2212';
}
.faq-item summary:hover,
.faq-item[open] summary { color: var(--c-accent); }
.faq-item p {
  color: var(--c-text-secondary);
  font-size: var(--fs-base);
  line-height: 1.75;
  margin-top: 0.75rem;
  padding-right: 2rem;
  overflow: hidden;
}

/* ========================================
   Scroll Reveal
   ======================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

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

/* stagger delays for grid children */
.reveal-stagger > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger > *:nth-child(6) { transition-delay: 400ms; }

/* ========================================
   Motion (progressive enhancement, native APIs only)
   ======================================== */

/* Scroll progress bar under the nav (scroll-driven animation, no JS) */
@supports (animation-timeline: scroll()) {
  .nav::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--c-accent);
    transform-origin: left;
    transform: scaleX(0);
    animation: progress linear both;
    animation-timeline: scroll(root block);
  }
  @keyframes progress { to { transform: scaleX(1); } }
}

/* Service cards: cursor spotlight + glowing border */
.service-card {
  position: relative;
  isolation: isolate;
}
.service-card::before,
.service-card::after {
  content: '';
  position: absolute;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}
.service-card::before {
  inset: 0;
  z-index: -1;
  background: radial-gradient(22rem circle at var(--mx,50%) var(--my,50%), var(--c-accent-subtle), transparent 65%);
}
.service-card::after {
  inset: -1px;
  padding: 1px;
  background: radial-gradient(16rem circle at var(--mx,50%) var(--my,50%), var(--c-accent), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.service-card:hover::before,
.service-card:hover::after { opacity: 1; }
.service-icon { transition: transform 0.4s var(--ease-out); }
.service-card:hover .service-icon { transform: translateY(-2px) scale(1.08); }

/* Revealed stagger items react to hover without delay */
.reveal-stagger > .reveal.revealed { transition-delay: 0ms; }

/* Accent words in headings get an underline that draws in on reveal */
.section-heading .accent {
  background: linear-gradient(currentColor, currentColor) left bottom / 0% 2px no-repeat;
  padding-bottom: 0.05em;
  transition: background-size 0.8s var(--ease-out) 0.25s;
}
.reveal.visible .section-heading .accent,
.section-heading.reveal.visible .accent {
  background-size: 100% 2px;
}

@media (prefers-reduced-motion: no-preference) {

  /* Cross-document transitions between pages (Chrome/Edge/Safari) */
  @view-transition { navigation: auto; }
  .nav { view-transition-name: site-nav; }

  /* Hero entrance */
  .hero-text > *,
  .hero-services li {
    animation: rise 0.8s var(--ease-out) backwards;
  }
  .hero-text > :nth-child(1) { animation-delay: 0.05s; }
  .hero-text > :nth-child(2) { animation-delay: 0.12s; }
  .hero-text > :nth-child(3) { animation: none; }
  .hero-services li:nth-child(1) { animation-delay: 0.25s; }
  .hero-services li:nth-child(2) { animation-delay: 0.31s; }
  .hero-services li:nth-child(3) { animation-delay: 0.37s; }
  .hero-services li:nth-child(4) { animation-delay: 0.43s; }
  .hero-services li:nth-child(5) { animation-delay: 0.49s; }
  .hero-text > .hero-divider {
    animation: grow 0.9s var(--ease-out) 0.55s backwards;
    transform-origin: left;
  }
  .hero-text > :nth-child(5) { animation-delay: 0.6s; }
  .hero-text > :nth-child(6) { animation-delay: 0.68s; }
  .hero-former-name::after {
    animation: grow 0.7s var(--ease-in-out) 0.7s backwards;
  }

  /* Scroll parallax: the portrait lags behind and recedes slightly while the hero scrolls out.
     Rule for all motion here: exactly one transform-type animation per element (intro on
     .avatar-container, float on .avatar-img, scroll on .hero-visual). Otherwise Chrome cannot
     run them on the compositor and they tick on the main thread every frame. */
  @supports (animation-timeline: view()) {
    .hero-visual {
      animation: avatar-scroll linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 100%;
    }
  }

  /* Idle float on the image itself */
  .avatar-img {
    animation: float 9s ease-in-out infinite;
    will-change: transform;
  }

  /* Soft accent glow drifting behind the avatar */
  .hero-visual { position: relative; isolation: isolate; }
  .hero-visual::before {
    content: '';
    position: absolute;
    z-index: -1;
    width: 85%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, var(--c-accent-glow), transparent 65%);
    /* Background layer moves opposite to the avatar for depth */
    translate: calc(var(--px, 0) * -22px) calc(var(--py, 0) * -16px);
    animation: glow-bloom 1.6s var(--ease-out) backwards, drift 14s ease-in-out infinite alternate;
  }

  /* Load entrance: portrait is uncovered by a growing circle while settling from a slight zoom */
  .avatar-container {
    animation:
      avatar-reveal 1.4s cubic-bezier(0.33,1,0.68,1) 0.1s backwards,
      avatar-settle 1.6s cubic-bezier(0.33,1,0.68,1) 0.1s backwards;
  }

  /* One-off accent ripple expanding behind the portrait */
  .hero-visual::after {
    content: '';
    position: absolute;
    z-index: -1;
    width: 62%;
    aspect-ratio: 1;
    /* Ring as SVG with a built-in fade towards the bottom, so it never shows through the
       transparent body of the illustration. No CSS mask: a mask layer can desync while scaling. */
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='.5' stop-color='%23A0603A'/%3E%3Cstop offset='.7' stop-color='%23A0603A' stop-opacity='0'/%3E%3C/linearGradient%3E%3Ccircle cx='50' cy='50' r='49' fill='none' stroke='url(%23g)' stroke-width='2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
    opacity: 0;
    pointer-events: none;
    animation: ripple 1.8s cubic-bezier(0.33,1,0.68,1) 0.25s;
  }
  [data-theme="dark"] .hero-visual::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='.5' stop-color='%23DCA070'/%3E%3Cstop offset='.7' stop-color='%23DCA070' stop-opacity='0'/%3E%3C/linearGradient%3E%3Ccircle cx='50' cy='50' r='49' fill='none' stroke='url(%23g)' stroke-width='2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
  }

  /* Tech badges pop in one after another */
  .tech-grid.visible .tech-badge {
    animation: pop 0.5s var(--ease-out) backwards;
    animation-delay: calc(var(--i, 0) * 35ms + 0.1s);
  }

  /* Certification badge spins in */
  .cert-content.visible .cert-badge {
    animation: badge-in 1s var(--ease-out) 0.1s backwards;
  }

  @keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
  }
  @keyframes grow {
    from { transform: scaleX(0); }
  }
  /* Opacity only: a scale animation next to `drift` would block compositing */
  @keyframes glow-bloom {
    from { opacity: 0; }
  }
  @keyframes avatar-reveal {
    from { clip-path: circle(0% at 50% 45%); }
    to   { clip-path: circle(80% at 50% 45%); }
  }
  @keyframes avatar-settle {
    from { transform: scale(1.15); }
  }
  @keyframes ripple {
    0%   { opacity: 0; scale: 0.5; }
    12%  { opacity: 1; }
    100% { opacity: 0; scale: 1.4; }
  }
  @keyframes avatar-scroll {
    to { translate: 0 18%; scale: 0.94; opacity: 0.5; }
  }
  @keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
  }
  @keyframes drift {
    0%   { transform: translate(-6%, -4%) scale(1); }
    50%  { transform: translate(5%, 3%) scale(1.08); }
    100% { transform: translate(-2%, 6%) scale(0.95); }
  }
  @keyframes pop {
    from { opacity: 0; transform: translateY(8px) scale(0.9); }
  }
  @keyframes badge-in {
    from { opacity: 0; transform: rotate(-25deg) scale(0.8); }
  }
}

/* Theme switch: circular reveal of the new theme from the toggle button, no default crossfade */
.vt-theme .nav { view-transition-name: none; }
/* Element color transitions would replay inside the new snapshot and flicker under the circle */
.vt-theme,
.vt-theme *,
.vt-theme *::before,
.vt-theme *::after {
  transition: none !important;
}
.vt-theme::view-transition-old(root) {
  animation: none;
  mix-blend-mode: normal;
}
.vt-theme::view-transition-new(root) {
  mix-blend-mode: normal;
  animation: theme-reveal 0.6s cubic-bezier(0.65,0,0.35,1) both;
}
@keyframes theme-reveal {
  from { clip-path: circle(0px at var(--vt-x, 50%) var(--vt-y, 50%)); }
  to   { clip-path: circle(var(--vt-r, 150%) at var(--vt-x, 50%) var(--vt-y, 50%)); }
}

/* ========================================
   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;
  }
}

/* ========================================
   Subpages (Impressum, Datenschutz)
   ======================================== */
.subpage {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem clamp(1.25rem,4vw,2.5rem);
}
.subpage h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  margin-bottom: 1.5rem;
}
.subpage h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
}
.subpage p,
.subpage address {
  margin-bottom: 1rem;
  color: var(--c-text-secondary);
}
.subpage address {
  font-style: normal;
}
.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: var(--fs-sm);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
  .nav {
    background: var(--c-bg);
  }
  .hero .wrap {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-visual {
    order: 1;
  }
  .hero-text {
    order: 2;
  }
  .hero-services {
    align-items: center;
  }
  .hero-divider {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-text > .hero-divider {
    transform-origin: center;
  }
  .hero-social {
    justify-content: center;
  }
  .services-grid {
    grid-template-columns: repeat(2,1fr);
  }
}

@media (max-width: 640px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
  .avatar-container {
    width: clamp(300px,75vw,440px);
  }
  .cert-content {
    flex-direction: column;
    text-align: center;
  }
  .footer .wrap {
    flex-direction: column;
    text-align: center;
  }
}
