/* ==========================================================================
   Kara Intelligent Systems — Design System
   --------------------------------------------------------------------------
   1. Tokens          6. Header & navigation    11. Mockups / visuals
   2. Reset & base    7. Hero                   12. Tabs
   3. Layout          8. Sections & headings    13. Forms
   4. Typography      9. Cards & grids          14. Footer
   5. Buttons & UI   10. Product showcase       15. Animation & utilities
                                                16. Light theme overrides
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  /* Brand */
  --c-primary: #12b5f5;          /* Kara cyan (from logo) */
  --c-primary-600: #0a8fd6;
  --c-accent: #7b6bff;           /* signal violet */
  --c-teal: #1fe0bf;             /* "healthy" network green */
  --c-warn: #ffb547;
  --c-danger: #ff5d73;

  /* Surfaces (dark, layered) */
  --c-bg: #050b18;
  --c-bg-2: #081227;
  --c-surface: rgba(16, 30, 58, 0.55);
  --c-surface-solid: #0d1a33;
  --c-surface-2: rgba(22, 40, 76, 0.6);
  --c-border: rgba(132, 170, 230, 0.14);
  --c-border-strong: rgba(132, 170, 230, 0.28);

  /* Text */
  --c-text: #eaf1ff;
  --c-text-2: #b3c3dd;
  --c-muted: #7d90b0;

  /* Gradients */
  --g-brand: linear-gradient(120deg, #12b5f5 0%, #4b8dff 50%, #7b6bff 100%);
  --g-text: linear-gradient(100deg, #ffffff 0%, #9fe3ff 45%, #a99dff 100%);
  --g-teal: linear-gradient(120deg, #1fe0bf, #12b5f5);

  /* Type */
  --f-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;

  --fs-xs: 0.78rem;
  --fs-sm: 0.9rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: clamp(1.15rem, 1.4vw, 1.3rem);
  --fs-h3: clamp(1.2rem, 1.6vw, 1.4rem);
  --fs-h2: clamp(1.9rem, 3.6vw, 2.9rem);
  --fs-h1: clamp(2.5rem, 5.6vw, 4.6rem);

  /* Spacing & shape */
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.5rem;  --sp-6: 2rem;   --sp-7: 3rem;    --sp-8: 4rem;
  --section-y: clamp(4rem, 8vw, 6.5rem);
  --gutter: clamp(16px, 4vw, 32px);
  --container: 1200px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Effects */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 0 1px rgba(18, 181, 245, 0.35), 0 10px 40px -10px rgba(18, 181, 245, 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 72px;
  color-scheme: dark;
}

/* Light theme: set by the inline script in <head> and the header toggle */
:root[data-theme="light"] {
  color-scheme: light;

  --c-primary: #0577b5;          /* darker cyan so it reads as text on white */
  --c-primary-600: #04679d;
  --c-accent: #5b4bdf;
  --c-teal: #0a8a74;
  --c-warn: #b26b00;
  --c-danger: #d2334c;

  --c-bg: #f5f8fd;
  --c-bg-2: #eaf0f9;
  --c-surface: rgba(255, 255, 255, 0.8);
  --c-surface-solid: #ffffff;
  --c-surface-2: rgba(255, 255, 255, 0.92);
  --c-border: rgba(20, 45, 90, 0.12);
  --c-border-strong: rgba(20, 45, 90, 0.22);

  --c-text: #0b1a33;
  --c-text-2: #3d4f6e;
  --c-muted: #5c6e8d;

  --g-text: linear-gradient(100deg, #0b1a33 0%, #0a6fb0 50%, #5b4bdf 100%);
  --g-teal: linear-gradient(120deg, #13c7a6, #0a8fd6);

  --shadow-sm: 0 2px 10px rgba(15, 35, 70, 0.08);
  --shadow: 0 20px 50px -20px rgba(15, 35, 70, 0.25);
}

/* 2. Reset & base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  min-height: 100vh;
  font-family: var(--f-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--c-text);
  background-color: var(--c-bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(123, 107, 255, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(18, 181, 245, 0.12), transparent 60%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
/* Inline line icons: <svg class="i" viewBox="0 0 24 24"> */
.i { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
::selection { background: rgba(18, 181, 245, 0.35); color: #fff; }

:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 1000;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--c-primary);
  color: #021022;
  font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* 3. Layout ---------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { position: relative; padding-block: var(--section-y); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.section--alt {
  background: linear-gradient(180deg, transparent, rgba(10, 22, 46, 0.7) 15%, rgba(10, 22, 46, 0.7) 85%, transparent);
}

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.split--reverse > :first-child { order: 2; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .split--reverse > :first-child { order: 0; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Decorative background grid used by hero & page heroes */
.bg-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(132, 170, 230, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(132, 170, 230, 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}

/* 4. Typography ------------------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--c-text);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); letter-spacing: -0.035em; line-height: 1.04; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.3; }
h4 { font-size: var(--fs-md); }
p { color: var(--c-text-2); text-wrap: pretty; }
.lead { font-size: var(--fs-lg); color: var(--c-text-2); line-height: 1.6; }
.text-gradient {
  background: var(--g-text);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.mono { font-family: var(--f-mono); }
strong { color: var(--c-text); font-weight: 600; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.38rem 0.9rem 0.38rem 0.7rem;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-pill);
  background: rgba(18, 181, 245, 0.07);
  color: #a8e6ff;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-teal);
  box-shadow: 0 0 0 4px rgba(31, 224, 191, 0.18);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

/* 5. Buttons & small UI ---------------------------------------------------- */
.btn {
  --btn-bg: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.97rem;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s, border-color 0.25s;
}
.btn svg { width: 18px; height: 18px; transition: transform 0.25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn--primary {
  background: var(--g-brand);
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(18, 181, 245, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(75, 141, 255, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn--ghost {
  border: 1px solid var(--c-border-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--c-text);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}
.btn--ghost:hover { border-color: rgba(18, 181, 245, 0.6); background: rgba(18, 181, 245, 0.08); transform: translateY(-2px); }
.btn--sm { min-height: 40px; padding: 0.55rem 1.1rem; font-size: 0.9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--c-primary);
  font-weight: 600;
  font-size: 0.95rem;
}
.link-arrow svg { width: 16px; height: 16px; transition: transform 0.25s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
  color: var(--c-text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.chip-list { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; }

.icon-badge {
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(18, 181, 245, 0.22), rgba(123, 107, 255, 0.16));
  border: 1px solid rgba(18, 181, 245, 0.3);
  color: #8fe0ff;
}
.icon-badge svg { width: 24px; height: 24px; }
.icon-badge--teal { background: linear-gradient(145deg, rgba(31, 224, 191, 0.2), rgba(18, 181, 245, 0.12)); border-color: rgba(31, 224, 191, 0.32); color: #7ff3dc; }
.icon-badge--violet { background: linear-gradient(145deg, rgba(123, 107, 255, 0.25), rgba(75, 141, 255, 0.12)); border-color: rgba(123, 107, 255, 0.35); color: #c3baff; }

.check-list { list-style: none; padding: 0; display: grid; gap: 0.7rem; }
.check-list li { position: relative; padding-left: 2rem; color: var(--c-text-2); }
.check-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.2rem;
  width: 1.3rem; height: 1.3rem;
  border-radius: 50%;
  background: rgba(31, 224, 191, 0.14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231fe0bf' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 0.75rem no-repeat;
  border: 1px solid rgba(31, 224, 191, 0.35);
}

/* 6. Header & navigation --------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled,
.site-header.is-open {
  background: rgba(5, 11, 24, 0.78);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
          backdrop-filter: saturate(160%) blur(16px);
  border-bottom-color: var(--c-border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--sp-5);
}

.brand { display: inline-flex; align-items: center; gap: 0.7rem; flex-shrink: 0; margin-right: auto; }
.brand__mark { width: 38px; height: 38px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.02em; }
.brand__sub { font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--c-muted); }

.nav { display: flex; align-items: center; gap: var(--sp-5); }
.nav__list { display: flex; align-items: center; gap: 0.25rem; list-style: none; padding: 0; }
.nav__link {
  position: relative;
  display: inline-flex;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-pill);
  color: var(--c-text-2);
  font-size: 0.94rem;
  font-weight: 500;
  transition: color 0.2s, background-color 0.2s;
}
.nav__link:hover { color: var(--c-text); background: rgba(255, 255, 255, 0.05); }
.nav__link[aria-current="page"] { color: var(--c-text); background: rgba(18, 181, 245, 0.1); }
.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 3px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--c-primary);
  transform: translateX(-50%);
}

.theme-toggle {
  order: 1;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid var(--c-border-strong);
  color: var(--c-text-2);
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.theme-toggle:hover { color: var(--c-text); border-color: var(--c-primary); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle__moon,
:root[data-theme="light"] .theme-toggle__sun { display: none; }
:root[data-theme="light"] .theme-toggle__moon { display: block; }

.nav-toggle {
  order: 2;
  display: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--c-border-strong);
  place-items: center;
}
.nav-toggle__bars { position: relative; width: 18px; height: 12px; }
.nav-toggle__bars span {
  position: absolute;
  left: 0;
  width: 100%; height: 2px;
  border-radius: 2px;
  background: var(--c-text);
  transition: transform 0.3s var(--ease), opacity 0.2s, top 0.3s var(--ease);
}
.nav-toggle__bars span:nth-child(1) { top: 0; }
.nav-toggle__bars span:nth-child(2) { top: 5px; }
.nav-toggle__bars span:nth-child(3) { top: 10px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 5px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 5px; transform: rotate(-45deg); }

@media (max-width: 1080px) {
  .site-header .container { gap: var(--sp-3); }
  .nav-toggle { display: grid; }
  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    height: calc(100dvh - var(--header-h));
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-5);
    padding: var(--sp-5) var(--gutter) var(--sp-7);
    background: rgba(5, 11, 24, 0.97);
    -webkit-backdrop-filter: blur(16px);
            backdrop-filter: blur(16px);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.3s var(--ease), visibility 0.25s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0.25rem; }
  .nav__link { padding: 0.95rem 1rem; font-size: 1.1rem; border-radius: var(--radius-sm); }
  .nav__link[aria-current="page"]::after { left: auto; right: 1rem; top: 50%; bottom: auto; width: 6px; height: 6px; transform: translateY(-50%); }
  .nav .btn { width: 100%; }
}
body.nav-locked { overflow: hidden; }

/* 7. Hero ------------------------------------------------------------------ */
.hero {
  position: relative;
  min-height: min(100vh, 980px);
  padding-top: calc(var(--header-h) + clamp(2.5rem, 7vw, 5.5rem));
  padding-bottom: clamp(3.5rem, 7vw, 6rem);
  overflow: hidden;
  isolation: isolate;
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: -1;
  opacity: 0.9;
}
.hero__glow {
  position: absolute;
  z-index: -2;
  width: 720px; height: 720px;
  right: -180px; top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(18, 181, 245, 0.22), transparent 65%);
  filter: blur(10px);
}
.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero__content { display: grid; gap: var(--sp-5); justify-items: start; }
.hero__title { max-width: 14ch; }
.hero__lead { max-width: 54ch; }
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  margin-top: var(--sp-3);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--c-border);
  list-style: none;
  padding-left: 0;
}
.hero__meta li { display: flex; align-items: center; gap: 0.55rem; color: var(--c-text-2); font-size: var(--fs-sm); }
.hero__meta svg { width: 18px; height: 18px; color: var(--c-teal); }

.hero__visual { position: relative; }

@media (max-width: 1024px) {
  .hero { min-height: 0; }
  .hero .container { grid-template-columns: 1fr; }
  .hero__title { max-width: 18ch; }
  .hero__visual { max-width: 620px; width: 100%; justify-self: center; }
}

/* Page hero (sub-pages) */
.page-hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(3rem, 8vw, 6rem));
  padding-bottom: clamp(3rem, 6vw, 5rem);
  overflow: hidden;
  isolation: isolate;
}
.page-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 800px; height: 500px;
  left: 50%; top: -200px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(75, 141, 255, 0.22), transparent 65%);
}
.page-hero__inner { display: grid; gap: var(--sp-5); justify-items: start; max-width: 780px; }
.page-hero--center .page-hero__inner { justify-items: center; text-align: center; margin-inline: auto; }
.page-hero h1 { font-size: clamp(2.3rem, 5vw, 4rem); }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; font-size: var(--fs-sm); color: var(--c-muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 0.5rem; opacity: 0.5; }
.breadcrumb a:hover { color: var(--c-text); }

/* 8. Sections & headings --------------------------------------------------- */
.section-head { display: grid; gap: var(--sp-4); max-width: 720px; margin-bottom: clamp(2.5rem, 5vw, 4rem); justify-items: start; }
.section-head--center { margin-inline: auto; text-align: center; justify-items: center; }
.section-head--split {
  max-width: none;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  align-items: end;
  gap: var(--sp-5) clamp(2rem, 5vw, 4rem);
}
.section-head--split > div { display: grid; gap: var(--sp-4); justify-items: start; }
@media (max-width: 860px) { .section-head--split { grid-template-columns: 1fr; } }

/* Tech marquee */
.marquee {
  position: relative;
  overflow: hidden;
  padding-block: var(--sp-5);
  border-block: 1px solid var(--c-border);
  background: rgba(8, 18, 39, 0.6);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track {
  display: flex;
  gap: clamp(2rem, 4vw, 3.5rem);
  width: max-content;
  list-style: none;
  padding: 0;
  animation: marquee 38s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--f-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--c-muted);
  white-space: nowrap;
}
.marquee__track li::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: var(--c-primary);
  opacity: 0.7;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  overflow: hidden;
}
.stat { padding: clamp(1.4rem, 3vw, 2.2rem); display: grid; gap: 0.35rem; }
.stat + .stat { border-left: 1px solid var(--c-border); }
.stat__value {
  font-family: var(--f-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  background: var(--g-text);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.stat__label { color: var(--c-muted); font-size: var(--fs-sm); }
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--c-border); }
}

/* 9. Cards & grids --------------------------------------------------------- */
.card {
  --mx: 50%;
  --my: 0%;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: clamp(1.4rem, 2.5vw, 2rem);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(20, 36, 70, 0.6), rgba(10, 20, 42, 0.55));
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s var(--ease);
}
.card::before {
  /* pointer-tracking spotlight (position set by JS) */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(18, 181, 245, 0.13), transparent 45%);
  opacity: 0;
  transition: opacity 0.35s;
}
.card:hover { border-color: rgba(18, 181, 245, 0.38); transform: translateY(-4px); box-shadow: var(--shadow); }
.card:hover::before { opacity: 1; }
.card h3 { margin-top: var(--sp-2); }
.card p { font-size: 0.97rem; }
.card .link-arrow { margin-top: auto; padding-top: var(--sp-2); }
.card--flat:hover { transform: none; }

.card__top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.card__index { font-family: var(--f-mono); font-size: var(--fs-xs); color: var(--c-muted); letter-spacing: 0.1em; }

/* Linked cards: whole card is clickable via stretched link */
.card--link a.stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; }

/* Value / principle mini-cards */
.feature {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  padding: var(--sp-5);
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s;
}
.feature:hover { background: rgba(255, 255, 255, 0.025); border-color: var(--c-border); }
.feature.card { flex-direction: row; padding: var(--sp-5); }
.feature h3 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.feature p { font-size: 0.95rem; }

/* 10. Product showcase ----------------------------------------------------- */
.product {
  position: relative;
  padding: clamp(1.6rem, 4vw, 3.5rem);
  border: 1px solid var(--c-border);
  border-radius: calc(var(--radius-lg) + 8px);
  background:
    radial-gradient(600px 300px at 0% 0%, rgba(18, 181, 245, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(16, 30, 60, 0.7), rgba(8, 16, 34, 0.7));
  overflow: hidden;
}
.product + .product { margin-top: var(--sp-6); }
.product--violet {
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(123, 107, 255, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(16, 30, 60, 0.7), rgba(8, 16, 34, 0.7));
}
.product__body { display: grid; gap: var(--sp-5); justify-items: start; }
.product__logo { display: flex; align-items: center; gap: 0.8rem; }
.product__logo .icon-badge { width: 52px; height: 52px; }
.product__name { font-family: var(--f-display); font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; }
.product__name sup { font-size: 0.55em; color: var(--c-muted); }
.product__tag { font-size: var(--fs-sm); color: var(--c-muted); }

.mini-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-5); width: 100%; list-style: none; padding: 0; }
.mini-features li { display: flex; gap: 0.7rem; align-items: flex-start; font-size: 0.95rem; color: var(--c-text-2); }
.mini-features svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 0.15rem; color: var(--c-primary); }
.mini-features strong { display: block; font-size: 0.98rem; }
@media (max-width: 520px) { .mini-features { grid-template-columns: 1fr; } }

/* 11. Mockups / visuals ---------------------------------------------------- */
.window {
  position: relative;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(14, 28, 56, 0.92), rgba(8, 17, 36, 0.95));
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  overflow: hidden;
}
.window__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--c-border);
  background: rgba(255, 255, 255, 0.02);
}
.window__dots { display: flex; gap: 6px; }
.window__dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.window__title { margin-left: 0.5rem; font-size: var(--fs-xs); color: var(--c-muted); font-family: var(--f-mono); }
.window__status { margin-left: auto; display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--fs-xs); color: var(--c-teal); font-weight: 600; }
.window__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse-dot 1.8s infinite; }
.window__body { padding: clamp(0.9rem, 2vw, 1.25rem); display: grid; gap: 0.9rem; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; }
.kpi {
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  min-width: 0;
}
.kpi__label { font-size: 0.68rem; color: var(--c-muted); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi__value { font-family: var(--f-display); font-size: 1.2rem; font-weight: 600; margin-top: 0.15rem; }
.kpi__delta { font-size: 0.7rem; font-weight: 600; color: var(--c-teal); }
.kpi__delta--down { color: var(--c-danger); }
@media (max-width: 520px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.chart-panel {
  padding: 0.9rem 0.9rem 0.5rem;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.chart-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.78rem; color: var(--c-text-2); margin-bottom: 0.35rem; }
.legend { display: flex; gap: 0.8rem; color: var(--c-muted); font-size: 0.7rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.legend i { width: 8px; height: 8px; border-radius: 2px; }
.live-chart { width: 100%; height: 150px; }
.live-chart .grid-line { stroke: rgba(132, 170, 230, 0.1); stroke-width: 1; }
.live-chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.live-chart .threshold { stroke: var(--c-warn); stroke-dasharray: 4 4; stroke-width: 1; opacity: 0.6; }

.float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--c-border-strong);
  border-radius: 14px;
  background: rgba(10, 21, 44, 0.92);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  animation: float 6s ease-in-out infinite;
  max-width: 270px;
}
.float-card strong { display: block; font-size: 0.85rem; }
.float-card span { color: var(--c-muted); }
.float-card .icon-badge { width: 36px; height: 36px; border-radius: 10px; }
.float-card .icon-badge svg { width: 18px; height: 18px; }
.float-card--alarm { left: -28px; bottom: -28px; }
.float-card--alarm .icon-badge { background: rgba(255, 181, 71, 0.14); border-color: rgba(255, 181, 71, 0.4); color: var(--c-warn); }
.float-card--ok { right: -18px; top: -34px; animation-delay: -3s; }
@media (max-width: 640px) {
  .float-card--alarm { left: 8px; bottom: -30px; }
  .float-card--ok { display: none; }
}

/* Audit log (Rahyab) */
.log { font-family: var(--f-mono); font-size: 0.78rem; display: grid; gap: 0.4rem; }
.log__row {
  display: grid;
  grid-template-columns: 70px 92px minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  color: var(--c-text-2);
}
.log__row--head { background: none; color: var(--c-muted); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; padding-block: 0.2rem; }
.log__row--flag { border-color: rgba(255, 181, 71, 0.35); background: rgba(255, 181, 71, 0.06); }
.log__row code { color: #9fe3ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log__user { color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { padding: 0.15rem 0.5rem; border-radius: var(--radius-pill); font-size: 0.66rem; font-weight: 600; font-family: var(--f-body); }
.pill--ok { background: rgba(31, 224, 191, 0.14); color: var(--c-teal); }
.pill--warn { background: rgba(255, 181, 71, 0.15); color: var(--c-warn); }
.log__row.is-new { animation: row-in 0.6s var(--ease); }
@media (max-width: 520px) {
  .log__row { grid-template-columns: 58px minmax(0, 1fr) auto; }
  .log__row > :nth-child(2) { display: none; }
}

/* Formula editor (KPI builder) */
.code-block {
  font-family: var(--f-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  padding: 1rem 1.1rem;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: rgba(2, 8, 20, 0.6);
  color: var(--c-text-2);
  overflow-x: auto;
}
.code-block .k { color: #c3baff; }
.code-block .v { color: #9fe3ff; }
.code-block .n { color: var(--c-teal); }
.code-block .c { color: var(--c-muted); }

/* Stack of threshold rows (Alarm engine) */
.rule { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem 1rem; align-items: center; padding: 0.8rem 0.9rem; border: 1px solid var(--c-border); border-radius: 12px; background: rgba(255, 255, 255, 0.02); }
.rule__name { font-weight: 600; font-size: 0.9rem; }
.rule__cond { font-family: var(--f-mono); font-size: 0.78rem; color: var(--c-muted); }
.rule__targets { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.rule__targets .chip { font-size: 0.72rem; padding: 0.2rem 0.6rem; }

/* KPI view mock (Reflect page): resolution chips + legend context menu */
.chip.is-on { border-color: rgba(18, 181, 245, 0.5); background: rgba(18, 181, 245, 0.14); color: var(--c-text); }
.chart-panel--menu { position: relative; }
.ctx-menu {
  position: absolute;
  right: 0.9rem; top: 2.4rem;
  display: grid;
  gap: 2px;
  padding: 0.35rem;
  border: 1px solid var(--c-border-strong);
  border-radius: 10px;
  background: var(--c-surface-solid);
  box-shadow: var(--shadow);
  font-size: 0.72rem;
}
.ctx-menu span { padding: 0.3rem 0.6rem; border-radius: 6px; color: var(--c-text-2); white-space: nowrap; }
.ctx-menu .is-active { background: rgba(18, 181, 245, 0.14); color: var(--c-text); }
@media (max-width: 520px) { .ctx-menu { display: none; } }

/* Map mock: drill path above the map and neighbour links */
.window__body--map { padding-bottom: 0; }
.window__body--map .breadcrumb { font-family: var(--f-mono); font-size: var(--fs-xs); }
.map-links path { fill: none; stroke: var(--c-primary); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: 0.7; }

/* Mini bars */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 0.5rem; }
.bars span {
  flex: 1;
  height: var(--h);
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--c-primary), rgba(18, 181, 245, 0.15));
  transform-origin: bottom;
  animation: grow 1s var(--ease) both;
  animation-delay: calc(var(--i) * 60ms);
}
.bars span:nth-child(3n) { background: linear-gradient(180deg, var(--c-accent), rgba(123, 107, 255, 0.15)); }

/* Abstract ring visual (about page) */
.orbit { position: relative; aspect-ratio: 1; max-width: 460px; width: 100%; margin-inline: auto; }
.orbit svg { width: 100%; height: 100%; }
.orbit .spin { transform-origin: 50% 50%; animation: spin 40s linear infinite; }
.orbit .spin-rev { transform-origin: 50% 50%; animation: spin 60s linear infinite reverse; }

/* Timeline */
.timeline { position: relative; display: grid; gap: var(--sp-5); list-style: none; padding: 0 0 0 2rem; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--c-primary), var(--c-accent), transparent); }
.timeline li { position: relative; }
.timeline li::before {
  content: "";
  position: absolute;
  left: calc(-2rem + 1px);
  top: 0.45rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--c-bg);
  border: 2px solid var(--c-primary);
  box-shadow: 0 0 0 4px rgba(18, 181, 245, 0.15);
}
.timeline__year { font-family: var(--f-mono); font-size: var(--fs-xs); color: var(--c-primary); letter-spacing: 0.1em; }
.timeline h3 { font-size: 1.1rem; margin: 0.2rem 0 0.3rem; }
.timeline p { font-size: 0.95rem; }

