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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Vazirmatn', sans-serif;
  background: var(--clr-bg);
  color: var(--clr-text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
  -webkit-font-smoothing: antialiased;
}

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

button, input, select {
  font-family: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

::selection {
  background: var(--brand-violet);
  color: #fff;
}

/* ── Background orbs ── */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.16;
  animation: drift 22s ease-in-out infinite alternate;
}

.orb-1 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, var(--brand-violet), transparent 70%);
  top: -140px; inset-inline-end: -100px;
}

.orb-2 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, var(--brand-orange), transparent 70%);
  bottom: -100px; inset-inline-start: -80px;
  animation-delay: -8s;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, 50px) scale(1.08); }
}

:root[data-theme="light"] .orb { opacity: 0.10; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .orb { opacity: 0.10; }
}

/* ── App shell layout ── */
.app {
  position: relative;
  z-index: 1;
  max-width: var(--page-max-w);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 12px);
}

.page-content {
  flex: 1;
  padding: 12px 16px 24px;
}

/* ── Utility ── */
.glass {
  background: var(--clr-surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--clr-border);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ltr { direction: ltr; unicode-bidi: isolate; }

@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;
  }
}

/* ── Cross-document view transitions (progressive enhancement) ── */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) {
    animation: fade-out var(--dur-fast) var(--ease) both;
  }
  ::view-transition-new(root) {
    animation: fade-in var(--dur) var(--ease) both;
  }
}

@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } }
