/* hexu.app refresh, 28 Nov 2026 — the light/dark switch and visible phone frames in dark mode.
   Add this file after css/hexu.css (CSP: style-src 'self', so no inline styles). It only adds rules; nothing in
   hexu.css needs deleting.

   How it works: hexu.css follows the system setting (@media prefers-color-scheme). When the visitor uses the switch,
   js/theme.js sets <html data-theme="light|dark">; the two blocks below then win over the media query, because
   :root[data-theme] is more specific than :root. Without a choice, nothing changes: the system setting decides. */

/* The visitor chose light: the site's light colours, even if the system is dark. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f3f5; --panel: #ffffff; --ink: #15181c; --ink2: #39414a; --ink3: #5a646f; --line: #e4e7eb; --field: #7d8792;
  --accent: #2e6fe8; --btn: #2e6fe8; --btn-hover: #245fd1; --btn-ink: #ffffff; --track: #e6eaef; --wash: #e4eefb;
  --cell: #2e6fe8; --comb: #d3deec; --glow: rgba(90, 169, 240, 0.24); --bee: #2e6fe8;
  --frame: #15181c; --frame-edge: #15181c; --lift: 0 48px 80px -40px rgba(21, 24, 28, 0.38);
}

/* The visitor chose dark: the site's dark colours, even if the system is light. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d10; --panel: #0e1216; --ink: #e6ebf0; --ink2: #c9d1d9; --ink3: #8b96a2; --line: #1e252c; --field: #6b7784;
  --accent: #5d80a6; --btn: #5276a0; --btn-hover: #46688f; --track: #1a2027; --wash: #141e2f;
  --cell: #5d80a6; --comb: #18212b; --glow: rgba(45, 111, 224, 0.26); --bee: #4fa3f7;
  --lift: 0 48px 80px -40px rgba(0, 0, 0, 0.7);
}

/* Phone frames in dark mode: a lighter body and a thin light rim, so the phone stands out from the dark page
   (the live frame, #1e252c on #0b0d10, all but disappears). Same frame, same shape; only these two colours change.
   Light mode keeps its dark frame. */
:root[data-theme="dark"] { --frame: #2a323c; --frame-edge: #6b7784; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --frame: #2a323c; --frame-edge: #6b7784; }
}
.hx-phone { box-shadow: 0 0 0 1.5px var(--frame-edge), var(--lift); }
.hx-phone--sm { box-shadow: 0 0 0 1.5px var(--frame-edge); }

/* The switch: a 44 x 44 button at the right end of the header. Hidden until js/theme.js has set it up, so
   visitors without JavaScript never see a button that does nothing. */
.hx-theme { flex: 0 0 auto; display: inline-grid; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0;
  border: 0; border-radius: 12px; background: transparent; color: var(--ink2); cursor: pointer; }
.hx-theme:hover { background: var(--track); color: var(--ink); }
.hx-theme:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.hx-theme svg { width: 22px; height: 22px; }
.hx-theme[hidden] { display: none; }
/* Show the moon on a light page (it switches to dark) and the sun on a dark page (it switches to light). */
.hx-theme .hx-theme-sun { display: none; }
.hx-theme[data-current="dark"] .hx-theme-sun { display: block; }
.hx-theme[data-current="dark"] .hx-theme-moon { display: none; }
.hx-nav .hx-theme { margin-left: -12px; }       /* sits close to the "Join the waitlist" button */
@media (max-width: 720px) {
  .hx-nav { gap: 8px; }
  .hx-nav .hx-btn--sm { margin-left: auto; }     /* logo left; button and switch together on the right */
  .hx-nav .hx-theme { margin-left: 0; }
}
/* Very narrow (a phone with large text): the logo stays, the word "Hexu" is kept for screen readers only,
   so the button and the switch still fit without a horizontal scroll. */
@media (max-width: 340px) {
  .hx-brand span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
}
