/* ============================================================
   BYIOT Smart Home — Main Stylesheet
   ============================================================ */

/* ---------- Custom Properties ---------- */
:root {
  --bg:            #F5F7FC;
  --surface:       #FFFFFF;
  --surface-2:     #EEF1F8;
  --border:        #DDE2EE;
  --accent:        #0099CC;
  --accent-dim:    rgba(0, 153, 204, 0.1);
  --accent-glow:   rgba(0, 153, 204, 0.3);
  --green:         #059669;
  --green-dim:     rgba(5, 150, 105, 0.1);
  --text:          #0D1117;
  --muted:         #6E7A8A;
  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     16px;
  --font:          'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', monospace;
  --transition:    0.25s ease;
  --transition-md: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Dark Theme ---------- */
[data-theme="dark"] {
  --bg:            #0A0A0A;
  --surface:       #111111;
  --surface-2:     #191919;
  --border:        #252525;
  --accent:        #00C2FF;
  --accent-dim:    rgba(0, 194, 255, 0.08);
  --accent-glow:   rgba(0, 194, 255, 0.25);
  --green:         #4EFFA1;
  --green-dim:     rgba(78, 255, 161, 0.1);
  --text:          #F0F0F0;
  --muted:         #888888;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-dim); color: var(--accent); }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--text); }

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

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================================
   KNX NAVIGATION
   ============================================================ */

.knx-nav-wrapper {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 24px;
}

.knx-logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.knx-logo span {
  color: var(--accent);
}

/* ---- KNX Switch Container ---- */
.knx-switch-container {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Main Switch Button ---- */
.knx-switch {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.knx-switch:hover {
  border-color: var(--accent);
  box-shadow: 0 0 18px var(--accent-glow), 0 0 40px rgba(0, 153, 204, 0.15);
}

.knx-switch.active {
  border-color: var(--accent);
  background: rgba(0, 153, 204, 0.1);
  box-shadow: 0 0 24px var(--accent-glow), 0 0 60px rgba(0, 153, 204, 0.2);
  transform: scale(1.08);
}

.knx-switch-icon {
  width: 24px;
  height: 24px;
  position: relative;
  transition: transform var(--transition-md);
}

.knx-switch.active .knx-switch-icon {
  transform: rotate(45deg);
}

/* Inner ring animation */
.knx-switch::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: border-color var(--transition);
}

.knx-switch.active::before {
  border-color: rgba(0, 153, 204, 0.3);
  animation: knx-ring-pulse 2s ease infinite;
}

@keyframes knx-ring-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.08); }
}

/* ---- Radial Menu Items ---- */
.knx-menu-item {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.25s ease;
  z-index: 9;
}

.knx-menu-item.visible {
  transform: var(--item-translate) scale(1);
  opacity: 1;
  pointer-events: all;
}

.knx-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  min-width: 68px;
  transition: border-color var(--transition), background var(--transition),
              box-shadow var(--transition), color var(--transition);
  -webkit-user-select: none; user-select: none;
}

.knx-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 14px var(--accent-glow);
}

.knx-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Theme Toggle ---- */
.knx-theme-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), box-shadow var(--transition), color var(--transition);
  color: var(--muted);
  flex-shrink: 0;
}
.knx-theme-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}
.knx-theme-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Stagger delays */
.knx-menu-item:nth-child(1) { transition-delay: 0.04s; }
.knx-menu-item:nth-child(2) { transition-delay: 0.08s; }
.knx-menu-item:nth-child(3) { transition-delay: 0.12s; }
.knx-menu-item:nth-child(4) { transition-delay: 0.16s; }

/* Backdrop */
.knx-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(180, 195, 220, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-md);
  z-index: 999;
}
.knx-backdrop.visible { opacity: 1; pointer-events: all; }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
}

.section-sm { padding: 64px 0; }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.7;
}

.highlight { color: var(--accent); }
.highlight-green { color: var(--green); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
}
.btn-primary:hover {
  background: #0088BB;
  color: #FFFFFF;
  box-shadow: 0 0 28px var(--accent-glow);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover {
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-2px);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 28px rgba(0, 153, 204, 0.15);
  transform: translateY(-4px);
}