/* Map viewer */
.map-svg { width: 100%; height: auto; }
.map-roads path { fill: none; stroke: rgba(132, 170, 230, 0.1); stroke-width: 7; stroke-linecap: round; }
.map-region { fill: rgba(18, 181, 245, 0.06); stroke: var(--c-primary); stroke-width: 1.5; stroke-dasharray: 6 5; animation: march 12s linear infinite; }
.map-svg .s-ok { fill: rgba(31, 224, 191, 0.5); }
.map-svg .s-warn { fill: rgba(255, 181, 71, 0.75); }
.map-svg .s-bad { fill: rgba(255, 93, 115, 0.8); }
.map-svg g > circle { fill: #fff; }
.map-pulse circle { fill: none !important; stroke: var(--c-danger); stroke-width: 2; transform-origin: center; animation: ping 2s var(--ease) infinite; }
.map-tip rect { fill: rgba(5, 11, 24, 0.92); stroke: var(--c-border-strong); }
.map-tip text { fill: var(--c-text); font: 600 10px var(--f-body); }
.map-tip .map-tip__bad { fill: #ff8a9b; font-weight: 500; }
@keyframes march { to { stroke-dashoffset: -110; } }
@keyframes ping { from { transform: scale(0.6); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }

/* Numbered steps */
.steps { counter-reset: step; }
.step { counter-increment: step; }
.step .card__index::before { content: "STEP 0" counter(step); }
@media (min-width: 1025px) {
  .steps .step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 47px;
    right: -1.5rem;
    width: 1.5rem;
    height: 2px;
    background: linear-gradient(90deg, var(--c-primary), transparent);
  }
  .steps .step { overflow: visible; }
}

/* Usage meters (license management) */
.meter-list { display: grid; gap: 0.75rem; }
.meter { display: grid; gap: 0.4rem; padding: 0.8rem 0.9rem; border: 1px solid var(--c-border); border-radius: 12px; background: rgba(255, 255, 255, 0.02); }
.meter__head { display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.82rem; }
.meter__head span:last-child { font-family: var(--f-mono); color: var(--c-muted); }
.meter__track { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.meter__fill { height: 100%; width: var(--v); border-radius: inherit; background: var(--g-teal); transform-origin: left; animation: fill 1.4s var(--ease) both; }
.meter__fill--warn { background: linear-gradient(90deg, var(--c-warn), #ff8a5b); }
@keyframes fill { from { transform: scaleX(0); } }

/* Data pipeline (BI) */
.pipeline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; list-style: none; padding: 0; }
.pipeline li { display: flex; align-items: center; gap: 0.5rem; }
.pipeline li:not(:last-child)::after { content: ""; width: 16px; height: 2px; background: linear-gradient(90deg, var(--c-primary), var(--c-accent)); border-radius: 2px; }
.pipeline .chip { background: rgba(18, 181, 245, 0.08); border-color: rgba(18, 181, 245, 0.3); color: var(--c-text); }

/* Config sidebar mock */
.config-ui { display: grid; grid-template-columns: 150px minmax(0, 1fr); min-height: 260px; }
.config-ui__side { border-right: 1px solid var(--c-border); padding: 0.75rem 0.5rem; display: grid; align-content: start; gap: 0.15rem; font-size: 0.8rem; }
.config-ui__side span { padding: 0.45rem 0.65rem; border-radius: 8px; color: var(--c-text-2); }
.config-ui__side span.is-active { background: rgba(18, 181, 245, 0.12); color: var(--c-text); }
.config-ui__main { padding: 1rem; display: grid; gap: 0.6rem; align-content: start; }
@media (max-width: 520px) { .config-ui { grid-template-columns: 1fr; } .config-ui__side { display: none; } }

/* 12. Tabs ----------------------------------------------------------------- */
.tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.4rem;
  margin-bottom: var(--sp-6);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-pill);
  background: rgba(8, 18, 39, 0.7);
  width: fit-content;
  max-width: 100%;
}
.tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-pill);
  color: var(--c-text-2);
  font-weight: 500;
  font-size: 0.93rem;
  transition: background-color 0.25s, color 0.25s;
}
.tabs__tab svg { width: 18px; height: 18px; }
.tabs__tab:hover { color: var(--c-text); }
.tabs__tab[aria-selected="true"] { background: var(--g-brand); color: #fff; box-shadow: 0 6px 20px -8px rgba(18, 181, 245, 0.8); }
.tabs__panel { animation: fade-up 0.5s var(--ease); }
.tabs__panel[hidden] { display: none; }
@media (max-width: 640px) {
  .tabs__list { border-radius: var(--radius); width: 100%; }
  .tabs__tab { flex: 1 1 calc(50% - 0.4rem); justify-content: center; padding-inline: 0.6rem; }
}

/* 13. Forms ---------------------------------------------------------------- */
.form { display: grid; gap: var(--sp-4); }
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
@media (max-width: 640px) { .form__row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 0.4rem; }
.field label { font-size: var(--fs-sm); font-weight: 500; color: var(--c-text-2); }
.field label .req { color: var(--c-primary); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--c-border-strong);
  border-radius: 12px;
  background: rgba(2, 8, 20, 0.55);
  color: var(--c-text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d90b0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.9rem center; background-size: 18px; padding-right: 2.5rem; }
.field select option { background: var(--c-surface-solid); }
.field textarea { min-height: 140px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #5a6d8e; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 4px rgba(18, 181, 245, 0.18);
}
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--c-danger); }
.field__error { font-size: var(--fs-xs); color: var(--c-danger); min-height: 1em; }
.form__note { font-size: var(--fs-xs); color: var(--c-muted); }
.form__status { padding: 0.9rem 1rem; border-radius: 12px; font-size: var(--fs-sm); }
.form__status[hidden] { display: none; }
.form__status--ok { background: rgba(31, 224, 191, 0.1); border: 1px solid rgba(31, 224, 191, 0.35); color: #9ff5e4; }
.form__status--error { background: rgba(255, 93, 115, 0.1); border: 1px solid rgba(255, 93, 115, 0.4); color: #ffb3bf; }
.form__status a { text-decoration: underline; }
.form .btn[aria-busy="true"] { opacity: 0.75; pointer-events: none; }
.form .btn[aria-busy="true"] svg { animation: spin 1s linear infinite; }
/* Honeypot field: off-screen, not display:none (some bots skip hidden inputs) */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.contact-list { display: grid; gap: var(--sp-3); list-style: none; padding: 0; }
.contact-item {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  transition: border-color 0.25s, transform 0.25s var(--ease);
}
a.contact-item:hover { border-color: rgba(18, 181, 245, 0.4); transform: translateX(4px); }
.contact-item small { display: block; color: var(--c-muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; }
.contact-item span { color: var(--c-text); font-weight: 500; overflow-wrap: anywhere; }

/* Office location: address + embedded map */
.map-card {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  overflow: hidden;
}
.map-card__info { display: grid; gap: var(--sp-4); align-content: center; justify-items: start; padding: clamp(1.5rem, 4vw, 2.75rem); }
.map-card__info h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.map-card__info address { font-style: normal; color: var(--c-text-2); line-height: 1.6; }
.map-card__map { position: relative; min-height: 360px; border-left: 1px solid var(--c-border); }
.map-card__map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* The OSM tiles are light; dim and invert them so the map sits in the dark theme */
:root:not([data-theme="light"]) .map-card__map iframe { filter: invert(0.9) hue-rotate(180deg) saturate(0.7) brightness(0.95); }
@media (max-width: 860px) {
  .map-card { grid-template-columns: 1fr; }
  .map-card__map { min-height: 300px; border-left: 0; border-top: 1px solid var(--c-border); }
}

/* CTA band */
.cta {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  align-items: center;
  gap: var(--sp-6);
  padding: clamp(2rem, 5vw, 3.75rem);
  border-radius: calc(var(--radius-lg) + 8px);
  border: 1px solid rgba(18, 181, 245, 0.35);
  background:
    radial-gradient(500px 260px at 100% 100%, rgba(123, 107, 255, 0.35), transparent 70%),
    radial-gradient(500px 260px at 0% 0%, rgba(18, 181, 245, 0.3), transparent 70%),
    #0a1630;
  overflow: hidden;
  isolation: isolate;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000);
          mask-image: linear-gradient(90deg, transparent, #000);
}
.cta h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); margin-bottom: var(--sp-3); }
@media (max-width: 860px) { .cta { grid-template-columns: 1fr; } }

/* Tutorials (tutorials.html): player + lesson list */
.page-hero--compact { padding-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.tut { padding-top: 0; }
.tut__toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.tut__filters .chip { cursor: pointer; transition: border-color 0.2s, background-color 0.2s, color 0.2s; }
.tut__filters .chip:hover { color: var(--c-text); border-color: var(--c-border-strong); }
.tut__search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: min(100%, 280px);
  margin-left: auto;
  padding: 0 0.9rem;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-pill);
  background: var(--c-surface);
  color: var(--c-muted);
}
.tut__search:focus-within { border-color: var(--c-primary); box-shadow: 0 0 0 4px rgba(18, 181, 245, 0.18); }
.tut__search svg { width: 18px; height: 18px; flex-shrink: 0; }
.tut__search input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: none; color: var(--c-text); outline: none; }

