/* =====================================================================
   DESIGN LANGUAGES — token values (single source of truth)
   Every app is written only against these custom properties, so any app
   can wear any skin. The remix panel overrides --accent*, --r-scale,
   --d-scale and the font tokens inline on the layer.
   ===================================================================== */

.layer {
  --r-scale: 1; --d-scale: 1; --speed: 1;
  --radius: calc(var(--radius-base) * var(--r-scale));
  --radius-sm: calc(var(--radius-base) * var(--r-scale) * .55);
  --pad: calc(var(--pad-base) * var(--d-scale));
  --gap: calc(var(--gap-base) * var(--d-scale));
  --accent-soft: color-mix(in oklab, var(--accent) 16%, transparent);
  --accent-ink: var(--accent);
  --label-weight: 500;
  --display-weight: 600;
  --num-weight: 500;
  --num-track: -0.02em;
  --display-track: -0.02em;
  --icon-stroke: 1.6;
  --ctl-h: 34px;
}

/* ---------- 1 · DOT MATRIX ---------- */
.layer[data-skin="dots"] {
  --radius-base: 22px; --pad-base: 20px; --gap-base: 14px; --border-w: 1px;
  --blur: none;
  --font-display: "Inter", system-ui, sans-serif; --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace; --font-num: "Geist Mono", ui-monospace, monospace;
  --label-font: var(--font-mono); --label-size: 11px; --label-track: .08em; --label-case: uppercase;
  --display-weight: 600;
}
.layer[data-skin="dots"][data-mode="dark"] {
  --bg: #0B0B0D; --bg-2: #141417; --surface: #141416; --surface-2: #1D1D20; --surface-3: #26262A;
  --line: rgba(255,255,255,.07); --line-2: rgba(255,255,255,.15);
  --text: #F2F1EE; --text-2: #8F8E94; --text-3: #56565C;
  --accent: #FF6A2B; --accent-2: #4D7CFF; --accent-3: #2EC4B6; --on-accent: #140A04;
  --good: #3DDC97; --warn: #FFB547; --bad: #FF5A5F;
  --t-low: #2EC4B6; --t-mid: #8F8E94; --t-high: #FF6A2B; --t-neg: #4D7CFF;
  --c1: #FF6A2B; --c2: #4D7CFF; --c3: #2EC4B6; --c4: #F2F1EE; --c5: #56565C;
  --shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 24px 48px -28px rgba(0,0,0,.9);
}
.layer[data-skin="dots"][data-mode="light"] {
  --bg: #ECEBE7; --bg-2: #E2E1DC; --surface: #FFFFFF; --surface-2: #F3F2EF; --surface-3: #E8E7E3;
  --line: rgba(0,0,0,.075); --line-2: rgba(0,0,0,.16);
  --text: #141416; --text-2: #6C6B70; --text-3: #A9A8AC;
  --accent: #E8591A; --accent-2: #2F5BEA; --accent-3: #0E9C90; --on-accent: #FFFFFF;
  --good: #17A86B; --warn: #D98A00; --bad: #E0393E;
  --t-low: #0E9C90; --t-mid: #A9A8AC; --t-high: #E8591A; --t-neg: #2F5BEA;
  --c1: #E8591A; --c2: #2F5BEA; --c3: #0E9C90; --c4: #141416; --c5: #A9A8AC;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 14px 32px -20px rgba(0,0,0,.28);
}

