@layer reset, tokens, base, components, pages;

@layer tokens {
  :root {
    --emoji-scale: 1em;
    --emoji-jumbo-scale: 2em;
    --emoji-picker-size: 28px;
    --reaction-emoji-size: 20px;
    --mt-reaction-ui-font: system-ui, -apple-system, "Segoe UI", sans-serif;
    --mt-reaction-emoji-font: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    --bg-dark: #070707;
    --bg-footer: #0d0d0f;
    --bg-card: #111113;
    --bg-card-hover: #18181c;
    --bg-input: #0c0c0f;
    --bg-notification: #17171a;
    --bg-notification-inner: #101012;

    --red-primary: #b8141b;
    --red-bright: #f0444d;
    --red-deep: #5f0d13;
    --red-accent: #e12630;

    --color-primary: var(--red-bright);
    --color-primary-dark: var(--red-primary);
    --color-danger: #ff3e3e;
    --color-warning: #ffaa00;
    --color-success: #48ff8b;
    --color-info: #6495ed;
    --icon-accent: #ff6268;

    --text-light: #f3f3f4;
    --text-secondary: #ffffff;
    --text-muted: var(--text-secondary);
    --text-faint: #74747c;

    --border-soft: rgba(255, 255, 255, 0.08);
    --border-softer: rgba(255, 255, 255, 0.05);
    --border-medium: rgba(255, 255, 255, 0.14);
    --border-red: rgba(240, 68, 77, 0.18);
    --border-red-bright: rgba(240, 68, 77, 0.35);

    --gradient: linear-gradient(to bottom, var(--red-bright), var(--red-primary), var(--red-deep));

    --grid-pattern:
      radial-gradient(circle at 50% -10%, rgba(127, 12, 20, 0.2), transparent 42%),
      linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    --grid-size: 100% 100%, 48px 48px, 48px 48px;

    --radius-xs: 0.25rem;
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 999px;

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --t-fast: 0.12s ease;
    --t-normal: 0.18s ease;
    --t-slow: 0.28s ease;

    --anim-fast: 120ms ease;
    --anim-normal: 220ms ease;
    --anim-slow: 320ms ease;

    --bg-input-hover: #1a1a1f;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.34);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.46);
    --shadow-glow: 0 0 22px rgba(240, 68, 77, 0.18);

    --mt-bg: var(--bg-dark);
    --mt-surface: var(--bg-card);
    --mt-surface-2: #161619;
    --mt-surface-3: #1c1c20;
    --mt-red: var(--red-bright);
    --mt-text: var(--text-light);
    --mt-text-secondary: var(--text-secondary);
    --mt-text-muted: var(--text-faint);
    --mt-border: var(--border-soft);
    --mt-border-strong: var(--border-medium);
    --mt-radius-sm: var(--radius-sm);
    --mt-radius-md: var(--radius-md);
    --mt-radius-lg: var(--radius-lg);

    --mt-content: min(1320px, calc(100% - 2rem));
    --mt-panel: linear-gradient(145deg, rgba(20, 20, 23, 0.98), rgba(11, 11, 13, 0.98));
    --mt-panel-raised: linear-gradient(145deg, rgba(27, 27, 31, 0.98), rgba(15, 15, 18, 0.98));
    --mt-media-spinner: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg fill='none' stroke='%23ff3e3e' stroke-width='3'%3E%3Ccircle cx='16' cy='16' r='12' stroke-opacity='.22'/%3E%3Cpath d='M16 4a12 12 0 0 1 12 12' stroke-linecap='round'/%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 16 16' to='360 16 16' dur='0.8s' repeatCount='indefinite'/%3E%3C/g%3E%3C/svg%3E");
  }

  @media (prefers-reduced-motion: reduce) {
    :root {
      --mt-media-spinner: radial-gradient(circle, transparent 42%, #ff3e3e 45% 55%, transparent 58%);
    }
  }
}
