/* Shared by every page: self-hosted fonts, page-change transitions and the small app header.
   Fonts are SIL Open Font Licence files in static/fonts (licences next to them). */

@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("/static/fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("/static/fonts/poppins-700.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400 700; font-style: normal; font-display: swap;
  src: url("/static/fonts/inter-variable.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-weight: 400; font-style: italic; font-display: swap;
  src: url("/static/fonts/instrument-serif-italic.woff2") format("woff2"); }

/* ---------- Colour tokens: light (default) and dark ----------
   Every colour on every page comes from these. The head script sets data-theme on <html> before
   anything paints; [data-theme="dark"] swaps the values. Orange stays #F26A1B with black text. */
:root {
  --c-bg: #F4F1EC;            /* page: paper */
  --c-surface: #FFFFFF;       /* cards, inputs */
  --c-band: #FFFFFF;          /* full-width alternate band */
  --c-card-on-band: #F4F1EC;  /* a card sitting on that band */
  --c-subtle: #FAF8F4;        /* faint boxes (trace, quotes) */
  --c-border: #ECE6DD;
  --c-border-strong: #CFCAC0; /* input outlines */
  --c-text: #111111;
  --c-text-2: #333333;
  --c-muted: #545454;
  --c-placeholder: #6B6B6B;
  --c-accent-text: #D9530A;   /* large orange words (headings) */
  --c-accent-link: #A63D06;   /* small orange text and links */
  --c-orange: #F26A1B;
  --c-on-orange: #111111;
  --c-soft: #FFF4EC;          /* light orange panels, chips */
  --c-soft-section: #FFF4EC;
  --c-chip: #F1ECE4;
  --c-green: #146C3A; --c-green-bg: #E7F5EC; --c-green-border: #B9DFC8;
  --c-invert-bg: #111111; --c-invert-text: #FFFFFF;   /* black pills and buttons */
  --c-header: #FFFFFF;
  --c-glow-1: rgba(242, 106, 27, .20); --c-glow-2: rgba(242, 106, 27, .10);
  --c-poster: #111111; --c-poster-border: transparent;
  --c-pro: #111111; --c-pro-border: #111111; --c-pro-line: #333333;
  --c-warn: #8A5A00; --c-warn-bg: #FFF6DF; --c-warn-border: #ECD9A6;
  --c-bad: #A3282F; --c-bad-bg: #FDECEC; --c-bad-border: #F1C4C6;
  --c-amber: #A15C07; --c-amber-bg: #FDF1DD;
  --c-summary-text: #E5E5E5; --c-summary-muted: #B4B4B4;
  --c-shadow: rgba(17, 17, 17, .08);
}
[data-theme="dark"] {
  --c-bg: #121212;
  --c-surface: #1C1C1F;
  --c-band: #18181B;
  --c-card-on-band: #1C1C1F;
  --c-subtle: #18181B;
  --c-border: #2E2E33;
  --c-border-strong: #3F3F46;
  --c-text: #F3F4F6;
  --c-text-2: #D4D4D8;
  --c-muted: #A1A1AA;
  --c-placeholder: #8B8B93;
  --c-accent-text: #FF8A4C;
  --c-accent-link: #FF9A5C;
  --c-soft: #2A1D13;
  --c-soft-section: #1F150E;
  --c-chip: #27272A;
  --c-green: #6EE7A0; --c-green-bg: #12321F; --c-green-border: #1E5233;
  --c-invert-bg: #F3F4F6; --c-invert-text: #111111;
  --c-header: #18181B;
  --c-glow-1: rgba(242, 106, 27, .28); --c-glow-2: rgba(242, 106, 27, .14);
  --c-poster: #050505; --c-poster-border: #2E2E33;
  --c-pro: #0A0A0A; --c-pro-border: #F26A1B; --c-pro-line: #2E2E33;
  --c-warn: #F5C26B; --c-warn-bg: #2A2110; --c-warn-border: #4A3A18;
  --c-bad: #FCA5A5; --c-bad-bg: #2A1416; --c-bad-border: #5A2A2E;
  --c-amber: #FBBF24; --c-amber-bg: #2E2410;
  --c-shadow: rgba(0, 0, 0, .45);
}

/* Brand blue: ONLY the first letter E of "Ezze" / "EZZE" (see static/brand/README.md).
   One rule; black surfaces (poster band, footer) swap the value. */
:root { --c-brand-blue: #1E40AF; }                       /* on white or paper */
[data-theme="dark"] { --c-brand-blue: #3B82F6; }
.band, .site-footer, .plan-pro { --c-brand-blue: #3B82F6; }   /* on black */
.brand-e { color: var(--c-brand-blue); }

/* The light logo or the dark one ("Jobz" in white). The hidden one is out of the accessibility tree. */
.logo-dark { display: none !important; }
[data-theme="dark"] .logo-light { display: none !important; }
[data-theme="dark"] .logo-dark { display: block !important; }

/* ---------- The light/dark switch (both pages) ---------- */
.theme-toggle { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; margin: 0; padding: 0;
  border-radius: 50%; border: 1px solid var(--c-border-strong); background: var(--c-surface); color: var(--c-text);
  cursor: pointer; font: inherit; transition: transform .18s ease; }
.theme-toggle:hover { transform: translateY(-1px); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle:focus-visible { outline: 3px solid var(--c-accent-text); outline-offset: 3px; }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }
html:not([data-theme]) .theme-toggle { display: none; }   /* without JavaScript it couldn't work */

/* While switching (only then), colours fade for about 200ms. theme.js adds this class briefly. */
html.theme-fade *, html.theme-fade *::before, html.theme-fade *::after {
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, fill .2s ease !important; }

/* Page changes (landing -> sign in -> app) fade and slide softly in browsers that support
   cross-document View Transitions. Others just load the page normally. */
@view-transition { navigation: auto; }
.logo { view-transition-name: site-logo; }   /* the logo stays in place between pages */

::view-transition-old(root) { animation: 180ms ease-in both vt-out; }
::view-transition-new(root) { animation: 260ms ease-out both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* The app page's top bar: the logo, linking back to the landing page. */
.brandbar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 860px; margin: 0 auto; padding: 16px 20px 0; }
.brandbar .logo { display: inline-flex; border-radius: 6px; }
.brandbar .logo img { display: block; height: 28px; width: auto; }
.brandbar .logo:focus-visible { outline: 3px solid var(--c-accent-text); outline-offset: 3px; }

/* The mascot peeking up behind the "bz" of "Jobz" in the header logo (every page). Placed in percentages of
   the logo, so it follows the logo when it shrinks on phones: the helmet (55% across the picture) is centred
   on "bz" (88% across the logo), and the picture's faded bottom sits just under the letters. Taken out of
   the layout (absolute), so the header's height and everything else in it stay exactly where they were.
   No motion here; the soft white glow is the band mascot's, scaled down, so the black helmet shows in dark mode. */
.logo { position: relative; isolation: isolate; }
.logo > img { position: relative; z-index: 1;             /* the logo (and its blue E and orange tag) in front */
  /* A thin outline in the background colour around the letters: invisible on the page, but it keeps the
     dark "bz" readable where it crosses the black helmet. */
  filter: drop-shadow(1.5px 0 0 var(--peek-halo)) drop-shadow(-1.5px 0 0 var(--peek-halo))
    drop-shadow(0 1.5px 0 var(--peek-halo)) drop-shadow(0 -1.5px 0 var(--peek-halo)); }
.logo { --peek-halo: var(--c-bg); }
.site-header.scrolled .logo { --peek-halo: var(--c-header); }   /* the landing header turns white when scrolled */
[data-theme="dark"] .logo > img { filter: none; }   /* white letters already stand out on the black helmet */
.logo .logo-peek { position: absolute; z-index: 0; left: 88%; bottom: -30%; transform: translateX(-55%);
  pointer-events: none; line-height: 0; }
.logo .logo-peek > img { display: block; height: 56px; width: auto;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, .12)); }
@media (max-width: 480px) {
  .logo .logo-peek > img { height: 40px; }
  .brandbar .logo .logo-peek { bottom: 0; }   /* /app keeps its full-size logo on phones, so the robot sits higher */
}
