/* ============================================================
   pierredev.de — Apple-inspired glass design
   ============================================================ */

:root {
  --bg: #f4f6fb;
  --surface: rgba(255, 255, 255, 0.55);
  --surface-strong: rgba(255, 255, 255, 0.78);
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --text-dim: rgba(30, 41, 59, 0.66);
  --text-faint: rgba(30, 41, 59, 0.42);
  --accent-1: #2f7cf6;
  --accent-2: #7c5cf0;
  --accent-3: #0ea5c9;
  --grad: linear-gradient(100deg, var(--accent-1), var(--accent-2) 55%, var(--accent-3));
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --nav-h: 64px;
  --radius: 22px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(47, 124, 246, 0.22); }

/* ---------- Background layers ---------- */

#gl-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  display: block;
  background:
    radial-gradient(1100px 700px at 18% 8%, rgba(140, 175, 255, 0.35), transparent 60%),
    radial-gradient(900px 650px at 85% 30%, rgba(185, 160, 250, 0.30), transparent 60%),
    radial-gradient(1000px 750px at 50% 95%, rgba(120, 215, 235, 0.28), transparent 65%),
    var(--bg);
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 9s steps(6) infinite;
}

@keyframes grain-shift {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 3%); }
}

/* ---------- Scroll progress ---------- */

.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 120;
  background: transparent;
}

#scroll-progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- Glass ---------- */

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

/* ---------- Navigation ---------- */

.nav-wrap {
  position: fixed;
  top: 14px;
  left: 0; right: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
  transition: transform 400ms var(--ease-out);
}

.nav-wrap.nav-hidden { transform: translateY(calc(-100% - 20px)); }

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  width: 100%;
  max-width: 760px;
  height: var(--nav-h);
  padding: 0 12px 0 22px;
  border-radius: 999px;
  box-shadow: 0 14px 44px rgba(45, 65, 120, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: background 300ms ease, border-color 300ms ease;
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--border-strong);
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(47, 124, 246, 0.75);
}

.logo-accent {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.nav-links a {
  position: relative;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 200ms ease, background 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { color: var(--text); background: rgba(15, 23, 42, 0.05); }
}

.nav-links a.active { color: var(--text); background: rgba(15, 23, 42, 0.07); }

.nav-cta { flex-shrink: 0; }

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 42px;
  margin-left: auto;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.nav-burger span {
  display: block;
  width: 18px; height: 2px;
  margin: 0 auto;
  border-radius: 2px;
  background: var(--text);
  transition: transform 250ms var(--ease-out), opacity 250ms ease;
}

.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-width: 760px;
  margin-top: 10px;
  padding: 10px;
  border-radius: 24px;
  box-shadow: 0 14px 44px rgba(45, 65, 120, 0.14);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}

.nav-mobile.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.nav-mobile a {
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 13px 16px;
  border-radius: 14px;
}

.nav-mobile a:active { background: rgba(15, 23, 42, 0.05); }

.nav-mobile-cta {
  background: var(--grad);
  color: #fff !important;
  font-weight: 650;
  text-align: center;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 160ms var(--ease-out), box-shadow 200ms ease, background 200ms ease, border-color 200ms ease;
  will-change: transform;
}

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

.btn-primary {
  background: linear-gradient(180deg, rgba(255,255,255,0.28), rgba(255,255,255,0) 45%), var(--grad);
  color: #fff;
  box-shadow: 0 8px 26px rgba(47, 124, 246, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 34px rgba(47, 124, 246, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  }
  .btn-primary:hover:active { transform: scale(0.97); }
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.6);
  border-color: var(--border);
  color: var(--text);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(45, 65, 120, 0.08);
}

@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--border-strong);
  }
}

.btn-lg { padding: 15px 30px; font-size: 16.5px; }

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 140px 0; position: relative; }

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 18px;
}

.section-eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--grad);
}

.section-title {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 20px;
}

