/* =============================================================================
   burntandtoast.com - the shared theme.

   THIS FILE IS THE CONTRACT. Articles and adverts authored elsewhere (Claude
   Design) link to it as ../styles.css and use the tokens and classes below; they
   should define layout specifics in their own <style>, never re-declare a token.
   Change a value here and every article ever published moves with it - which is
   the whole reason the site owns this file rather than each document carrying a
   copy of the design.

   ⚠️ ARTICLE URLS MUST NOT END IN A SLASH. Documents link ../styles.css, which
   resolves to /styles.css only from /blog/<slug>. From /blog/<slug>/ it would
   resolve to /blog/styles.css and every article would render unstyled. The
   article route enforces this with a redirect - see functions/blog/[slug].ts.

   Palette is the "toast warm" set already used by the homepage: the same
   near-black base and Inter type as the Dartistry app, with ember orange where
   Dartistry uses cyan. The studio and the product are family, not twins.
   ============================================================================= */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-var.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 {
  /* ---- surfaces ---- */
  --bt-bg: #08090B;
  --surface-card: #121316;
  --surface-elev: #1A1B1F;

  /* ---- lines. `default` is the visible hairline on a card; `section` is the
         quieter rule between blocks of a page. ---- */
  --border-default: #4E4B46;
  --border-section: #2B2926;

  /* ---- accent ---- */
  --accent: #F0873A;
  --accent-2: #E8B44C;
  --char: #8A3A1E;
  --text-on-accent: #1A0B03;

  /* ---- text ramp: strong > body > muted. Do not add a fourth. ---- */
  --text-strong: #F7F5F2;
  --text-body: #A9A5A0;
  --text-muted: #8C8A86;

  /* ---- accent derivatives. A hairline or a wash of the accent, so a document never
         has to hand-write rgba(240,135,58,...) and drift from the palette. ---- */
  --accent-line: rgba(240, 135, 58, 0.35);
  --accent-tint: rgba(240, 135, 58, 0.10);
  --bt-hairline: #2B2926;

  /* ---- Dartistry's OWN locked colours. ⚠️ These are the product's brand, not the
         studio's, and they are sanctioned ONLY inside a Dartistry logo lockup or
         product card - exactly as index.html uses them. Ember stays the studio accent
         everywhere else. Defined here because a document referencing an UNDEFINED
         custom property in a fill or stroke falls back to the initial value, which is
         BLACK - the logo renders as a black box with no error anywhere. ---- */
  --bt-dartistry-cyan: #00D4C8;
  --bt-dartistry-gold: #d4b060;

  /* ---- layout and motion helpers documents reach for ---- */
  --card-gap: 14px;
  --lift-hover: translateY(-2px);
  --shadow-ember: 0 2px 24px rgba(240, 135, 58, 0.14);
  --fs-prodname: 20px;

  /* ---- radii ---- */
  --radius-sm: 9px;
  --radius-card: 16px;
  --radius-lg: 22px;
  --radius-btn: 10px;
  --radius-pill: 999px;

  /* ---- type sizes ---- */
  --fs-wordmark: 18px;
  --fs-brandsub: 12px;
  --fs-kicker: 12px;
  --fs-eyebrow: 11px;
  --fs-h3: 20px;
  --fs-card-body: 15.5px;
  --fs-chip: 13px;
  --lh-card: 1.6;

  /* ---- letter spacing ---- */
  --ls-hero: -0.03em;
  --ls-h2: -0.02em;
  --ls-h3: -0.01em;
  --ls-kicker: 0.18em;
  --ls-eyebrow: 0.16em;
  --ls-brandsub: 0.14em;
  --ls-btn: 0.1em;

  /* ---- motion ---- */
  --dur-fast: 0.18s;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --font: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bt-bg); scroll-behavior: smooth; }
body {
  color: var(--text-body);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px;
}
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }
.num { font-variant-numeric: tabular-nums; }

/* ---- the warm backdrop. Documents drop in the two empty divs and get this for
       free: <div class="bt-backdrop"></div><div class="bt-backdrop-ember"></div>
       Fixed, behind everything, never interactive, all layers <= 7%. ---- */
