/* =============================================================
   Philippe Sünram – One-Pager
   Design-System. Farben, Spacing und Typo zentral als
   CSS-Custom-Properties. Zum Umfärben nur :root anpassen.
   ============================================================= */

/* ---------- Design-Tokens ---------- */
:root {
  /* Flächen (Near-Black) */
  --bg:            #0a0b0f;
  --bg-elevated:   #0f1117;
  --surface:       #14161c;
  --surface-2:     #191c24;

  /* Linien */
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Text */
  --text:          #f4f6fb;
  --text-muted:    #a2aab8;  /* auf BG: 8.41:1 */
  --text-faint:    #767f8d;  /* auf BG: ~4.86:1 (WCAG AA) */

  /* Akzent (Elektrisch-Blau).
     Hinweis: --accent/--accent-bright dienen dekorativ (Glow, Linien, Icons,
     Verlaufstext). Fuer weissen Text AUF Akzentflaeche (Buttons, Skip-Link)
     werden --accent-deep / --accent-hover genutzt, die WCAG AA (>=4.5:1) erfuellen. */
  --accent:        #3d7bff;
  --accent-bright: #5b93ff;
  --accent-deep:   #2b5fd9;  /* Weiss darauf: 5.61:1 */
  --accent-hover:  #3568e0;  /* Weiss darauf: ~5.0:1 */
  --accent-glow:   rgba(61, 123, 255, 0.35);
  --accent-cyan:   #22d3ee;

  /* Typo */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --container: 1120px;
  --radius:    16px;
  --radius-sm: 10px;

  /* Rhythmus */
  --section-y: clamp(4.5rem, 10vw, 8rem);

  /* Bewegung */
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --speed:     0.45s;
}

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

* { margin: 0; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a {
  color: var(--accent-bright);
  text-decoration: none;
  transition: color var(--speed) var(--ease);
}
a:hover { color: var(--text); }

h1, h2, h3 {
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 650;
  text-wrap: balance;
}

/* ---------- Fokus / Zugänglichkeit ---------- */
:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -100px;
  transform: translateX(-50%);
  background: var(--accent-deep);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 200;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0.75rem; color: #fff; }

.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;
}

/* ---------- Layout-Helfer ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.section { padding-block: var(--section-y); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.section-title {
  font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem);
  max-width: 22ch;
}

.lead {
  color: var(--text-muted);
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem);
  max-width: 62ch;
  line-height: 1.7;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.35rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--speed) var(--ease),
              box-shadow var(--speed) var(--ease),
              background var(--speed) var(--ease),
              border-color var(--speed) var(--ease),
              color var(--speed) var(--ease);
  will-change: transform;
}

.btn-primary {
  --btn-bg: var(--accent-deep);
  background: var(--btn-bg);
  color: #fff;
  box-shadow: 0 8px 24px -10px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -12px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
  background: rgba(61, 123, 255, 0.06);
}

.btn .arrow { transition: transform var(--speed) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Header / Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 11, 15, 0.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--speed) var(--ease),
              background var(--speed) var(--ease);
}
.site-header[data-scrolled="true"] {
  border-bottom-color: var(--border);
  background: rgba(10, 11, 15, 0.9);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand-mark {
  height: 28px;
  width: auto;
  display: block;
  flex: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  padding: 0;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width var(--speed) var(--ease);
}
.nav-links a:hover::after { width: 100%; }

.nav-cta { display: inline-flex; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0 11px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(5rem, 12vw, 9rem) var(--section-y);
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 22% 0%, rgba(61, 123, 255, 0.20), transparent 70%),
    radial-gradient(40% 40% at 90% 10%, rgba(34, 211, 238, 0.10), transparent 70%);
}
.hero .container { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero-photo {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4 / 5;
  box-shadow: 0 30px 70px -34px rgba(0, 0, 0, 0.75);
}
.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 8%;
}

.hero h1 {
  font-size: clamp(2.5rem, 1.6rem + 3.4vw, 4rem);
  max-width: 15ch;
  margin-bottom: 1.6rem;
}
.hero h1 .accent {
  color: transparent;
  background: linear-gradient(120deg, var(--accent-bright), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
}
.hero-sub {
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.4rem);
  color: var(--text-muted);
  max-width: 56ch;
  margin-bottom: 2.5rem;
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.hero-meta {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  color: var(--text-faint);
  font-size: 0.9rem;
  font-weight: 500;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 0.55rem; }
.hero-meta span::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Problem ---------- */
.problem .section-title { margin-bottom: 1.5rem; }
.problem-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.problem-aside {
  border-left: 2px solid var(--border-strong);
  padding-left: 1.5rem;
  display: grid;
  gap: 1.5rem;
}
.problem-aside .stat-num {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
  font-weight: 700;
  color: var(--accent-bright);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.problem-aside .stat-label {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---------- Leistungen ---------- */
.services-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  overflow: hidden;
  transition: transform var(--speed) var(--ease),
              border-color var(--speed) var(--ease),
              background var(--speed) var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, var(--accent-glow), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--speed) var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.card:hover::before { opacity: 1; }

.card-icon {
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(61, 123, 255, 0.10);
  border: 1px solid rgba(61, 123, 255, 0.22);
  color: var(--accent-bright);
  margin-bottom: 1.5rem;
}
.card-icon svg { width: 24px; height: 24px; }
.card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.card p {
  color: var(--text-muted);
  font-size: 0.975rem;
  line-height: 1.65;
}

/* ---------- Tool-Stack ---------- */
.tools-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}
.tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 1.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: transform var(--speed) var(--ease),
              border-color var(--speed) var(--ease),
              background var(--speed) var(--ease);
}
.tool:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.tool-logo {
  color: var(--text-muted);
  display: grid;
  place-items: center;
  transition: color var(--speed) var(--ease);
}
.tool-logo svg { width: 34px; height: 34px; display: block; }
.tool:hover .tool-logo { color: var(--text); }
.tool-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-faint);
  transition: color var(--speed) var(--ease);
}
.tool:hover .tool-name { color: var(--text-muted); }
.tools-note {
  margin-top: 1.75rem;
  color: var(--text-faint);
  font-size: 0.95rem;
}

