@charset "UTF-8";
/* ══════════════════════════════════════════════════════════════════════
   core.css — DRM Design System
   Brand-agnostic reset + base styles. References semantic tokens
   defined in each client's brand.css. No colors, no utility classes.
   ══════════════════════════════════════════════════════════════════════ */

@layer reset, base;

/* ── Self-hosted fonts ─────────────────────────────────────────────── */

@font-face {
  font-family: "SF Mono";
  src: url("/assets/fonts/sf-mono/sf-mono-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SF Mono";
  src: url("/assets/fonts/sf-mono/sf-mono-semibold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ── Reset ─────────────────────────────────────────────────────────── */

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  html {
    /* 112.5% = 18px at browser default, scaling with the user's font-size
       preference. Reasoning: systems/design/plugins/typography § Root size. */
    font-size: 112.5%;
    -webkit-text-size-adjust: 100%;
  }

  body {
    min-height: 100dvh;
    text-rendering: optimizeLegibility;
    font-kerning: normal;
  }

  img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
  }

  input, button, textarea, select {
    font: inherit;
  }

  p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
  }

  /* `::selection` is defined in brand.css (unlayered, same-origin) — a
     layered cross-origin version here was observed to fail to apply in
     Chrome 146. Keep all selection styling with the brand tokens. */

  :focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
  }

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

/* ── Base styles ───────────────────────────────────────────────────── */

@layer base {

  /* Body */
  body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
  }

  /* Headings — Butterick's: space above > space below */
  h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: var(--line-height-snug);
    hyphens: none;
    margin-block-start: var(--space-xl);
    margin-block-end: var(--space-xs);
  }

  /* H1–H2: display font (Sole Serif) */
  h1, h2 {
    font-family: var(--font-display);
  }
  h1 { font-size: var(--font-size-h1); margin-block-start: 0; }
  h2 { font-size: var(--font-size-h2); }

  /* H3–H6: body font (Freight Sans Pro) */
  h3, h4, h5, h6 {
    font-family: var(--font-body);
  }
  h3 {
    font-size: var(--font-size-h3);
    margin-block-start: var(--space-lg);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  h4 {
    font-size: var(--font-size-h4);
    margin-block-start: var(--space-lg);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-secondary);
  }
  h5 { font-size: var(--font-size-h5); margin-block-start: var(--space-md); }
  h6 { font-size: var(--font-size-h6); margin-block-start: var(--space-md); }

  /* Flow spacing — space between block elements (Butterick's: space, not indent) */
  p + p { margin-block-start: var(--space-xs); }
  :is(ul, ol, blockquote, pre, table) + p,
  p + :is(ul, ol, blockquote, pre, table),
  :is(ul, ol, blockquote, pre, table) + :is(ul, ol, blockquote, pre, table) {
    margin-block-start: var(--space-sm);
  }

  /* Links */
  a {
    color: var(--color-text-accent);
    text-decoration: none;
    transition: var(--transition);
  }
  a:hover { opacity: 0.85; }

  /* Blockquotes */
  blockquote {
    border-left: 3px solid var(--color-accent);
    padding-left: var(--space-md);
    margin-block: var(--space-sm);
    font-style: italic;
  }

  /* Lists — Butterick's: hanging indent, outside markers */
  ul, ol {
    padding-inline-start: var(--space-sm);
    list-style-position: outside;
  }
  li + li { margin-block-start: var(--space-xxs); }

  /* Code */
  pre, code {
    font-family: var(--font-mono);
    background: var(--bedrock);
    color: var(--chalk);
    border-radius: var(--radius-sm);
  }
  code {
    padding: 0.15em 0.35em;
    font-size: 0.9em;
  }
  pre {
    padding: var(--space-sm);
    margin-block: var(--space-sm);
    overflow-x: auto;
    border: 1px solid var(--color-border-default);
    box-shadow: var(--shadow-md);
  }
  pre code {
    padding: 0;
    background: none;
    font-size: inherit;
  }

  /* Syntax highlighting — Prism.js custom theme using design tokens.
     Code blocks sit on --color-bg-secondary (green-tinted), so all
     syntax colors must pass contrast against that surface. */
  /* Syntax highlighting — Prism.js theme on Bedrock (neutral dark).
     Uses system alert colors for hue distinction.
     Three colors lightened for AA contrast on Bedrock:
     --syntax-comment: sage lightened from #647772 to #7A918B
     --syntax-string:  moss lightened from #4A7C59 to #5FA877
     --syntax-tag:     ember lightened from #C0392B to #E0564A */
  pre {
    --syntax-comment: oklch(0.64 0.024 178);
    --syntax-string:  oklch(0.68 0.08 153);
    --syntax-tag:     oklch(0.64 0.17 30);
  }
  .token.comment,
  .token.prolog,
  .token.doctype,
  .token.cdata {
    color: var(--syntax-comment);
    font-style: italic;
  }
  .token.punctuation {
    color: var(--syntax-comment);
  }
  .token.property {
    color: var(--ore);
  }
  .token.tag,
  .token.constant,
  .token.symbol {
    color: var(--syntax-tag);
  }
  .token.deleted {
    color: var(--ember);
  }
  .token.selector,
  .token.string,
  .token.char,
  .token.builtin,
  .token.inserted {
    color: var(--syntax-string);
  }
  .token.attr-name {
    color: var(--ember-soft);
  }
  .token.number,
  .token.boolean {
    color: var(--hearth);
  }
  .token.attr-value,
  .token.atrule,
  .token.keyword {
    color: var(--amber);
  }
  .token.function,
  .token.class-name {
    color: var(--chalk);
    font-weight: 600;
  }
  .token.regex,
  .token.important,
  .token.variable {
    color: var(--ember);
  }
  .token.operator,
  .token.entity,
  .token.url {
    color: var(--sage);
  }

  /* Tables */
  table {
    border-collapse: collapse;
    width: 100%;
    margin-block: var(--space-sm);
  }
  th, td {
    padding: var(--space-xxs) var(--space-xs);
    text-align: left;
    border-bottom: 1px solid var(--color-border-default);
  }
  th {
    font-family: var(--font-ui);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: var(--font-size-small);
  }

  /* Horizontal rule */
  hr {
    border: none;
    border-top: 1px solid var(--color-border-default);
    margin-block: var(--space-lg);
  }

  /* ── Page structure (retained from Client-First) ──────────────── */

  .page-wrapper {
    overflow-x: hidden;
  }

  .padding-global {
    padding-inline: 5%;
  }

  .container-large {
    max-width: 80rem;
    margin-inline: auto;
    width: 100%;
  }

  .container-medium {
    max-width: 64rem;
    margin-inline: auto;
    width: 100%;
  }

  .container-small {
    max-width: 48rem;
    margin-inline: auto;
    width: 100%;
  }
}
