/* ==========================================================================
   base.css – CSS custom properties, reset, typography
   ========================================================================== */

/* ── Custom Properties ── */
:root {
  color-scheme: dark;

  /* Colors – Dark Theme (default) */
  --bg:        #0F121C;
  --bg-mid:    #171B27;
  --bg-light:  #242A3B;
  --bg-elev:   #1c2133;
  --primary:   #007AFF;
  --primary-l: #4DA3FF;
  --text:      #DEECFF;
  --muted:     #8A9AAF;
  --dim:       #596678;
  --divider:   #2E3648;
  --success:   #34C759;
  --warning:   #FFCC00;
  --accent:    #FF5A1F;

  /* Surfaces & Effects */
  --surface-soft:   rgba(255,255,255,.05);
  --surface-soft-2: rgba(255,255,255,.07);
  --surface-soft-3: rgba(255,255,255,.09);
  --nav-bg:         rgba(15,18,28,.92);
  --menu-bg:        rgba(15,18,28,.97);
  --noise-opacity:  .4;
  --icon-filter:    brightness(0) invert(1);
  --phone-shadow:   0 32px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.04);
  --mockup-shadow:        rgba(0,0,0,.55);
  --mockup-shadow-tilt:   rgba(0,0,0,.65);
  --mockup-shadow-hover:  rgba(0,0,0,.5);

  /* Typography */
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  /* Spacing */
  --page-padding: 2.5rem;
  --content-max:  1100px;   /* gemeinsame Inhaltsbreite: Header, Footer & alle Seiten */
  --section-py:   7rem;
  --radius-lg:    20px;
  --radius-md:    14px;
  --radius-sm:    8px;
}

/* ── Light Theme ── */
[data-theme="light"] {
  color-scheme: light;

  --bg:        #F4F6FB;
  --bg-mid:    #FFFFFF;
  --bg-light:  #EEF2F8;
  --bg-elev:   #E4EAF4;
  --primary:   #007AFF;
  --primary-l: #0060CC;
  --text:      #14213D;
  --muted:     #5E6C84;
  --dim:       #8A99B0;
  --divider:   #DEE4ED;

  --surface-soft:   rgba(20,33,61,.05);
  --surface-soft-2: rgba(20,33,61,.08);
  --surface-soft-3: rgba(20,33,61,.12);
  --nav-bg:         rgba(255,255,255,.85);
  --menu-bg:        rgba(244,246,251,.97);
  --noise-opacity:  .12;
  --icon-filter:    brightness(0) invert(0.45);
  --phone-shadow:   0 24px 64px rgba(20,33,61,.18), 0 0 0 1px rgba(20,33,61,.04);
  --mockup-shadow:        rgba(20,33,61,.22);
  --mockup-shadow-tilt:   rgba(20,33,61,.32);
  --mockup-shadow-hover:  rgba(20,33,61,.18);
}

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

html {
  scroll-behavior: smooth;
  /* iOS Safari fix: overflow-x on body alone doesn't prevent horizontal scroll.
     clip statt hidden: hidden macht body zum Scroll-Container und bricht position:sticky */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .25s ease, color .25s ease;
}

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

a {
  color: inherit;
}

/* ── Noise texture overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* ── Typography utilities ── */
.display {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: .93;
  letter-spacing: -.01em;
  text-transform: uppercase;
}

.display-xl { font-size: clamp(4rem, 12vw, 9.5rem); }
.display-lg { font-size: clamp(2.4rem, 6vw, 5rem); }

.label {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: .68rem;
}

/* ── Layout utilities ── */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  overflow: visible;
}

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

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.section-tag::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary);
}

.section-intro { max-width: 560px; }
.section-intro .display-lg { color: var(--text); margin-bottom: 1rem; }
.section-intro p { color: var(--muted); line-height: 1.7; }

/* ── Tag pills ── */
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }

.tag {
  padding: .2rem .6rem;
  border-radius: 5px;
  font-size: .7rem;
  font-weight: 500;
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid var(--surface-soft-2);
}

.tag.g,
.tag.o,
.tag.y {
  background: var(--surface-soft);
  color: var(--muted);
  border-color: var(--surface-soft-2);
}

/* ── Split layout ── */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.split-text p { color: var(--muted); line-height: 1.7; margin-top: 1rem; }
.split-text p + p { margin-top: .7rem; }

.feat-list {
  list-style: none;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.feat-list li {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: .88rem;
  color: var(--muted);
}

.feat-list li svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex-shrink: 0;
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .7s ease, transform .7s ease;
}

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

/* ── Responsive ── */
@media (max-width: 900px) {
  :root { --section-py: 5rem; --page-padding: 1.5rem; }

  .split { grid-template-columns: 1fr; gap: 3rem; }
  .split.rev > :first-child { order: 2; }
}

@media (max-width: 640px) {
  :root { --section-py: 4rem; --page-padding: 1.25rem; }
}