/* NextDev Multi-Theme Engine & Design System — Conforms to DESIGN.md v3 & IS 5568 */

/* 1. Theme 1: Dark Graphite (Default / ПО УМОЛЧАНИЮ) */
:root,
[data-theme="dark-graphite"] {
  color-scheme: dark;
  --theme-id: dark-graphite;
  --bg: #1B1C1F;
  --surface: #24262A;
  --surface-sand: #2C2E33;
  --surface-dark: #141517;
  --border: #3B3D42;
  --border-subtle: #2C2E33;
  --ink: #F4F4F2;
  --muted-ink: #B3B5BB;
  --primary: #39FF14;
  --primary-hover: #68FF4C;
  --primary-light: #23381E;
  --on-primary: #1B1C1F;
  --accent-blue: #38BDF8;
  --accent-green: #39FF14;
  --error: #FF5A5F;
  --header-bg: rgba(27, 28, 31, 0.94);

  /* Logo variables */
  --logo-mark-bg: #24262A;
  --logo-mark-border: #3B3D42;
  --logo-chevron: #F4F4F2;
  --logo-cursor: #39FF14;
  --logo-next: #F4F4F2;
  --logo-dev: #39FF14;

  /* Demo window variables */
  --demo-chrome-bg: #1A1B1E;
  --demo-url-bg: #121316;
  --demo-tabs-bg: #1E2024;
  --demo-card-bg: #202226;
  --demo-card-border: #3B3D42;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);

  --font: Rubik, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --wrap-width: 1200px;
}

/* 2. Theme 2: Dark Blue */
[data-theme="dark-blue"] {
  color-scheme: dark;
  --theme-id: dark-blue;
  --bg: #0B132B;
  --surface: #1C2541;
  --surface-sand: #243256;
  --surface-dark: #070B19;
  --border: #334155;
  --border-subtle: #1E293B;
  --ink: #F8FAFC;
  --muted-ink: #94A3B8;
  --primary: #38BDF8;
  --primary-hover: #7DD3FC;
  --primary-light: #0C4A6E;
  --on-primary: #0B132B;
  --accent-blue: #38BDF8;
  --accent-green: #34D399;
  --error: #F87171;
  --header-bg: rgba(11, 19, 43, 0.94);

  --logo-mark-bg: #1C2541;
  --logo-mark-border: #334155;
  --logo-chevron: #F8FAFC;
  --logo-cursor: #38BDF8;
  --logo-next: #F8FAFC;
  --logo-dev: #38BDF8;

  --demo-chrome-bg: #0E162E;
  --demo-url-bg: #070B19;
  --demo-tabs-bg: #16203B;
  --demo-card-bg: #172242;
  --demo-card-border: #334155;
}