/* ---------- Arbeitsweise ---------- */
.work { background: var(--bg-elevated); }
.work-head { max-width: 60ch; margin-bottom: 3.5rem; }
.work-head .section-title { margin-block: 1.25rem; }
.work-grid {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.work-photo {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4 / 5;
}
.work-photo img { width: 100%; height: 100%; object-fit: cover; }
.steps { display: grid; gap: 0.5rem; }
.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  align-items: start;
}
.step:last-child { border-bottom: 1px solid var(--border); }
.step-num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-bright);
  padding-top: 0.15rem;
  letter-spacing: 0.05em;
}
.step h3 { font-size: 1.15rem; margin-bottom: 0.35rem; font-weight: 600; }
.step p { color: var(--text-muted); font-size: 0.975rem; }

/* ---------- Über mich ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.about-photo {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    linear-gradient(160deg, var(--surface-2), var(--surface)),
    var(--surface);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }

.about-text p { color: var(--text-muted); margin-bottom: 1.25rem; }
.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: var(--text); font-weight: 600; }

/* ---------- Kontakt ---------- */
.contact { position: relative; overflow: hidden; }
.contact-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(61, 123, 255, 0.14), transparent 55%),
    var(--surface);
  padding: clamp(2.5rem, 6vw, 5rem);
  text-align: center;
}
.contact-card h2 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  margin-bottom: 1.25rem;
  max-width: 18ch;
  margin-inline: auto;
}
.contact-card .lead {
  margin-inline: auto;
  margin-bottom: 2.5rem;
  text-align: center;
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}
.contact-direct {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.contact-direct a { color: var(--text); }
.contact-direct a:hover { color: var(--accent-bright); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 3rem 2.5rem;
  margin-top: var(--section-y);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
}
.footer-links a { color: var(--text-muted); font-size: 0.92rem; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--text-faint); font-size: 0.9rem; }

/* =============================================================
   Rechtsseiten (AGB, Impressum, Datenschutz)
   ============================================================= */
.legal { padding-block: clamp(3rem, 8vw, 5rem) var(--section-y); }
.legal .container { max-width: 820px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 2.5rem;
}
.back-link:hover { color: var(--accent-bright); }
.back-link .arrow { transition: transform var(--speed) var(--ease); }
.back-link:hover .arrow { transform: translateX(-3px); }

.legal h1 {
  font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem);
  margin-bottom: 0.75rem;
}
.legal .legal-meta {
  color: var(--text-faint);
  font-size: 0.9rem;
  margin-bottom: 3rem;
}
.legal h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  letter-spacing: -0.01em;
}
.legal h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.legal h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
}
.legal p,
.legal li {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.75;
}
.legal ol, .legal ul { padding-left: 1.4rem; margin-bottom: 1rem; }
.legal li { margin-bottom: 0.6rem; }
.legal strong { color: var(--text); font-weight: 600; }
.legal .note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-size: 0.95rem;
}
.legal .note p { margin-bottom: 0.5rem; color: var(--text-muted); }
.legal .note p:last-child { margin-bottom: 0; }

/* =============================================================
   Scroll-Reveal (durch main.js aktiviert)
   Der versteckte Startzustand greift NUR, wenn JavaScript aktiv ist
   (html.js wird inline gesetzt). Ohne JS bleibt der Inhalt sichtbar.
   ============================================================= */
.reveal { transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal { opacity: 0; transform: translateY(24px); }
.reveal.in-view { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 860px) {
  .hero-grid,
  .problem-grid,
  .work-grid,
  .about-grid,
  .services-grid { grid-template-columns: 1fr; }

  .problem-aside { border-left: 0; padding-left: 0; }
  .about-photo { max-width: 420px; margin-inline: auto; }
  .hero-photo { max-width: 340px; margin: 0.5rem auto 0; }
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 520px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-cta { display: none; }

  .nav-links {
    position: fixed;
    inset: 72px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    transform: translateY(-200%);
    transition: transform 0.4s var(--ease);
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.8);
  }
  .nav-links[data-open="true"],
  .nav-links:focus-within { transform: translateY(0); }
  .nav-links a {
    padding: 1rem clamp(1.25rem, 5vw, 2.5rem);
    font-size: 1.05rem;
  }
  .nav-links a::after { display: none; }
  .nav-links li:not(:last-child) a { border-bottom: 1px solid var(--border); }
}

/* =============================================================
   Reduzierte Bewegung respektieren
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal, .js .reveal { opacity: 1; transform: none; }
}