.tut__layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.tut__player {
  overflow: hidden;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-lg);
  background: #000;
  box-shadow: var(--shadow);
}
.tut__player video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.tut__info { display: grid; gap: var(--sp-3); padding: var(--sp-5) var(--sp-1) 0; justify-items: start; }
.tut__meta { font-family: var(--f-mono); font-size: var(--fs-xs); color: var(--c-primary); letter-spacing: 0.04em; }
.tut__title { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.tut__info .btn-row { margin-top: var(--sp-2); }
.tut__info .btn:disabled { opacity: 0.45; pointer-events: none; }
.tut__flip { transform: scaleX(-1); }
.btn:hover .tut__flip { transform: scaleX(-1) translateX(3px); }
.btn.is-ready { animation: pulse-ring 1.6s var(--ease) 3; }
@keyframes pulse-ring { 50% { box-shadow: 0 0 0 8px rgba(18, 181, 245, 0.25); } }

.tut__playlist {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
}
.tut__playlist-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.tut__playlist-head h2 { font-size: 1.15rem; }
.tut__playlist-head span { font-size: var(--fs-xs); color: var(--c-muted); }
.tut__progress { animation: none; transition: width 0.4s var(--ease); }
.tut__list { display: grid; gap: var(--sp-2); max-height: min(62vh, 560px); overflow-y: auto; margin-inline: calc(var(--sp-2) * -1); padding-inline: var(--sp-2); }
.tut__series { font-family: var(--f-body); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-muted); margin-top: var(--sp-2); }
.tut__items { display: grid; gap: 0.35rem; list-style: none; padding: 0; }
.tut__empty, .tut__noscript { color: var(--c-muted); font-size: var(--fs-sm); }

