/* ===== DESIGN TOKENS ===== */
:root {
  /* Type Scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* Fonts */
  --font-display: 'Cabinet Grotesk', 'Helvetica Neue', sans-serif;
  --font-body: 'General Sans', 'Helvetica Neue', sans-serif;
}

/* ===== INDUSTRIAL / AUTOMATION COLOR PALETTE ===== */
/* Cool slate + electric blue accent — professional, technical, trustworthy */

:root,
[data-theme='light'] {
  --color-bg: #f4f5f7;
  --color-surface: #ffffff;
  --color-surface-2: #fafbfc;
  --color-surface-offset: #eef0f3;
  --color-surface-offset-2: #e4e7ec;
  --color-surface-dynamic: #d8dce4;
  --color-divider: #d0d5dd;
  --color-border: #c4c9d4;

  --color-text: #1a1d26;
  --color-text-muted: #5f6577;
  --color-text-faint: #9ea3b0;
  --color-text-inverse: #f4f5f7;

  --color-primary: #1d5ed4;
  --color-primary-hover: #1548a8;
  --color-primary-active: #0e3680;
  --color-primary-highlight: #dbe6f9;

  /* Brand colors for the 3 marks */
  --color-nicehome: #e63946;
  --color-nicehome-bg: #fef2f2;
  --color-mhouse: #2e7d32;
  --color-mhouse-bg: #f0fdf0;
  --color-moovo: #e67e22;
  --color-moovo-bg: #fffbf0;

  --color-success: #2e7d32;
  --color-warning: #e67e22;
  --color-error: #d32f2f;

  --shadow-sm: 0 1px 2px oklch(0.2 0.02 250 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.02 250 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.02 250 / 0.12);
}

[data-theme='dark'] {
  --color-bg: #111318;
  --color-surface: #1a1d24;
  --color-surface-2: #1f222b;
  --color-surface-offset: #161920;
  --color-surface-offset-2: #22252e;
  --color-surface-dynamic: #2a2d38;
  --color-divider: #2a2d38;
  --color-border: #363a47;

  --color-text: #d4d7e0;
  --color-text-muted: #8a8f9e;
  --color-text-faint: #5a5f6e;
  --color-text-inverse: #1a1d26;

  --color-primary: #5b8fef;
  --color-primary-hover: #4078dc;
  --color-primary-active: #2d63c4;
  --color-primary-highlight: #1e2a42;

  --color-nicehome: #f06070;
  --color-nicehome-bg: #2a1a1c;
  --color-mhouse: #5cb85c;
  --color-mhouse-bg: #1a2a1a;
  --color-moovo: #f0a050;
  --color-moovo-bg: #2a2218;

  --color-success: #5cb85c;
  --color-warning: #f0a050;
  --color-error: #ef5350;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #111318;
    --color-surface: #1a1d24;
    --color-surface-2: #1f222b;
    --color-surface-offset: #161920;
    --color-surface-offset-2: #22252e;
    --color-surface-dynamic: #2a2d38;
    --color-divider: #2a2d38;
    --color-border: #363a47;
    --color-text: #d4d7e0;
    --color-text-muted: #8a8f9e;
    --color-text-faint: #5a5f6e;
    --color-text-inverse: #1a1d26;
    --color-primary: #5b8fef;
    --color-primary-hover: #4078dc;
    --color-primary-active: #2d63c4;
    --color-primary-highlight: #1e2a42;
    --color-nicehome: #f06070;
    --color-nicehome-bg: #2a1a1c;
    --color-mhouse: #5cb85c;
    --color-mhouse-bg: #1a2a1a;
    --color-moovo: #f0a050;
    --color-moovo-bg: #2a2218;
    --color-success: #5cb85c;
    --color-warning: #f0a050;
    --color-error: #ef5350;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
  }
}

/* ===== GLOBAL LAYOUT ===== */
.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
  transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text);
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
}