/* ---------- 2 · FROST GLASS ---------- */
.layer[data-skin="glass"] {
  --radius-base: 28px; --pad-base: 22px; --gap-base: 15px; --border-w: 1px;
  --blur: blur(28px) saturate(170%);
  --font-display: "Onest", system-ui, sans-serif; --font-body: "Onest", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace; --font-num: "Onest", system-ui, sans-serif;
  --label-font: var(--font-body); --label-size: 13px; --label-track: 0; --label-case: none; --label-weight: 500;
  --num-weight: 300; --num-track: -0.035em; --display-weight: 500;
}
.layer[data-skin="glass"][data-mode="dark"] {
  --bg: #0E0B24; --bg-2: #1D1546; --surface: rgba(255,255,255,.075); --surface-2: rgba(255,255,255,.09); --surface-3: rgba(255,255,255,.16);
  --line: rgba(255,255,255,.14); --line-2: rgba(255,255,255,.28);
  --text: #F6F4FF; --text-2: rgba(236,232,255,.68); --text-3: rgba(236,232,255,.4);
  --accent: #9DB8FF; --accent-2: #D69CFF; --accent-3: #7FF0D0; --on-accent: #120E2E;
  --good: #7FF0B4; --warn: #FFD38A; --bad: #FF8FA3;
  --t-low: #7FF0D0; --t-mid: #9DB8FF; --t-high: #FF9EC7; --t-neg: #D69CFF;
  --c1: #9DB8FF; --c2: #D69CFF; --c3: #7FF0D0; --c4: #FFD38A; --c5: rgba(236,232,255,.35);
  --shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 30px 60px -32px rgba(4,2,20,.75);
}
.layer[data-skin="glass"][data-mode="light"] {
  --bg: #F1E6F2; --bg-2: #DCE5FA; --surface: rgba(255,255,255,.5); --surface-2: rgba(255,255,255,.55); --surface-3: rgba(255,255,255,.82);
  --line: rgba(255,255,255,.75); --line-2: rgba(60,50,120,.16);
  --text: #1C1838; --text-2: rgba(28,24,56,.64); --text-3: rgba(28,24,56,.38);
  --accent: #6461EE; --accent-2: #BD4FD3; --accent-3: #0E9F83; --on-accent: #FFFFFF;
  --good: #0E9C66; --warn: #C9800A; --bad: #DC3E66;
  --t-low: #0E9F83; --t-mid: #8A87F5; --t-high: #E0558C; --t-neg: #BD4FD3;
  --c1: #6461EE; --c2: #BD4FD3; --c3: #0E9F83; --c4: #E8A23A; --c5: rgba(28,24,56,.25);
  --shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 24px 50px -28px rgba(70,40,130,.35);
}

/* ---------- 3 · SWISS EDITORIAL ---------- */
.layer[data-skin="swiss"] {
  --radius-base: 0px; --pad-base: 18px; --gap-base: 22px; --border-w: 0px;
  --blur: none; --shadow: none;
  --font-display: "Inter", "Helvetica Neue", Arial, sans-serif; --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace; --font-num: "Inter", "Helvetica Neue", Arial, sans-serif;
  --label-font: var(--font-mono); --label-size: 10.5px; --label-track: .06em; --label-case: uppercase;
  --num-weight: 700; --num-track: -0.055em; --display-weight: 700; --display-track: -0.04em; --icon-stroke: 1.8;
}
.layer[data-skin="swiss"][data-mode="light"] {
  --bg: #F2EFE8; --bg-2: #EAE6DD; --surface: #F2EFE8; --surface-2: #E5E1D7; --surface-3: #D9D4C8;
  --line: rgba(17,17,17,.16); --line-2: #111111;
  --text: #111111; --text-2: #5E5A52; --text-3: #A09B90;
  --accent: #E3260E; --accent-2: #111111; --accent-3: #1F4FD8; --on-accent: #FFFFFF;
  --good: #1F7A4D; --warn: #B86E06; --bad: #E3260E;
  --t-low: #111111; --t-mid: #9C978C; --t-high: #E3260E; --t-neg: #1F4FD8;
  --c1: #111111; --c2: #E3260E; --c3: #9C978C; --c4: #1F4FD8; --c5: #D9D4C8;
}
.layer[data-skin="swiss"][data-mode="dark"] {
  --bg: #121212; --bg-2: #1A1A1A; --surface: #121212; --surface-2: #222222; --surface-3: #2E2E2E;
  --line: rgba(242,239,232,.2); --line-2: #F2EFE8;
  --text: #F2EFE8; --text-2: #A39E93; --text-3: #5F5B54;
  --accent: #FF3B1F; --accent-2: #F2EFE8; --accent-3: #6B95FF; --on-accent: #FFFFFF;
  --good: #5FC28C; --warn: #F0A43A; --bad: #FF3B1F;
  --t-low: #F2EFE8; --t-mid: #6A665E; --t-high: #FF3B1F; --t-neg: #6B95FF;
  --c1: #F2EFE8; --c2: #FF3B1F; --c3: #6A665E; --c4: #6B95FF; --c5: #2E2E2E;
}

