/* ============================================================
   MW // OPERATOR // V1.0 — Design Tokens
   Inspiracja: Jerrod OS dashboard (operator OS aesthetic)
   ============================================================ */

:root {
    /* === Backgrounds === */
    --mw-bg-cream:        #F4EDE0;
    --mw-bg-cream-2:      #EAE2D2;
    --mw-bg-cream-light:  #FAF6EF;
    --mw-bg-card:         #FFFFFF;
    --mw-bg-dark:         #1A1814;
    --mw-bg-muted:        #F8F2E5;

    /* === Accent (orange/coral, sparingly) === */
    --mw-accent:          #E07856;
    --mw-accent-soft:     #F2A988;
    --mw-accent-bg:       rgba(224, 120, 86, 0.08);
    --mw-accent-strong:   #C4593B;

    /* === Text === */
    --mw-text-primary:    #1A1814;
    --mw-text-secondary:  #5C5650;
    --mw-text-muted:      #9C958A;
    --mw-text-faint:      #BDB6AB;
    --mw-text-on-accent:  #FFFFFF;

    /* === Borders === */
    --mw-border-soft:     #E5DDD0;
    --mw-border-medium:   #C8BFB0;
    --mw-border-strong:   #1A1814;

    /* === Status colors === */
    --mw-status-online:   #4A7C59;
    --mw-status-warn:     #D4A537;
    --mw-status-urgent:   #C4593B;
    --mw-status-info:     #5870A0;

    /* === Shadows === */
    --mw-shadow-sm:       0 1px 2px rgba(26,24,20,0.04);
    --mw-shadow-card:     0 1px 3px rgba(26,24,20,0.06), 0 4px 12px rgba(26,24,20,0.04);
    --mw-shadow-card-hi:  0 2px 6px rgba(26,24,20,0.08), 0 8px 24px rgba(26,24,20,0.06);
    --mw-shadow-modal:    0 4px 16px rgba(26,24,20,0.12), 0 24px 64px rgba(26,24,20,0.16);

    /* === Typography === */
    --mw-font-mono:       'JetBrains Mono', 'IBM Plex Mono', 'Courier New', monospace;
    --mw-font-serif:      'Playfair Display', 'EB Garamond', Georgia, serif;
    --mw-font-sans:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

    --mw-fs-mono-xs:      11px;
    --mw-fs-mono-sm:      12px;
    --mw-fs-mono-md:      13px;
    --mw-fs-body:         14px;
    --mw-fs-body-lg:      16px;
    --mw-fs-h3:           20px;
    --mw-fs-h2:           28px;
    --mw-fs-h1:           42px;
    --mw-fs-display:      72px;

    --mw-ls-mono:         0.08em;
    --mw-ls-mono-tight:   0.04em;

    /* === Spacing === */
    --mw-sp-1: 4px;
    --mw-sp-2: 8px;
    --mw-sp-3: 12px;
    --mw-sp-4: 16px;
    --mw-sp-5: 20px;
    --mw-sp-6: 24px;
    --mw-sp-8: 32px;
    --mw-sp-10: 40px;
    --mw-sp-12: 48px;

    /* === Radius === */
    --mw-radius-card:   16px;
    --mw-radius-card-sm: 10px;
    --mw-radius-pill:   999px;
    --mw-radius-button: 8px;

    /* === Animations === */
    --mw-ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
    --mw-ease-in-out:   cubic-bezier(0.65, 0, 0.35, 1);
    --mw-dur-fast:      150ms;
    --mw-dur-base:      300ms;
    --mw-dur-slow:      600ms;

    /* === Aliasy używane w layoutach (mw-layout.css, taby, telemetria) === */
    --mw-bg:              var(--mw-bg-cream);
    --mw-bg-elev:         var(--mw-bg-cream-light);
    --mw-fg:              var(--mw-text-primary);
    --mw-muted:           var(--mw-text-muted);
    --mw-border:          var(--mw-border-medium);
    --mw-border-subtle:   var(--mw-border-soft);
}

/* ============================================================
   DARK MODE
   ============================================================ */

