/* ============================================
   SHOWROOM — 3D Portfolio Gallery
   Dark immersive theme with glassmorphism
   ============================================ */

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

:root {
  --bg: #06080f;
  --bg2: #0a0d16;
  --surface: rgba(255,255,255,0.025);
  --surface-hover: rgba(255,255,255,0.05);
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);
  --text: #e2e8f0;
  --text-muted: #64748b;
  --accent: #00d4ff;
  --accent2: #8b5cf6;
  --glow: rgba(0,212,255,0.12);
  --glow2: rgba(139,92,246,0.10);
  --max: 1200px;
  --radius: 18px;
  --radius-sm: 10px;
  --header-h: 60px;
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(0,212,255,0.25); color: #fff; }

/* === Perspective Grid Floor === */
.bg-grid {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.bg-grid::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-image:
    linear-gradient(rgba(0,212,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.025) 1px, transparent 1px);
  background-size: 70px 70px;
  transform: perspective(500px) rotateX(65deg);
  transform-origin: center 30%;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, rgba(0,0,0,0.6), transparent);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, rgba(0,0,0,0.6), transparent);
}

/* Ambient glow orbs */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}
.bg-orb--1 { width: 600px; height: 600px; background: rgba(0,212,255,0.045); top: -20%; right: -10%; }
.bg-orb--2 { width: 500px; height: 500px; background: rgba(139,92,246,0.04); bottom: 30%; left: -10%; }
.bg-orb--3 { width: 350px; height: 350px; background: rgba(0,212,255,0.03); bottom: -5%; right: 15%; }

/* === Scroll Progress === */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 200;
  width: 0;
  pointer-events: none;
}

/* === Skip Link === */
.skip-link {
  position: fixed;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 24px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  z-index: 999;
  text-decoration: none;
  transition: top 0.3s;
}
.skip-link:focus { top: 12px; }

/* === Header === */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  background: rgba(6,8,15,0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
}
.header--hidden { transform: translateY(-100%); }
.header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.header__logo svg { width: 28px; height: 28px; flex-shrink: 0; }
.header__logo span {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.header__nav { display: flex; gap: 28px; align-items: center; }
.header__nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.header__nav a:hover { color: var(--accent); }

/* Burger */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 101;
}
.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
  transform-origin: center;
}
.burger.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

@media (max-width: 768px) {
  .burger { display: flex; }
  .header__nav {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(6,8,15,0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 36px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 99;
  }
  .header__nav.open { opacity: 1; pointer-events: auto; }
  .header__nav a { font-size: 1.15rem; }
}

/* === Hero === */
.hero {
  position: relative;
  z-index: 1;
  padding: calc(var(--header-h) + 100px) 24px 80px;
  text-align: center;
  max-width: var(--max);
  margin: 0 auto;
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(0,212,255,0.04);
  margin-bottom: 36px;
}
.hero__badge .pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{ opacity:1; } 50%{ opacity:0.2; } }

.hero h1 {
  font-size: clamp(2.8rem, 8vw, 6rem);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -0.04em;
  margin-bottom: 28px;
  background: linear-gradient(160deg, #fff 20%, var(--accent) 55%, var(--accent2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__sub {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 72px;
  line-height: 1.75;
}

/* Stats row */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 680px;
  margin: 0 auto;
}
.stat {
  padding: 22px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  backdrop-filter: blur(10px);
  text-align: center;
}
.stat__num {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.stat__label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hero { padding-top: calc(var(--header-h) + 60px); padding-bottom: 50px; }
}

/* Hero reveal */
.hero__badge, .hero h1, .hero__sub, .stats {
  opacity: 0;
  transform: translateY(28px);
}
.hero__badge.vis { opacity:1; transform:translateY(0); transition: opacity 0.6s ease, transform 0.6s ease; transition-delay: 0.15s; }
.hero h1.vis { opacity:1; transform:translateY(0); transition: opacity 0.7s ease, transform 0.7s ease; transition-delay: 0.35s; }
.hero__sub.vis { opacity:1; transform:translateY(0); transition: opacity 0.6s ease, transform 0.6s ease; transition-delay: 0.55s; }
.stats.vis { opacity:1; transform:translateY(0); transition: opacity 0.6s ease, transform 0.6s ease; transition-delay: 0.75s; }