.card-icon {
  width: 48px; height: 48px;
  background: var(--accent-dim);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.card-icon svg {
  width: 24px; height: 24px;
  stroke: var(--accent); fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.card-text {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
}

/* ============================================================
   HERO
   ============================================================ */

#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 120px 0 80px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Animated grid */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 153, 204, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 153, 204, 0.08) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

/* Gradient orbs */
.hero-orb-1 {
  position: absolute;
  top: -200px;
  left: 50%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(0, 153, 204, 0.12) 0%, transparent 65%);
  transform: translateX(-50%);
  animation: orb-drift 8s ease-in-out infinite alternate;
}

.hero-orb-2 {
  position: absolute;
  bottom: -100px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.1) 0%, transparent 65%);
  animation: orb-drift 11s ease-in-out infinite alternate-reverse;
}

@keyframes orb-drift {
  from { transform: translateX(-50%) scale(1); }
  to   { transform: translateX(-50%) scale(1.1) translateY(-20px); }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--accent-dim);
  border: 1px solid rgba(0, 153, 204, 0.3);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 28px;
}

.hero-badge-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

.hero-title {
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero-title .line-2 {
  background: linear-gradient(135deg, var(--accent) 0%, var(--green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 40px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.hero-stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-stat-num {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* House SVG side panel */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-svg-wrap {
  position: relative;
  width: 100%;
  max-width: 540px;
}

.house-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  overflow: hidden;
}

.house-panel svg {
  width: 100%;
  height: auto;
}

/* KNX node animations */
.knx-node {
  fill: var(--accent);
  animation: node-pulse 2.5s ease-in-out infinite;
}

.knx-node:nth-child(2n) { animation-delay: 0.5s; fill: var(--green); }
.knx-node:nth-child(3n) { animation-delay: 1s; }
.knx-node:nth-child(4n) { animation-delay: 1.5s; fill: var(--green); }

@keyframes node-pulse {
  0%, 100% { r: 4; opacity: 0.8; }
  50% { r: 6; opacity: 1; }
}

.knx-connection {
  stroke: var(--accent);
  stroke-width: 0.8;
  opacity: 0.25;
  stroke-dasharray: 4 4;
  animation: dash-flow 3s linear infinite;
}

@keyframes dash-flow {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -32; }
}

/* Status overlay items */
.status-chip {
  position: absolute;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  animation: float-chip 4s ease-in-out infinite alternate;
}

.status-chip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(78,255,161,0.6);
}

.status-chip-1 { top: -16px; right: 20px; animation-duration: 4s; }
.status-chip-2 { bottom: 20px; left: -16px; animation-duration: 5s; animation-delay: 1s; }

@keyframes float-chip {
  from { transform: translateY(0); }
  to   { transform: translateY(-8px); }
}

/* ============================================================
   KNX INTRO SECTION
   ============================================================ */

.knx-intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.knx-pillars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 40px;
}

.knx-pillar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
}
.knx-pillar:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.knx-pillar-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 6px;
}

.knx-pillar-text {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Feature list */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 32px;
}

.feature-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.feature-icon {
  width: 36px; height: 36px;
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.feature-icon svg {
  width: 16px; height: 16px;
  stroke: var(--accent); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.feature-item h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.feature-item p { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }

/* ============================================================
   SERVICES SECTION
   ============================================================ */

.services-header {
  text-align: center;
  margin-bottom: 56px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  cursor: pointer;
  transition: all var(--transition-md);
  position: relative;
  overflow: hidden;
}

.service-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--green));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-md);
}

.service-card:hover {
  border-color: var(--accent);
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0, 153, 204, 0.15);
}
.service-card:hover::after { transform: scaleX(1); }

.service-number {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-bottom: 20px;
}

/* ============================================================
   STATS STRIP
   ============================================================ */

.stats-strip {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 48px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.stat-item {
  text-align: center;
  padding: 16px 24px;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }

.stat-num {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ============================================================
   PROJECTS SECTION
   ============================================================ */

.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 48px;
}

.projects-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 280px 220px;
  gap: 20px;
}

.project-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: all var(--transition-md);
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
  transform: scale(1.02);
}

.project-card:first-child {
  grid-row: span 2;
}

.project-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  opacity: 0.35;
  transition: opacity var(--transition);
}
.project-card:hover .project-bg { opacity: 0.25; }

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(238,241,248,0.97) 0%, transparent 60%);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.project-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent-dim);
  border: 1px solid rgba(0,153,204,0.25);
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.project-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.project-meta { font-size: 0.78rem; color: var(--muted); }

/* ============================================================
   PROCESS SECTION
   ============================================================ */

