/* labs.jonasjohansson.se shared base — tokens, theme, masthead.
   Linked cross-origin by every Labs tool. Keep this additive: it must not
   restyle a tool's own UI. Tools opt into tokens by using the variables. */

@font-face {
  font-family: "SeasonMix";
  src: url("https://labs.jonasjohansson.se/fonts/SeasonMix-Regular.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --labs-white: #f0f0f0;
  --labs-black: #252525;
  --labs-gray: #555555;

  --labs-bg: var(--labs-white);
  --labs-fg: var(--labs-black);
  --labs-hairline: rgba(37, 37, 37, 0.14);
  --labs-hairline-strong: rgba(37, 37, 37, 0.4);

  --labs-font: "SeasonMix", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --labs-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --labs-size-xs: 0.86rem;
  --labs-size-small: clamp(0.9rem, 0.6rem + 1vw, 1.25rem);
  --labs-size-intro: clamp(1.05rem, 0.5rem + 1vw + 0.3vh, 1.8rem);
  --labs-size-large: clamp(1.4rem, 1rem + 1.5vw, 2.4rem);
  --labs-leading-tight: 1.15;
  --labs-leading: 1.375;

  --labs-space-xs: 0.25rem;
  --labs-space-sm: 0.5rem;
  --labs-space-md: 1rem;
  --labs-space-lg: 1.5rem;
  --labs-space-xl: 2rem;
  --labs-space-2xl: 4rem;
  --labs-radius: 0;

  --labs-mast-height: 2rem;
}

/* System preference is the fallback; an explicit data-theme wins. */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --labs-bg: var(--labs-black);
    --labs-fg: var(--labs-white);
    --labs-hairline: rgba(240, 240, 240, 0.12);
    --labs-hairline-strong: rgba(240, 240, 240, 0.4);
  }
}
html[data-theme="dark"] {
  --labs-bg: var(--labs-black);
  --labs-fg: var(--labs-white);
  --labs-hairline: rgba(240, 240, 240, 0.12);
  --labs-hairline-strong: rgba(240, 240, 240, 0.4);
}
html[data-theme="light"] {
  --labs-bg: var(--labs-white);
  --labs-fg: var(--labs-black);
  --labs-hairline: rgba(37, 37, 37, 0.14);
  --labs-hairline-strong: rgba(37, 37, 37, 0.4);
}

/* Masthead: a small fixed strip, top-left, out of the way of right-hand panels. */
.labs-mast {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  height: var(--labs-mast-height);
  padding: 0 0.75rem;
  font-family: var(--labs-font);
  font-size: var(--labs-size-xs);
  line-height: 1;
  color: var(--labs-fg);
  background: color-mix(in srgb, var(--labs-bg) 82%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-right: 1px solid var(--labs-hairline);
  border-bottom: 1px solid var(--labs-hairline);
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.18s ease;
}
.labs-mast:hover,
.labs-mast:focus-visible {
  opacity: 1;
  outline: none;
}
.labs-mast:focus-visible {
  box-shadow: inset 0 0 0 2px currentColor;
}
.labs-mast .labs-mast-home {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.18s ease;
}
.labs-mast:hover .labs-mast-home {
  text-decoration-color: currentColor;
}
.labs-mast .labs-mast-sep {
  opacity: 0.4;
}
.labs-mast .labs-mast-name {
  opacity: 0.7;
}

@media print {
  .labs-mast {
    display: none !important;
  }
}
