/* ==========================================================================
   Maniro — Global Base Styles
   Theme tokens, reset, typography primitives shared across the site.
   ========================================================================== */

:root {
  /* --- Color: Light (default) --- */
  --color-bg: #ffffff;
  --color-bg-subtle: #f5f8fb;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;

  --color-text: #10161f;
  --color-text-muted: #5b6b7c;

  --color-sky: #0ea5e9;
  --color-sky-dark: #0369a1;
  --color-sky-tint: #eaf6fd;

  --shadow-sm: 0 1px 2px rgba(16, 22, 31, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 22, 31, 0.08);
  --shadow-lg: 0 16px 40px rgba(16, 22, 31, 0.12);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-full: 999px;

  --container-width: 1180px;
  --header-height: 76px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* Vazirmatn first — this is a Persian-first site, so the custom
     variable font should always win over generic system fonts. The
     system stack remains as a fallback for the brief instant before
     the webfont loads, and for any non-Persian glyphs. */
  --font-sans: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Tahoma", "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  --color-bg: #0b0f14;
  --color-bg-subtle: #0f151c;
  --color-surface: #10161f;
  --color-border: #232c37;

  --color-text: #edf1f5;
  --color-text-muted: #93a1b0;

  --color-sky: #38bdf8;
  --color-sky-dark: #0ea5e9;
  --color-sky-tint: rgba(56, 189, 248, 0.1);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.55);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
  overflow-wrap: break-word;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: 24px;
}

/* Screen-reader-only text (visible label for assistive tech, hidden visually) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Visible keyboard focus across the page */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-sky);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--color-sky-tint);
  color: var(--color-text);
}

img {
  image-rendering: -webkit-optimize-contrast;
}

/* --- Skip to main content (keyboard / screen-reader users) --- */
.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  inset-inline-start: 10px;
  transform: translateY(-140%);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.2s var(--ease);
}

.skip-link:focus-visible,
.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--color-sky);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* --- Shared "coming soon" placeholder used by pages not yet built --- */
.page-placeholder {
  padding-block: 120px;
  min-height: calc(100vh - var(--header-height) - 320px);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 15px;
}

/* --- Shared buttons (used in Hero) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding-inline: 26px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: normal;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease),
    border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn-primary {
  background: var(--color-text);
  color: var(--color-bg);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-sky-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

[data-theme="dark"] .btn-primary:hover {
  background: var(--color-sky);
  color: var(--color-bg);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-sky);
  color: var(--color-sky-dark);
  background: var(--color-sky-tint);
  transform: translateY(-2px);
}

[data-theme="dark"] .btn-secondary:hover {
  color: var(--color-sky);
}

/* ===========================
   Custom Scrollbar
=========================== */

/* Width */
::-webkit-scrollbar {
  width: 12px;
}

/* Background */
::-webkit-scrollbar-track {
  background: #d1d5db; /* Light Gray */
  border-radius: 10px;
}

/* Thumb */
::-webkit-scrollbar-thumb {
  background: linear-gradient(
      180deg,
      #60a5fa,
      #3b82f6
  );
  border-radius: 10px;
  border: 2px solid #d1d5db;
  transition: all 0.3s ease;
}

/* Hover */
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
      180deg,
      #3b82f6,
      #2563eb
  );
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #60a5fa #d1d5db;
}