/* ============================================================
   creator.css: the small base the Creator pages stand on.

   admin-post.html and admin-how-it-works.html carry their own page styles. This file is what they take from "the site": the page-wide
   tokens (ink, accent, fonts, speed, lines), a reset, the top bar (logo, links, Log out, the light/dark switch) and the light and dark
   themes. It knows no brand: the accent colour is brand.theme in creator.config.mjs, which the page's first inline script writes into
   --accent and --accent-dark before the page paints (a value that is not a colour is ignored, and the defaults below stay).

   THE NEW WEBSITE DESIGN (2026-11-15): white, black 1px frames, SQUARE corners (--radius is 0), the mono face for small labels, ORANGE for the
   current link and the primary button, a BLACK block for Log out. The fonts are the site's own, Inter and JetBrains Mono, SELF-HOSTED: the two
   variable woff2 files in assets/fonts/ (the latin subset, with their open font licences beside them) are read from this page's own origin, which
   the page's policy allows (font-src 'self') and which needs no font or style host. Segoe UI and Cascadia Mono or Consolas are only the fallback
   while a file loads and for letters outside the latin subset.
   The accent defaults to the cobalt ink #24567f, which is AA (4.5:1) as the colour of a link on white.

   Light and dark are the data-theme attribute on <html> ("light" or "dark"): the same script sets it from the saved choice
   (localStorage "creator-theme") or from the operating system. The Creator's work area pins its own colours inside #cc, so it
   looks the same in both themes; only the top bar and the quick-start page follow the theme (the dark theme is the new site's own
   dark tokens: #14181d, #1d232b, #f5f7f9).
   ============================================================ */

/* The site's two fonts, self-hosted (Inter: wght 100 to 900, JetBrains Mono: wght 100 to 800). The files are the latin subsets Google Fonts serves, with the
   same unicode-range, so a letter outside it (Cyrillic, Greek) comes from the fallback in the stack. font-display: swap shows text at once. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --accent: #24567f;
  --accent-dark: #7fb0d8;
  --blue: var(--accent);
  --sky: var(--accent-dark);
  --ink: #000000;
  --ink-dim: #555555;
  --bg: #ffffff;
  --bar-bg: #ffffff;
  --bar-line: #000000;
  --bar-hover: #f7f7f5;
  --current-bg: #e87e2a;
  --current-ink: #000000;
  --logout-bg: #000000;
  --logout-ink: #ffffff;
  --line-lite: #eaeaea;
  --panel: #f7f7f5;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  --font-serif: Georgia, "Times New Roman", "Palatino Linotype", serif;
  --speed: 0.18s;
  --radius: 0;
  --gutter: clamp(16px, 4vw, 48px);
  --bar-height: 64px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ink: #f5f7f9;
  --ink-dim: #a9b1ba;
  --bg: #14181d;
  --bar-bg: #14181d;
  --bar-line: #f5f7f9;
  --bar-hover: #1d232b;
  --panel: #1d232b;
  --line-lite: #2a323c;
  --logout-bg: #f5f7f9;
  --logout-ink: #14181d;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

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

a {
  color: var(--blue);
}

/* :where() gives the dark link colour no specificity, so a link with a class of its own (the bar's links, Log out, the strip's) keeps its colour */
:where(:root[data-theme="dark"]) a {
  color: var(--sky);
}

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

:root[data-theme="dark"] :focus-visible {
  outline-color: var(--sky);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- the top bar ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--bar-height);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 0 0 var(--gutter);
  background: var(--bar-bg);
  border-bottom: 1px solid var(--bar-line);
}

.brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  display: block;
  height: 26px;
  width: auto;
  max-width: none;
}

.logo-dark {
  display: none !important;
}

:root[data-theme="dark"] .logo-light {
  display: none !important;
}

:root[data-theme="dark"] .logo-dark {
  display: block !important;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.topnav a,
.topnav-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 10px 14px;
  color: var(--ink);
  font: 600 14px/1.2 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--speed) ease, color var(--speed) ease;
}

.topnav a:hover,
.topnav-btn:hover,
.topnav a:focus-visible,
.topnav-btn:focus-visible {
  background: var(--bar-hover);
}

/* the current page: the orange block with black words, in both themes */
.topnav a[aria-current="page"] {
  background: var(--current-bg);
  color: var(--current-ink);
}

.theme-toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid var(--bar-line);
  background: transparent;
  color: var(--ink);
  transition: background-color var(--speed) ease;
}

.theme-toggle:hover {
  background: var(--bar-hover);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

.theme-toggle .i-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .i-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .i-sun {
  display: block;
}

@media (max-width: 700px) {
  .topbar {
    gap: 10px;
  }
  .topnav {
    gap: 2px;
  }
}
