/**
 * Theme material profile — tokens only.
 * Components must read radius/face/shadow from NeoMaterial + these overrides.
 * Do not add component selectors here.
 */

/* Fluent-scale geometry (WinUI: control 4, overlay 8). */
:root,
:is(:root, .nm-root)[data-density="compact"],
:root[data-palette="graphite"][data-scheme="light"][data-density="compact"][data-contrast="high"] {
 --radius-panel: 8px;
 --radius-float: 8px;
 --radius-control: 4px;
 --radius-control-rect: 4px;
 --radius-pill: 4px;
 --radius-select: 4px;
 --radius-inset: 6px;
 --radius-well-item: 4px;
 --radius-well: 6px;
 --radius-segment: 6px;
 --radius-segment-item: 4px;
 --progress-radius: var(--radius-control);
 --calendar-day-radius: var(--radius-control);
 /* Theme contracts derived from NM radii — never height/2 pills. */
 --mm-pill-radius: var(--radius-control);
 --mm-toolbar-radius: var(--radius-control);
 --mm-selected-radius: var(--radius-control);
}

/* Quieter relief: same material system, lower amplitude.
 * Drop the soft ambient halo — dual shoulder is enough; the extra 0 0 blur
 * stacked with .nm-layer press/release and looked muddy on unpress. */
:is(:root, .nm-root[data-scheme])[data-effects="on"],
:is(:root, .nm-root[data-scheme])[data-contrast="high"]:not([data-effects="off"]) {
 --material-contrast-strength: 0.55;
 --sheen-opacity: 0.14;
 --sheen-pressed-opacity: 0.06;
 --panel-relief-distance: calc(var(--control-size) / 11);
 --panel-relief-blur: calc(var(--control-size) / 2.6);
 --control-relief-distance: calc(var(--control-size) / 18);
 --control-relief-blur: calc(var(--control-size) / 4);
 --well-relief-distance: calc(var(--control-size) / 20);
 --well-relief-blur: calc(var(--control-size) / 8);
 --control-relief-shadow:
  calc(-1 * var(--control-relief-distance)) calc(-1 * var(--control-relief-distance)) var(--control-relief-blur) var(--control-relief-light),
  var(--control-relief-distance) var(--control-relief-distance) var(--control-relief-blur) var(--control-relief-shade);
 --shadow-contact-press:
  calc(-1 * var(--control-relief-distance) / 2) calc(-1 * var(--control-relief-distance) / 2) calc(var(--control-relief-blur) / 2) var(--control-relief-light),
  calc(var(--control-relief-distance) / 2) calc(var(--control-relief-distance) / 2) calc(var(--control-relief-blur) / 2) var(--control-relief-shade);
}

/* Beat NM light faces (0.48 white convex) via the same selector. */
:is(:root, .nm-root[data-scheme])[data-scheme="light"]:not([data-effects="off"]) {
 --surface-shadow-ink: 48 48 48;
 --surface-face-flat: linear-gradient(var(--angle-light-direction), rgb(255 255 255 / 0.04), transparent 48%, rgb(0 0 0 / 0.012));
 --surface-face-concave: linear-gradient(180deg, rgb(var(--surface-shadow-ink) / 0.028), transparent 55%, rgb(255 255 255 / 0.018));
 --surface-face-convex: linear-gradient(var(--angle-light-direction), rgb(255 255 255 / 0.09), transparent 50%, rgb(var(--surface-shadow-ink) / 0.028));
 --control-relief-light: rgb(255 255 255 / calc(0.16 * var(--material-contrast-strength)));
 --control-relief-shade: rgb(var(--surface-shadow-ink) / calc(0.08 * var(--material-contrast-strength)));
 --surface-well-light: rgb(255 255 255 / calc(0.06 * var(--material-contrast-strength)));
 --surface-well-shade: rgb(var(--surface-shadow-ink) / calc(0.1 * var(--material-contrast-strength)));
 --mm-selected-face: var(--surface-face-convex);
}

/* Engraving UI: shared geometry and quiet interactive surfaces. */
:root{
 --mm-prose-weight:400;
 --mm-ui-height:36px;
 --mm-ui-icon:28px;
 --mm-ui-nest:4px;
 --mm-ui-inline:12px;
 --mm-ui-block:6px;
 --mm-ui-gap:8px;
 --mm-content-inset:16px;
 --mm-content-gap:16px;
 --mm-ui-hover:color-mix(in srgb,var(--text) 4%,transparent);
 --mm-ui-selected:color-mix(in srgb,var(--text) 9%,transparent);
 --mm-ui-border:color-mix(in srgb,var(--text) 22%,transparent);
 --mm-toolbar-control-size:var(--mm-ui-icon);
 --mm-toolbar-height:var(--mm-ui-height);
}
@media(max-width:850px){:root{--mm-ui-height:44px;--mm-ui-icon:36px;--mm-content-inset:12px;--site-gutter:12px}}

/* Fit the shell to the engraving's actual area below the shared toolbar. */
:root{
 --mm-shell-gap:var(--gap-large);
 --mm-shell-pad:var(--mm-content-inset);
 --mm-credits-block:calc(var(--gap-large) + var(--space-stack) + 18px);
 --mm-shell-content-block:calc(var(--mm-shell-max-block) - 2 * var(--mm-content-inset) - var(--mm-ui-height) - var(--mm-content-gap) - var(--mm-credits-block));
}

/* Rem-based controls follow the shared scale in content-tokens.css. */
@media screen and (min-width:851px){
 :root{
  --font-size-input:1rem;--font-size-body:.9375rem;--font-size-label:.875rem;
  --font-size-caption:.875rem;--font-size-small:.875rem;--font-size-micro:.75rem;--font-size-control:1.125rem;
  --mm-ui-height:2.25rem;--mm-ui-icon:1.75rem;--mm-ui-inline:.75rem;--mm-ui-block:.375rem;--mm-ui-nest:.25rem;
  --mm-credits-block:calc(var(--gap-large) + var(--space-stack) + 1.125rem);
 }
 .sidebar :is(.nav-link,.nm-disclosure-trigger),.sidebar .subnav a{font-size:.9375rem}
 .sidebar .site-brand{font-size:2rem}
 .sidebar .site-description{font-size:.8125rem}
 .news-card .card-meta{font-size:.75rem}
 .footer-bottom>.footer-copy,.footer-bottom>.footer-privacy,.pagination{font-size:.875rem}
}
@media(min-width:2560px) and (min-height:900px){:root{--card-min-width:280px}}
@media(min-width:3200px) and (min-height:900px){:root{--card-min-width:330px}}
