/*
 * Design tokens for the MCP Azure Security Guide.
 *
 * One source for color, type, and shape. The other stylesheets in this folder read only these tokens, and
 * tools/verify/check_contrast.py reads the color values from this file and from the theme's palette, so a color
 * change is one edit here plus a passing contrast check.
 *
 * The neutrals, fonts, and radii resolve to mkdocs-shadcn's variables, so the guide's components sit on the
 * theme's palette in both schemes. The guide's own colors (risk, coverage, status, code, admonitions, diagram
 * roles, the banner, the screens of the home page cards) keep their values here.
 *
 * Fonts: Geist and Geist Mono come with the theme, which declares them in css/geist.css and serves them from
 * fonts/; overrides/templates/extra_head.html preloads fonts/Geist.woff2 and fonts/GeistMono.woff2. Metric-matched
 * fallback faces below keep layout stable if either webfont arrives after first paint. SIL Open Font License 1.1:
 * ../../assets/fonts/OFL.txt.
 *
 * Icons in data URIs are from Material Design Icons (Pictogrammers), Apache License 2.0.
 */

/* Metric-matched fallback faces for Geist and Geist Mono (1005/295/0 vertical metrics; 0.60em mono advance). */
@font-face {
  font-family: "Geist Fallback";
  font-weight: 100 599;
  src: local("Arial"), local("Liberation Sans"), local("Helvetica Neue"), local("Roboto");
  ascent-override: 97.38%;
  descent-override: 28.59%;
  line-gap-override: 0%;
  size-adjust: 103.2%;
}

@font-face {
  font-family: "Geist Fallback";
  font-weight: 600 900;
  src: local("Arial Bold"), local("Liberation Sans Bold"), local("Helvetica Neue Bold"), local("Roboto Bold"), local("Arial");
  ascent-override: 98.82%;
  descent-override: 29.01%;
  line-gap-override: 0%;
  size-adjust: 101.7%;
}

@font-face {
  font-family: "Geist Mono Fallback";
  font-weight: 100 599;
  src: local("Courier New"), local("Liberation Mono"), local("DejaVu Sans Mono"), local("Droid Sans Mono"), local("Roboto Mono");
  ascent-override: 100.5%;
  descent-override: 29.5%;
  line-gap-override: 0%;
  size-adjust: 100%;
}

@font-face {
  font-family: "Geist Mono Fallback";
  font-weight: 600 900;
  src: local("Courier New Bold"), local("Liberation Mono Bold"), local("DejaVu Sans Mono Bold"), local("Courier New"), local("Liberation Mono"), local("DejaVu Sans Mono"), local("Droid Sans Mono"), local("Roboto Mono");
  ascent-override: 100.5%;
  descent-override: 29.5%;
  line-gap-override: 0%;
  size-adjust: 100%;
}

/* Scheme-independent tokens. shadcn keeps the browser's 16px root font size, so 1rem = 16px here. */
:root {
  --font-sans: "Geist", "Geist Fallback", sans-serif;
  --font-mono: "Geist Mono", "Geist Mono Fallback", monospace;
  --g-font-sans: var(--font-sans);
  --g-font-mono: var(--font-mono);

  /* Type scale, with px at the 16px root. */
  --g-text-xs: 0.75rem;    /* 12: badge labels, dates */
  --g-text-sm: 0.875rem;   /* 14: chips, captions, navigation, eyebrows */
  --g-text-base: 1rem;     /* 16: h4, card titles; body text is the theme's 15px */
  --g-text-lg: 1.125rem;   /* 18: banner summary, hero promise */
  --g-text-2xl: 1.5rem;    /* 24: a Markdown page title */
  --g-text-3xl: 2rem;      /* 32: banner title */
  --g-text-4xl: 2.625rem;  /* 42: hero title */

  --g-radius-sm: var(--radius-sm);    /* 6 */
  --g-radius: var(--radius-md);       /* 8 */
  --g-radius-card: var(--radius-xl);  /* 12: cards and collapsible blocks */
  --g-radius-lg: var(--radius-xl);    /* 12 */
  --g-radius-pill: 999px;
  --g-focus-width: 2px;
  --g-measure: 47.5rem;  /* 760px page column: about 103 characters of body text; 11.7px text on an 877-unit drawing */

  --guide-banner-from: #0f1b3d;
  --guide-banner-to: #3949ab;
  --guide-banner-fg: #ffffff;
  /* The specification bar runs from the banner's navy through its indigo and an orchid to a light pink. White text
     stays on the run up to the orchid; the pink lies past the text, behind the navy dismiss button. */
  --guide-specbar-from: var(--guide-banner-from);
  --guide-specbar-via: var(--guide-banner-to);
  --guide-specbar-orchid: #9d4b97;
  --guide-specbar-to: #fbcfe8;
  --guide-specbar-fg: #ffffff;
  --guide-specbar-ink: var(--guide-banner-from);
  --guide-sherpa: #5eead4;

  /* Admonition accents, one per type, in both schemes: Sherpa's for the types it colors, the same family for the
     rest. The accent draws a block's edge and the tint of its card or summary; its text stays the article's. A warning
     takes shadcn's own warning color, which Sherpa's warnings use: a soft amber on the light page and a deep brown on
     the dark one, where the bright amber of the other accents would muddy the block. */
  --g-adm-note: #3b82f6;
  --g-adm-abstract: #06b6d4;
  --g-adm-info: #0ea5e9;
  --g-adm-tip: #14b8a6;
  --g-adm-success: #10b981;
  --g-adm-question: #a855f7;
  --g-adm-warning: var(--warning);
  --g-adm-failure: #f43f5e;
  --g-adm-danger: #ef4444;
  --g-adm-bug: #ec4899;
  --g-adm-example: #8b5cf6;
  --g-adm-quote: #71717a;
  --g-adm-spec: #6366f1;
  /* How much of the accent an admonition's edge and tint take: a strong edge on a pale tint in the light scheme,
     a softer edge on a deeper tint in the dark one, as shadcn draws its info block. */
  --g-adm-edge: 100%;
  --g-adm-tint: 7%;
}