/* === Section Header === */
.section {
  position: relative;
  z-index: 1;
  padding: 60px 24px 80px;
}
.section__head {
  max-width: var(--max);
  margin: 0 auto 44px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.section__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-hover), transparent);
}
.section__line--r { background: linear-gradient(90deg, transparent, var(--border-hover)); }
.section__tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  padding: 6px 16px;
  border: 1px solid rgba(0,212,255,0.12);
  border-radius: 100px;
  background: rgba(0,212,255,0.04);
}
.section__tag--purple {
  color: var(--accent2);
  border-color: rgba(139,92,246,0.15);
  background: rgba(139,92,246,0.05);
}

/* Section head reveal */
.section__head {
  opacity: 0;
  transform: translateY(20px);
}
.section__head.vis {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* === Project Grid === */
.grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
@media (max-width: 768px) {
  .grid { grid-template-columns: 1fr; gap: 16px; }
}

/* === Card === */
.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: border-color 0.35s, box-shadow 0.35s, transform 0.35s cubic-bezier(.4,0,.2,1);
  will-change: transform;
  cursor: default;
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow:
    0 0 50px -10px var(--glow),
    0 25px 60px -15px rgba(0,0,0,0.6);
}

/* Gradient top bar */
.card__bar {
  height: 3px;
  width: 100%;
}

/* Card body */
.card__body { padding: 28px 28px 24px; }

/* Top row: icon + badge */
.card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}
.card__icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card__icon svg { width: 22px; height: 22px; }

.card__badge {
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid;
}
.card__badge--web {
  color: var(--accent);
  border-color: rgba(0,212,255,0.18);
  background: rgba(0,212,255,0.06);
}
.card__badge--app {
  color: var(--accent2);
  border-color: rgba(139,92,246,0.18);
  background: rgba(139,92,246,0.06);
}
.card__badge--plugin {
  color: #f57c00;
  border-color: rgba(245,124,0,0.18);
  background: rgba(245,124,0,0.06);
}

/* Title / subtitle */
.card__name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 3px;
  color: var(--text);
}
.card__type {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Description */
.card__desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 18px;
}

/* Location + tags row */
.card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.card__loc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.03);
}
.card__loc svg { width: 12px; height: 12px; opacity: 0.5; }

.card__tag {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 500;
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* CTA link */
.card__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: gap 0.25s;
}
.card__link:hover { gap: 12px; }
.card__link svg { width: 15px; height: 15px; }

/* Card reveal */
.card {
  opacity: 0;
  transform: translateY(44px);
}
.card.vis {
  animation: cardIn 0.55s ease forwards;
}
@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}
/* Stagger via JS data-delay attribute */

/* === CTA Section === */
.cta-section {
  position: relative;
  z-index: 1;
  padding: 80px 24px 100px;
  text-align: center;
}
.cta-box {
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}
.cta-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, var(--accent) 40%, var(--accent2) 60%, transparent 95%);
}
.cta-box h2 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
}
.cta-box p {
  color: var(--text-muted);
  margin-bottom: 36px;
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow 0.3s, transform 0.2s;
  letter-spacing: 0.01em;
}
.cta-btn:hover {
  box-shadow: 0 0 40px var(--glow), 0 0 80px var(--glow2);
  transform: translateY(-2px);
}
.cta-btn svg { width: 18px; height: 18px; }
.cta-box--leads { margin-top: 40px; }
.cta-box--leads::before { background: linear-gradient(90deg, transparent 5%, #22c55e 40%, #3b82f6 60%, transparent 95%); }
.cta-box--leads strong { color: var(--accent); }
.cta-btn--leads { background: linear-gradient(135deg, #22c55e, #3b82f6); }
.cta-btn--leads:hover { box-shadow: 0 0 40px rgba(34,197,94,0.25), 0 0 80px rgba(59,130,246,0.15); }

/* CTA reveal */
.cta-box {
  opacity: 0;
  transform: translateY(30px);
}
.cta-box.vis {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

@media (max-width: 560px) {
  .cta-box { padding: 40px 24px; }
}

/* === Footer === */
.footer {
  position: relative;
  z-index: 1;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
}
.footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer__copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.footer__links { display: flex; gap: 20px; }
.footer__links a {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer__links a:hover { color: var(--accent); }

/* === Legal Pages (Impressum, Datenschutz) === */
.legal {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 60px) 24px 80px;
}
.legal h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 32px;
  letter-spacing: -0.02em;
}
.legal h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 12px;
}
.legal p, .legal li {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.75;
  margin-bottom: 12px;
}
.legal ul { padding-left: 20px; }
.legal a { color: var(--accent); text-decoration: none; }
.legal a:hover { text-decoration: underline; }

/* === Theme Toggle Button === */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s;
  padding: 0;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--border-hover); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-icon--light { display: none; }
[data-theme="light"] .theme-icon--dark { display: none; }
[data-theme="light"] .theme-icon--light { display: block; }

/* === USP Strip === */
.usp-strip {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 52px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.usp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}
.usp::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  flex-shrink: 0;
}
.usp-strip {
  opacity: 0;
  transform: translateY(20px);
}
.usp-strip.vis {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: 0.9s;
}

/* === Light Theme === */
[data-theme="light"] {
  --bg: #f4f7fb;
  --bg2: #edf2f7;
  --surface: rgba(255,255,255,0.65);
  --surface-hover: rgba(255,255,255,0.85);
  --border: rgba(15,23,42,0.08);
  --border-hover: rgba(15,23,42,0.16);
  --text: #0f172a;
  --text-muted: #475569;
  --accent: #0284c7;
  --accent2: #7c3aed;
  --glow: rgba(2,132,199,0.08);
  --glow2: rgba(124,58,237,0.06);
}
[data-theme="light"] .bg-grid::before {
  background-image:
    linear-gradient(rgba(15,23,42,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,0.035) 1px, transparent 1px);
}
[data-theme="light"] .bg-orb--1 { background: rgba(2,132,199,0.07); }
[data-theme="light"] .bg-orb--2 { background: rgba(124,58,237,0.055); }
[data-theme="light"] .bg-orb--3 { background: rgba(2,132,199,0.04); }
[data-theme="light"] .header { background: rgba(244,247,251,0.82); }
[data-theme="light"] .hero h1 {
  background: linear-gradient(160deg, #0f172a 15%, #0284c7 50%, #7c3aed 90%);
  -webkit-background-clip: text;
  background-clip: text;
}
[data-theme="light"] .card {
  background: rgba(255,255,255,0.6);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
[data-theme="light"] .card:hover {
  box-shadow: 0 14px 44px rgba(0,0,0,0.09);
}
[data-theme="light"] .cta-box { background: rgba(255,255,255,0.6); }
[data-theme="light"] .cta-box--leads strong { color: #16a34a; }
[data-theme="light"] .stat { background: rgba(255,255,255,0.5); }
[data-theme="light"] .burger span { background: var(--text); }
[data-theme="light"] .scroll-progress { background: linear-gradient(90deg, #0284c7, #7c3aed); }
[data-theme="light"] .section__tag { color: #0369a1; border-color: rgba(3,105,161,0.15); background: rgba(3,105,161,0.06); }
[data-theme="light"] .section__tag--purple { color: #6d28d9; border-color: rgba(109,40,217,0.15); background: rgba(109,40,217,0.06); }
[data-theme="light"] .hero__badge { color: #0369a1; border-color: rgba(3,105,161,0.15); background: rgba(3,105,161,0.06); }
[data-theme="light"] .hero__badge .pulse { background: #0369a1; }
[data-theme="light"] .card__badge--web { color: #0369a1; border-color: rgba(3,105,161,0.18); background: rgba(3,105,161,0.07); }
[data-theme="light"] .card__badge--app { color: #6d28d9; border-color: rgba(109,40,217,0.18); background: rgba(109,40,217,0.07); }
[data-theme="light"] .card__badge--plugin { color: #e65100; border-color: rgba(230,81,0,0.18); background: rgba(230,81,0,0.07); }
[data-theme="light"] .card__tag { background: rgba(0,0,0,0.04); }
[data-theme="light"] .card__loc { background: rgba(0,0,0,0.04); }

@media (max-width: 768px) {
  [data-theme="light"] .header__nav { background: rgba(244,247,251,0.97); }
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card, .hero__badge, .hero h1, .hero__sub, .stats,
  .section__head, .cta-box { opacity: 1; transform: none; }
}