.bt-backdrop, .bt-backdrop-ember {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
}
.bt-backdrop {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E") repeat,
    radial-gradient(150% 130% at 50% 40%, rgba(0,0,0,0) 52%, rgba(0,0,0,0.5) 100%),
    radial-gradient(1200px 620px at 50% -10%, #241A12 0%, rgba(36,26,18,0) 64%);
  background-size: 140px 140px, 100% 100%, 100% 100%;
}
.bt-backdrop-ember {
  background:
    radial-gradient(circle at 100% 100%, rgba(240,135,58,0.13) 0%, rgba(240,135,58,0.04) 42%, rgba(240,135,58,0) 72%),
    radial-gradient(circle at 0% 96%, rgba(138,58,30,0.10) 0%, rgba(138,58,30,0) 55%);
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--text-on-accent);
  padding: 12px 18px; font-weight: 700; z-index: 10;
}
.skip:focus { left: 0; }

/* =============================================================================
   Shared article furniture. A document that uses these class names gets the
   house look without restating it. Anything genuinely one-off still belongs in
   the document's own <style>.
   ============================================================================= */

.shell { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.shell-wide { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  padding: 18px 24px; border-bottom: 1px solid var(--border-section);
  max-width: 1120px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand img, .brand svg { width: 40px; height: 40px; flex: none; }
.wordmark {
  font-size: var(--fs-wordmark); font-weight: 900;
  letter-spacing: -0.01em; line-height: 1.05; white-space: nowrap;
  color: var(--text-strong);
}
.wordmark .and { font-weight: 500; color: var(--text-muted); font-size: 15px; }
.wordmark .t { color: var(--accent); }
.brandsub {
  font-size: var(--fs-brandsub); font-weight: 700;
  letter-spacing: var(--ls-brandsub); text-transform: uppercase;
  color: var(--text-muted); margin-top: 3px;
}

.copybtn {
  display: inline-flex; align-items: center; padding: 10px 20px;
  background: transparent; color: var(--text-strong); font-family: inherit;
  font-weight: 600; font-size: 12px; letter-spacing: var(--ls-btn);
  text-transform: uppercase; border-radius: var(--radius-btn);
  border: 1px solid var(--border-default);
  transition: border-color var(--dur-fast) var(--ease);
}
.copybtn:hover { border-color: var(--accent); }

header.art { padding: 76px 24px 0; }
header.art h1, h1.hero {
  margin-top: 18px; font-size: clamp(36px, 5.4vw, 58px); font-weight: 900;
  letter-spacing: var(--ls-hero); line-height: 1.05; text-wrap: balance;
  color: var(--text-strong);
}
h1 .hl, .hl { color: var(--accent); }
.kicker {
  font-size: var(--fs-kicker); font-weight: 700; letter-spacing: var(--ls-kicker);
  text-transform: uppercase; color: var(--accent);
}
.standfirst {
  margin-top: 24px; font-size: 20px; line-height: 1.55;
  color: var(--text-body); text-wrap: pretty;
}
.standfirst b { color: var(--text-strong); font-weight: 600; }
.byline {
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border-section);
  display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
}

article { padding: 44px 24px 20px; }
article p {
  margin-top: 22px; font-size: 18px; line-height: 1.68;
  color: var(--text-body); text-wrap: pretty;
}
article p b { color: var(--text-strong); font-weight: 600; }
article h2 {
  margin-top: 56px; font-size: 29px; font-weight: 900;
  letter-spacing: var(--ls-h2); line-height: 1.12;
  color: var(--text-strong); text-wrap: balance;
}
article h2 + p { margin-top: 16px; }
article h3 {
  margin-top: 40px; font-size: var(--fs-h3); font-weight: 700;
  letter-spacing: var(--ls-h3); color: var(--text-strong);
}
article ul, article ol { margin-top: 20px; padding-left: 24px; }
article li { margin-top: 8px; font-size: 18px; line-height: 1.68; }
article img { border-radius: var(--radius-card); border: 1px solid var(--border-default); }
article blockquote {
  margin-top: 28px; border-left: 3px solid var(--accent); padding-left: 20px;
  color: var(--text-body); font-style: italic;
}
article code {
  background: var(--surface-elev); border: 1px solid var(--border-default);
  border-radius: 5px; padding: 2px 6px; font-size: 0.9em;
}
article pre {
  margin-top: 22px; background: var(--surface-elev);
  border: 1px solid var(--border-default); border-radius: var(--radius-card);
  padding: 18px; overflow-x: auto;
}
article pre code { background: none; border: 0; padding: 0; }

.pull {
  margin: 48px 0 0; padding: 26px 28px; background: var(--surface-card);
  border: 1px solid var(--border-default); border-radius: var(--radius-card);
  font-size: 22px; line-height: 1.42; font-weight: 600;
  color: var(--text-strong); text-wrap: pretty;
}
.pull span { color: var(--accent); }

.rule { margin-top: 56px; height: 1px; background: var(--border-section); }

.endcard {
  margin-top: 56px; background: var(--surface-card);
  border: 1px solid var(--border-default); border-radius: var(--radius-card);
  padding: 28px 26px;
}
.endcard .n {
  font-size: var(--fs-eyebrow); font-weight: 700;
  letter-spacing: var(--ls-eyebrow); color: var(--text-muted);
  text-transform: uppercase;
}
.endcard h3 {
  margin-top: 12px; font-size: var(--fs-h3); font-weight: 700;
  letter-spacing: var(--ls-h3); color: var(--text-strong);
}
.endcard p {
  margin-top: 12px; font-size: var(--fs-card-body);
  line-height: var(--lh-card); color: var(--text-body);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chip {
  background: var(--surface-elev); border: 1px solid var(--border-default);
  border-radius: var(--radius-pill); padding: 7px 14px;
  font-size: var(--fs-chip); font-weight: 600; color: var(--text-body);
}

footer.art {
  margin-top: 20px; padding: 56px 24px 76px;
  color: var(--text-muted); font-size: 13px; line-height: 1.7;
}

.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translateX(-50%) translateY(14px); opacity: 0; pointer-events: none;
  background: var(--accent); color: var(--text-on-accent); font-weight: 700;
  font-size: 12px; letter-spacing: var(--ls-btn); text-transform: uppercase;
  padding: 11px 22px; border-radius: var(--radius-pill);
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.toast.in { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  header.art { padding-top: 44px; }
  article p, article li { font-size: 17px; }
}

/* =============================================================================
   Video and animation.

   Self-hosted only. The CSP allows media-src 'self' and deliberately has no
   frame-src, so a YouTube or Vimeo embed cannot render - see public/_headers for
   why that is a decision rather than an omission. Put files in public/video/ and
   reference them as /video/name.mp4.

   The house pattern for a silent UI demo, which is what most clips here will be.
   It behaves like a GIF and is roughly a tenth of the size:

     <figure class="clip">
       <video autoplay muted loop playsinline poster="/video/thing-poster.jpg">
         <source src="/video/thing.mp4" type="video/mp4">
       </video>
       <figcaption>What the reader is looking at.</figcaption>
     </figure>

   For anything with speech, drop autoplay/muted/loop and add `controls`.

   ⚠️ ALWAYS set a poster. Without one the article shows a black rectangle until
   the first frame decodes, which on a slow connection is most of the visit.
   ============================================================================= */

.clip { margin: 40px 0 0; }
.clip video {
  display: block; width: 100%; height: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-default);
  background: var(--surface-elev);
}
.clip figcaption {
  margin-top: 10px; font-size: 14px; line-height: 1.5;
  color: var(--text-muted); text-wrap: pretty;
}

/* A clip that is the width of the text column reads small on a wide screen. This
   lets one break out to the full shell width where it earns it. */
.clip.wide { margin-left: calc((760px - 100vw) / 2); margin-right: calc((760px - 100vw) / 2); }
@media (min-width: 1120px) {
  .clip.wide { margin-left: -180px; margin-right: -180px; }
}
@media (max-width: 800px) {
  .clip.wide { margin-left: 0; margin-right: 0; }
}

/* ⚠️ Reduced motion is handled in JS, not here: CSS cannot pause a <video>, so a
   rule in this file would look like it worked and do nothing. Every article ships
   a script that, when the reader prefers reduced motion, stops the loop, exposes
   the controls and pauses playback - see functions/_shared/share.ts. Nothing for
   an author to remember, and nothing to add to a document. */

/* =============================================================================
   HOUSE COMPONENTS - the recurring furniture of an article.

   These exist so the same thing is not reinvented per article. A document that
   uses these class names gets the house look for free and needs NO CSS of its
   own; anything genuinely one-off still travels with the article (the importer
   captures a document's <style> and <script> - see the admin help guide).

   Promoted from the first article that invented them, so existing articles that
   define their own copies still win: per-article CSS is emitted after this file.
   ============================================================================= */

/* ---- figure: a boxed exhibit with a small uppercase label ---- */
.fig {
  margin: 44px 0 0; padding: 26px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
}
.fig > p { margin-top: 14px; font-size: 16px; line-height: 1.6; color: var(--text-body); }
.figlbl {
  font-size: var(--fs-eyebrow); font-weight: 700;
  letter-spacing: var(--ls-eyebrow); text-transform: uppercase;
  color: var(--text-muted);
}
/* Let a wide exhibit (a diagram) break past the text column. */
.fig.wide { margin-left: calc(50% - min(46vw, 480px)); margin-right: calc(50% - min(46vw, 480px)); }
@media (max-width: 900px) { .fig.wide { margin-left: 0; margin-right: 0; } }

/* ---- inline code, and command lines ---- */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em; color: var(--accent);
}
/* A stack of shell commands or checks. Each line reads as a thing that runs. */
.cmds { display: grid; gap: 9px; margin-top: 14px; }
.cmds div {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; color: var(--text-body);
  background: var(--surface-elev);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
}
.cmds div::before { content: "$ "; color: var(--accent); font-weight: 700; }
.cmds.plain div::before { content: none; }