.tut-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  width: 100%;
  padding: 0.45rem;
  border: 1px solid transparent;
  border-radius: 14px;
  text-align: left;
  transition: background-color 0.2s, border-color 0.2s;
}
.tut-item:hover { background: rgba(18, 181, 245, 0.06); }
.tut-item.is-current { border-color: rgba(18, 181, 245, 0.4); background: rgba(18, 181, 245, 0.1); }
.tut-item__thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 9px; background: var(--c-surface-2); border: 1px solid var(--c-border); }
.tut-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tut-item__time { position: absolute; right: 4px; bottom: 4px; padding: 0.05rem 0.35rem; border-radius: 5px; background: rgba(2, 8, 20, 0.8); color: #fff; font-family: var(--f-mono); font-size: 0.66rem; }
.tut-item.is-current .tut-item__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 20, 0.45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 22px no-repeat;
}
.tut-item__body { display: grid; gap: 0.15rem; min-width: 0; }
.tut-item__num { font-size: var(--fs-xs); color: var(--c-muted); }
.tut-item.is-done .tut-item__num { color: var(--c-teal); }
.tut-item__title { color: var(--c-text); font-weight: 500; font-size: 0.92rem; line-height: 1.35; }

@media (max-width: 1024px) {
  .tut__layout { grid-template-columns: 1fr; }
  .tut__playlist { position: static; }
  .tut__list { max-height: none; }
}
@media (max-width: 520px) {
  .tut__search { margin-left: 0; width: 100%; }
  .tut-item { grid-template-columns: 96px minmax(0, 1fr); }
}

