/* Sir SoSo studio: shared design system. Quiet dark surfaces, hairline borders,
   one champagne accent used sparingly, Vazirmatn for Persian, Inter for the mark. */
@font-face { font-family: 'Vazirmatn'; src: url('/fonts/vazirmatn-arabic.woff2') format('woff2'); font-weight: 100 900; unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/fonts/vazirmatn-latin.woff2') format('woff2'); font-weight: 100 900; unicode-range: U+0000-024F, U+2000-206F; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --bg: #0a0a0b;
  --surface: #111113;
  --surface-2: #17171a;
  --surface-3: #1e1e22;
  --border: rgba(255, 255, 255, .075);
  --border-2: rgba(255, 255, 255, .13);
  --text: #f4f4f5;
  --text-2: #a1a1aa;
  --text-3: #6e6e78;
  --accent: #d8b46c;
  --accent-2: #e9cb88;
  --accent-ink: #15110a;
  --accent-soft: rgba(216, 180, 108, .12);
  --accent-line: rgba(216, 180, 108, .38);
  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, .1);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, .1);
  --blue: #8ab4f8;
  --blue-soft: rgba(138, 180, 248, .1);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: 'Vazirmatn', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.35; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 17px; line-height: 1.5; font-weight: 600; }
h3 { font-size: 15px; line-height: 1.5; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Soft light at the top of the page; static, no animation. */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(70vmax 40vmax at 50% -12%, rgba(216, 180, 108, .07), transparent 70%); }

/* Icons: stroked, 1.75 line, inherit colour. The sprite sits in each page. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 16px; height: 16px; }
.i.lg { width: 24px; height: 24px; }
.i.fill { fill: currentColor; stroke: none; }
[dir="rtl"] .i.flip { transform: scaleX(-1); }

/* Brand mark */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; direction: ltr; }
.brand .mark { width: 30px; height: 30px; color: var(--accent); }
.brand .word { font: 800 14px/1 'Inter', sans-serif; letter-spacing: .16em; direction: ltr; }
.brand .tag { font-size: 12px; color: var(--text-3); padding-inline-start: 10px; border-inline-start: 1px solid var(--border-2); line-height: 1; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--r-md);
  border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s, transform .1s var(--ease); user-select: none; }
.btn:hover { background: var(--surface-3); border-color: rgba(255, 255, 255, .18); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.quiet:hover { background: var(--surface-2); color: var(--text); }
.btn.success { color: var(--green); border-color: rgba(74, 222, 128, .3); background: var(--green-soft); }
.btn.danger { color: var(--red); border-color: rgba(248, 113, 113, .28); background: transparent; }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; gap: 6px; }
.btn.lg { height: 52px; padding: 0 24px; font-size: 15px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.icon { width: 40px; padding: 0; }
.btn.icon.sm { width: 34px; }
.btn[disabled], .btn.busy { opacity: .5; pointer-events: none; }

/* Inputs */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--text-2); }
.input { width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--border-2); background: var(--surface-2);
  color: var(--text); font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: .04em; direction: ltr; }
.input-wrap { position: relative; }
.input-wrap .input { padding-inline-end: 48px; }
.input-wrap .btn.icon { position: absolute; inset-inline-end: 4px; top: 4px; height: 40px; width: 40px; border: 0; background: transparent; color: var(--text-3); }
.input-wrap .btn.icon:hover { color: var(--text); background: var(--surface-3); }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* Status: a dot and a word, never a loud pill. */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.status.ready::before { background: var(--accent); }
.status.approved { color: var(--green); }
.status.approved::before { background: var(--green); }
.status.failed, .status.rejected { color: var(--red); }
.status.failed::before, .status.rejected::before { background: var(--red); }
.status.working::before { background: var(--blue); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }

.progress { height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .5s var(--ease); }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: fixed; inset-inline: 0; bottom: calc(24px + env(safe-area-inset-bottom)); margin: 0 auto; width: max-content; max-width: calc(100% - 32px);
  padding: 11px 18px; border-radius: var(--r-md); background: var(--surface-3); border: 1px solid var(--border-2); color: var(--text);
  font-size: 14px; font-weight: 500; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); opacity: 0; transform: translateY(12px); transition: .25s var(--ease); z-index: 60; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }

/* Full-screen video player */
dialog.player { padding: 0; border: 0; margin: 0; background: transparent; width: 100%; max-width: 100%; height: 100%; max-height: 100%; }
dialog.player::backdrop { background: rgba(5, 5, 6, .92); }
dialog.player .wrap { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 20px; }
dialog.player video { max-height: calc(100dvh - 120px); max-width: 100%; aspect-ratio: 9 / 16; border-radius: var(--r-lg); background: #000; }
dialog.player .bar { display: flex; gap: 10px; }

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