/* Kvitbox palette and type for the design kit (dealt by start.mjs: cool-grey-cobalt, instrument).
   Loaded after layout.css, because layout.css resets --ly-scale. */
:root {
  /* white and light blue ground under the cobalt accent */
  --p-bg: #ffffff; --p-surface: #eaeffd; --p-ink: #0d1230; --p-muted: #4a5270;
  --p-accent: #1f2de6; --p-accent-ink: #ffffff; --p-action: #1f2de6; --p-action-ink: #ffffff;
  --p-inv-bg: #0a0e66; --p-inv-surface: #141a8a; --p-inv-ink: #ffffff; --p-inv-muted: #b9c0f5;
  --p-inv-accent: #ffffff; --p-inv-accent-ink: #0a0e66; --p-inv-action: #ffffff; --p-inv-action-ink: #0a0e66;
  --font-display: var(--font-sans), system-ui, sans-serif;
  --font-text: var(--font-sans), system-ui, sans-serif;
  --font-mono: var(--font-mono-face), ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display-weight: 500;
  --display-tracking: -0.028em;
  --display-tracking-xl: -0.036em;
  --display-stretch: 96%;
  --ly-scale: 1.04;
  /* planet diameter: always wider than the screen, and a little wider still on a small screen,
     where a fixed ratio would leave the curve almost touching the side edges */
  --planet-w: calc(168vw + 4rem);
}
@media (min-width: 1600px) {
  :root { --planet-w: calc(186vw + 2rem); }
}

/* the frames behind the product pieces: white, with a hairline so they still read against the page */
html[data-ground="sand"] { --ground-bg: #ffffff; --ground-surface: #f3f6fe; --ground-ink: #0d1230; --ground-muted: #4a5270; --ground-accent: #1f2de6; }
/* the kit paints a mesh of the ground's accent into every panel on a software page: flat white here */
:root:has(meta[name="site-kind"]:is([content="tech"], [content="software"], [content="gaming"])) .panel:not([data-fx], .panel--device), .frame { background-image: none; background-color: #ffffff; }
.frame, .panel:not(.ui-panel) { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--p-ink) 10%, transparent); }

/* the language list in the foot: one row */
.footer .langs { display: flex; flex-flow: row wrap; gap: 0 var(--s-5); }
.langs a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--muted); }
.langs a:hover { color: var(--ink); text-decoration: underline; }
.langs a[aria-current="true"] { color: var(--ink); font-weight: 500; }

/* ------------------------------------------------------------------ theme: dark is the default, light the choice
   <html data-theme="dark|light"> is set before the page paints (lib/site-theme-script.ts). The product pieces
   (.ui) keep their own light look on both, like a window on a desk. --hl is the accent for text and marks on the page. */
:root { --hl: var(--p-accent); color-scheme: light; }
html[data-theme="dark"] {
  color-scheme: dark;
  --p-bg: #05071f; --p-surface: #0a0e2e; --p-ink: #f2f4ff; --p-muted: #a9b0dc;
  --hl: #8c98ff;
  --line-dark: rgb(255 255 255 / .12);
}
html[data-theme="dark"][data-ground="sand"] { --ground-bg: #0a0e2e; --ground-surface: #0a0e2e; --ground-ink: #f2f4ff; --ground-muted: #a9b0dc; --ground-accent: #8c98ff; }
html[data-theme="dark"] .frame, html[data-theme="dark"] .panel:not(.ui-panel) { background-color: #0a0e2e; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12); }

/* the switch in the header */
.theme-toggle { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-left: auto; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; transition: background-color 160ms ease, border-color 160ms ease; }
.theme-toggle:hover { background: color-mix(in oklab, var(--ink) 10%, transparent); }
.theme-toggle:active { transform: scale(.96); }
.theme-toggle + .nav__actions { margin-left: 0; }

/* the change of theme: light is revealed by a circle that grows from the horizon at the foot of the screen,
   with a sun rising in front of it; dark falls from the top */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-group(sun), ::view-transition-old(sun), ::view-transition-new(sun) { animation: none; mix-blend-mode: normal; }
.theme-sun { position: fixed; z-index: 90; left: 50%; bottom: 0; width: 80vmin; height: 80vmin; margin-bottom: -40vmin; border-radius: 50%; view-transition-name: sun; pointer-events: none;
  background: radial-gradient(circle, #fffbe0 0%, #ffe28a 22%, rgb(255 170 70 / .55) 44%, rgb(255 140 60 / 0) 70%);
  animation: sun-rise 1300ms cubic-bezier(.45, .05, .2, 1) both; }
@keyframes sun-rise {
  0% { opacity: 0; transform: translate(-50%, 30%) scale(.7); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -85%) scale(1.15); }
}

/* the consent banner (components/layout/Analytics.tsx): a card at the foot of the screen, not a wall in front of the page */
.consent { position: fixed; z-index: 80; inset: auto var(--s-3) var(--s-3); max-width: 640px; margin: 0 auto; padding: var(--s-5);
  border-radius: var(--r-lg); background: var(--p-surface); color: var(--p-ink); font: 400 var(--t-body)/1.5 var(--font-text);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--p-ink) 14%, transparent), 0 18px 48px rgb(0 0 0 / .35); }
.consent__title { margin: 0 0 var(--s-2); font: 600 18px/1.3 var(--font-display); letter-spacing: 0; }
.consent__text { margin: 0 0 var(--s-3); color: var(--p-muted); }
.consent a, .consent-settings { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.consent__options { display: grid; gap: var(--s-2); margin: 0 0 var(--s-4); padding: 0; border: 0; }
.consent__option { display: flex; align-items: flex-start; gap: var(--s-3); cursor: pointer; }
.consent__option input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--hl); }
.consent__hint { display: block; color: var(--p-muted); font-size: var(--t-small); }
.consent__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.consent__actions > .btn { flex: 1 1 auto; min-height: 44px; }
.consent-settings { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; font: inherit; color: var(--muted); cursor: pointer; }
.consent-settings:hover { color: var(--ink); }