/* 14. Footer --------------------------------------------------------------- */
.site-footer {
  position: relative;
  padding-top: clamp(3rem, 6vw, 4.5rem);
  border-top: 1px solid var(--c-border);
  background: linear-gradient(180deg, rgba(8, 18, 39, 0.5), #030812);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
  gap: var(--sp-6);
}
.footer__about p { margin-top: var(--sp-4); font-size: 0.93rem; max-width: 34ch; }
.footer__col h2 { font-family: var(--f-body); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-muted); margin-bottom: var(--sp-4); }
.footer__col ul { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.footer__col a { color: var(--c-text-2); font-size: 0.94rem; transition: color 0.2s; }
.footer__col a:hover { color: var(--c-primary); }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-block: var(--sp-5);
  border-top: 1px solid var(--c-border);
  color: var(--c-muted);
  font-size: var(--fs-sm);
}
@media (max-width: 860px) { .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer__about { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer__grid { grid-template-columns: 1fr; } }

.back-to-top {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--c-border-strong);
  background: rgba(10, 21, 44, 0.85);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  color: var(--c-text);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s var(--ease), visibility 0.3s, border-color 0.2s;
}
.back-to-top svg { width: 20px; height: 20px; }
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { border-color: var(--c-primary); }

/* 15. Animation & utilities ------------------------------------------------ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: var(--delay, 0ms); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } }
@keyframes row-in { from { opacity: 0; transform: translateY(-8px); background: rgba(18, 181, 245, 0.15); } }
@keyframes dash { to { stroke-dashoffset: 0; } }

.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); }
.text-center { text-align: center; }
.muted { color: var(--c-muted); }
.stack { display: grid; gap: var(--sp-4); }
.stack > .eyebrow, .stack > .icon-badge { justify-self: start; }
.feature.card h3 { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .marquee__track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
}

/* 16. Light theme overrides ------------------------------------------------- */
/* Tokens cover most of the UI; these replace the dark surfaces and tints that
   are hard-coded above. */
