/* ============================================================================
   theme.css — the public site's two-mode palette (allmeans.works).

   The landing site has no build step, so this is the one shared stylesheet the
   three pages (/, /works, /bio) link. It owns ONLY the colour tokens and the
   theme toggle; every page keeps its own layout CSS and maps its local
   variables onto the `--amw-*` tokens below.

   Contract:
     • One token set, two values. Light is exactly what the site looked like
       before dark mode existed — the light column is not a redesign.
     • The site rule "all visible text is BLACK, never grey" survives the
       switch: there is ONE ink token, and in dark mode it is a full-contrast
       warm off-white. No muted secondary text in either mode.
     • `color-scheme` is set per mode so native scrollbars, form controls and
       the browser's own canvas follow the page instead of staying white.

   Load order matters: link this AFTER a page's inline <style> so a tie on
   specificity (e.g. `button:focus-visible`) resolves in the theme's favour.
   ============================================================================ */

:root {
  color-scheme: light;

  --amw-bg: #fff;            /* page / paper */
  --amw-ink: #0a0a0a;        /* every piece of visible text */
  --amw-accent: #ff3b21;     /* the brand red-orange — LARGE display type only (3:1) */
  --amw-accent-strong: #cc2a10; /* the darker sibling for small type (4.5:1 on white) */

  --amw-panel: #e9e9e9;      /* image placeholder blocks */
  --amw-panel-line: #c8c8c8; /* hairline around media + placeholders */
  --amw-panel-line-soft: #d2d2d2;
  --amw-shadow: rgba(0, 0, 0, .08);
  --amw-shadow-strong: rgba(0, 0, 0, .12);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --amw-bg: #0b0b0c;
  --amw-ink: #f2f0ec;        /* warm off-white — pure #fff on near-black glares */
  --amw-accent: #ff6a4d;     /* the same red-orange, lifted to ~7:1 on the dark bg */
  --amw-accent-strong: #ff8a70; /* on dark, "stronger" means LIGHTER — ~8.5:1 */

  --amw-panel: #191a1c;
  --amw-panel-line: #3a3b40;
  --amw-panel-line-soft: #2b2c30;
  --amw-shadow: rgba(0, 0, 0, .65);
  --amw-shadow-strong: rgba(0, 0, 0, .75);
}

/* The switch itself: a cross-fade rather than a hard cut, but never for people
   who asked for less motion. */
body {
  transition: background-color .18s ease, color .18s ease;
}

@media (prefers-reduced-motion: reduce) {
  body,
  .amw-theme-toggle {
    transition: none;
  }
}

/* ---------------------------------------------------------------------------
   The toggle — lower left, on every page.
   Bold + graphic like the rest of the site: square corners, 2px black rule,
   Archivo Black, uppercase. It names the mode you are switching TO.
   --------------------------------------------------------------------------- */
.amw-theme-toggle {
  position: fixed;
  left: clamp(.75rem, 2.5vw, 1.5rem);
  bottom: clamp(.75rem, 2.5vw, 1.5rem);
  z-index: 60; /* above the works page's collage (0) and its preview (50) */

  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px; /* tap target */
  padding: .45rem .7rem;

  font-family: "Archivo Black", ui-sans-serif, system-ui, sans-serif;
  font-size: .8rem;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .02em;
  text-decoration: none;

  color: var(--amw-ink);
  background: var(--amw-bg);
  border: 2px solid var(--amw-ink);
  border-radius: 0;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}

.amw-theme-toggle:hover,
.amw-theme-toggle:focus-visible {
  background: var(--amw-ink);
  color: var(--amw-bg);
  text-decoration: none;
}

.amw-theme-toggle:focus-visible {
  outline: 2px solid var(--amw-accent);
  outline-offset: 2px;
}

.amw-theme-toggle svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Narrow phones: the word would crowd the huge type on the landing page. */
@media (max-width: 420px) {
  .amw-theme-toggle__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .amw-theme-toggle {
    gap: 0;
    padding: .45rem .55rem;
  }
}
