/* ════════════════════════════════════════════════════════
   BASE.CSS — فونت، ریست، تایپوگرافی، لایوت پایه
   ════════════════════════════════════════════════════════ */

/* ── فونت Estedad ── */
@font-face {
  font-family: 'Estedad';
  src: url('/assets/fonts/Estedad.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── Reset مدرن ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: 1.7;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition:
    background-color var(--duration-slow) var(--ease-out),
    color var(--duration-slow) var(--ease-out);
  max-width: 100vw;
  overflow-x: hidden;
}

/* ── تایپوگرافی Editorial ── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-extrabold);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

p {
  line-height: 1.8;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

/* ── Selection & Scrollbar ── */
::selection {
  background: var(--color-accent-soft);
  color: var(--color-text);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

/* ── Focus States (دسترس‌پذیری) ── */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Utility Classes ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

/* ── Canvas پس‌زمینه ── */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 900px 600px at 15% 0%,
      var(--color-accent-soft) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 700px 500px at 85% 100%,
      rgba(177, 138, 63, 0.06) 0%,
      transparent 55%
    );
}

/* ── Reduced Motion (دسترس‌پذیری) ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

html,
body {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}
