/* =====================================================================
   Design tokens, fonts and a mobile-safe reset. Light theme only.
   The brand colour (--brand) comes from core/brand.py (set in base.html);
   every other brand shade is mixed from it, so a rebrand is one value.
   ===================================================================== */

/* Body text: Vazirmatn UI with Persian digits, so every number shows as ۱۲۳. */
@font-face { font-family: "Vazir"; src: url("../fonts/Vazirmatn-UI-FD-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazir"; src: url("../fonts/Vazirmatn-UI-FD-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazir"; src: url("../fonts/Vazirmatn-UI-FD-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Vazir"; src: url("../fonts/Vazirmatn-UI-FD-ExtraBold.woff2") format("woff2"); font-weight: 800 900; font-display: swap; }
/* Latin digits, for part numbers and codes that people copy or compare: class .latin */
@font-face { font-family: "Vazir Latin"; src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  /* Brand scale */
  --brand-50: color-mix(in srgb, var(--brand) 6%, white);
  --brand-100: color-mix(in srgb, var(--brand) 12%, white);
  --brand-200: color-mix(in srgb, var(--brand) 24%, white);
  --brand-400: color-mix(in srgb, var(--brand) 70%, white);
  --brand-600: color-mix(in srgb, var(--brand) 88%, black);
  --brand-700: color-mix(in srgb, var(--brand) 75%, black);
  --brand-soft: var(--brand-100);
  --brand-strong: var(--brand-600);

  /* Accent: warm orange for offers, highlights and the odd call to action */
  --accent: #f26b1d;
  --accent-soft: #fff1e8;

  /* Neutrals */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f4f6;   /* fills: search, inputs, image placeholders */
  --divider: #eef0f3;
  --text: #171a21;
  --text-2: #3d4350;
  --muted: #6b7280;
  --faint: #9aa1ad;
  --border: #eaecf0;
  --border-strong: #d3d7de;

  /* Status */
  --success: #0f9d58; --success-soft: #e8f7ef;
  --warning: #c27803; --warning-soft: #fff6e0;
  --danger: #dc2626;  --danger-soft: #fdecec;
  --info: #2563eb;    --info-soft: #eaf1fe;

  /* Shape */
  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 20px; --r-xl: 28px; --r-full: 999px;
  --radius: var(--r-md);

  /* Elevation */
  --shadow-xs: 0 1px 2px rgb(16 24 40 / 0.05);
  --shadow: 0 1px 2px rgb(16 24 40 / 0.04), 0 4px 16px rgb(16 24 40 / 0.06);
  --shadow-lg: 0 4px 8px rgb(16 24 40 / 0.04), 0 16px 40px rgb(16 24 40 / 0.12);
  --shadow-brand: 0 10px 28px color-mix(in srgb, var(--brand) 28%, transparent);

  /* Type scale */
  --fs-xs: 0.75rem; --fs-sm: 0.8125rem; --fs-md: 0.9375rem; --fs-lg: 1.0625rem;
  --fs-xl: 1.25rem; --fs-2xl: 1.5rem; --fs-3xl: 1.875rem;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 120ms; --t: 200ms;

  --font: "Vazir", "Vazir Latin", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  /* Mobile: nothing may push the page sideways (the "page wobbles" bug). */
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Installed app: no rubber-band bounce that drags the header and tab bar. */
@media (display-mode: standalone) {
  html, body { overscroll-behavior-y: none; }
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
/* 16px+ inputs: stops iOS zooming into the page when a field is focused. */
input, select, textarea { font-size: max(16px, 1em); }
a, button, [role="button"], label, summary { touch-action: manipulation; }
h1, h2, h3, h4, p { margin: 0; overflow-wrap: anywhere; }
:focus-visible { outline: 2.5px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

.latin { font-family: "Vazir Latin", system-ui, sans-serif; letter-spacing: 0.01em; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Smooth cross-fade between in-app pages (htmx uses the View Transitions API). */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 160ms; }

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

/* ---------- Logo ---------- */
.logo-icon { display: block; flex: none; }
.logo-icon--xs { width: 30px; height: 30px; }
.logo-icon--sm { width: 36px; height: 36px; }
.logo-icon--md { width: 56px; height: 56px; }
.logo-icon--lg { width: 96px; height: 96px; filter: drop-shadow(0 10px 24px color-mix(in srgb, var(--brand) 30%, transparent)); }

/* ---------- Public landing page ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-name { font-weight: 800; font-size: 1.15rem; white-space: nowrap; }

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 16px;
  text-align: center;
}
.hero h1 { margin-top: 12px; font-size: clamp(1.75rem, 6vw, 2.5rem); font-weight: 900; }
.tagline { color: var(--muted); font-size: var(--fs-lg); }
.hero .search { width: min(100%, 520px); margin-top: 20px; }
.chip--soon { margin-top: 8px; }

.footer {
  padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-sm);
}
