:root,
html[data-color-scheme="light"] {
  color-scheme: light;

  /* Colors */
  --color-bg: #fff9f0;
  --color-surface: #ffffff;
  --color-surface-alt: #f8f4ec;
  --color-surface-warm: #fff5e0;
  --color-badge: #fff4d4;
  --color-primary: #ffb818;
  --color-primary-hover: #e5a616;
  --color-on-primary: #17252b;
  --color-dark: #17252b;
  --color-dark-soft: #1e3038;
  --color-text: #17252b;
  --color-text-secondary: #5c6b73;
  --color-text-on-dark: #ffffff;
  --color-text-muted: #8a969c;
  --color-border: #e9e1d5;
  --color-border-light: #f0ebe3;
  --color-success: #22c55e;
  --color-error: #ef4444;
  --color-focus: #ffb818;
  --color-ink: #17252b;
  --color-ink-soft: #1e3038;
  --color-brand: #ffb818;
  --color-accent: #ffb818;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(23, 37, 43, 0.05);
  --shadow-md: 0 8px 24px rgba(23, 37, 43, 0.07);
  --shadow-lg: 0 18px 48px rgba(23, 37, 43, 0.1);

  /* Dust / island (motion) */
  --color-dust: #17252b;
  --island-shadow: 0 18px 22px rgba(23, 37, 43, 0.14);
  --island-shadow-high: 0 28px 32px rgba(23, 37, 43, 0.2);
}

html[data-color-scheme="dark"] {
  color-scheme: dark;

  --color-bg: #0f171a;
  --color-surface: #1a2429;
  --color-surface-alt: #152022;
  --color-surface-warm: #1e2a30;
  --color-badge: #2a353b;
  --color-primary: #ffb818;
  --color-primary-hover: #e5a616;
  --color-on-primary: #17252b;
  --color-dark: #0a1013;
  --color-dark-soft: #141c20;
  --color-text: #f3ebe0;
  --color-text-secondary: #b7aea3;
  --color-text-on-dark: #f3ebe0;
  --color-text-muted: #8f877c;
  --color-border: #2c383e;
  --color-border-light: #243036;
  --color-success: #22c55e;
  --color-error: #ef4444;
  --color-focus: #ffb818;
  --color-ink: #f3ebe0;
  --color-ink-soft: #b7aea3;
  --color-brand: #ffb818;
  --color-accent: #ffb818;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.45);

  --color-dust: #f3ebe0;
  --island-shadow: 0 18px 22px rgba(0, 0, 0, 0.45);
  --island-shadow-high: 0 28px 32px rgba(0, 0, 0, 0.55);
}

:root {
  /* Typography */
  --font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
  --font-size-hero: 3.25rem;
  --font-size-h1: 2.5rem;
  --font-size-h2: 2rem;
  --font-size-h3: 1.25rem;
  --font-size-h4: 1rem;
  --font-size-body-lg: 1.0625rem;
  --font-size-body: 0.9375rem;
  --font-size-caption: 0.8125rem;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  --line-height-tight: 1.2;
  --line-height-snug: 1.45;
  --line-height-normal: 1.75;
  --line-height-relaxed: 1.9;
  --letter-tight: -0.02em;
  --measure: 40rem;
  --measure-wide: 46rem;

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

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --radius-card: 1.5rem;
  --radius-pill: 9999px;

  /* Motion */
  --transition: 0.2s ease;
  --transition-slow: 0.45s ease;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* Layout */
  --container-max: 90rem;
  --container-padding: 6.25rem;
  --header-height: 5rem;
  --topbar-height: 2.375rem;
  --content-max: 72rem;
}

/* Theme toggle (header) */
.hs-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    transform 0.16s var(--ease-out);
}

.hs-theme-toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}

.hs-theme-toggle:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hs-theme-toggle:active {
  transform: scale(0.96);
}

.hs-theme-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.hs-theme-toggle .hs-theme-toggle__sun {
  display: none;
}

.hs-theme-toggle .hs-theme-toggle__moon {
  display: block;
}

html[data-color-scheme="dark"] .hs-theme-toggle .hs-theme-toggle__sun {
  display: block;
}

html[data-color-scheme="dark"] .hs-theme-toggle .hs-theme-toggle__moon {
  display: none;
}

/* Dark: elevated chrome so footer/top-bar don't vanish */
html[data-color-scheme="dark"] .top-bar {
  background-color: var(--color-dark-soft);
}

html[data-color-scheme="dark"] .home-footer {
  background-color: var(--color-dark);
  border-block-start: 1px solid var(--color-border);
}

/* Monochrome icons loaded as <img> — invert for cream stroke on dark bg */
html[data-color-scheme="dark"] img[src*="assets/icons/"]:not([src*="logo.svg"]) {
  filter: brightness(0) invert(0.92);
}

/* Inline SVG icons (about process, 404 stars, etc.) */
.about-process-card__icon,
.about-timeline svg,
.about-process svg,
.about-values svg,
.nf-decor svg {
  color: var(--color-text);
}

/* Soften form success banner on dark */
html[data-color-scheme="dark"] .ct-form__success {
  background: color-mix(in srgb, var(--color-success) 18%, var(--color-surface));
  color: var(--color-text);
}

html[data-color-scheme="dark"] .sd-page[data-theme="product"] {
  --sd-tint: #2a353b;
  --sd-media-bg: #1e2a30;
  --sd-ink-soft: #d9cfc3;
}
html[data-color-scheme="dark"] .sd-page[data-theme="ui-ux"] {
  --sd-tint: #2c2622;
  --sd-media-bg: #241e1a;
  --sd-ink-soft: #e0d2c6;
}
html[data-color-scheme="dark"] .sd-page[data-theme="web"] {
  --sd-tint: #1a2a32;
  --sd-media-bg: #0e2938;
  --sd-ink-soft: #c5d5de;
}
html[data-color-scheme="dark"] .sd-page[data-theme="mobile"] {
  --sd-tint: #16302d;
  --sd-media-bg: #134e4a;
  --sd-ink-soft: #c5e0db;
}
html[data-color-scheme="dark"] .sd-page[data-theme="mvp"] {
  --sd-tint: #2a2233;
  --sd-media-bg: #2e1c40;
  --sd-ink-soft: #ddd0e8;
}
html[data-color-scheme="dark"] .sd-page[data-theme="ai"] {
  --sd-tint: #22203a;
  --sd-media-bg: #1e1b4b;
  --sd-ink-soft: #d4d0f0;
}
html[data-color-scheme="dark"] .sd-page[data-theme="seo"] {
  --sd-tint: #1a2e24;
  --sd-media-bg: #14532d;
  --sd-ink-soft: #c5e0d0;
}
html[data-color-scheme="dark"] .sd-page[data-theme="consulting"] {
  --sd-tint: #2a2620;
  --sd-media-bg: #4e3629;
  --sd-ink-soft: #e0d4c8;
}

@media (max-width: 75rem) {
  :root {
    --container-padding: 2.5rem;
    --section-space: 4.5rem;
  }
}

@media (max-width: 64rem) {
  :root {
    --container-padding: 1.25rem;
    --font-size-h1: 1.875rem;
    --section-space: 4rem;
  }
}

@media (max-width: 48rem) {
  :root {
    --font-size-hero: 2.125rem;
    --font-size-h2: 1.5rem;
    --section-space: 3.25rem;
    --section-space-sm: 2.5rem;
  }
}
