/* ═══════════════════════════════════════════════════════════════════════════
   style.css — KeyForge Landing Page
   Theme  : Clean Light (white / off-white, dark typography)
   Accent : #7E41EE
   Font   : Inter (Google Fonts) → system-ui fallback
═══════════════════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────────────────────
   0. DESIGN TOKENS
   All brand values live here. Change once, update everywhere.
─────────────────────────────────────────────────────────────────────────── */
:root {
  /* Colors */
  --color-bg:          #FAFAFA;        /* Page background */
  --color-surface:     #FFFFFF;        /* Card / panel background */
  --color-border:      #E8E8ED;        /* Subtle dividers */
  --color-text-primary:   #111111;     /* Headlines */
  --color-text-secondary: #555560;     /* Body copy */
  --color-text-muted:     #9898A3;     /* Labels, fine print */
  --color-accent:      #7E41EE;        /* Brand purple */
  --color-accent-hover:#6930D4;        /* Darken 10 % for hover */
  --color-accent-soft: rgba(126, 65, 238, 0.10); /* Tinted bg for chips */
  --color-white:       #FFFFFF;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;

  /* Spacing scale (8-pt grid) */
  --space-1:  4px;
  --space-2:  8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* Border radius */
  --radius-sm:   6px;
  --radius-md:  12px;
  --radius-lg:  24px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px  3px rgba(0,0,0,0.06), 0 1px  2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px  6px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow:   500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --max-width: 1280px;
  --section-padding-x: clamp(var(--space-6), 6vw, var(--space-9));
}


/* ───────────────────────────────────────────────────────────────────────────
   1. RESET & BASE
─────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  /* scroll-behavior: smooth; HAST DU JA SCHON GELÖSCHT */
  overflow-x: hidden;
  
  /* NEU: Aktiviert den Magnet-Effekt auf der Y-Achse */
  scroll-snap-type: y mandatory; 
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

ul, ol { list-style: none; }

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


/* ───────────────────────────────────────────────────────────────────────────
   2. FIXED 3D CANVAS
   Covers the full viewport, sits behind all HTML content.
   Three.js renders here.
─────────────────────────────────────────────────────────────────────────── */
#canvas-3d {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;           /* Behind all HTML */
  display: block;
  pointer-events: none;  /* Lets scroll events pass through to the page */
}


/* ───────────────────────────────────────────────────────────────────────────
   3. LOADING OVERLAY
   Fades out once the GLTF model is ready (class .hidden added by JS).
─────────────────────────────────────────────────────────────────────────── */
#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-5);

  /* Smooth fade-out */
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Spinner ring */
.loader-ring {
  width: 48px;
  height: 48px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}


/* ───────────────────────────────────────────────────────────────────────────
   4. NAVIGATION
─────────────────────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: var(--space-4) var(--section-padding-x);
  height: 64px;

  /* Glassmorphism-lite for the light theme */
  background: rgba(250, 250, 250, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--color-border);

  transition: box-shadow var(--transition-normal);
}

.nav.scrolled {
  box-shadow: var(--shadow-sm);
}

/* Logo */
.nav__logo {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
  transition: color var(--transition-fast);
}

.nav__logo:hover { color: var(--color-accent); }

/* Links */
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

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

/* CTA nav link */
.nav__link--cta {
  background: var(--color-accent);
  color: var(--color-white);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-pill);
  font-weight: 600;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.nav__link--cta:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  color: var(--color-white);
}


/* ───────────────────────────────────────────────────────────────────────────
   5. SECTIONS — SHARED LAYOUT
   Each section is a full-viewport scroll trigger target.
   Content containers are positioned so they never overlap the 3D model.
─────────────────────────────────────────────────────────────────────────── */
.section {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0 var(--section-padding-x);
  
  /* NEU: Hier rastet der Magnet ein (immer genau in der Mitte) */
  scroll-snap-align: center; 
  /* NEU: Verhindert, dass man beim schnellen Scrollen Sektionen überspringt */
  scroll-snap-stop: always;  
}

/* Content box shared styles */
.section__content {
  position: relative;
  z-index: 1;          /* Above canvas, below nav */
  max-width: 520px;
}

/* ── Alignment modifiers ── */
.section__content--center {
  max-width: 680px;
  margin-inline: auto;
  text-align: center;
  align-items: center;
  display: flex;
  flex-direction: column;
}

.section__content--left {
  /* Stays on the left ~40 % of the viewport */
  margin-left: 0;
  margin-right: auto;
}

/* Overlay: semi-transparent pill behind text for top-down section */
.section__content--overlay {
  background: rgba(250, 250, 250, 0.80);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-7);
  box-shadow: var(--shadow-lg);
}


/* ───────────────────────────────────────────────────────────────────────────
   6. SECTION — HERO
─────────────────────────────────────────────────────────────────────────── */
.section--hero {
  min-height: 100vh;
  padding-top: 64px; /* Nav height */
}

/* Headline animation prep — lines start invisible (JS sets initial state) */
.headline__line {
  display: block;
  /* GSAP will override opacity/transform from main.js */
}

.headline__line--accent {
  color: var(--color-accent);
}

/* Hero CTA button group */
.hero-cta-group {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-6);
  flex-wrap: wrap;
  justify-content: center;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.scroll-hint__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.scroll-hint__line {
  width: 1px;
  height: 48px;
  background: linear-gradient(
    to bottom,
    var(--color-accent),
    transparent
  );
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%,100% { opacity: 0.3; transform: scaleY(1); }
  50%      { opacity: 1;   transform: scaleY(1.15); }
}