.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
  margin-top: 48px;
}

.process-steps::before {
  content: '';
  position: absolute;
  top: 28px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--green) 100%);
  opacity: 0.3;
}

.process-step {
  text-align: center;
  padding: 0 24px;
  position: relative;
}

.process-num {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent);
  position: relative;
  z-index: 1;
  transition: all var(--transition);
}
.process-step:hover .process-num {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  background: var(--accent-dim);
}

.process-step h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; }
.process-step p { font-size: 0.83rem; color: var(--muted); line-height: 1.6; }

/* ============================================================
   CTA SECTION
   ============================================================ */

.cta-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin: 80px 0;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -120px; left: 50%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0, 153, 204, 0.08) 0%, transparent 70%);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
}

.cta-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 16px;
  position: relative;
}

.cta-text {
  font-size: 1rem;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.cta-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand-name {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.footer-brand-name span { color: var(--accent); }

.footer-brand-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.footer-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--text);
  opacity: 0.8;
  transition: all var(--transition);
}
.footer-links a:hover { opacity: 1; color: var(--accent); padding-left: 4px; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 153, 204, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 140px;
}

.form-select option { background: var(--surface); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Alert messages */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 20px;
  display: none;
}
.alert.show { display: block; }
.alert-success { background: var(--green-dim); border: 1px solid rgba(5,150,105,0.3); color: var(--green); }
.alert-error { background: rgba(220,0,0,0.07); border: 1px solid rgba(200,0,0,0.25); color: #B91C1C; }

/* ============================================================
   PAGE HEADER
   ============================================================ */

.page-header {
  padding: 160px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: -100px; left: 50%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(0, 153, 204, 0.08) 0%, transparent 65%);
  transform: translateX(-50%);
  pointer-events: none;
}

.page-header-title {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.page-header-sub {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ============================================================
   CONFIGURATOR
   ============================================================ */

.config-builder {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}

.config-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: sticky;
  top: 100px;
}

.config-panel-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.config-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.config-line:last-of-type { border-bottom: none; }
.config-line-label { color: var(--muted); }
.config-line-val { font-weight: 600; color: var(--accent); }

.config-total {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 700;
}

.config-total-val { color: var(--green); }

.option-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
}

.option-group-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.option-group-icon {
  width: 32px; height: 32px;
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.option-group-icon svg {
  width: 16px; height: 16px;
  stroke: var(--accent); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.option-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.option-chip {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--muted);
  background: var(--surface-2);
}
.option-chip:hover { border-color: var(--accent); color: var(--accent); }
.option-chip.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: center;
  transition: all var(--transition);
}
.team-card:hover { border-color: var(--accent); transform: translateY(-4px); }

.team-avatar {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.team-info { padding: 24px; }
.team-name { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.team-role { font-size: 0.82rem; color: var(--accent); font-weight: 600; margin-bottom: 10px; }
.team-bio { font-size: 0.83rem; color: var(--muted); line-height: 1.6; }

/* Certification badges */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.cert-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition);
}
.cert-badge:hover { border-color: var(--green); }

.cert-icon {
  width: 40px; height: 40px;
  background: var(--green-dim);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cert-icon svg {
  width: 20px; height: 20px;
  stroke: var(--green); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.cert-name { font-size: 0.88rem; font-weight: 700; margin-bottom: 2px; }
.cert-issuer { font-size: 0.75rem; color: var(--muted); }

/* ============================================================
   SCROLL ANIMATIONS
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16,1,0.3,1);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .grid-2, .knx-intro-grid { grid-template-columns: 1fr; gap: 48px; }
  .grid-3, .team-grid { grid-template-columns: 1fr 1fr; }
  .grid-4, .stats-grid, .process-steps { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .projects-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .project-card:first-child { grid-row: span 1; }
  .hero-visual { display: none; }
  .config-builder { grid-template-columns: 1fr; }
  .config-panel { position: static; }
}

@media (max-width: 768px) {
  .section { padding: 64px 0; }
  .section-sm { padding: 48px 0; }
  .container { padding: 0 20px; }
  .grid-3, .team-grid, .process-steps { grid-template-columns: 1fr; }
  .grid-4, .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .projects-grid { grid-template-columns: 1fr; }
  .projects-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .cta-section { padding: 48px 24px; margin: 56px 0; }
  .stat-item { border-right: none; border-bottom: 1px solid var(--border); }
  .stat-item:last-child { border-bottom: none; }

  /* Tighter vertical rhythm on phones — less wasted space up top */
  #hero { min-height: auto; padding: 104px 0 64px; }
  .page-header { padding: 116px 0 56px; }
  .knx-intro-grid { gap: 40px; }

  /* KNX nav mobile */
  .knx-nav-wrapper { top: 16px; }
  .knx-logo { display: none; }
}

@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .section { padding: 56px 0; }
  .hero-actions { flex-direction: column; }
  .hero-stats { gap: 24px; }
  .cta-actions { flex-direction: column; align-items: center; }
  .option-chips { flex-direction: column; }

  /* Full-width, easy-to-tap buttons */
  .hero-actions .btn,
  .cta-actions .btn { width: 100%; max-width: 340px; justify-content: center; }

  /* Headline sizes tuned for small screens */
  .hero-title { font-size: clamp(2.1rem, 9vw, 4.8rem); }
  .page-header-title { font-size: clamp(2rem, 8vw, 4rem); }
  .section-title { font-size: clamp(1.7rem, 7vw, 3rem); }

  /* Trim padding further */
  .page-header { padding: 100px 0 44px; }
  .cta-section { padding: 40px 20px; }
}