:root[data-theme="light"] .section--alt { background: linear-gradient(180deg, transparent, rgba(222, 232, 247, 0.75) 15%, rgba(222, 232, 247, 0.75) 85%, transparent); }
:root[data-theme="light"] .bg-grid {
  background-image:
    linear-gradient(rgba(20, 45, 90, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 45, 90, 0.07) 1px, transparent 1px);
}
:root[data-theme="light"] .eyebrow { background: rgba(18, 181, 245, 0.1); color: #0a6fb0; }
:root[data-theme="light"] .btn--ghost,
:root[data-theme="light"] .chip { background: rgba(255, 255, 255, 0.7); }
:root[data-theme="light"] .btn--ghost:hover { background: rgba(18, 181, 245, 0.1); }
:root[data-theme="light"] .icon-badge { color: #0a7fc0; }
:root[data-theme="light"] .icon-badge--teal { color: var(--c-teal); }
:root[data-theme="light"] .icon-badge--violet { color: var(--c-accent); }
:root[data-theme="light"] .float-card--alarm .icon-badge { color: var(--c-warn); }
:root[data-theme="light"] .pipeline .chip { background: rgba(18, 181, 245, 0.08); }

:root[data-theme="light"] .site-header.is-scrolled,
:root[data-theme="light"] .site-header.is-open { background: rgba(245, 248, 253, 0.85); }
:root[data-theme="light"] .nav__link:hover { background: rgba(20, 45, 90, 0.06); }
@media (max-width: 1080px) {
  :root[data-theme="light"] .nav { background: rgba(245, 248, 253, 0.98); }
}

:root[data-theme="light"] .marquee { background: rgba(255, 255, 255, 0.6); }
:root[data-theme="light"] .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.75));
  box-shadow: var(--shadow-sm);
}
:root[data-theme="light"] .card:hover { box-shadow: var(--shadow); }
:root[data-theme="light"] .feature:hover { background: rgba(20, 45, 90, 0.03); }
:root[data-theme="light"] .product {
  background:
    radial-gradient(600px 300px at 0% 0%, rgba(18, 181, 245, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 248, 253, 0.9));
}
:root[data-theme="light"] .product--violet {
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(123, 107, 255, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 248, 253, 0.9));
}

