/* ============================================================
   WindowsNews.AI — Editorial Design System
   Tokens · Light/Dark · Category coding · Fluent glass
   ============================================================ */

:root {
  /* ---- Type ---- (fallbacks lead with Segoe UI — metrically near-identical to
     Archivo for the Windows audience, minimizing font-swap layout shift) ---- */
  --font-display: 'Archivo', 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, Arial, sans-serif;
  --font-ui: 'Archivo', 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, Arial, sans-serif;
  --font-read: 'Newsreader', Georgia, 'Times New Roman', Cambria, serif;
  --font-mono: 'IBM Plex Mono', 'Cascadia Code', Consolas, ui-monospace, monospace;

  /* skeleton fill behind media — reserves color while real images decode (0 CLS) */
  --skeleton: var(--ink-150);

  /* ---- Cool deep-ink neutral scale (LIGHT) ---- */
  --ink-0:  #ffffff;
  --ink-25: #fbfcfe;
  --ink-50: #f4f6fb;
  --ink-100:#eef1f7;
  --ink-150:#e4e8f1;
  --ink-200:#d7dce8;
  --ink-300:#bac2d4;
  --ink-400:#8b94a9;
  --ink-500:#5f6880;
  --ink-600:#454d63;
  --ink-700:#323a4d;
  --ink-800:#1f2638;
  --ink-900:#121829;
  --ink-950:#0a0e1a;

  /* ---- Semantic surfaces (LIGHT default) ---- */
  --bg:          var(--ink-50);
  --bg-page:     #f6f8fc;
  --surface:     #ffffff;
  --surface-2:   var(--ink-25);
  --surface-3:   var(--ink-100);
  --surface-sunk:var(--ink-50);

  --text:        var(--ink-900);
  --text-2:      var(--ink-600);
  --text-3:      var(--ink-500);
  --text-faint:  var(--ink-400);
  --on-accent:   #ffffff;

  --line:        var(--ink-150);
  --line-2:      var(--ink-200);
  --line-strong: var(--ink-300);

  /* ---- Windows blue heritage ---- */
  --brand:       #0078d4;
  --brand-ink:   #005a9e;
  --brand-bright:#2b88ff;
  --brand-soft:  rgba(0,120,212,0.10);
  --brand-line:  rgba(0,120,212,0.28);

  /* ---- Category coding (editorial intelligence) ---- */
  --cat-windows:    #0078d4;  --cat-windows-soft:    rgba(0,120,212,0.12);
  --cat-ai:         #7c5cff;  --cat-ai-soft:         rgba(124,92,255,0.12);
  --cat-security:   #e5484d;  --cat-security-soft:   rgba(229,72,77,0.12);
  --cat-cloud:      #11a8cd;  --cat-cloud-soft:      rgba(17,168,205,0.12);
  --cat-enterprise: #12a594;  --cat-enterprise-soft: rgba(18,165,148,0.12);
  --cat-dev:        #e08c00;  --cat-dev-soft:        rgba(224,140,0,0.12);

  --live:   #e5484d;
  --gain:   #12a594;
  --loss:   #e5484d;

  /* ---- Glass ---- */
  --glass-bg:     rgba(255,255,255,0.72);
  --glass-bg-2:   rgba(248,250,253,0.66);
  --glass-line:   rgba(255,255,255,0.7);
  --glass-edge:   rgba(15,23,42,0.08);
  --glass-blur:   blur(20px) saturate(180%);
  --glass-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 8px 32px rgba(15,23,42,0.08);

  /* ---- Elevation ---- */
  --sh-xs: 0 1px 2px rgba(15,23,42,0.06);
  --sh-sm: 0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.05);
  --sh-md: 0 6px 16px rgba(15,23,42,0.08), 0 2px 6px rgba(15,23,42,0.05);
  --sh-lg: 0 18px 40px rgba(15,23,42,0.12), 0 6px 14px rgba(15,23,42,0.07);
  --sh-xl: 0 32px 70px rgba(15,23,42,0.16);

  /* ---- Radii ---- */
  --r-xs: 4px;
  --r-sm: 7px;
  --r-md: 11px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* ---- Layout ---- */
  --wrap: 1280px;
  --wrap-wide: 1400px;
  --gap: 28px;
  --nav-h: 62px;

  /* ---- Mesh art tints (placeholders) ---- */
  --mesh-a: #2b88ff;
  --mesh-b: #7c5cff;
  --mesh-c: #11a8cd;
}