/* The page palette is shadcn's. These resolve on <html>, where the theme's dark class switches its variables,
   so they need no dark values of their own. Secondary text is shadcn's muted foreground drawn a little toward the
   foreground, which keeps it at 4.5:1 on the tinted surfaces it sits on. shadcn's --ring is 2.6:1 on the light
   background, under the 3:1 a focus indicator needs, so focus takes the primary color. */
:root {
  --guide-bg: var(--background);
  --guide-fg: var(--foreground);
  --guide-card: var(--card);
  --guide-muted: color-mix(in srgb, var(--muted-foreground) 85%, var(--foreground));
  --guide-border: var(--border);
  --guide-border-strong: color-mix(in srgb, var(--foreground) 20%, var(--background));
  --guide-surface: var(--muted);
  --guide-surface-2: var(--surface);
  --guide-accent: var(--primary);
  --guide-accent-fg: var(--primary-foreground);
  --guide-accent-surface: var(--accent);
  --guide-focus: var(--primary);
  --g-code-bg: var(--muted);
}

/* Light scheme. */
:root {
  color-scheme: light;
  --guide-risk: #cf222e;
  --guide-risk-surface: #ffebe9;
  --guide-cov-full: #116329;
  --guide-cov-partial: #7d4e00;
  --guide-cov-new: #6639ba;
  --guide-status-ga: #116329;
  --guide-status-preview: #0550ae;
  --guide-status-unverified: #59636e;
  --guide-status-unavailable: #3f3f46;
  --guide-sherpa-ink: #0f766e;

  --g-code-keyword: #6639ba;
  --g-code-string: #116329;
  --g-code-function: #0550ae;
  --g-code-number: #953800;
  --g-code-special: #a40e26;
  --g-shadow-sm: 0 1px 2px rgb(9 9 11 / 0.05);
  --g-shadow-md: 0 10px 28px -12px rgb(15 27 61 / 0.22);
  --guide-card-surface: var(--guide-card);
  --guide-card-border: color-mix(in srgb, var(--guide-border) 75%, var(--guide-border-strong));
  --guide-card-shadow: 0 1px 2px rgb(9 9 11 / 0.03);
  /* How much of --guide-muted a hover card's border mixes into the popover color: the least that keeps 3:1. */
  --guide-hovercard-edge: 70%;

  /* Diagram palette (light scheme): Oxide-inspired quiet tiles, dim lines, bright labels, blue theme. */
  --dg-accent: #3949ab;
  --dg-accent-sub: #47559e;
  --dg-accent-surface: #eef0fb;
  --dg-accent-border: #d0d6f0;
  --dg-accent-line: #6f7cc9;
  --dg-grad-from: #0f1b3d;
  --dg-grad-to: #3949ab;

  --dg-surface: #f5f6fa;
  --dg-surface-border: #dce0ec;
  --dg-data-line: #7d879b;
  --dg-fg: #3b4356;
  --dg-muted: #5b6477;
  --dg-flow-label: #4b5466;
  --dg-line: #848da0;

  --dg-zone: #f9fafd;
  --dg-zone-line: #7b859c;
  --dg-vnet-fill: #f4f6fd;
  --dg-vnet-line: #7280cc;

  --dg-amber: #7d4e00;
  --dg-amber-line: #b07d1f;

  --dg-risk: #cf222e;
  --dg-risk-surface: #fff0ef;
  --dg-risk-strong: #cf222e;
  --dg-on-risk: #ffffff;

  /* The screen of a home page card, behind its icon: a pale panel, lit at its top and shaded at its foot, under an
     indigo dot grid, with a glow behind the icon and an edge that fades to the panel. */
  --guide-screen-surface: #f4f6fc;
  --guide-screen-lit: #f9faff;
  --guide-screen-shade: #eff2fa;
  --guide-screen-rim: rgb(15 27 61 / 0.095);
  --guide-screen-dot: rgb(57 73 171 / 0.15);
  --guide-screen-scanline: transparent;
  --guide-screen-glow: rgb(57 73 171 / 0.3);
  --guide-screen-vignette: rgb(243 245 251 / 0.72);
}

