/* The Charmers AI theme, shared by charmers.ai and the hub (theme/README.md).

   Tokens follow branding/tokens.css and docs/BRAND-GUIDE.md. This file owns
   what the two products have in common: colours in both themes, type, the
   page wrapper and its gutters, the header bar's geometry, buttons, form
   fields, notices, focus and the responsive steps. A product's own style
   sheet comes after it and adds only what is its own (the website's
   sections and cards, the hub's progress ring and admin tables).

   A product may set these tokens after this file instead of changing rules:
     --canvas            the page's background (default: --bg)
     --field-bg          a text field's background (default: --bg)
     --accent, --on-accent, --accent-hover
                         .button--primary (a customer theme replaces these)
     --action, --on-action, --action-hover
                         .button--ink, the page's main action */

:root {
  --night: #10241f;
  --lamplight: #ffc42e;
  --ember: #f4762b;
  --pine: #1d6b4f;
  --mist: #f2f5f1;
  --white: #ffffff;
  --slate: #51605b;
  --line: #d5ddd7;
  --signal: #b3261e;

  --bg: var(--white);
  --surface: var(--mist);
  --text: var(--night);
  --text-muted: var(--slate);
  --border: var(--line);
  --link: var(--pine);
  --danger: var(--signal);
  /* The lit room: the hero panel and footer. Night in light mode. */
  --room: var(--night);
  --room-text: #eef3ef;
  --room-muted: #b9c7c0;

  --canvas: var(--bg);
  --field-bg: var(--bg);
  --field-border: #8a9a93;
  --accent: var(--lamplight);
  --on-accent: var(--night);
  --accent-hover: #ffd35c;
  --action: var(--night);
  --on-action: var(--white);
  --action-hover: #1d3a33;

  --font-display: "Bricolage Grotesque Variable", "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --font-text: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", Verdana, system-ui, sans-serif;
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --text-xs: 0.875rem;
  --text-sm: 1rem;
  --text-md: 1.25rem;
  --text-lg: 1.5625rem;
  --text-xl: 1.9375rem;
  --text-2xl: 2.4375rem;
  --text-3xl: 3.0625rem;
  --text-4xl: 3.8125rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  --page-max: 75rem;
  --gutter: 1rem;
  --section: var(--space-12);
  /* The width of a form's fields. */
  --form-max: 26rem;
  /* The header bar: its height and the wordmark's. */
  --header-height: 4rem;
  --logo-height: 38px;

  --radius-control: 6px;
  --radius-card: 12px;
  --radius-panel: 24px;
  --shadow-float: 0 12px 32px -8px rgb(16 36 31 / 0.22);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --duration: 180ms;
  color-scheme: light;
}

@media (min-width: 48rem) {
  :root { --gutter: 1.5rem; --section: var(--space-24); }
}

/* Dark: Night's greens, with Lamplight for the main action. A page that
   must stay light (a customer's logo made only for white) sets
   data-theme="light" on <html>. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10241f;
    --surface: #18322c;
    --text: #eef3ef;
    --text-muted: #a9b8b1;
    --border: #2c4a42;
    --link: #7fd1ae;
    --danger: #ff9b8f;
    --room: #0b1a16;
    --action: var(--lamplight);
    --on-action: var(--night);
    --action-hover: var(--lamplight);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10241f;
  --surface: #18322c;
  --text: #eef3ef;
  --text-muted: #a9b8b1;
  --border: #2c4a42;
  --link: #7fd1ae;
  --danger: #ff9b8f;
  --room: #0b1a16;
  --action: var(--lamplight);
  --on-action: var(--night);
  --action-hover: var(--lamplight);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 400 var(--text-sm) / 1.55 var(--font-text);
  overflow-wrap: break-word;
}
img, svg, video { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
  color: inherit;
}
h1 { font-size: clamp(var(--text-2xl), 6.5vw, var(--text-4xl)); }
h2 { font-size: clamp(var(--text-xl), 4vw, var(--text-2xl)); }
h3 { font-size: var(--text-md); line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; max-width: 65ch; text-wrap: pretty; }
strong, b { font-weight: 700; }
em, i, cite { font-style: normal; font-weight: 700; }

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 2px; }

/* The page wrapper: one column, centred, with the same gutters everywhere. */
.wrap { max-width: var(--page-max); margin-inline: auto; padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px)); }
.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-8); }
.lede { font-size: var(--text-md); line-height: 1.5; }
.muted { color: var(--text-muted); }
.small { font-size: var(--text-xs); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* The header bar: the wordmark at the wrapper's left edge, anything else on the right. */
.site-header { border-bottom: 1px solid var(--border); }
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  min-height: var(--header-height); flex-wrap: wrap;
}
.site-header .brand { display: block; padding-block: var(--space-3); }
.site-header .brand img { height: var(--logo-height); width: auto; }

/* A page's heading and what follows it: the inner pages and the 404. */
.page-hero { padding-block: var(--space-12) var(--space-8); }
@media (min-width: 48rem) { .page-hero { padding-block: var(--space-16) var(--space-12); } }
.page-hero > .wrap { display: grid; gap: var(--space-6); }
.page-hero h1 { max-width: 20ch; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0 var(--space-6);
  border-radius: var(--radius-control); border: 1px solid transparent;
  font: 700 var(--text-sm) / 1 var(--font-text);
  text-decoration: none; cursor: pointer;
  transition: background-color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.button--primary { background: var(--accent); color: var(--on-accent); }
.button--primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.button--ink { background: var(--action); color: var(--on-action); }
.button--ink:hover { background: var(--action-hover); color: var(--on-action); }
/* Secondary: the link colour as text and border, on the page's own background. */
.button--secondary { background: transparent; color: var(--link); border-color: currentColor; }
.button--secondary:hover { color: var(--link); background: color-mix(in srgb, var(--link) 10%, transparent); }
.button[disabled], .button[aria-disabled="true"] { opacity: 0.6; cursor: progress; }
.text-link { font-weight: 700; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); }

/* Forms: a column of fields no wider than --form-max, at the wrapper's left edge. */
.form-column { display: grid; gap: var(--space-6); max-width: var(--form-max); justify-items: start; }
.form-column > * { margin: 0; }
.field { display: grid; gap: var(--space-2); margin: 0; padding: 0; border: 0; min-width: 0; justify-self: stretch; }
.field > label, .field > legend { font-weight: 700; padding: 0; }
.field .hint, .hint { font-size: var(--text-xs); line-height: 1.4; color: var(--text-muted); }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.field select, .field textarea {
  width: 100%; min-height: 3rem; padding: var(--space-3) var(--space-4);
  font: inherit; color: var(--text); background: var(--field-bg);
  border: 1px solid var(--field-border); border-radius: var(--radius-control);
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: 3px solid var(--link); outline-offset: 1px; border-color: var(--link);
}
/* A message about the whole form, such as a wrong password. */
.form-error { color: var(--danger); font-size: var(--text-xs); font-weight: 700; }

/* A notice: a short warning or confirmation, with an Ember rule on its left. */
.notice {
  max-width: 48ch; padding: var(--space-3) var(--space-4);
  background: var(--surface); border-inline-start: 4px solid var(--ember);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
