/* Design tokens, reset and typography. */

:root {
  color-scheme: dark light;

  --bg: #0f0f13;
  --bg-elevated: #17171e;
  --surface: #1c1c25;
  --surface-2: #23232e;
  --line: #2e2e3c;
  --line-soft: #26262f;

  --text: #f4f4f7;
  --text-muted: #9c9cb0;
  --text-faint: #6f6f82;

  --accent: #f0b429;
  --accent-ink: #17140a;
  --accent-soft: rgba(240, 180, 41, 0.13);
  --accent-line: rgba(240, 180, 41, 0.32);

  --good: #3ecf8e;
  --good-soft: rgba(62, 207, 142, 0.12);
  --warn: #f5a524;
  --warn-soft: rgba(245, 165, 36, 0.12);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.12);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --pad: 16px;
  --tap: 44px;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.28);

  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, 'Noto Sans Arabic', 'Cairo', sans-serif;
  --font-num: ui-rounded, -apple-system, 'SF Pro Rounded', 'Segoe UI', system-ui, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f4f7;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-2: #f0f0f4;
    --line: #e0e0e8;
    --line-soft: #ebebf1;

    --text: #16161c;
    --text-muted: #63637a;
    --text-faint: #8c8ca0;

    --accent: #b07d06;
    --accent-ink: #ffffff;
    --accent-soft: rgba(176, 125, 6, 0.1);
    --accent-line: rgba(176, 125, 6, 0.28);

    --good: #14855c;
    --good-soft: rgba(20, 133, 92, 0.1);
    --warn: #a86a05;
    --warn-soft: rgba(168, 106, 5, 0.1);
    --danger: #c62f2f;
    --danger-soft: rgba(198, 47, 47, 0.09);

    --shadow: 0 1px 2px rgba(20, 20, 40, 0.06), 0 8px 24px rgba(20, 20, 40, 0.07);
  }
}

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

html,
body {
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100dvh;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.01em;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

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

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

.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

[dir='rtl'] .flip {
  transform: scaleX(-1);
}