/* 3. Theme 3: Light */
[data-theme="light"] {
  color-scheme: light;
  --theme-id: light;
  --bg: #F8F9FA;
  --surface: #FFFFFF;
  --surface-sand: #F1F3F5;
  --surface-dark: #E2E8F0;
  --border: #CBD5E1;
  --border-subtle: #E2E8F0;
  --ink: #0F172A;
  --muted-ink: #475569;
  --primary: #166534;
  --primary-hover: #14532D;
  --primary-light: #DCFCE7;
  --on-primary: #FFFFFF;
  --accent-blue: #0284C7;
  --accent-green: #166534;
  --error: #B91C1C;
  --header-bg: rgba(248, 249, 250, 0.94);

  --logo-mark-bg: #1B1C1F;
  --logo-mark-border: #3B3D42;
  --logo-chevron: #F4F4F2;
  --logo-cursor: #39FF14;
  --logo-next: #0F172A;
  --logo-dev: #166534;

  --demo-chrome-bg: #0F172A;
  --demo-url-bg: #1E293B;
  --demo-tabs-bg: #1E293B;
  --demo-card-bg: #1E293B;
  --demo-card-border: #334155;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

/* 4. Theme 4: Light Terracotta */
[data-theme="light-terracotta"] {
  color-scheme: light;
  --theme-id: light-terracotta;
  --bg: #FCFBF9;
  --surface: #FFFFFF;
  --surface-sand: #F5F2EB;
  --surface-dark: #E8E4DC;
  --border: #E5E5E5;
  --border-subtle: #F0EEEA;
  --ink: #171717;
  --muted-ink: #525252;
  --primary: #C2410C;
  --primary-hover: #9A3412;
  --primary-light: #FFEDD5;
  --on-primary: #FFFFFF;
  --accent-blue: #0284C7;
  --accent-green: #15803D;
  --error: #B91C1C;
  --header-bg: rgba(252, 251, 249, 0.94);

  --logo-mark-bg: #1B1C1F;
  --logo-mark-border: #3B3D42;
  --logo-chevron: #F4F4F2;
  --logo-cursor: #39FF14;
  --logo-next: #171717;
  --logo-dev: #C2410C;

  --demo-chrome-bg: #0F172A;
  --demo-url-bg: #1E293B;
  --demo-tabs-bg: #1E293B;
  --demo-card-bg: #1E293B;
  --demo-card-border: #334155;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

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

html {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Hebrew Typography Constraint: weight <= 600, elegant 500 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}

strong, b {
  font-weight: 600;
}

html[lang="he"] h1,
html[lang="he"] h2,
html[lang="he"] h3,
html[lang="he"] h4,
html[lang="he"] h5,
html[lang="he"] h6,
html[lang="he"] .hero-title,
html[lang="he"] .section-title,
html[lang="he"] .product-card-name,
html[lang="he"] .work-card-title,
html[lang="he"] .feature-title,
html[lang="he"] strong,
html[lang="he"] b {
  font-weight: 500 !important;
}

html[lang="he"] .btn,
html[lang="he"] .brand-link,
html[lang="he"] .nav-link {
  font-weight: 500 !important;
}

p, li, td, th {
  color: var(--ink);
}

.text-muted {
  color: var(--muted-ink) !important;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

/* Accessible focus ring */
:focus-visible {
  outline: 2px solid var(--ink) !important;
  outline-offset: 3px !important;
}

/* Containers */
.wrap {
  width: 100%;
  max-width: var(--wrap-width);
  margin-inline: auto;
  padding-inline: 24px;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: none;
}

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

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-mark-svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: block;
}

.brand-text {
  display: inline-flex;
  align-items: baseline;
  direction: ltr;
}

.brand-next {
  color: var(--logo-next);
}

.brand-dev {
  color: var(--logo-dev);
  font-weight: 600;
}

.brand-mark {
  width: 32px;
  height: 32px;
  background-color: var(--ink);
  color: var(--surface);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted-ink);
  padding: 6px 0;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--ink);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  inset-inline-end: 0;
  height: 2px;
  background-color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Switcher Header Component (Nadlan pattern) */
.theme-switcher-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.theme-switcher-btn {
  height: 34px;
  padding-inline: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.theme-switcher-btn:hover {
  border-color: var(--ink);
}

.theme-swatch-current {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--primary);
  background-color: var(--bg);
  flex-shrink: 0;
}

.theme-swatch-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary);
}

.theme-chevron {
  color: var(--muted-ink);
  transition: transform 0.15s ease;
}

.theme-switcher-btn[aria-expanded="true"] .theme-chevron {
  transform: rotate(180deg);
}

.theme-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 195px;
  padding: 6px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  flex-direction: column;
  gap: 2px;
}

.theme-dropdown.open {
  display: flex;
}

.theme-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--muted-ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: start;
  transition: all 0.12s ease;
}

.theme-option:hover,
.theme-option:focus-visible {
  background-color: var(--surface-sand);
  color: var(--ink);
  outline: none;
}

.theme-option.active {
  background-color: var(--primary-light);
  color: var(--ink);
  font-weight: 600;
}

.theme-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-width: 1.5px;
  border-style: solid;
  flex-shrink: 0;
}

.theme-swatch span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.theme-option-text {
  flex: 1;
  white-space: nowrap;
}

.theme-check {
  font-size: 12px;
  color: var(--primary);
  opacity: 0;
}

.theme-option.active .theme-check {
  opacity: 1;
}

/* Footer Theme Selector Bar (Nadlan pattern) */
.footer-theme-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 0;
  margin-top: 28px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.footer-theme-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-ink);
}

.footer-theme-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-theme-btn {
  height: 32px;
  padding-inline: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted-ink);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.footer-theme-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.footer-theme-btn.active {
  color: var(--ink);
  border-color: var(--primary);
  background-color: var(--primary-light);
  font-weight: 600;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--ink);
}