/* ---- a code block with an optional filename/label bar ---- */
.codeblock { margin-top: 22px; border: 1px solid var(--border-default); border-radius: var(--radius-card); overflow: hidden; }
.codeblock .lbl {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; color: var(--text-muted);
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-default);
  padding: 9px 14px;
}
.codeblock pre { margin: 0; border: 0; border-radius: 0; background: var(--surface-elev); }

/* ---- callout: a short aside that is not a pull quote ---- */
.callout {
  margin-top: 28px; padding: 18px 20px;
  background: var(--accent-tint);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-card);
  color: var(--text-body); font-size: 16px; line-height: 1.6;
}
.callout b, .callout strong { color: var(--text-strong); }

/* ---- card grid: roles, options, anything that comes in a set ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 18px; }
.card {
  padding: 20px; background: var(--surface-elev);
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
}
.card .cmd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; color: var(--accent); margin-bottom: 9px;
}
.card h4 { font-size: 16px; font-weight: 700; color: var(--text-strong); }
.card p { margin-top: 8px; font-size: var(--fs-card-body); line-height: var(--lh-card); color: var(--text-body); }

/* ---- numbered steps ---- */
.steps { display: grid; gap: 10px; margin-top: 18px; counter-reset: step; }
.steps li {
  list-style: none; position: relative; padding: 14px 16px 14px 48px;
  background: var(--surface-elev); border: 1px solid var(--border-default);
  border-radius: var(--radius-sm); font-size: 16px; line-height: 1.55;
}
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 15px; top: 13px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--text-on-accent);
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
}

/* ⚠️ ANY ANIMATION AN ARTICLE ADDS MUST HONOUR THIS. The site handles it for
   <video> automatically, but it cannot reach into a document's own keyframes. */
@media (prefers-reduced-motion: reduce) {
  .fig *, .callout * { animation: none !important; transition: none !important; }
}
