/* =========================================================
   Base: reset, typography, primitives
   ========================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--cc-border-strong) transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--cc-bg);
  background-image: var(--cc-aura-1), var(--cc-aura-2);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--cc-text);
  font-family: Vazirmatn, "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--cc-mid), color var(--cc-mid);
}

h1, h2, h3, h4, h5 {
  margin: 0 0 0.5em;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--cc-text);
}

h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: clamp(22px, 2.6vw, 30px); }
h3 { font-size: clamp(18px, 2vw, 22px); }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; transition: color var(--cc-fast); }
a:hover { color: var(--cc-accent); }

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

ul, ol { margin: 0 0 1em; padding-inline-start: 1.4em; }
ul.cc-plain, ol.cc-plain { list-style: none; margin: 0; padding: 0; }

strong, b { font-weight: 700; }
small { font-size: 0.85em; color: var(--cc-text-2); }

hr {
  border: 0;
  height: 1px;
  background: var(--cc-border);
  margin: 28px 0;
}

code, pre, kbd {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

::selection { background: var(--cc-accent); color: var(--cc-accent-ink); }

:focus-visible {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
  border-radius: var(--cc-r-xs);
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--cc-border-strong);
  border-radius: var(--cc-r-full);
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--cc-text-3); background-clip: content-box; }

/* Utilities */
.screen-reader-text, .cc-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

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

.cc-stack > * + * { margin-block-start: var(--cc-stack-gap, 16px); }
.cc-muted { color: var(--cc-text-2); }
.cc-dim { color: var(--cc-text-3); }
.cc-nowrap { white-space: nowrap; }
.cc-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cc-hide { display: none !important; }

.cc-icon { width: 20px; height: 20px; flex: none; }
.cc-icon--sm { width: 16px; height: 16px; }
.cc-icon--lg { width: 24px; height: 24px; }

/* Numbers stay LTR inside RTL text */
.cc-ltr { direction: ltr; unicode-bidi: isolate; }

/* Entry content (pages, product description) */
.cc-prose { color: var(--cc-text-2); line-height: 1.95; }
.cc-prose h2, .cc-prose h3, .cc-prose h4 { color: var(--cc-text); margin-top: 1.6em; }
.cc-prose a { color: var(--cc-accent); text-decoration: underline; text-underline-offset: 3px; }
.cc-prose img { border-radius: var(--cc-r); margin: 1.4em 0; }
.cc-prose blockquote {
  margin: 1.6em 0;
  padding: 14px 20px;
  border-inline-start: 3px solid var(--cc-accent);
  background: var(--cc-surface-2);
  border-radius: var(--cc-r-sm);
  color: var(--cc-text);
}
.cc-prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; }
.cc-prose th, .cc-prose td { padding: 10px 14px; border-bottom: 1px solid var(--cc-border); text-align: start; }
.cc-prose th { color: var(--cc-text); font-weight: 600; }

/* Animations */
@keyframes cc-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes cc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cc-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes cc-spin { to { transform: rotate(360deg); } }
@keyframes cc-pop { 0% { transform: scale(0.86); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }

.cc-anim-in { animation: cc-fade-up var(--cc-slow) both; }