.lang-switch:hover {
  border-color: var(--ink);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
  touch-action: manipulation;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--on-primary) !important;
  border-color: var(--primary);
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--ink);
  background-color: var(--surface-sand);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 16px 28px;
  font-size: 16px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  background-color: var(--surface-sand);
  color: var(--muted-ink);
  border: 1px solid var(--border-subtle);
}

.badge-primary {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: rgba(194, 65, 12, 0.2);
}

.badge-green {
  background-color: #f0fdf4;
  color: var(--accent-green);
  border-color: rgba(21, 128, 61, 0.2);
}

/* Section Common */
.section {
  padding-block: 72px;
}

.section-head {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
  margin-bottom: 48px;
}

.section-head.text-start {
  text-align: start;
  margin-inline: 0;
}

.section-title {
  font-size: clamp(26px, 3.5vw, 36px);
  margin-top: 12px;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-lead {
  font-size: 17px;
  color: var(--muted-ink);
  line-height: 1.65;
}

/* Hero Section */
.hero-section {
  padding-block: 60px 48px;
  text-align: center;
}

.hero-wrap {
  max-width: 900px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero-title {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.hero-lead {
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--muted-ink);
  line-height: 1.6;
  max-width: 740px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* Products Showcase (Home) */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.product-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.product-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.product-card-name {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}

.product-card-tagline {
  font-size: 14px;
  color: var(--muted-ink);
  line-height: 1.4;
}

.product-card-shot {
  margin-block: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background-color: var(--surface-sand);
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card-desc {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 16px;
  flex-grow: 1;
}

.product-card-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Custom Dev Section (Teaser on Home / Full on Custom) */
.custom-dev-box {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.workflow-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.workflow-step-card {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
}

.workflow-step-num {
  font-size: 28px;
  font-weight: 600;
  color: var(--primary);
  opacity: 0.8;
  margin-bottom: 8px;
  display: block;
}

.workflow-step-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.workflow-step-text {
  font-size: 14px;
  color: var(--muted-ink);
  line-height: 1.5;
}

/* Works Grid */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.work-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.work-card-img {
  aspect-ratio: 16 / 10;
  width: 100%;
  background-color: var(--surface-sand);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.work-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-card-body {
  padding: 20px;
  flex-grow: 1;
}

.work-card-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}

.work-card-text {
  font-size: 13.5px;
  color: var(--muted-ink);
  line-height: 1.5;
}

/* ========================================================= */
/* Interactive Live Demo Window (mengto/html-demo pattern)  */
/* ========================================================= */
/* ========================================================= */
/* Interactive Live Demo Window (mengto/html-demo pattern)  */
/* ========================================================= */
.demo-window-container {
  margin-block: 24px 48px;
}

#product-hero {
  padding-block: 36px 16px;
}

#demo.section {
  padding-top: 0;
}

#demo .section-head {
  margin-bottom: 20px;
}

.demo-window {
  background-color: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.demo-chrome {
  background-color: var(--demo-chrome-bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.demo-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.demo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.demo-dot.red { background-color: #ef4444; }
.demo-dot.yellow { background-color: #f59e0b; }
.demo-dot.green { background-color: #10b981; }

.demo-url-bar {
  background-color: var(--demo-url-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 16px;
  font-size: 12px;
  color: var(--muted-ink);
  font-family: monospace;
  direction: ltr;
  max-width: 320px;
  width: 100%;
  text-align: center;
}

.demo-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--accent-green);
  font-weight: 500;
}

.demo-live-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-green);
}

.demo-tabs-bar {
  background-color: var(--demo-tabs-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  overflow-x: auto;
}

.demo-tab-btn {
  background: none;
  border: none;
  color: var(--muted-ink);
  padding: 12px 20px;
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.demo-tab-btn:hover {
  color: var(--ink);
}

.demo-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background-color: var(--primary-light);
}

.demo-tab-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--surface);
  color: var(--muted-ink);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.demo-tab-btn.active .demo-tab-step-num {
  background-color: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  font-weight: 600;
}

.demo-stage {
  padding: 28px 24px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.demo-step-view {
  display: none;
}

.demo-step-view.active {
  display: block;
}

.demo-progress-bar {
  height: 3px;
  background-color: var(--surface-dark);
  width: 100%;
  overflow: hidden;
}

.demo-progress-fill {
  height: 100%;
  background-color: var(--primary);
  width: 0%;
  transition: width 0.1s linear;
}

.demo-card-inner {
  background-color: var(--demo-card-bg);
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid var(--demo-card-border);
  max-width: 720px;
  margin-inline: auto;
  color: var(--ink);
}

.demo-table-wrapper {
  background-color: var(--demo-card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--demo-card-border);
  overflow-x: auto;
  max-width: 860px;
  margin-inline: auto;
}

.demo-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: start;
}

.demo-data-table th {
  padding: 8px 12px;
  border-bottom: 1px solid var(--demo-card-border);
  color: var(--muted-ink);
  font-weight: 500;
}

.demo-data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--ink);
}

/* Feature Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background-color: var(--surface-sand);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.feature-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-text {
  font-size: 14px;
  color: var(--muted-ink);
  line-height: 1.55;
}

/* Screens Gallery */
.screens-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: center;
}

.screen-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.screen-card img {
  width: 100%;
  height: auto;
  display: block;
}

.screen-caption {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--muted-ink);
  background-color: var(--surface-sand);
  border-top: 1px solid var(--border-subtle);
}

/* FAQ */
.faq-list {
  max-width: 800px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.faq-q {
  padding: 18px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
}

.faq-q::-webkit-details-marker {
  display: none;
}

.faq-a {
  padding: 0 24px 20px;
  font-size: 14.5px;
  color: var(--muted-ink);
  line-height: 1.6;
}

/* Contact Bar on All Pages (Ilya's addition) */
.contact-bar-section {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding-block: 36px;
}

.contact-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.contact-pill-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.contact-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--surface-sand);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.contact-label {
  font-size: 12px;
  color: var(--muted-ink);
  display: block;
}

.contact-value {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

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

/* Chat Widget Section */
.chat-section {
  background-color: var(--surface-sand);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  margin-block: 40px;
  border: 1px solid var(--border);
}

.chat-box {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: start;
}

.chat-messages {
  min-height: 100px;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.msg-row {
  display: flex;
}

.msg-row.me {
  justify-content: flex-end;
}

.msg {
  background-color: var(--surface-sand);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 15px;
  line-height: 1.5;
  max-width: 85%;
}

.msg.user {
  background-color: var(--primary-light);
  border-color: rgba(194, 65, 12, 0.3);
}

.chat-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

#chat-input {
  flex-grow: 1;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 15px;
  color: var(--ink);
}

#chat-send {
  padding: 10px 20px;
}

#voice-button {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#voice-button.recording {
  background-color: #fee2e2;
  border-color: #ef4444;
  color: #ef4444;
}

