/* =============================================
   D.Code Landing Page
   ============================================= */

/* --- Theme: Electric Indigo Dark (default) --- */
:root,
[data-theme="ei-dark"] {
  --bg: #0A0A1F;
  --bg-rgb: 10, 10, 31;
  --surface: #16162F;
  --surface-high: #1E1E3D;
  --primary: #6366F1;
  --primary-rgb: 99, 102, 241;
  --secondary: #EC4899;
  --secondary-rgb: 236, 72, 153;
  --accent: #22D3EE;
  --accent-rgb: 34, 211, 238;
  --text: #E0E0E0;
  --text-muted: rgba(255, 255, 255, 0.55);
  --border: rgba(255, 255, 255, 0.08);
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.06);
  --header-bg: rgba(10, 10, 31, 0.85);
  --phone-bezel: #1a1a2e;
  --scheme-dot: #6366F1;
  --scheme-dot-ring: #EC4899;
}

/* --- Theme: Electric Indigo Light --- */
[data-theme="ei-light"] {
  --bg: #F8FAFC;
  --bg-rgb: 248, 250, 252;
  --surface: #FFFFFF;
  --surface-high: #F1F5F9;
  --primary: #4F46E5;
  --primary-rgb: 79, 70, 229;
  --secondary: #DB2777;
  --secondary-rgb: 219, 39, 119;
  --accent: #0891B2;
  --accent-rgb: 8, 145, 178;
  --text: #1E293B;
  --text-muted: rgba(0, 0, 0, 0.5);
  --border: rgba(0, 0, 0, 0.08);
  --card-bg: rgba(0, 0, 0, 0.03);
  --card-border: rgba(0, 0, 0, 0.06);
  --header-bg: rgba(248, 250, 252, 0.85);
  --phone-bezel: #e2e8f0;
  --scheme-dot: #4F46E5;
  --scheme-dot-ring: #DB2777;
}

/* --- Theme: Arctic Teal Dark --- */
[data-theme="at-dark"] {
  --bg: #061417;
  --bg-rgb: 6, 20, 23;
  --surface: #0D2126;
  --surface-high: #143338;
  --primary: #14B8A6;
  --primary-rgb: 20, 184, 166;
  --secondary: #F87171;
  --secondary-rgb: 248, 113, 113;
  --accent: #5EEAD4;
  --accent-rgb: 94, 234, 212;
  --text: #E0E0E0;
  --text-muted: rgba(255, 255, 255, 0.55);
  --border: rgba(255, 255, 255, 0.08);
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.06);
  --header-bg: rgba(6, 20, 23, 0.85);
  --phone-bezel: #0D2126;
  --scheme-dot: #14B8A6;
  --scheme-dot-ring: #F87171;
}

/* --- Theme: Arctic Teal Light --- */
[data-theme="at-light"] {
  --bg: #F0FDFA;
  --bg-rgb: 240, 253, 250;
  --surface: #FFFFFF;
  --surface-high: #CCFBF1;
  --primary: #0F766E;
  --primary-rgb: 15, 118, 110;
  --secondary: #DC2626;
  --secondary-rgb: 220, 38, 38;
  --accent: #0D9488;
  --accent-rgb: 13, 148, 136;
  --text: #134E4A;
  --text-muted: rgba(0, 0, 0, 0.5);
  --border: rgba(0, 0, 0, 0.08);
  --card-bg: rgba(0, 0, 0, 0.03);
  --card-border: rgba(0, 0, 0, 0.06);
  --header-bg: rgba(240, 253, 250, 0.85);
  --phone-bezel: #e2e8f0;
  --scheme-dot: #0F766E;
  --scheme-dot-ring: #DC2626;
}

/* --- Language Toggle --- */
[data-lang="de"] .i18n-en { display: none !important; }
[data-lang="en"] .i18n-de { display: none !important; }

/* --- Mode Icon Toggle --- */
[data-theme$="-dark"] .light-icon { display: none; }
[data-theme$="-light"] .dark-icon { display: none; }

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

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

h2 {
  font-size: 48px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 64px;
  letter-spacing: -0.5px;
}

/* --- Header --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.5s ease;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 28px;
  font-weight: 900;
  text-decoration: none;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: opacity 0.3s;
}
.logo:hover { opacity: 0.8; }

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
}
.control-btn:hover {
  background: rgba(var(--primary-rgb), 0.15);
  border-color: rgba(var(--primary-rgb), 0.3);
}

.mode-icon {
  font-size: 22px;
}

.scheme-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--scheme-dot);
  box-shadow: 0 0 0 3px var(--scheme-dot-ring);
  transition: all 0.4s ease;
}

.lang-btn {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
}

/* --- Hero --- */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 40px 80px;
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.25) 0%, rgba(var(--accent-rgb), 0.08) 40%, transparent 70%);
  border-radius: 50%;
  filter: blur(80px);
  animation: hero-pulse 8s ease-in-out infinite;
  pointer-events: none;
}
.hero-glow.secondary {
  width: 500px;
  height: 500px;
  transform: translate(-30%, -40%);
  background: radial-gradient(circle, rgba(var(--secondary-rgb), 0.15) 0%, transparent 60%);
  animation: hero-pulse 12s ease-in-out infinite reverse;
}

@keyframes hero-pulse {
  0%, 100% { transform: translate(-50%, -60%) scale(1); opacity: 1; }
  50% { transform: translate(-50%, -60%) scale(1.15); opacity: 0.7; }
}

.hero-container {
  position: relative;
  z-index: 2;
}