[data-theme="dark"] {
  --bg:          #080b14;
  --bg-page:     #070a12;
  --surface:     #0e1422;
  --surface-2:   #121a2b;
  --surface-3:   #16203500;
  --surface-3:   #161f31;
  --surface-sunk:#0a0f1c;

  --text:        #eef2fb;
  --text-2:      #aab4cb;
  --text-3:      #7f8aa4;
  --text-faint:  #5d6781;
  --on-accent:   #ffffff;

  --line:        #1c2438;
  --line-2:      #232d45;
  --line-strong: #313c58;

  --brand:       #4cb8ff;
  --brand-ink:   #2b88ff;
  --brand-bright:#6fc8ff;
  --brand-soft:  rgba(76,184,255,0.12);
  --brand-line:  rgba(76,184,255,0.30);

  --cat-windows:    #4cb8ff;  --cat-windows-soft:    rgba(76,184,255,0.15);
  --cat-ai:         #9d83ff;  --cat-ai-soft:         rgba(157,131,255,0.16);
  --cat-security:   #ff6b6f;  --cat-security-soft:   rgba(255,107,111,0.15);
  --cat-cloud:      #38c6e6;  --cat-cloud-soft:      rgba(56,198,230,0.15);
  --cat-enterprise: #2bd4bf;  --cat-enterprise-soft: rgba(43,212,191,0.15);
  --cat-dev:        #ffb02e;  --cat-dev-soft:        rgba(255,176,46,0.15);

  --live:   #ff6b6f;
  --gain:   #2bd4bf;
  --loss:   #ff6b6f;

  --glass-bg:     rgba(14,20,34,0.66);
  --glass-bg-2:   rgba(10,15,28,0.6);
  --glass-line:   rgba(120,140,180,0.14);
  --glass-edge:   rgba(0,0,0,0.5);
  --glass-blur:   blur(22px) saturate(170%);
  --glass-shadow: 0 1px 0 rgba(140,165,210,0.08) inset, 0 12px 40px rgba(0,0,0,0.5);

  --sh-xs: 0 1px 2px rgba(0,0,0,0.4);
  --sh-sm: 0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
  --sh-md: 0 8px 22px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.4);
  --sh-lg: 0 22px 50px rgba(0,0,0,0.62), 0 8px 18px rgba(0,0,0,0.45);
  --sh-xl: 0 36px 80px rgba(0,0,0,0.7);

  --mesh-a: #2b6fff;
  --mesh-b: #7c5cff;
  --mesh-c: #11a8cd;
  --skeleton: var(--surface-3);
}

/* ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--font-ui);
  background: var(--bg-page);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .35s ease, color .35s ease;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
::selection { background: var(--brand-soft); color: var(--text); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.wrap-wide { max-width: var(--wrap-wide); margin: 0 auto; padding: 0 28px; }

/* Scrollbar */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 3px solid var(--bg-page); }
*::-webkit-scrollbar-track { background: transparent; }

/* ---- Kicker / eyebrow ---- */
.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* ---- Category chip ---- */
.cat-chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: var(--r-xs);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  white-space: nowrap;
}
.cat-chip::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 2px;
  background: currentColor;
}
.cat-windows    { color: var(--cat-windows);    background: var(--cat-windows-soft); }
.cat-ai         { color: var(--cat-ai);         background: var(--cat-ai-soft); }
.cat-security   { color: var(--cat-security);   background: var(--cat-security-soft); }
.cat-cloud      { color: var(--cat-cloud);      background: var(--cat-cloud-soft); }
.cat-enterprise { color: var(--cat-enterprise); background: var(--cat-enterprise-soft); }
.cat-dev        { color: var(--cat-dev);        background: var(--cat-dev-soft); }

/* category accent var resolver */
[data-cat="windows"]    { --accent: var(--cat-windows); --accent-soft: var(--cat-windows-soft); }
[data-cat="ai"]         { --accent: var(--cat-ai); --accent-soft: var(--cat-ai-soft); }
[data-cat="security"]   { --accent: var(--cat-security); --accent-soft: var(--cat-security-soft); }
[data-cat="cloud"]      { --accent: var(--cat-cloud); --accent-soft: var(--cat-cloud-soft); }
[data-cat="enterprise"] { --accent: var(--cat-enterprise); --accent-soft: var(--cat-enterprise-soft); }
[data-cat="dev"]        { --accent: var(--cat-dev); --accent-soft: var(--cat-dev-soft); }

/* ---- Glass surface util ---- */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-shadow);
}

/* ---- Mesh placeholder art ---- */
.mesh {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--ink-800), var(--ink-950));
  isolation: isolate;
}
.mesh::before {
  content: "";
  position: absolute; inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 130% at var(--bx, 14%) var(--by, 8%),  var(--accent, var(--mesh-a)) 0%, transparent 46%),
    radial-gradient(110% 120% at var(--cx, 88%) var(--cy, 18%), var(--mesh-b) 0%, transparent 50%),
    radial-gradient(130% 130% at var(--dx, 70%) var(--dy, 100%), var(--mesh-c) 0%, transparent 52%);
  opacity: var(--mesh-op, .62);
  filter: hue-rotate(var(--hue, 0deg));
}
.mesh::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,0.05) 0 1px, transparent 1px 3px);
  opacity: .5;
  z-index: 1;
}
.mesh > .mesh-label {
  position: absolute;
  left: 12px; bottom: 11px;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.62);
  background: rgba(0,0,0,0.28);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 3px 7px;
  border-radius: 5px;
  text-transform: uppercase;
}

/* ---- Buttons ---- */
.btn {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .14s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--sh-sm); }
.btn-primary:hover { background: var(--brand-ink); box-shadow: var(--sh-md); }
.btn-ghost { color: var(--text); border: 1px solid var(--line-2); background: var(--surface); }
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface-2); }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }

/* ---- Section label ---- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title .bar { width: 4px; height: 22px; border-radius: 2px; background: var(--accent, var(--brand)); flex: none; }
.section-title { white-space: nowrap; }
.section-more {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  display: inline-flex; align-items: center; gap: 6px;
  transition: color .2s, gap .2s;
}
.section-more:hover { color: var(--brand); gap: 9px; }

/* fade-in */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }

@media (max-width: 980px) {
  .wrap, .wrap-wide { padding: 0 18px; }
  :root { --gap: 20px; }
}