#voice-status {
  font-size: 13px;
  color: var(--muted-ink);
  margin-top: 6px;
}

.chat-contact {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--primary);
  text-decoration: underline;
}

.tracking-notice {
  font-size: 12px;
  color: var(--muted-ink);
  margin-top: 14px;
  text-align: center;
}

/* Lead Form Section */
.lead-form-box {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 680px;
  margin-inline: auto;
}

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

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--ink);
}

.form-control {
  width: 100%;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s ease;
}

.form-control:focus {
  border-color: var(--ink);
}

.honeypot {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  height: 0;
  width: 0;
  margin: 0;
  padding: 0;
}

#leaderr {
  font-size: 14px;
  min-height: 1.4em;
  margin-bottom: 14px;
}

#leaderr.error {
  color: var(--error);
}

.form-notice {
  font-size: 12px;
  color: var(--muted-ink);
  margin-top: 12px;
  text-align: center;
}

/* Footer */
.site-footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding-block: 48px 24px;
  margin-top: auto;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}

.footer-brand p {
  font-size: 14px;
  color: var(--muted-ink);
  max-width: 360px;
  margin-top: 10px;
}

.footer-col-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}

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

.footer-links a {
  font-size: 14px;
  color: var(--muted-ink);
}

.footer-links a:hover {
  color: var(--ink);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted-ink);
  flex-wrap: wrap;
  gap: 12px;
}

/* Reduced Motion Compliance */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .demo-live-pulse {
    box-shadow: none !important;
  }
}