/* Dark scheme, on screen only: paper always gets the light values. */
@media screen {
  .dark {
    color-scheme: dark;
    --guide-risk: #ff7b72;
    --guide-risk-surface: #3a1a1d;
    --guide-cov-full: #3fb950;
    --guide-cov-partial: #d29922;
    --guide-cov-new: #bc8cff;
    --guide-status-ga: #3fb950;
    --guide-status-preview: #79c0ff;
    --guide-status-unverified: #9198a1;
    --guide-status-unavailable: #d4d4d8;
    --guide-sherpa-ink: #5eead4;
    /* A softer rose ends the specification bar over the near-black header. */
    --guide-specbar-to: #d98cb8;

    --g-code-keyword: #d2a8ff;
    --g-code-string: #7ee787;
    --g-code-function: #79c0ff;
    --g-code-number: #ffa657;
    --g-code-special: #ff7b72;
    --g-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --g-shadow-md: 0 12px 32px -12px rgb(0 0 0 / 0.7);
    --guide-hovercard-edge: 55%;
    /* A card sinks a little toward the page. */
    --guide-card-surface: color-mix(in srgb, var(--guide-card) 72%, var(--guide-bg));
    --guide-card-border: var(--guide-border);
    --guide-card-shadow: none;
    --g-adm-edge: 50%;
    --g-adm-tint: 22%;

    /* Diagram palette (dark scheme): Oxide-inspired dark tinted tiles, dim lines, bright labels, periwinkle blue. */
    --dg-accent: #8c9eff;
    --dg-accent-sub: #7f90e8;
    --dg-accent-surface: #131933;
    --dg-accent-border: #212b54;
    --dg-accent-line: #5266c4;
    --dg-grad-from: #5c6fd6;
    --dg-grad-to: #8c9eff;

    --dg-surface: #141821;
    --dg-surface-border: #222938;
    --dg-data-line: #6c7790;
    --dg-fg: #b3bac7;
    --dg-muted: #8d96a8;
    --dg-flow-label: #a3abbb;
    --dg-line: #5f6a80;

    --dg-zone: #0d1018;
    --dg-zone-line: #5d677c;
    --dg-vnet-fill: #0d1122;
    --dg-vnet-line: #4e5fb8;

    --dg-amber: #e5b04a;
    --dg-amber-line: #85642a;

    --dg-risk: #ff7b72;
    --dg-risk-surface: #291316;
    --dg-risk-strong: #da3633;
    --dg-on-risk: #ffffff;

    /* A near-black screen lit from its middle, under faint scanlines, with an indigo glow. */
    --guide-screen-surface: #0d1018;
    --guide-screen-lit: #151926;
    --guide-screen-shade: #090b11;
    --guide-screen-rim: rgb(255 255 255 / 0.085);
    --guide-screen-dot: transparent;
    --guide-screen-scanline: rgb(0 0 0 / 0.15);
    --guide-screen-glow: rgb(140 158 255 / 0.42);
    --guide-screen-vignette: rgb(7 9 14 / 0.58);
  }
}

:root,
.dark {
  /* Diagram font follows the site font; colors come from the light and dark blocks above. */
  --dg-font: var(--g-font-sans);
}

/* Icons, drawn with mask-image so they take the text color. */
:root {
  --g-icon-seen: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 9a3 3 0 0 1 3 3 3 3 0 0 1-3 3 3 3 0 0 1-3-3 3 3 0 0 1 3-3m0-4.5c5 0 9.27 3.11 11 7.5-1.73 4.39-6 7.5-11 7.5S2.73 16.39 1 12c1.73-4.39 6-7.5 11-7.5M3.18 12a9.821 9.821 0 0 0 17.64 0 9.821 9.821 0 0 0-17.64 0"/></svg>');
  --g-icon-arrow: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11z"/></svg>');
  --g-icon-external: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3m-2 16H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7h-2z"/></svg>');
  --g-icon-chevron: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6z"/></svg>');
}