[data-theme="dark"] {
    --mw-bg-cream:        #1A1814;
    --mw-bg-cream-2:      #221F1A;
    --mw-bg-cream-light:  #15130F;
    --mw-bg-card:         #2B2620;
    --mw-bg-dark:         #F4EDE0;
    --mw-bg-muted:        #221F1A;

    --mw-text-primary:    #F4EDE0;
    --mw-text-secondary:  #C8BFB0;
    --mw-text-muted:      #9C958A;
    --mw-text-faint:      #5C5650;
    --mw-text-on-accent:  #1A1814;

    --mw-border-soft:     #3A352E;
    --mw-border-medium:   #4D4639;
    --mw-border-strong:   #F4EDE0;

    --mw-shadow-card:     0 1px 3px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.2);
    --mw-shadow-card-hi:  0 2px 6px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.3);
    --mw-shadow-modal:    0 4px 16px rgba(0,0,0,0.6), 0 24px 64px rgba(0,0,0,0.4);
}

/* ============================================================
   BASE
   ============================================================ */

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

html, body {
    height: 100%;
    background: var(--mw-bg-cream);
    color: var(--mw-text-primary);
    font-family: var(--mw-font-sans);
    font-size: var(--mw-fs-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background var(--mw-dur-base) var(--mw-ease-out),
                color var(--mw-dur-base) var(--mw-ease-out);
}

body {
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

::selection { background: var(--mw-accent); color: var(--mw-text-on-accent); }

/* Scrollbar (kremowa, dyskretna) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--mw-border-medium); border-radius: 999px; border: 2px solid var(--mw-bg-cream); }
::-webkit-scrollbar-thumb:hover { background: var(--mw-text-muted); }

/* ============================================================
   TYPOGRAFIA — utility classes
   ============================================================ */

.mw-mono { font-family: var(--mw-font-mono); }
.mw-serif { font-family: var(--mw-font-serif); }
.mw-sans { font-family: var(--mw-font-sans); }

.mw-mono-label {
    font-family: var(--mw-font-mono);
    font-size: var(--mw-fs-mono-sm);
    font-weight: 500;
    letter-spacing: var(--mw-ls-mono);
    text-transform: uppercase;
    color: var(--mw-text-muted);
}

.mw-mono-value {
    font-family: var(--mw-font-mono);
    font-size: var(--mw-fs-mono-md);
    font-weight: 500;
    color: var(--mw-text-primary);
}

.mw-h-display {
    font-family: var(--mw-font-serif);
    font-size: var(--mw-fs-display);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--mw-text-primary);
}

.mw-h-display em {
    font-style: italic;
    font-weight: 400;
}

.mw-h-1 {
    font-family: var(--mw-font-serif);
    font-size: var(--mw-fs-h1);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.mw-h-1 em { font-style: italic; }

.mw-h-2 {
    font-family: var(--mw-font-serif);
    font-size: var(--mw-fs-h2);
    font-weight: 400;
    line-height: 1.2;
}

.mw-h-3 {
    font-family: var(--mw-font-sans);
    font-size: var(--mw-fs-h3);
    font-weight: 600;
    line-height: 1.3;
}

.mw-text-muted { color: var(--mw-text-muted); }
.mw-text-faint { color: var(--mw-text-faint); }
.mw-text-accent { color: var(--mw-accent); }

/* ============================================================
   ANIMACJE
   ============================================================ */

@keyframes mw-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(1.6); }
}

@keyframes mw-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes mw-fade-in-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes mw-fade-in-down {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes mw-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes mw-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.mw-anim-pulse  { animation: mw-pulse 1.5s ease-in-out infinite; }
.mw-anim-fade   { animation: mw-fade-in var(--mw-dur-base) var(--mw-ease-out) both; }
.mw-anim-rise   { animation: mw-fade-in-up var(--mw-dur-base) var(--mw-ease-out) both; }
.mw-anim-drop   { animation: mw-fade-in-down var(--mw-dur-base) var(--mw-ease-out) both; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   UTILITY: focus state (accessibility)
   ============================================================ */

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 2px solid var(--mw-accent);
    outline-offset: 2px;
}