/* Responsive Rules */
@media (max-width: 900px) {
  .screens-grid {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .theme-switcher-btn .theme-switcher-label {
    display: none;
  }

  .site-header .wrap {
    padding-inline: 16px;
  }
  .header-inner {
    gap: 8px;
  }
  .brand-link {
    font-size: 19px;
    gap: 8px;
  }
  .brand-mark {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .header-actions {
    gap: 8px;
  }
  .header-phone-link {
    padding: 7px 10px;
  }
  .header-phone-text {
    display: none;
  }
  .lang-switch {
    padding: 6px 10px;
    font-size: 12px;
  }
  .mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
  }
  .main-nav {
    display: none;
  }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    inset-inline: 0;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 24px;
    gap: 16px;
    box-shadow: var(--shadow-md);
  }
  .hero-section {
    padding-block: 28px 16px;
  }
  .hero-wrap {
    gap: 12px;
  }
  .hero-title {
    font-size: clamp(24px, 5.5vw, 32px);
    margin-block: 4px;
    line-height: 1.25;
  }
  .hero-lead {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 4px;
  }
  .hero-actions {
    gap: 8px;
    margin-top: 4px;
  }
  .hero-actions .btn {
    padding: 10px 18px;
    font-size: 14px;
  }
  #demo.section {
    padding-block: 16px 40px;
  }
  #demo .section-head {
    margin-bottom: 16px;
  }
  #demo .section-title {
    font-size: 22px;
    margin-block: 4px;
  }
  #demo .section-lead {
    font-size: 14px;
    margin-bottom: 6px;
  }
  .contact-bar-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .lead-form-box {
    padding: 24px;
  }
}