.section-sub {
  font-size: clamp(17px, 2vw, 19px);
  color: var(--text-dim);
  max-width: 560px;
  margin-bottom: 28px;
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: calc(var(--nav-h) + 40px) 24px 80px;
}

.hero-inner {
  max-width: 900px;
  will-change: transform, opacity;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  margin-bottom: 34px;
}

.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.hero-title {
  font-size: clamp(44px, 8.4vw, 96px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin-bottom: 28px;
}

.hero-title .line {
  display: block;
  overflow: hidden;
  padding: 0.06em 0.1em;
  margin: -0.06em -0.1em;
}

.hero-title .line > span {
  display: inline-block;
  transform: translateY(112%);
  animation: line-up 900ms var(--ease-out) forwards;
}

.hero-title .line:nth-child(2) > span { animation-delay: 120ms; }

@keyframes line-up {
  to { transform: translateY(0); }
}

.hero-title em { font-style: italic; }

.hero-sub {
  font-size: clamp(17px, 2.4vw, 21px);
  color: var(--text-dim);
  margin-bottom: 40px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.scroll-hint {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  opacity: 0;
  animation: fade-in 800ms ease 1400ms forwards;
}

@keyframes fade-in { to { opacity: 1; } }

.scroll-hint-track {
  width: 26px; height: 42px;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  display: flex;
  justify-content: center;
  padding-top: 7px;
}

.scroll-hint-dot {
  width: 4px; height: 8px;
  border-radius: 999px;
  background: var(--text-dim);
  animation: scroll-dot 2s var(--ease-in-out) infinite;
}

@keyframes scroll-dot {
  0% { transform: translateY(0); opacity: 1; }
  60% { transform: translateY(14px); opacity: 0; }
  61% { transform: translateY(0); opacity: 0; }
  100% { opacity: 1; }
}

.scroll-hint-label {
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: transform, opacity;
}

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

/* ---------- Cards (Leistungen) ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 56px;
}

.card {
  position: relative;
  border-radius: var(--radius);
  padding: 34px 30px 30px;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(45, 65, 120, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: transform 300ms var(--ease-out), border-color 300ms ease, background 300ms ease,
              opacity 800ms var(--ease-out);
  transform-style: preserve-3d;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    border-color: var(--border-strong);
    background: var(--surface-strong);
  }
  .card:hover .card-glow { opacity: 1; }
}

.card-icon {
  width: 52px; height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: linear-gradient(160deg, rgba(255,255,255,0.95), rgba(255,255,255,0.55));
  border: 1px solid var(--border);
  color: var(--accent-1);
  margin-bottom: 24px;
  box-shadow: 0 4px 14px rgba(45, 65, 120, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.card:nth-child(2) .card-icon { color: var(--accent-2); }
.card:nth-child(3) .card-icon { color: var(--accent-3); }

.card-icon svg { width: 24px; height: 24px; }

.card h3 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.card p {
  font-size: 15.5px;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.tags li {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--border);
}

.card-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 400ms ease;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(90, 140, 255, 0.14), transparent 65%);
}

/* ---------- Prozess (Scrollytelling) ---------- */

.process {
  position: relative;
  height: 420vh;
}

.process-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.process-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  align-items: center;
}

.process-left .section-title { margin-bottom: 44px; }

.process-progress {
  display: flex;
  align-items: center;
  gap: 20px;
}

.process-counter {
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.06em;
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.process-total { color: var(--text-faint); font-weight: 500; }

.process-bar {
  flex: 1;
  max-width: 220px;
  height: 2px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

#process-bar-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
}

.process-right {
  position: relative;
  min-height: 340px;
}

.process-step {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: calc(var(--radius) + 6px);
  padding: 44px 46px;
  box-shadow: 0 30px 80px rgba(45, 65, 120, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  opacity: 0;
  transform: translateY(46px) scale(0.96);
  pointer-events: none;
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
  will-change: transform, opacity;
}

.process-step.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.process-step.passed {
  opacity: 0;
  transform: translateY(-46px) scale(0.96);
}

.step-num {
  font-size: clamp(56px, 6vw, 84px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.9;
  margin-bottom: 18px;
}

.process-step h3 {
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.process-step p {
  font-size: 16.5px;
  color: var(--text-dim);
  max-width: 420px;
}

/* ---------- Über mich ---------- */

.about-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 70px;
  align-items: center;
}

.stats {
  display: grid;
  gap: 16px;
}

.stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  border-radius: var(--radius);
  padding: 26px 30px;
  box-shadow: 0 14px 40px rgba(45, 65, 120, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.stat-value {
  font-size: clamp(36px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  font-size: 15px;
  color: var(--text-dim);
  text-align: right;
}

/* ---------- Kontakt ---------- */

.contact { padding-bottom: 120px; }

.contact-panel {
  position: relative;
  text-align: center;
  border-radius: calc(var(--radius) + 10px);
  padding: clamp(50px, 8vw, 90px) 30px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(45, 65, 120, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.contact-panel .section-eyebrow { justify-content: center; }
.contact-panel .section-sub { margin-left: auto; margin-right: auto; margin-bottom: 36px; }

.contact-title {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 18px;
}

.contact-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(500px 260px at 50% 0%, rgba(120, 165, 255, 0.22), transparent 70%),
    radial-gradient(400px 240px at 80% 100%, rgba(185, 160, 250, 0.18), transparent 70%);
}

.magnetic { will-change: transform; }

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 34px 0;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-faint);
}

.footer a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .footer a:hover { color: var(--text); }
}

/* ---------- Impressum ---------- */

.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 90px) 24px 100px;
}

.legal h1 {
  font-size: clamp(34px, 5vw, 48px);
  letter-spacing: -0.03em;
  margin-bottom: 40px;
}

.legal-card {
  border-radius: var(--radius);
  padding: 36px 34px;
  margin-bottom: 20px;
  box-shadow: 0 14px 40px rgba(45, 65, 120, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.legal-card h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.legal-card p {
  color: var(--text-dim);
  font-size: 15.5px;
  margin-bottom: 10px;
}

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

.legal-card a { color: var(--accent-1); text-decoration: none; }

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

@media (max-width: 900px) {
  .section { padding: 100px 0; }

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

  .about-layout { grid-template-columns: 1fr; gap: 44px; }
  .stat-label { text-align: right; }

  /* Prozess: normales Stacking statt Scrollytelling */
  .process { height: auto; padding: 100px 0; }
  .process-sticky { position: static; height: auto; overflow: visible; align-items: stretch; }
  .process-layout { grid-template-columns: 1fr; gap: 40px; }
  .process-progress { display: none; }
  .process-left .section-title { margin-bottom: 0; }
  .process-right { min-height: 0; display: grid; gap: 16px; }
  .process-step {
    position: static;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    padding: 30px 28px;
  }
  .process-step.passed { opacity: 1; transform: none; }
  .step-num { font-size: 40px; margin-bottom: 12px; }
}

@media (max-width: 760px) {
  .nav { gap: 12px; }
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; }
  .nav-mobile { display: flex; }
}

@media (min-width: 761px) {
  .nav-mobile { display: none !important; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .br-desktop { display: none; }
  .hero { padding-bottom: 110px; }
  .hero-cta .btn { width: 100%; max-width: 320px; }
  .contact-panel { padding-left: 22px; padding-right: 22px; }
  .contact-panel .btn { max-width: 100%; overflow-wrap: anywhere; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .grain { animation: none; }
  .pulse-dot { animation: none; }
  .scroll-hint-dot { animation: none; }

  .hero-title .line > span {
    transform: none;
    animation: none;
  }

  .scroll-hint { opacity: 1; animation: none; }

  .reveal {
    transform: none;
    transition: opacity 300ms ease;
  }

  .process-step {
    transition: opacity 300ms ease;
    transform: none;
  }
  .process-step.passed { transform: none; }

  .hero-inner { transform: none !important; }
}