/* Mockups */
:root[data-theme="light"] .window {
  background: linear-gradient(180deg, #ffffff, #f7f9fd);
  box-shadow: 0 40px 80px -30px rgba(15, 35, 70, 0.3);
}
:root[data-theme="light"] .window__bar { background: rgba(20, 45, 90, 0.03); }
:root[data-theme="light"] .window__dots i { background: rgba(20, 45, 90, 0.18); }
:root[data-theme="light"] .kpi,
:root[data-theme="light"] .chart-panel,
:root[data-theme="light"] .log__row:not(.log__row--head):not(.log__row--flag),
:root[data-theme="light"] .rule,
:root[data-theme="light"] .meter { background: rgba(20, 45, 90, 0.03); }
:root[data-theme="light"] .meter__track { background: rgba(20, 45, 90, 0.08); }
:root[data-theme="light"] .live-chart .grid-line,
:root[data-theme="light"] .map-roads path { stroke: rgba(20, 45, 90, 0.1); }
:root[data-theme="light"] .float-card { background: rgba(255, 255, 255, 0.95); }
:root[data-theme="light"] .log__row code,
:root[data-theme="light"] .code-block .v { color: #0a6fb0; }
:root[data-theme="light"] .code-block { background: #f0f4fa; }
:root[data-theme="light"] .code-block .k { color: var(--c-accent); }
:root[data-theme="light"] .map-tip rect { fill: rgba(255, 255, 255, 0.96); }
:root[data-theme="light"] .map-tip .map-tip__bad { fill: var(--c-danger); }
:root[data-theme="light"] .tabs__list { background: rgba(255, 255, 255, 0.75); }
:root[data-theme="light"] .tut__playlist,
:root[data-theme="light"] .tut__search { background: rgba(255, 255, 255, 0.85); }

/* About page orbit: centre disc and rings are drawn with dark-theme colours */
:root[data-theme="light"] .orbit circle[fill="#081227"] { fill: #ffffff; }
:root[data-theme="light"] .orbit circle[stroke^="rgba(132"] { stroke: rgba(20, 45, 90, 0.2); }

/* Forms */
:root[data-theme="light"] .field input,
:root[data-theme="light"] .field select,
:root[data-theme="light"] .field textarea { background-color: #ffffff; }
:root[data-theme="light"] .field input::placeholder,
:root[data-theme="light"] .field textarea::placeholder { color: #8494ad; }
:root[data-theme="light"] .form__status--ok { color: #0a7a66; }
:root[data-theme="light"] .form__status--error { color: #b82640; }

/* CTA, footer, back-to-top */
:root[data-theme="light"] .cta {
  background:
    radial-gradient(500px 260px at 100% 100%, rgba(123, 107, 255, 0.18), transparent 70%),
    radial-gradient(500px 260px at 0% 0%, rgba(18, 181, 245, 0.18), transparent 70%),
    #eef4fc;
}
:root[data-theme="light"] .cta::before { background-image: radial-gradient(rgba(20, 45, 90, 0.12) 1px, transparent 1px); }
:root[data-theme="light"] .site-footer { background: linear-gradient(180deg, rgba(234, 240, 249, 0.5), #e4ebf6); }
:root[data-theme="light"] .back-to-top { background: rgba(255, 255, 255, 0.9); }
