@layer reset, tokens, base, layout, components, utilities;

@layer tokens {
  :root {
    color-scheme: dark;

    /* Matte Archival Sumi-Ink Palette — harmonized with 0-x antique brass */
    --bg: #0b0b0a;
    --bg-subtle: #121210;
    --bg-hover: #161614;
    --bg-dialog: #111110;
    --bg-header: rgba(11, 11, 10, 0.88);
    --bg-logo-canvas: #161614;

    --ink: #eeece7;
    --ink-2: #9d9991;
    --ink-3: #78746d;

    --rule: rgba(238, 236, 231, 0.11);
    --rule-strong: rgba(238, 236, 231, 0.24);
    --logo-border: rgba(238, 236, 231, 0.14);

    /* Single quiet aristocratic accent: Brushed Antique Brass */
    --brass: #c9a86c;
    --brass-subtle: rgba(201, 168, 108, 0.12);

    /* Typography */
    --font-serif: 'Cormorant Garamond', 'Noto Serif SC', 'Songti SC', 'STSong', Georgia, serif;
    --font-sans: 'Inter', 'Noto Sans SC', 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, monospace;

    /* Swiss Editorial Grid */
    --max-w: 1120px;
    --rail-w: 224px;
    --gutter: clamp(1.25rem, 4vw, 3rem);
    --header-h: 56px;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
  }

  :root[data-surface='paper'] {
    color-scheme: light;

    /* Unbleached Archival Cotton Paper Palette */
    --bg: #f3f0e8;
    --bg-subtle: #ebe7dd;
    --bg-hover: #e7e2d7;
    --bg-dialog: #f7f4ec;
    --bg-header: rgba(243, 240, 232, 0.9);
    --bg-logo-canvas: #141413;

    --ink: #151513;
    --ink-2: #4f4c46;
    --ink-3: #6c6860;

    --rule: rgba(21, 21, 19, 0.12);
    --rule-strong: rgba(21, 21, 19, 0.28);
    --logo-border: rgba(21, 21, 19, 0.12);

    --brass: #8b692e;
    --brass-subtle: rgba(139, 105, 46, 0.1);
  }

  @media (prefers-contrast: more) {
    :root {
      --ink-2: #c5c1b8;
      --ink-3: #a19d95;
      --rule: rgba(238, 236, 231, 0.24);
      --rule-strong: rgba(238, 236, 231, 0.45);
    }

    :root[data-surface='paper'] {
      --ink-2: #2d2b27;
      --ink-3: #46433e;
      --rule: rgba(21, 21, 19, 0.26);
      --rule-strong: rgba(21, 21, 19, 0.5);
    }
  }

  @media (forced-colors: active) {
    :root,
    :root[data-surface='paper'] {
      --bg: Canvas;
      --bg-subtle: Canvas;
      --bg-hover: Canvas;
      --ink: CanvasText;
      --ink-2: CanvasText;
      --ink-3: GrayText;
      --rule: CanvasText;
      --rule-strong: Highlight;
      --brass: Highlight;
    }
  }
}
