/**
 * RoccOS Design Tokens
 * Nezu — Cool muted greys, editorial typography,
 * PP Editorial New serif + Satoshi sans, orange-red accent.
 */

@font-face {
  font-family: 'PP Editorial New';
  src: url('/assets/fonts/PPEditorialNew.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Satoshi';
  src: url('/assets/fonts/Satoshi-Variable.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Satoshi';
  src: url('/assets/fonts/Satoshi-VariableItalic.woff2') format('woff2');
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* ── Palette: Nezu — cool muted greys (launcher homepage base) ──
     This is the LIGHT base for the launcher homepage (`/`). The dark adaptive
     band system lives in `html.os-desktop` below and only applies to the
     windowed desktop OS (`/roccos` · `?os=desktop`). deep-link.js adds the
     `os-desktop` class in <head> before paint. */
  --os-bg: #ECEAE7;
  --os-bg-warm: #F2F0ED;
  --os-surface: rgba(242, 240, 237, 0.90);
  --os-surface-raised: rgba(246, 244, 241, 0.94);
  --os-surface-hover: rgba(238, 236, 233, 0.96);
  --os-surface-opaque: #F4F2EF;
  --os-border: rgba(0, 0, 0, 0.10);
  --os-border-subtle: rgba(0, 0, 0, 0.06);

  /* Text — cool near-black */
  --os-text: #1A1D1E;
  --os-text-secondary: #47585C;
  --os-text-muted: #80989B;
  --os-text-inverse: #FFFFFF;

  /* Accent — burnt orange (retained) */
  --os-accent: #E8631C;
  --os-accent-hover: #D45A18;
  --os-accent-muted: rgba(232, 99, 28, 0.10);
  --os-accent-text: #FFFFFF;

  /* Secondary — desaturated steel */
  --os-coral: #47585C;
  --os-coral-muted: rgba(71, 88, 92, 0.10);
  --os-secondary: #47585C;
  --os-secondary-muted: rgba(71, 88, 92, 0.10);

  /* Tertiary — muted sage */
  --os-sage: #6B8F71;
  --os-sage-muted: rgba(107, 143, 113, 0.10);
  --os-tertiary: #6B8F71;
  --os-tertiary-muted: rgba(107, 143, 113, 0.10);

  /* Data accent — subtle yellow-green for section abbreviations */
  --os-accent-data: #A8B545;
  --os-accent-data-muted: rgba(168, 181, 69, 0.12);

  /* System colors */
  --os-success: #6B8F71;
  --os-warning: #D4A24C;
  --os-error: #C45B5B;
  --os-info: #4A7FB5;

  /* Window control buttons — monochrome */
  --os-btn-close: #A0A0A0;
  --os-btn-minimize: #B8B8B8;
  --os-btn-maximize: #C8C8C8;
  --os-btn-inactive: #DDDBD8;

  /* Nezu gradient tones */
  --os-gradient-peach: #C8D5BB;
  --os-gradient-rose: #D4DCDA;
  --os-gradient-lilac: #B0BEC5;

  /* Button tokens — neutral glass */
  --os-btn-glass: rgba(255, 255, 255, 0.80);
  --os-btn-glass-border: rgba(0, 0, 0, 0.10);
  --os-btn-glass-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(242, 240, 237, 0.78));
  --os-btn-ghost: rgba(236, 234, 231, 0.6);
  --os-btn-ghost-border: rgba(0, 0, 0, 0.08);

  /* ── Color Blocking ── */
  --os-desktop-bg: #E4E2DF;
  --os-menu-bg: rgba(242, 240, 237, 0.94);
  --os-menu-border: rgba(0, 0, 0, 0.10);
  --os-menu-text: #1A1D1E;
  --os-taskbar-bg: rgba(242, 240, 237, 0.88);
  --os-taskbar-border: rgba(0, 0, 0, 0.08);
  --os-titlebar-bg: transparent;
  --os-titlebar-text: #1A1D1E;
  --os-titlebar-border: rgba(0, 0, 0, 0.06);
  --os-titlebar-inactive: rgba(242, 240, 237, 0.7);
  --os-titlebar-text-inactive: #80989B;

  /* Backward compat aliases */
  --os-dock-bg: var(--os-taskbar-bg);
  --os-dock-border: var(--os-taskbar-border);

  /* Glassmorphism — frosted glass */
  --os-glass: rgba(242, 240, 237, 0.88);
  --os-glass-border: rgba(0, 0, 0, 0.10);
  --os-glass-blur: 20px;

  --crt-glare-color: 255, 255, 255;
  --crt-gleam-color: 255, 255, 255;

  /* ── Spacing Scale (4px base) ── */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;

  /* ── Type Scale ── */
  --font-sans: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'PP Editorial New', Georgia, 'Times New Roman', serif;
  --font-system: var(--font-sans);
  --font-display: var(--font-serif);
  --font-mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-md: 17px;
  --text-lg: 20px;
  --text-xl: 24px;
  --text-2xl: 32px;
  --text-3xl: 42px;
  --text-display: clamp(36px, 5vw, 64px);
  --text-hero: clamp(48px, 8vw, 120px);
  --text-mega: clamp(80px, 12vw, 160px);
  --text-counter: clamp(64px, 10vw, 120px);

  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-loose: 1.75;

  --font-heading: var(--font-serif);
  --tracking-tight: -0.02em;
  --tracking-display: -0.03em;
  --tracking-wide: 0.05em;
  --tracking-mega: -0.06em;
  --tracking-label: 0.08em;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* ── Border Radius — Soft rounded ── */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* ── Shadows — Soft diffused ── */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-window: 0 4px 24px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  /* Bevel borders — disabled (kept for backward compat) */
  --bevel-highlight: transparent;
  --bevel-shadow: transparent;
  --shadow-bevel-raised: none;
  --shadow-bevel-sunken: none;

  /* ── Z-Index Layers ── */
  --z-scene-bg: 1;
  --z-laptop: 3;
  --z-desktop: 5;
  --z-scene-hint: 4;
  --z-wallpaper: 0;
  --z-desktop-icons: 10;
  --z-greta: 20;
  --z-windows: 100;
  --z-dock: 600;
  --z-taskbar: 600;
  --z-menu-bar: 700;
  --z-start-menu: 750;
  --z-context-menu: 800;
  --z-overlay: 900;
  --z-game-overlay: 1000;
  --z-boot: 1000;
  --z-onboarding: 2000;
  --z-skip-link: 10000;
  --z-name-burst: 10000;
  --z-spotlight: 9500;
  --z-crt-overlay: 9998;
  --z-mega-menu-backdrop: 9998;
  --z-mega-menu-panel: 9999;
  --z-preloader: 99999;
  --z-cursor: 99999;

  /* ── Transitions ── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring: cubic-bezier(0.22, 1.2, 0.36, 1);
  /* Case-study flow diagrams (js/apps/case-study-flow.js). Stronger curves than
     --ease-out / --ease-in-out above, which stay as-is for the rest of the OS. */
  --ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out-strong: cubic-bezier(0.77, 0, 0.175, 1);

  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* ── Layout — Windows taskbar ── */
  --menu-bar-height: 0px;
  --taskbar-height: 36px;
  --taskbar-padding: 2px;
  --dock-height: 36px;
  --dock-padding: 2px;
  --desktop-padding: 16px;
  --icon-size: 80px;
  --icon-grid-gap: 20px;
}

/* ═══════════════════════════════════════════════════════════════════════
   DESKTOP OS — STATIC BAND
   Scoped to the windowed desktop OS only (`/roccos` · `?os=desktop`).
   deep-link.js adds `.os-desktop` to <html> in <head> before first paint, so
   the launcher homepage (`/`, light :root above) is never touched.

   --os-band is a FIXED colour — no JS drives it. The per-app adaptive flood
   (js/os/adaptive-theme.js + js/core/app-palettes.js) was removed 2026-09-03;
   every chrome/surface/text token below still DERIVES from --os-band /
   --os-accent / --os-accent-text, they just never change after load.
   color-mix uses the single-percentage form on purpose — two percentages
   summing under 100% silently inject transparency.
   ═══════════════════════════════════════════════════════════════════════ */
html.os-desktop {
  --os-band: #1C4030;          /* static desktop background — flat colour, never flooded */
  --os-band-text: #F2E7D0;     /* cream body text — effectively constant */
  --os-band-dim: #B7A892;      /* dim cream — secondary text */
  --os-accent: #E8631C;        /* burnt-orange house default; travels per app */
  --os-accent-text: #1A0E06;   /* ink that sits ON the accent (accentInk) */

  /* Win98 chrome palette — flat, no color-mix (the bevels need exact greys).
     Shared by the taskbar, Start menu, context menu, and window title bars. */
  --win98-face: #C0C0C0;
  --win98-light: #FFFFFF;
  --win98-hilight: #DFDFDF;
  --win98-shadow: #808080;
  --win98-dark: #000000;
  --win98-text: #000000;
  --win98-tooltip: #FFFFE1;
  --win98-select: var(--os-band); /* inverted-highlight bg — follows the desktop colour */
  --win98-select-text: #F2E7D0;  /* cream text on the select highlight */

  /* Surfaces — lifted off the band with a touch of cream */
  --os-bg: var(--os-band);
  --os-bg-warm: color-mix(in srgb, var(--os-band), #F2E7D0 5%);
  --os-surface: color-mix(in srgb, var(--os-band), #F2E7D0 7%);
  --os-surface-raised: color-mix(in srgb, var(--os-band), #F2E7D0 11%);
  --os-surface-hover: color-mix(in srgb, var(--os-band), #F2E7D0 15%);
  --os-surface-opaque: color-mix(in srgb, var(--os-band), #F2E7D0 6%);
  --os-border: rgba(242, 231, 208, 0.14);
  --os-border-subtle: rgba(242, 231, 208, 0.08);

  /* Text — cream on band */
  --os-text: var(--os-band-text);
  --os-text-secondary: var(--os-band-dim);
  --os-text-muted: color-mix(in srgb, var(--os-band-dim), var(--os-band) 34%);
  --os-text-inverse: var(--os-band);

  /* Accent — burnt orange, travels per app */
  --os-accent-hover: color-mix(in srgb, var(--os-accent), #F2E7D0 18%);
  --os-accent-muted: color-mix(in srgb, var(--os-accent) 16%, transparent);

  /* Secondary — warm taupe */
  --os-coral: #C7A98C;
  --os-coral-muted: rgba(199, 169, 140, 0.14);
  --os-secondary: #C7A98C;
  --os-secondary-muted: rgba(199, 169, 140, 0.14);

  /* Tertiary — muted sage */
  --os-sage: #9FB89B;
  --os-sage-muted: rgba(159, 184, 155, 0.14);
  --os-tertiary: #9FB89B;
  --os-tertiary-muted: rgba(159, 184, 155, 0.14);

  /* Data accent — yellow-green */
  --os-accent-data: #BCC94E;
  --os-accent-data-muted: rgba(188, 201, 78, 0.15);

  /* System colors — tuned to read on a dark band */
  --os-success: #6FBF7C;
  --os-warning: #E5C97F;
  --os-error: #E0796F;
  --os-info: #5B8DEF;

  /* Window control buttons — monochrome (read on dark) */
  --os-btn-inactive: rgba(242, 231, 208, 0.22);

  /* Gradient tones — deep, derived from the band */
  --os-gradient-peach: color-mix(in srgb, var(--os-band), #E8631C 18%);
  --os-gradient-rose: color-mix(in srgb, var(--os-band), #C7A98C 14%);
  --os-gradient-lilac: color-mix(in srgb, var(--os-band), #9B7FB0 14%);

  /* Button tokens — warm glass on dark */
  --os-btn-glass: rgba(242, 231, 208, 0.08);
  --os-btn-glass-border: rgba(242, 231, 208, 0.16);
  --os-btn-glass-gradient: linear-gradient(135deg, rgba(242, 231, 208, 0.14), rgba(242, 231, 208, 0.05));
  --os-btn-ghost: color-mix(in srgb, var(--os-band) 80%, transparent);
  --os-btn-ghost-border: rgba(242, 231, 208, 0.12);

  /* Color Blocking — chrome floods to the band */
  --os-desktop-bg: var(--os-band);
  --os-menu-bg: color-mix(in srgb, var(--os-band), black 8%);
  --os-menu-border: rgba(242, 231, 208, 0.12);
  --os-menu-text: var(--os-band-text);
  --os-taskbar-bg: var(--win98-face);
  --os-taskbar-border: var(--win98-light);
  --os-titlebar-bg: var(--os-band);
  --os-titlebar-text: var(--os-band-text);
  --os-titlebar-border: rgba(242, 231, 208, 0.08);
  --os-titlebar-inactive: color-mix(in srgb, var(--os-band), black 28%);
  --os-titlebar-text-inactive: var(--os-band-dim);

  /* Glassmorphism — frosted glass on band */
  --os-glass: color-mix(in srgb, var(--os-band) 88%, transparent);
  --os-glass-border: rgba(242, 231, 208, 0.12);
  --os-glass-blur: 20px;

  --crt-glare-color: 242, 231, 208;
  --crt-gleam-color: 242, 231, 208;
}

/* ── Light / Dark themes RETIRED ──
   Manual light/dark toggles are gone. The launcher homepage uses the light
   :root base; the desktop OS uses the static band (html.os-desktop above).
   Retro (Konami) remains a hard override below. */

/* ── Themed Scrollbars ── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--os-border) transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--os-border);
  border-radius: 4px;
  border: none;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--os-text-muted);
  border: none;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* ── SEO Content (visually hidden, accessible to crawlers + screen readers) ── */
.seo-content {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Retro theme (Konami code) ──
   `html[…]` (0,1,1) so it ties html.os-desktop's specificity and, coming later
   in source, wins — keeping retro a hard monochrome override in desktop mode. */
html[data-theme="retro"] {
  --crt-glare-color: 51, 255, 51;
  --crt-gleam-color: 51, 255, 51;

  /* Win98 chrome family — pinned monochrome so the taskbar/Start menu/
     context menu/title bars stay CRT green instead of Win98 grey. */
  --win98-face: #1a1a1a;
  --win98-light: #33ff33;
  --win98-hilight: #22cc22;
  --win98-shadow: #119911;
  --win98-dark: #000000;
  --win98-text: #33ff33;
  --win98-tooltip: #1a1a1a;
  --win98-select: #33ff33;
  --win98-select-text: #0a0a0a;

  /* Pin the band to CRT green so every band-derived token below resolves
     monochrome, overriding the static house band set in html.os-desktop. */
  --os-band: #0a0a0a;
  --os-band-text: #33ff33;
  --os-band-dim: #22cc22;
  --os-accent-text: #0a0a0a;

  --os-bg: #0a0a0a;
  --os-bg-warm: #0f0f0f;
  --os-surface: #1a1a1a;
  --os-surface-raised: #222222;
  --os-surface-hover: #2a2a2a;
  --os-surface-opaque: #1a1a1a;
  --os-border: #33ff33;
  --os-border-subtle: rgba(51, 255, 51, 0.2);
  --os-text: #33ff33;
  --os-text-secondary: #22cc22;
  --os-text-muted: #119911;
  --os-accent: #33ff33;
  --os-accent-hover: #66ff66;
  --os-accent-data: #33ff33;
  --os-accent-data-muted: rgba(51, 255, 51, 0.15);
  --os-glass: rgba(10, 10, 10, 0.95);
  --os-glass-border: rgba(51, 255, 51, 0.15);
  --font-system: var(--font-mono);

  /* Reset color blocking — retro stays monochrome CRT green */
  --os-desktop-bg: #0a0a0a;
  --os-menu-bg: #1a1a1a;
  --os-menu-border: #33ff33;
  --os-menu-text: #33ff33;
  --os-taskbar-bg: #1a1a1a;
  --os-taskbar-border: #33ff33;
  --os-dock-bg: #1a1a1a;
  --os-dock-border: #33ff33;
  --os-titlebar-bg: #222222;
  --os-titlebar-text: #33ff33;
  --os-titlebar-border: #33ff33;
  --os-titlebar-inactive: #1a1a1a;
  --os-titlebar-text-inactive: #119911;

  /* Glass button tokens — CRT green */
  --os-btn-glass: rgba(51, 255, 51, 0.14);
  --os-btn-glass-border: rgba(51, 255, 51, 0.3);
  --os-btn-glass-gradient: linear-gradient(135deg, rgba(51, 255, 51, 0.2), rgba(51, 255, 51, 0.08));
  --os-btn-ghost: rgba(10, 10, 10, 0.38);
  --os-btn-ghost-border: rgba(51, 255, 51, 0.15);
}

/* ── Cursor set ──
   Every `cursor:` in the OS stylesheets routes through these tokens. Default
   values are plain keywords; the desktop surface (html.os-desktop) swaps in
   the Windows XP-style pixel cursors. The accordion surface keeps native
   cursors. Hotspots are in 32×32 SVG pixels. */
:root {
  --cur-arrow: default;
  --cur-hand: pointer;
  --cur-text: text;
  --cur-move: move;
  --cur-grab: grab;
  --cur-grabbing: grabbing;
  --cur-ns: ns-resize;
  --cur-ew: ew-resize;
  --cur-nwse: nwse-resize;
  --cur-nesw: nesw-resize;
  --cur-busy: wait;
  --cur-not: not-allowed;
  --cur-help: help;
  --cur-cross: crosshair;
  --cur-zoom: zoom-in;
  --cur-none: none;
}

html.os-desktop {
  --cur-arrow: url('/agentic/img/cursors/xp-arrow.svg') 1 1, default;
  --cur-hand: url('/agentic/img/cursors/xp-hand.svg') 9 1, pointer;
  --cur-text: url('/agentic/img/cursors/xp-text.svg') 16 16, text;
  --cur-move: url('/agentic/img/cursors/xp-move.svg') 15 15, move;
  --cur-grab: url('/agentic/img/cursors/xp-arrow.svg') 1 1, grab;
  --cur-grabbing: url('/agentic/img/cursors/xp-move.svg') 15 15, grabbing;
  --cur-ns: url('/agentic/img/cursors/xp-ns.svg') 15 15, ns-resize;
  --cur-ew: url('/agentic/img/cursors/xp-ew.svg') 15 15, ew-resize;
  --cur-nwse: url('/agentic/img/cursors/xp-nwse.svg') 15 15, nwse-resize;
  --cur-nesw: url('/agentic/img/cursors/xp-nesw.svg') 15 15, nesw-resize;
  --cur-busy: url('/agentic/img/cursors/xp-busy.svg') 15 15, wait;
  --cur-not: url('/agentic/img/cursors/xp-not.svg') 15 15, not-allowed;
  --cur-help: url('/agentic/img/cursors/xp-help.svg') 1 1, help;
  --cur-cross: url('/agentic/img/cursors/xp-cross.svg') 15 15, crosshair;
  --cur-zoom: url('/agentic/img/cursors/xp-hand.svg') 9 1, zoom-in;
}
