/* ==========================================================================
   tokens.css — design tokens + base element styles (Windows 11, dark)
   Every other stylesheet consumes these names; never use
   raw colours elsewhere. Fonts are self-hosted IBM Plex (SIL OFL 1.1, see
   fonts/OFL.txt); Segoe UI Variable / Cascadia are used when installed.
   ========================================================================== */

/* ---- Self-hosted fonts (Latin-1 subsets) -------------------------------- */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/IBMPlexSans-Regular-Latin1.woff2") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/IBMPlexSans-Medium-Latin1.woff2") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/IBMPlexSans-SemiBold-Latin1.woff2") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/IBMPlexMono-Regular-Latin1.woff2") format("woff2");
  unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/IBMPlexMono-Medium-Latin1.woff2") format("woff2");
  unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02;
}

/* Registered so progress bars / rings can animate their value smoothly.
   Apps set it with el.style.setProperty('--p', String(0..1)). */
@property --p {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

:root {
  color-scheme: dark;

  /* ---- Colour: layered surfaces (Mica / Acrylic, dark) ------------------ */
  --c-bg: #0b0f1a;                       /* page behind everything (wallpaper fallback) */
  --c-surface-1: #202020;                /* window body (Mica base) */
  --c-surface-2: #2b2b2b;                /* cards, raised controls */
  --c-surface-3: #1c1c1c;                /* title bars, taskbar base */
  --c-surface-4: #2c2c2c;                /* flyouts, menus, tooltips (solid fallback) */
  --c-mica: rgba(32, 32, 32, 0.93);      /* window body over wallpaper (with --blur-mica) */
  --c-mica-alt: rgba(24, 24, 24, 0.9);   /* title bar / tabs tint */
  --c-acrylic: rgba(40, 40, 40, 0.82);   /* start menu, flyouts, toasts (with --blur-acrylic) */
  --c-taskbar: rgba(28, 28, 28, 0.84);
  --blur-acrylic: blur(30px) saturate(140%);
  --blur-mica: blur(60px) saturate(120%);

  --c-card: rgba(255, 255, 255, 0.051);          /* card on a surface */
  --c-card-hover: rgba(255, 255, 255, 0.07);
  --c-fill-subtle-hover: rgba(255, 255, 255, 0.061);
  --c-fill-subtle-pressed: rgba(255, 255, 255, 0.042);
  --c-control: rgba(255, 255, 255, 0.061);       /* button / textbox rest */
  --c-control-hover: rgba(255, 255, 255, 0.084);
  --c-control-pressed: rgba(255, 255, 255, 0.033);
  --c-control-disabled: rgba(255, 255, 255, 0.042);
  --c-control-input-active: rgba(30, 30, 30, 0.7);
  --c-control-strong: rgba(255, 255, 255, 0.544); /* checkbox border, textbox underline */
  --c-control-alt: rgba(0, 0, 0, 0.1);            /* checkbox rest fill */

  --c-stroke: rgba(255, 255, 255, 0.06);          /* dividers, card borders */
  --c-stroke-strong: rgba(255, 255, 255, 0.14);   /* emphasised borders, tracks */
  --c-stroke-control: rgba(255, 255, 255, 0.07);  /* control border */
  --c-stroke-control-top: rgba(255, 255, 255, 0.093); /* control top highlight */
  --c-stroke-surface: rgba(117, 117, 117, 0.4);   /* window / flyout outer edge */
  --c-stroke-on-accent: rgba(255, 255, 255, 0.08);
  --c-stroke-on-accent-bottom: rgba(0, 0, 0, 0.14);

  --c-text: #ffffff;
  --c-text-2: rgba(255, 255, 255, 0.786);         /* secondary */
  --c-text-tertiary: rgba(255, 255, 255, 0.544);  /* placeholders, captions */
  --c-text-3: rgba(255, 255, 255, 0.363);         /* disabled */

  --c-accent: #60cdff;
  --c-accent-hover: #5abde9;
  --c-accent-pressed: #53aad2;
  --c-accent-strong: #0078d4;                     /* selection, filled accents behind white text */
  --c-accent-subtle: rgba(96, 205, 255, 0.12);
  --c-accent-subtle-stroke: rgba(96, 205, 255, 0.28);
  --c-accent-text: #000000;                       /* text on --c-accent */
  --c-accent-text-2: rgba(0, 0, 0, 0.5);          /* pressed text on accent */
  --c-accent-link: #99ebff;                       /* hyperlink text on dark */

  --c-success: #6ccb5f;
  --c-warning: #fce100;
  --c-error: #ff99a4;
  --c-info: #60cdff;
  --c-success-bg: #393d1b;
  --c-warning-bg: #433519;
  --c-error-bg: #442726;
  --c-info-bg: #1f2d38;
  --c-success-subtle: rgba(108, 203, 95, 0.12);
  --c-warning-subtle: rgba(252, 225, 0, 0.1);
  --c-error-subtle: rgba(255, 153, 164, 0.12);

  --c-bsod: #0078d7;
  --c-overlay: rgba(0, 0, 0, 0.45);               /* modal / lightbox scrim */
  --c-overlay-light: rgba(0, 0, 0, 0.3);

  /* ---- Type -------------------------------------------------------------- */
  --font-ui: "Segoe UI Variable Text", "Segoe UI", "IBM Plex Sans", system-ui, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, "IBM Plex Mono", monospace;

  --fs-caption: 12px;
  --fs-body: 14px;
  --fs-body-strong: 14px;   /* pair with --fw-strong */
  --fs-body-large: 18px;
  --fs-subtitle: 20px;
  --fs-title: 28px;
  --fs-title-large: 40px;
  --fs-display: 68px;       /* lock-screen clock */

  --lh-caption: 16px;
  --lh-body: 20px;
  --lh-body-large: 24px;
  --lh-subtitle: 28px;
  --lh-title: 36px;
  --lh-title-large: 52px;
  --lh-display: 1.1;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-strong: 600;

  /* Font shorthands for the Windows 11 type ramp. */
  --type-caption: var(--fw-regular) var(--fs-caption) / var(--lh-caption) var(--font-ui);
  --type-body: var(--fw-regular) var(--fs-body) / var(--lh-body) var(--font-ui);
  --type-body-strong: var(--fw-strong) var(--fs-body-strong) / var(--lh-body) var(--font-ui);
  --type-body-large: var(--fw-regular) var(--fs-body-large) / var(--lh-body-large) var(--font-ui);
  --type-subtitle: var(--fw-strong) var(--fs-subtitle) / var(--lh-subtitle) var(--font-display);
  --type-title: var(--fw-strong) var(--fs-title) / var(--lh-title) var(--font-display);
  --type-title-large: var(--fw-strong) var(--fs-title-large) / var(--lh-title-large) var(--font-display);
  --type-display: var(--fw-strong) var(--fs-display) / var(--lh-display) var(--font-display);

  /* ---- Shape & space ----------------------------------------------------- */
  --r-sm: 4px;      /* controls */
  --r-md: 8px;      /* windows, flyouts, cards */
  --r-lg: 12px;     /* large surfaces, start menu */
  --r-pill: 999px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 28px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;

  --control-h: 32px;     /* Fluent standard control height */
  --touch-target: 44px;  /* minimum on coarse pointers */

  --shadow-window: 0 0 0 1px rgba(0, 0, 0, 0.32), 0 32px 64px rgba(0, 0, 0, 0.42), 0 2px 21px rgba(0, 0, 0, 0.32);
  --shadow-window-inactive: 0 0 0 1px rgba(0, 0, 0, 0.24), 0 16px 32px rgba(0, 0, 0, 0.3), 0 2px 10.67px rgba(0, 0, 0, 0.24);
  --shadow-flyout: 0 8px 16px rgba(0, 0, 0, 0.26), 0 0 0 1px rgba(0, 0, 0, 0.2);
  --shadow-tooltip: 0 4px 8px rgba(0, 0, 0, 0.26);
  --shadow-card: 0 2px 4px rgba(0, 0, 0, 0.16);

  /* ---- Motion ------------------------------------------------------------ */
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 333ms;
  --ease: cubic-bezier(0.1, 0.9, 0.2, 1);        /* Fluent decelerate */
  --ease-in: cubic-bezier(0.7, 0, 1, 0.5);       /* Fluent accelerate (exits) */
  --ease-standard: cubic-bezier(0.55, 0.55, 0, 1); /* point to point */

  /* ---- Layers ------------------------------------------------------------ */
  --z-desktop: 0;
  --z-window: 100;       /* windows use calc(var(--z-window) + stackIndex), stackIndex < 4900 */
  --z-taskbar: 5000;
  --z-flyout: 6000;      /* start menu, tray flyouts, context menus */
  --z-toast: 7000;
  --z-lightbox: 8000;
  --z-lock: 9000;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur: 0ms;
    --dur-slow: 0ms;
  }
}

/* ---- Base elements ------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  height: 100%;
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font: var(--type-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ol, ul {
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: var(--fw-strong);
}

img, svg, video, canvas {
  max-width: 100%;
}

img {
  border-style: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: default;
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 1em;
}

a {
  color: var(--c-accent-link);
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--c-accent-strong);
  color: #ffffff;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* Thin, Windows 11-style overlay scrollbars. */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.32) transparent;
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  background-clip: content-box;
  border: 3px solid transparent;
  border-radius: var(--r-pill);
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.5);
}

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