/* ============================================================
   DARK THEME — HARDCODED COLOR OVERRIDES
   ============================================================ */

[data-theme="dark"] .knx-backdrop {
  background: rgba(10, 10, 10, 0.6);
}
[data-theme="dark"] .knx-switch-icon { color: #ffffff; }
[data-theme="dark"] .knx-switch:hover {
  box-shadow: 0 0 18px var(--accent-glow), 0 0 40px rgba(0, 194, 255, 0.15);
}
[data-theme="dark"] .knx-switch.active {
  background: rgba(0, 194, 255, 0.08);
  box-shadow: 0 0 24px var(--accent-glow), 0 0 60px rgba(0, 194, 255, 0.2);
}
[data-theme="dark"] .knx-switch.active::before {
  border-color: rgba(0, 194, 255, 0.3);
}
[data-theme="dark"] .btn-primary { color: #0A0A0A; }
[data-theme="dark"] .btn-primary:hover { background: #22d0ff; color: #0A0A0A; }
[data-theme="dark"] .card:hover {
  box-shadow: 0 0 28px rgba(0, 194, 255, 0.08);
}
[data-theme="dark"] .hero-grid {
  background-image:
    linear-gradient(rgba(0, 194, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 194, 255, 0.04) 1px, transparent 1px);
}
[data-theme="dark"] .hero-orb-1 {
  background: radial-gradient(circle, rgba(0, 194, 255, 0.08) 0%, transparent 65%);
}
[data-theme="dark"] .hero-orb-2 {
  background: radial-gradient(circle, rgba(78, 255, 161, 0.06) 0%, transparent 65%);
}
[data-theme="dark"] .hero-badge { border-color: rgba(0, 194, 255, 0.25); }
[data-theme="dark"] .status-chip { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); }
[data-theme="dark"] .status-chip-dot { box-shadow: 0 0 8px rgba(78, 255, 161, 0.6); }
[data-theme="dark"] .service-card:hover {
  box-shadow: 0 20px 60px rgba(0, 194, 255, 0.1);
}
[data-theme="dark"] .project-card:hover {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .project-overlay {
  background: linear-gradient(to top, rgba(10, 10, 10, 0.95) 0%, transparent 60%);
}
[data-theme="dark"] .project-bg { opacity: 0.15; }
[data-theme="dark"] .project-card:hover .project-bg { opacity: 0.08; }
[data-theme="dark"] .project-tag { border-color: rgba(0, 194, 255, 0.25); }
[data-theme="dark"] .cta-section::before {
  background: radial-gradient(circle, rgba(0, 194, 255, 0.06) 0%, transparent 70%);
}
[data-theme="dark"] .page-header::before {
  background: radial-gradient(circle, rgba(0, 194, 255, 0.06) 0%, transparent 65%);
}
[data-theme="dark"] .alert-error {
  background: rgba(255, 80, 80, 0.1);
  border-color: rgba(255, 100, 100, 0.3);
  color: #ff6b6b;
}
[data-theme="dark"] .alert-success { border-color: rgba(78, 255, 161, 0.3); }
[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-textarea:focus,
[data-theme="dark"] .form-select:focus {
  box-shadow: 0 0 0 3px rgba(0, 194, 255, 0.1);
}