#hero h1 {
  font-size: 120px;
  font-weight: 900;
  letter-spacing: -3px;
  line-height: 1;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 40px rgba(var(--primary-rgb), 0.4));
}

.tagline {
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 24px;
  opacity: 0.9;
}

.hero-desc {
  font-size: 18px;
  max-width: 700px;
  margin: 0 auto 48px;
  color: var(--text-muted);
  line-height: 1.8;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: rgba(var(--primary-rgb), 0.12);
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.5s ease;
}

.badge-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
}

.hero-badge .material-symbols-outlined {
  font-size: 22px;
  color: var(--primary);
}

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 36px 28px;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: default;
}
.feature-card:hover {
  transform: translateY(-8px);
  border-color: rgba(var(--primary-rgb), 0.3);
  box-shadow: 0 20px 40px rgba(var(--primary-rgb), 0.12);
  background: rgba(var(--primary-rgb), 0.06);
}

.feature-icon {
  font-size: 48px;
  color: var(--primary);
  margin-bottom: 20px;
  display: block;
  transition: all 0.4s ease;
  filter: drop-shadow(0 0 12px rgba(var(--primary-rgb), 0.3));
}
.feature-card:hover .feature-icon {
  filter: drop-shadow(0 0 24px rgba(var(--primary-rgb), 0.5));
  transform: scale(1.1);
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* --- Screenshots --- */
#screenshots {
  overflow: hidden;
}

.screenshots-scroll {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 max(40px, calc((100vw - 1200px) / 2 + 40px)) 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
  -webkit-overflow-scrolling: touch;
}
.screenshots-scroll::-webkit-scrollbar {
  height: 6px;
}
.screenshots-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.screenshots-scroll::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

.phone-frame {
  flex: 0 0 auto;
  scroll-snap-align: center;
  width: 220px;
  background: var(--phone-bezel);
  border-radius: 32px;
  padding: 10px;
  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: all 0.4s ease;
  position: relative;
}
.phone-frame::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 20px;
  background: var(--bg);
  border-radius: 10px;
  z-index: 2;
  transition: background-color 0.5s ease;
}
.phone-frame:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 35px 60px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(var(--primary-rgb), 0.2);
}

.phone-frame img {
  width: 100%;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  border-radius: 22px;
  display: block;
  background: linear-gradient(160deg, var(--surface), var(--surface-high));
}

/* --- Privacy / USPs --- */
.usp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.usp-card {
  text-align: center;
  padding: 48px 32px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  transition: all 0.4s ease;
}
.usp-card:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  box-shadow: 0 16px 32px rgba(var(--accent-rgb), 0.1);
}

.usp-icon {
  font-size: 56px;
  color: var(--accent);
  margin-bottom: 24px;
  display: block;
  filter: drop-shadow(0 0 16px rgba(var(--accent-rgb), 0.4));
}

.usp-card h3 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
}

.usp-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* --- Footer --- */
footer {
  padding: 60px 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  border-top: 1px solid var(--border);
  transition: border-color 0.5s ease;
}

.footer-links {
  margin-top: 8px;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s;
}
.footer-links a:hover {
  color: var(--primary);
}
.footer-sep {
  margin: 0 8px;
  opacity: 0.4;
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }
.reveal:nth-child(5) { transition-delay: 0.32s; }
.reveal:nth-child(6) { transition-delay: 0.40s; }
.reveal:nth-child(7) { transition-delay: 0.48s; }
.reveal:nth-child(8) { transition-delay: 0.56s; }

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  #hero h1 { font-size: 90px; }
  .tagline { font-size: 24px; }
  h2 { font-size: 40px; }
}

@media (max-width: 768px) {
  .container { padding: 0 24px; }
  .header-inner { padding: 14px 24px; }
  .section { padding: 80px 0; }

  #hero {
    min-height: auto;
    padding: 140px 24px 80px;
  }
  #hero h1 { font-size: 64px; letter-spacing: -2px; }
  .tagline { font-size: 20px; }
  .hero-desc { font-size: 16px; }
  .hero-glow { width: 400px; height: 400px; }
  .hero-glow.secondary { width: 300px; height: 300px; }

  h2 { font-size: 36px; margin-bottom: 48px; }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .feature-card {
    padding: 28px 24px;
    text-align: left;
    display: grid;
    grid-template-columns: 56px 1fr;
    grid-template-rows: auto auto;
    column-gap: 16px;
    row-gap: 4px;
    align-items: center;
  }
  .feature-icon {
    font-size: 40px;
    margin-bottom: 0;
    grid-row: 1 / 3;
    align-self: center;
  }
  .feature-card h3 { margin-bottom: 0; }
  .feature-card p { font-size: 13px; }

  .screenshots-scroll {
    gap: 16px;
    padding-left: 24px;
    padding-right: 24px;
  }
  .phone-frame { width: 180px; border-radius: 28px; padding: 8px; }
  .phone-frame::before { width: 50px; height: 16px; top: 12px; }
  .phone-frame img { border-radius: 20px; }

  .usp-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .usp-card { padding: 36px 24px; }
  .usp-icon { font-size: 44px; }
  .usp-card h3 { font-size: 20px; }

  .logo { font-size: 24px; }
  .control-btn { width: 38px; height: 38px; border-radius: 10px; }
}

@media (max-width: 480px) {
  #hero h1 { font-size: 48px; }
  .tagline { font-size: 17px; }
  .hero-badge { font-size: 14px; padding: 10px 20px; gap: 8px; }
  h2 { font-size: 30px; }
  .phone-frame { width: 160px; }
  .controls { gap: 6px; }
  .control-btn { width: 36px; height: 36px; }
}