.logo-text span {
  color: var(--color-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header-contact {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header-contact-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.header-contact-link:hover {
  color: var(--color-primary);
}

.header-contact-link svg {
  flex-shrink: 0;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
}
.theme-toggle:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

/* ===== BRAND NAV (top tabs) ===== */
.brand-nav {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  position: sticky;
  top: 64px;
  z-index: 40;
}

.brand-nav-inner {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
}

.brand-tab {
  flex: 1;
  max-width: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 3px solid transparent;
  transition:
    color var(--transition-interactive),
    border-color var(--transition-interactive),
    background var(--transition-interactive);
}

.brand-tab:hover {
  color: var(--color-text);
  background: var(--color-surface-offset);
}

.brand-tab--nicehome.active,
.brand-tab--nicehome:hover {
  color: var(--color-nicehome);
  border-bottom-color: var(--color-nicehome);
}

.brand-tab--mhouse.active,
.brand-tab--mhouse:hover {
  color: var(--color-mhouse);
  border-bottom-color: var(--color-mhouse);
}

.brand-tab--moovo.active,
.brand-tab--moovo:hover {
  color: var(--color-moovo);
  border-bottom-color: var(--color-moovo);
}

.brand-tab-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.brand-tab--nicehome .brand-tab-dot { background: var(--color-nicehome); }
.brand-tab--mhouse .brand-tab-dot { background: var(--color-mhouse); }
.brand-tab--moovo .brand-tab-dot { background: var(--color-moovo); }

/* ===== HERO ===== */
.hero {
  padding: clamp(var(--space-12), 8vw, var(--space-24)) 0;
  text-align: center;
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg) 100%);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.hero h1 span {
  color: var(--color-primary);
}

.hero-sub {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto var(--space-8);
}

.hero-brands {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.hero-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.01em;
}

.hero-brand-badge--nicehome {
  background: var(--color-nicehome-bg);
  color: var(--color-nicehome);
}
.hero-brand-badge--mhouse {
  background: var(--color-mhouse-bg);
  color: var(--color-mhouse);
}
.hero-brand-badge--moovo {
  background: var(--color-moovo-bg);
  color: var(--color-moovo);
}

/* ===== BRAND SECTION ===== */
.brand-section {
  padding: clamp(var(--space-12), 6vw, var(--space-20)) 0;
  scroll-margin-top: 140px;
}

.brand-section + .brand-section {
  border-top: 1px solid var(--color-divider);
}

.brand-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.brand-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-icon--nicehome { background: var(--color-nicehome-bg); color: var(--color-nicehome); }
.brand-icon--mhouse { background: var(--color-mhouse-bg); color: var(--color-mhouse); }
.brand-icon--moovo { background: var(--color-moovo-bg); color: var(--color-moovo); }

.brand-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-tagline {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.brand-intro {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 720px;
  margin-bottom: var(--space-8);
  line-height: 1.7;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.product-card-img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: var(--color-surface-2);
  padding: var(--space-4);
}

.product-card-body {
  padding: var(--space-5) var(--space-6) var(--space-6);
}

.product-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.product-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.product-specs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.spec-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
}

/* Brand features list */
.brand-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
}

.feature-check {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.feature-item p {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.5;
}

.feature-item .feature-label {
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

/* ===== BRAND ARGUMENTAIRE ===== */
.brand-argumentaire {
  margin-bottom: var(--space-8);
}

.brand-argumentaire h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.brand-argumentaire .brand-intro {
  margin-bottom: var(--space-3);
}

/* ===== FAQ SECTION ===== */
.faq-section {
  padding: clamp(var(--space-12), 6vw, var(--space-20)) 0;
  border-top: 1px solid var(--color-divider);
}

.faq-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-2);
}

.faq-sub {
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-8);
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  text-align: left;
  color: var(--color-text);
  cursor: pointer;
}

.faq-question:hover {
  background: var(--color-surface-offset);
}

.faq-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-answer-inner {
  padding: 0 var(--space-6) var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.faq-item.open .faq-answer {
  max-height: 400px;
}

/* ===== COMPARISON TABLE ===== */
.comparison-section {
  padding: clamp(var(--space-12), 6vw, var(--space-20)) 0;
  border-top: 1px solid var(--color-divider);
}

.comparison-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-2);
}

.comparison-sub {
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-8);
}

.comparison-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-divider);
}

.comparison-table {
  min-width: 640px;
}

.comparison-table th,
.comparison-table td {
  padding: var(--space-4) var(--space-5);
  text-align: left;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-divider);
}

.comparison-table thead th {
  background: var(--color-surface-offset);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.comparison-table thead th:first-child {
  border-radius: var(--radius-lg) 0 0 0;
}
.comparison-table thead th:last-child {
  border-radius: 0 var(--radius-lg) 0 0;
}

.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.comparison-table tbody td:first-child {
  font-weight: 500;
  color: var(--color-text);
}

.comparison-table tbody tr:hover {
  background: var(--color-surface-offset);
}

.brand-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.brand-label-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  display: inline-block;
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--color-divider);
  padding: var(--space-10) 0 var(--space-8);
  text-align: center;
}

.footer-partner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.footer-partner-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.footer-partner-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-primary);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  background: oklch(from var(--color-primary) l c h / 0.08);
  transition: background 0.2s ease, transform 0.2s ease;
}

.footer-partner-link:hover {
  background: oklch(from var(--color-primary) l c h / 0.15);
  transform: translateY(-1px);
}

.footer-contact-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.footer-contact-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-contact-link:hover {
  color: var(--color-primary);
}

.footer-contact-sep {
  color: var(--color-text-faint);
  font-size: var(--text-sm);
}

.footer-info {
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
}

.footer-info p {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  max-width: none;
  margin-top: var(--space-1);
}

.footer a {
  color: var(--color-primary);
  text-decoration: none;
}
.footer a:hover {
  text-decoration: underline;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  opacity: 0;
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fade-up-d1 { animation-delay: 0.1s; }
.fade-up-d2 { animation-delay: 0.2s; }
.fade-up-d3 { animation-delay: 0.3s; }
.fade-up-d4 { animation-delay: 0.4s; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== MOBILE ===== */
@media (max-width: 767px) {
  .brand-tab {
    padding: var(--space-3) var(--space-3);
    font-size: var(--text-xs);
    gap: var(--space-1);
  }
  
  .brand-tab-dot {
    width: 8px;
    height: 8px;
  }

  .brand-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .brand-features {
    grid-template-columns: 1fr;
  }

  .hero-brands {
    gap: var(--space-3);
  }

  .header-inner {
    position: relative;
    flex-wrap: wrap;
    height: auto;
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
    gap: var(--space-1);
  }

  .header-actions {
    gap: var(--space-2);
  }

  .theme-toggle {
    position: absolute;
    right: var(--space-4);
    top: var(--space-2);
    width: 32px;
    height: 32px;
  }

  .header-contact {
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
    padding-bottom: var(--space-1);
  }

  .header-contact-link {
    font-size: 0.7rem;
  }

  .footer-partner-link {
    font-size: var(--text-base);
    padding: var(--space-3) var(--space-4);
  }

  .footer-contact-row {
    flex-direction: column;
    gap: var(--space-1);
  }

  .footer-contact-sep {
    display: none;
  }
}

@media (min-width: 768px) {
  .header-inner {
    height: 72px;
  }
  
  .brand-nav {
    top: 72px;
  }

  .brand-section {
    scroll-margin-top: 150px;
  }
}