/* ---------- 4 · NEO-BRUTAL ---------- */
.layer[data-skin="brutal"] {
  --radius-base: 12px; --pad-base: 18px; --gap-base: 18px; --border-w: 2.5px;
  --blur: none;
  --font-display: "Archivo Expanded", "Arial Black", sans-serif; --font-body: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "Space Grotesk", ui-monospace, monospace; --font-num: "Archivo Expanded", "Arial Black", sans-serif;
  --label-font: var(--font-body); --label-size: 12px; --label-track: .03em; --label-case: uppercase; --label-weight: 700;
  --num-weight: 900; --num-track: -0.03em; --display-weight: 900; --icon-stroke: 2.2;
}
.layer[data-skin="brutal"][data-mode="light"] {
  --bg: #FFF3D6; --bg-2: #FFE7A8; --surface: #FFFFFF; --surface-2: #FFF8E8; --surface-3: #FFE9B0;
  --line: #111111; --line-2: #111111; --ink: #111111;
  --text: #111111; --text-2: #3E3A31; --text-3: #8A8475;
  --accent: #FFD23F; --accent-2: #FF8FB1; --accent-3: #7DD3FC; --on-accent: #111111; --accent-ink: #C42D63;
  --good: #2FBF61; --warn: #FF9F1C; --bad: #FF4D4D;
  --t-low: #8CE99A; --t-mid: #FFFFFF; --t-high: #FF8FB1; --t-neg: #7DD3FC;
  --c1: #FFD23F; --c2: #FF8FB1; --c3: #7DD3FC; --c4: #8CE99A; --c5: #FFFFFF;
  --tint-1: #FFD23F; --tint-2: #FF8FB1; --tint-3: #7DD3FC; --tint-4: #B8F2A0; --tint-5: #C7B8FF;
  --shadow: 5px 5px 0 #111111;
}
.layer[data-skin="brutal"][data-mode="dark"] {
  --bg: #161616; --bg-2: #202020; --surface: #222222; --surface-2: #2C2C2C; --surface-3: #383838;
  --line: #F5F0E1; --line-2: #F5F0E1; --ink: #F5F0E1;
  --text: #F5F0E1; --text-2: #CFC9B8; --text-3: #8E887A;
  --accent: #FFD23F; --accent-2: #FF8FB1; --accent-3: #7DD3FC; --on-accent: #111111; --accent-ink: #FFD23F;
  --good: #59E08A; --warn: #FFB04A; --bad: #FF6B6B;
  --t-low: #8CE99A; --t-mid: #3A3A3A; --t-high: #FF8FB1; --t-neg: #7DD3FC;
  --c1: #FFD23F; --c2: #FF8FB1; --c3: #7DD3FC; --c4: #8CE99A; --c5: #3A3A3A;
  --tint-1: #FFD23F; --tint-2: #FF8FB1; --tint-3: #7DD3FC; --tint-4: #8CE99A; --tint-5: #C7B8FF;
  --shadow: 5px 5px 0 var(--card-tint, #FFD23F);
}

/* ---------- 5 · NOIR LUXE ---------- */
.layer[data-skin="noir"] {
  --radius-base: 3px; --pad-base: 22px; --gap-base: 14px; --border-w: 1px;
  --blur: none;
  --font-display: "Instrument Serif", "Times New Roman", serif; --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace; --font-num: "Instrument Serif", "Times New Roman", serif;
  --label-font: var(--font-mono); --label-size: 9.5px; --label-track: .24em; --label-case: uppercase; --label-weight: 400;
  --num-weight: 400; --num-track: -0.01em; --display-weight: 400; --display-track: 0; --icon-stroke: 1.2;
}
.layer[data-skin="noir"][data-mode="dark"] {
  --bg: #0C0B09; --bg-2: #16130E; --surface: #11100D; --surface-2: #1A1813; --surface-3: #24211A;
  --line: rgba(201,164,92,.2); --line-2: rgba(201,164,92,.5);
  --text: #EDE6D6; --text-2: #9C937F; --text-3: #5E5748;
  --accent: #C9A45C; --accent-2: #8E9AAF; --accent-3: #B8694E; --on-accent: #0C0B09;
  --good: #A3BC80; --warn: #D9A55B; --bad: #C8644F;
  --t-low: #C9A45C; --t-mid: #4A4438; --t-high: #B8694E; --t-neg: #8E9AAF;
  --c1: #C9A45C; --c2: #8E9AAF; --c3: #B8694E; --c4: #EDE6D6; --c5: #4A4438;
  --shadow: 0 40px 70px -48px rgba(0,0,0,.95);
}
.layer[data-skin="noir"][data-mode="light"] {
  --bg: #F4EFE6; --bg-2: #EBE3D5; --surface: #FAF7F1; --surface-2: #F1EBDF; --surface-3: #E7DFCF;
  --line: rgba(156,122,60,.26); --line-2: rgba(156,122,60,.6);
  --text: #1B1813; --text-2: #6E6556; --text-3: #A89E8B;
  --accent: #96743A; --accent-2: #556580; --accent-3: #8E3B2C; --on-accent: #FAF7F1;
  --good: #5E7A3A; --warn: #A8701F; --bad: #A53A2A;
  --t-low: #96743A; --t-mid: #D3C8B3; --t-high: #8E3B2C; --t-neg: #556580;
  --c1: #96743A; --c2: #556580; --c3: #8E3B2C; --c4: #1B1813; --c5: #D3C8B3;
  --shadow: 0 30px 60px -44px rgba(60,40,10,.45);
}

/* ---------- 6 · NORDIC CALM ---------- */
.layer[data-skin="nordic"] {
  --radius-base: 24px; --pad-base: 22px; --gap-base: 16px; --border-w: 0px;
  --blur: none;
  --font-display: "Fraunces", Georgia, serif; --font-body: "Onest", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace; --font-num: "Fraunces", Georgia, serif;
  --label-font: var(--font-body); --label-size: 13px; --label-track: 0; --label-case: none; --label-weight: 500;
  --num-weight: 400; --num-track: -0.03em; --display-weight: 400; --display-track: -0.01em; --icon-stroke: 1.6;
}
.layer[data-skin="nordic"][data-mode="light"] {
  --bg: #E7ECE9; --bg-2: #DCE4E0; --surface: #F8F8F5; --surface-2: #EDF1EE; --surface-3: #E1E7E3;
  --line: rgba(35,48,45,.08); --line-2: rgba(35,48,45,.17);
  --text: #23302D; --text-2: #63716D; --text-3: #A2ADA9;
  --accent: #2F6F62; --accent-2: #D07A52; --accent-3: #5F93AE; --on-accent: #FFFFFF;
  --good: #3B8A66; --warn: #CF8650; --bad: #C2554A;
  --t-low: #2F6F62; --t-mid: #B9C7C2; --t-high: #D07A52; --t-neg: #5F93AE;
  --c1: #2F6F62; --c2: #5F93AE; --c3: #D07A52; --c4: #A3B79A; --c5: #D5DDD9;
  --shadow: 0 1px 2px rgba(35,48,45,.05), 0 20px 44px -28px rgba(35,48,45,.3);
}
.layer[data-skin="nordic"][data-mode="dark"] {
  --bg: #111715; --bg-2: #18201D; --surface: #1A2320; --surface-2: #212C28; --surface-3: #2A3632;
  --line: rgba(228,233,230,.07); --line-2: rgba(228,233,230,.15);
  --text: #E4E9E6; --text-2: #93A19C; --text-3: #5D6A66;
  --accent: #7FC1AE; --accent-2: #E39B76; --accent-3: #8DB7CF; --on-accent: #0F221E;
  --good: #79C29A; --warn: #E3A676; --bad: #E07B6E;
  --t-low: #7FC1AE; --t-mid: #33403C; --t-high: #E39B76; --t-neg: #8DB7CF;
  --c1: #7FC1AE; --c2: #8DB7CF; --c3: #E39B76; --c4: #B5C9A8; --c5: #33403C;
  --shadow: 0 24px 48px -30px rgba(0,0,0,.6);
}

/* =====================================================================
   GROUNDS — the atmosphere behind every screen
   ===================================================================== */
.layer { background: var(--bg); color: var(--text); }
.ground { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.layer[data-skin="dots"] .ground {
  background:
    radial-gradient(120% 80% at 80% -10%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 60%),
    radial-gradient(circle, var(--line-2) 1px, transparent 1.3px) 0 0 / 16px 16px,
    linear-gradient(var(--bg), var(--bg-2));
  -webkit-mask-image: none;
}
.layer[data-skin="dots"][data-mode="light"] .ground {
  background:
    radial-gradient(120% 80% at 80% -10%, color-mix(in oklab, var(--accent) 8%, transparent), transparent 60%),
    radial-gradient(circle, rgba(0,0,0,.09) 1px, transparent 1.3px) 0 0 / 16px 16px,
    linear-gradient(var(--bg), var(--bg-2));
}

.layer[data-skin="glass"] .ground { background: linear-gradient(160deg, var(--bg), var(--bg-2)); }
.layer[data-skin="glass"] .ground::before,
.layer[data-skin="glass"] .ground::after,
.layer[data-skin="glass"] .ground i {
  content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .85;
  animation: drift 26s ease-in-out infinite alternate;
}
.layer[data-skin="glass"] .ground::before { width: 58%; height: 70%; left: -10%; top: -18%; background: radial-gradient(circle, #6C5CFF 0, transparent 68%); }
.layer[data-skin="glass"] .ground::after { width: 52%; height: 64%; right: -8%; bottom: -20%; background: radial-gradient(circle, #FF5FA8 0, transparent 66%); animation-duration: 31s; animation-delay: -7s; }
.layer[data-skin="glass"] .ground i { display: block; width: 46%; height: 56%; left: 40%; top: 18%; background: radial-gradient(circle, #21D4B4 0, transparent 66%); opacity: .55; animation-duration: 37s; animation-delay: -12s; }
.layer[data-skin="glass"][data-mode="light"] .ground::before { background: radial-gradient(circle, #B7A6FF 0, transparent 68%); }
.layer[data-skin="glass"][data-mode="light"] .ground::after { background: radial-gradient(circle, #FFB3CF 0, transparent 66%); }
.layer[data-skin="glass"][data-mode="light"] .ground i { background: radial-gradient(circle, #9FF0DE 0, transparent 66%); }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(8%, 10%) scale(1.12); }
  100% { transform: translate(-6%, 4%) scale(.94); }
}

.layer[data-skin="swiss"] .ground {
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / 12 - 1px), color-mix(in oklab, var(--text) 6%, transparent) calc(100% / 12 - 1px), color-mix(in oklab, var(--text) 6%, transparent) calc(100% / 12)),
    var(--bg);
}

.layer[data-skin="brutal"] .ground {
  background:
    radial-gradient(circle, color-mix(in oklab, var(--text) 14%, transparent) 1.4px, transparent 1.6px) 0 0 / 22px 22px,
    var(--bg);
}

.layer[data-skin="noir"] .ground {
  background:
    radial-gradient(90% 70% at 50% 0%, color-mix(in oklab, var(--accent) 7%, transparent), transparent 70%),
    radial-gradient(140% 100% at 50% 120%, rgba(0,0,0,.35), transparent 60%),
    var(--bg);
}
.layer[data-skin="noir"] .ground::after {
  content: ""; position: absolute; inset: 0; opacity: .5; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.layer[data-skin="noir"][data-mode="light"] .ground::after { mix-blend-mode: multiply; opacity: .25; }

.layer[data-skin="nordic"] .ground {
  background:
    radial-gradient(80% 60% at 15% 0%, color-mix(in oklab, var(--accent-3) 14%, transparent), transparent 70%),
    radial-gradient(70% 60% at 100% 100%, color-mix(in oklab, var(--accent-2) 10%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}