/* ───────────────────────────────────────────────────────────────────────────
   7. SECTION — PROFILE
─────────────────────────────────────────────────────────────────────────── */
.section--profile {
  /* 3D model sits on the right — content stays left */
}


/* ───────────────────────────────────────────────────────────────────────────
   8. SECTION — LAYOUT (Top-Down)
─────────────────────────────────────────────────────────────────────────── */
.section--layout {
  justify-content: center;
}

.chip-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--space-5);
}

.chip {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(126, 65, 238, 0.20);
  letter-spacing: 0.01em;
}


/* ───────────────────────────────────────────────────────────────────────────
   9. SECTION — SPECS
─────────────────────────────────────────────────────────────────────────── */
.section--specs {
  /* 3D model slides right — content left */
}

.specs-list {
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.specs-list__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-6);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}

.specs-list__row:first-child {
  border-top: 1px solid var(--color-border);
}

.specs-list__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.specs-list__value {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-primary);
  text-align: right;
}


/* ───────────────────────────────────────────────────────────────────────────
   10. SECTION — CTA
─────────────────────────────────────────────────────────────────────────── */
.section--cta {
  background: linear-gradient(
    160deg,
    var(--color-bg) 0%,
    rgba(126, 65, 238, 0.04) 100%
  );
}

.price-tag {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin: var(--space-6) 0;
}

.price-tag__amount {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--color-text-primary);
}

.price-tag__suffix {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

.fine-print {
  margin-top: var(--space-5);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-align: center;
}


/* ───────────────────────────────────────────────────────────────────────────
   11. TYPOGRAPHY SYSTEM
─────────────────────────────────────────────────────────────────────────── */

/* Badge pill */
.badge {
  display: inline-flex;
  align-items: center;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(126, 65, 238, 0.20);
  margin-bottom: var(--space-4);
}

/* Inverted badge (white text on accent) for CTA section */
.badge--inverted {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: transparent;
}

/* Headlines */
.headline {
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--color-text-primary);
}

.headline--hero {
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  margin-bottom: var(--space-5);
}

.headline--section {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  margin-bottom: var(--space-5);
}

.headline--cta {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin-bottom: var(--space-4);
}

/* Sub-headline / hero tagline */
.subline--hero {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 400;
  color: var(--color-text-secondary);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: var(--space-3);
}

/* Body copy */
.body-text {
  font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
  color: var(--color-text-secondary);
  line-height: 1.75;
  margin-bottom: var(--space-5);
}

.body-text--centered {
  text-align: center;
  max-width: 440px;
  margin-inline: auto;
}


/* ───────────────────────────────────────────────────────────────────────────
   12. FEATURE LIST
─────────────────────────────────────────────────────────────────────────── */
.feature-list {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.feature-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.feature-list__icon {
  color: var(--color-accent);
  font-size: 0.5rem;
  flex-shrink: 0;
}


/* ───────────────────────────────────────────────────────────────────────────
   13. BUTTONS
─────────────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 0 var(--space-6);
  height: 48px;
  cursor: pointer;
  border: none;
  transition:
    background    var(--transition-fast),
    color         var(--transition-fast),
    transform     var(--transition-fast),
    box-shadow    var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}

/* Primary — accent fill */
.btn--primary {
  background: var(--color-accent);
  color: var(--color-white);
  box-shadow: 0 4px 20px rgba(126, 65, 238, 0.35);
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(126, 65, 238, 0.45);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(126, 65, 238, 0.30);
}

/* Ghost — transparent with border */
.btn--ghost {
  background: transparent;
  color: var(--color-text-primary);
  box-shadow: inset 0 0 0 1.5px var(--color-border);
}

.btn--ghost:hover {
  box-shadow: inset 0 0 0 1.5px var(--color-text-primary);
  transform: translateY(-1px);
}

/* Large modifier */
.btn--large {
  height: 56px;
  font-size: 1.0625rem;
  padding: 0 var(--space-8);
}


/* ───────────────────────────────────────────────────────────────────────────
   14. FOOTER
─────────────────────────────────────────────────────────────────────────── */
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6) var(--section-padding-x);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer__copy {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.footer__nav {
  display: flex;
  gap: var(--space-5);
}

.footer__link {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

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


/* ───────────────────────────────────────────────────────────────────────────
   15. SCROLL PROGRESS BAR
   A thin accent-colored strip at the very top of the viewport.
   JS drives its width via a CSS custom property.
─────────────────────────────────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: calc(var(--scroll-progress, 0) * 100%);
  background: linear-gradient(90deg, var(--color-accent), #B47EFF);
  z-index: 9998;
  transition: width 0.05s linear;
}


/* ───────────────────────────────────────────────────────────────────────────
   16. RESPONSIVE BREAKPOINTS
─────────────────────────────────────────────────────────────────────────── */

/* Tablet (≤ 900px) */
@media (max-width: 900px) {
  .nav__links {
    gap: var(--space-4);
  }

  .section__content--overlay {
    padding: var(--space-6) var(--space-5);
  }

  /* On smaller screens, center all section content */
  .section__content--left {
    max-width: 100%;
  }
}

/* Mobile (≤ 600px) */
@media (max-width: 600px) {
  :root {
    --section-padding-x: var(--space-5);
  }

  /* Hide nav links on very small screens — keep logo + CTA only */
  .nav__links li:not(:last-child) {
    display: none;
  }

  .hero-cta-group {
    flex-direction: column;
    align-items: stretch;
  }

  .specs-list__row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }

  .specs-list__value {
    text-align: left;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ───────────────────────────────────────────────────────────────────────────
   17. ACCESSIBILITY — REDUCED MOTION
   Disable all animations / transitions when the user prefers reduced motion.
─────────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }
}