/* NextDev consulting demonstration, intentionally scoped */
.consulting-features {grid-template-columns:repeat(6,minmax(0,1fr));gap:16px}
.consulting-features > .feature-card {grid-column:span 2;min-width:0}
.consulting-features > .feature-card:nth-last-child(2):nth-child(4),
.consulting-features > .feature-card:last-child:nth-child(5){grid-column:span 3}
.audit-stats {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:24px 0}
.audit-stat,.audit-panel {border:1px solid var(--border);background:var(--surface);border-radius:var(--radius-md);padding:24px;min-width:0}
.audit-stat strong{display:block;font-size:clamp(20px,2.5vw,32px);color:var(--primary);line-height:1.3}.audit-stat span{display:block;color:var(--muted-ink);font-size:14px;margin-top:6px}
.audit-panel{margin-bottom:18px}.audit-panel h3{font-size:clamp(17px,2vw,22px);margin-bottom:8px}.audit-subtle{color:var(--muted-ink);font-size:13px;line-height:1.6;margin-bottom:18px}
.audit-table-scroll{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.audit-presence{width:100%;border-collapse:collapse;text-align:start;font-size:14px;min-width:700px}
.audit-presence th,.audit-presence td{padding:14px 12px;text-align:start;border-bottom:1px solid var(--border);vertical-align:middle}
.audit-presence th{color:var(--muted-ink);font-weight:600}.audit-presence td:first-child{font-weight:600}
.audit-presence td:last-child{font-weight:600;color:var(--primary)}
.audit-pill{display:inline-block;white-space:nowrap;font-size:12px;padding:5px 9px;border-radius:100px;border:1px solid var(--border)}
.audit-pill.partial{color:var(--ink);background:var(--surface-sand)}.audit-pill.issue{color:#b96e27;background:rgba(220,150,55,.08)}
.audit-charts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.audit-bar-row{display:grid;grid-template-columns:100px minmax(0,1fr) 55px;align-items:center;gap:12px;margin:13px 0;font-size:13px}
.audit-bar-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.audit-bar-row strong{text-align:end;font-variant-numeric:tabular-nums}
.audit-track{height:13px;border-radius:100px;background:var(--surface-sand);overflow:hidden}.audit-track>div{height:100%;border-radius:100px;background:var(--primary)}
.audit-split{display:flex;width:100%;height:26px;border-radius:8px;overflow:hidden;margin:22px 0 16px}
.audit-split>div:nth-child(1){background:var(--primary)}.audit-split>div:nth-child(2){background:#809d8d}.audit-split>div:nth-child(3){background:#b9c9bf}
.audit-legend{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:18px;font-size:12px}
.audit-legend span{display:flex;align-items:center;gap:6px}.audit-dot{width:9px;height:9px;border-radius:50%;display:inline-block}.audit-dot.p0{background:var(--primary)}.audit-dot.p1{background:#809d8d}.audit-dot.p2{background:#b9c9bf}
.audit-deliverables{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.audit-deliverables>div{background:var(--surface-sand);padding:16px;border-radius:10px;min-width:0}.audit-deliverables strong{color:var(--primary)}.audit-deliverables p{font-size:14px;margin-top:8px;line-height:1.6}
@media(max-width:950px){.consulting-features{grid-template-columns:repeat(2,minmax(0,1fr))}.consulting-features>.feature-card,.consulting-features>.feature-card:nth-last-child(2):nth-child(4){grid-column:span 1}.consulting-features>.feature-card:last-child:nth-child(5){grid-column:span 2}.audit-charts{grid-template-columns:1fr}.audit-deliverables{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.consulting-features{grid-template-columns:1fr}.consulting-features>.feature-card,.consulting-features>.feature-card:last-child:nth-child(5){grid-column:span 1}.audit-stats{grid-template-columns:1fr 1fr}.audit-stats>.audit-stat:last-child{grid-column:span 2}.audit-stat,.audit-panel{padding:17px}.audit-deliverables{grid-template-columns:1fr}.audit-bar-row{grid-template-columns:76px minmax(0,1fr) 52px;gap:8px}}

/* Light baseline for clients without JS: explicit dark themes keep their own variables */
:root:not([data-theme]), :root[data-theme="light"]{color-scheme:light}
.audit-table-scroll{overflow:visible;background:transparent}
.audit-presence{min-width:0;table-layout:fixed;width:100%;border:1px solid var(--border);border-radius:12px;border-collapse:separate;border-spacing:0;overflow:hidden;direction:inherit;font-size:14px;line-height:1.55}
.audit-presence th{background:var(--surface-sand);color:var(--ink);font-size:13px;font-weight:600;vertical-align:middle}
.audit-presence th,.audit-presence td{padding:14px 16px;border-bottom:1px solid var(--border-subtle);overflow-wrap:anywhere;word-break:normal}
.audit-presence th:nth-child(1),.audit-presence td:nth-child(1){width:23%}
.audit-presence th:nth-child(2),.audit-presence td:nth-child(2){width:20%}
.audit-presence th:nth-child(3),.audit-presence td:nth-child(3){width:49%}
.audit-presence th:nth-child(4),.audit-presence td:nth-child(4){width:8%;text-align:center;white-space:nowrap}
.audit-presence tbody tr:last-child td{border-bottom:0}
.audit-presence tbody tr:nth-child(even) td{background:var(--surface-sand)}
.audit-presence td:first-child{font-weight:600}
.audit-presence td:last-child{font-weight:700;color:var(--primary)}
.audit-presence td[dir="ltr"]{unicode-bidi:isolate}
.audit-pill{border-color:var(--border);font-weight:600}
[data-theme="light"] .audit-pill.issue,[data-theme="light-terracotta"] .audit-pill.issue{color:#92400e;background:#fff7ed;border-color:#fed7aa}
@media(max-width:800px){
 .audit-table-scroll{overflow:visible}
 .audit-presence,.audit-presence tbody,.audit-presence tr,.audit-presence td{display:block;width:100%!important}
 .audit-presence{border:0;background:none;overflow:visible}
 .audit-presence thead{display:none}
 .audit-presence tr{margin:0 0 14px;border:1px solid var(--border);background:var(--surface);border-radius:12px;overflow:hidden;padding:12px 15px}
 .audit-presence td,.audit-presence tbody tr:nth-child(even) td{display:grid;grid-template-columns:minmax(90px,31%) minmax(0,1fr);align-items:start;gap:12px;border:0;border-bottom:1px solid var(--border-subtle);padding:10px 0;background:transparent;text-align:start!important;white-space:normal!important}
 .audit-presence tr td:last-child{border-bottom:0}
 .audit-presence td:before{content:attr(data-label);font-size:12px;font-weight:600;color:var(--muted-ink)}
 .audit-presence td:last-child{justify-content:start}
}
@media(max-width:420px){.audit-presence td{grid-template-columns:minmax(84px,34%) minmax(0,1fr);gap:8px}}

/* Compact portfolio 2026-11-25 */
#products .products-grid {grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
#products .product-card {padding:15px;min-width:0;justify-content:flex-start}
#products .product-card-top {margin-bottom:5px}
#products .product-card-name {font-size:19px}
#products .product-card-name a {color:inherit;text-decoration:none}
#products .product-card-shot {aspect-ratio: 16 / 8;margin-block:9px}
#products .product-card-desc {margin-bottom:10px;font-size:14px}
#products .product-card-footer {padding-top:9px;gap:8px;flex-wrap:wrap}
@media(max-width:900px){#products .products-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){#products .products-grid{grid-template-columns:minmax(0,1fr)}}
