/* ByteTheCookies dark theme for Forgejo, from the 2026 brand manual (Brand Manual-Dark.pdf): its tokens below,
   mapped onto forgejo-dark's variables. Only variables plus two element rules: an upgrade that renames a variable
   shows Forgejo's colour there, nothing breaks. Check after a Forgejo minor upgrade: docs/runbooks/forgejo.md#branding */
@import "./theme-forgejo-dark.css";

/* Geist and Geist Mono (OFL-1.1, @fontsource 5.3.0), served by Forgejo itself: no third-party requests */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/geist-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/geist-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/geist-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/geist-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/geist-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  /* Brand manual tokens (dark column). Everything below references these, never a hex. */
  --btc-canvas: #0b0b0c;
  --btc-recessed: #151516;
  --btc-base: #1a1a1b;
  --btc-fill: #262627;
  --btc-hairline: #262628;
  --btc-line: #343436;
  --btc-text-strong: #fafafa;
  --btc-text-subtle: #a1a1a1;
  --btc-brand: #d99a3e;
  --btc-brand-text: #edbb71;
  --btc-on-brand: #1a1206;
  --btc-caramel-100: #fae9d0;
  --btc-caramel-200: #f4d3a1;
  --btc-caramel-300: #edbb71;
  --btc-caramel-400: #e5a651;
  --btc-caramel-500: #d99a3e;
  --btc-caramel-600: #bf7f2a;
  --btc-caramel-700: #9c6422;
  --btc-caramel-800: #7a4d1d;
  --btc-caramel-900: #5c3a17;
  /* status: icon/text colour and card background as drawn in the manual */
  --btc-success: #34d399;
  --btc-success-bg: #0b231c;
  --btc-danger: #ef4444;
  --btc-danger-text: #fca5a5;
  --btc-danger-bg: #2b1313;
  --btc-warning: #f59e0b;
  --btc-warning-text: #fcd34d;
  --btc-warning-bg: #2c1f0b;
  --btc-info: #60a5fa;
  --btc-info-bg: #121e31;

  /* forgejo-dark derives most surfaces and greys from this scale: true neutrals, canvas (900) to text-strong (100);
     the steps between the manual's tokens are interpolated */
  --steel-900: var(--btc-canvas);
  --steel-850: #111112;
  --steel-800: var(--btc-recessed);
  --steel-750: var(--btc-base);
  --steel-700: #202021;
  --steel-650: var(--btc-fill);
  --steel-600: var(--btc-line);
  --steel-550: #3f3f42;
  --steel-500: #4e4e51;
  --steel-450: #5e5e61;
  --steel-400: #707073;
  --steel-350: #858588;
  --steel-300: var(--btc-text-subtle);
  --steel-250: #b8b8b8;
  --steel-200: #cfcfcf;
  --steel-150: #e4e4e4;
  --steel-100: var(--btc-text-strong);

  /* caramel: in Forgejo's dark themes "dark-N" is lighter and "light-N" darker. Text on caramel = On caramel */
  --color-primary: var(--btc-brand);
  --color-primary-contrast: var(--btc-on-brand);
  --color-primary-dark-1: var(--btc-caramel-400);
  --color-primary-dark-2: var(--btc-caramel-400);
  --color-primary-dark-3: var(--btc-caramel-300);
  --color-primary-dark-4: var(--btc-caramel-300);
  --color-primary-dark-5: var(--btc-caramel-200);
  --color-primary-dark-6: var(--btc-caramel-200);
  --color-primary-dark-7: var(--btc-caramel-100);
  --color-primary-light-1: var(--btc-caramel-600);
  --color-primary-light-2: var(--btc-caramel-600);
  --color-primary-light-3: var(--btc-caramel-700);
  --color-primary-light-4: var(--btc-caramel-700);
  --color-primary-light-5: var(--btc-caramel-800);
  --color-primary-light-6: var(--btc-caramel-800);
  --color-primary-light-7: var(--btc-caramel-900);
  --color-primary-alpha-10: #d99a3e19;
  --color-primary-alpha-20: #d99a3e33;
  --color-primary-alpha-30: #d99a3e4b;
  --color-primary-alpha-40: #d99a3e66;
  --color-primary-alpha-50: #d99a3e80;
  --color-primary-alpha-60: #d99a3e99;
  --color-primary-alpha-70: #d99a3eb3;
  --color-primary-alpha-80: #d99a3ecc;
  --color-primary-alpha-90: #d99a3ee1;
  --color-primary-hover: var(--color-primary-dark-1);
  --color-primary-active: var(--color-primary-light-1);

  /* Forgejo's "secondary" is its border colour */
  --color-secondary: var(--btc-hairline);
  --color-secondary-alpha-10: #26262819;
  --color-secondary-alpha-20: #26262833;
  --color-secondary-alpha-30: #2626284b;
  --color-secondary-alpha-40: #26262866;
  --color-secondary-alpha-50: #26262880;
  --color-secondary-alpha-60: #26262899;
  --color-secondary-alpha-70: #262628b3;
  --color-secondary-alpha-80: #262628cc;
  --color-secondary-alpha-90: #262628e1;

  /* status. The saturated tones are too light for white button text (merge, delete): buttons keep a darker step,
     badges, banners and icons use the manual's colours */
  --color-red: #dc2626;
  --color-red-light: var(--btc-danger);
  --color-green: #059669;
  --color-green-light: var(--btc-success);
  --color-yellow: #d97706;
  --color-yellow-light: var(--btc-warning);
  --color-blue: #2563eb;
  --color-blue-light: var(--btc-info);
  --color-orange: var(--btc-brand);
  --color-orange-light: var(--btc-caramel-400);
  --color-gold: var(--btc-brand);
  --color-error-border: #5c2323;
  --color-error-bg: var(--btc-danger-bg);
  --color-error-bg-active: #3b1a1a;
  --color-error-bg-hover: #3b1a1a;
  --color-error-text: var(--btc-danger-text);
  --color-success-border: #1c5a44;
  --color-success-bg: var(--btc-success-bg);
  --color-success-text: #6ee7b7;
  --color-warning-border: #5e4210;
  --color-warning-bg: var(--btc-warning-bg);
  --color-warning-text: var(--btc-warning-text);
  --color-info-border: #24406a;
  --color-info-bg: var(--btc-info-bg);
  --color-info-text: #93c5fd;
  --color-red-badge: var(--btc-danger);
  --color-red-badge-bg: #ef444422;
  --color-red-badge-hover-bg: #ef444444;
  --color-green-badge: var(--btc-success);
  --color-green-badge-bg: #34d39922;
  --color-green-badge-hover-bg: #34d39944;
  --color-yellow-badge: var(--btc-warning);
  --color-yellow-badge-bg: #f59e0b22;
  --color-yellow-badge-hover-bg: #f59e0b44;
  --color-orange-badge: var(--btc-brand);
  --color-orange-badge-bg: #d99a3e22;
  --color-orange-badge-hover-bg: #d99a3e44;

  /* surfaces by the manual's roles: page = canvas, cards = base, table/box heads and wells = recessed,
     hover/selected = fill, flat borders = hairline, floating edges and inputs = line */
  --color-body: var(--btc-canvas);
  --color-box-header: var(--btc-recessed);
  --color-box-body: var(--btc-base);
  --color-box-body-highlight: var(--btc-fill);
  --color-text: var(--btc-text-strong);
  --color-text-light: var(--steel-150);
  --color-text-light-1: var(--steel-200);
  --color-text-light-2: var(--btc-text-subtle);
  --color-text-light-3: var(--btc-text-subtle);
  --color-placeholder-text: var(--steel-350);
  --color-footer: var(--btc-recessed);
  --color-header-wrapper: var(--btc-recessed);
  --color-header-wrapper-transparent: #15151600;
  --color-nav-bg: var(--btc-recessed);
  --color-nav-hover-bg: var(--btc-fill);
  --color-secondary-nav-bg: var(--btc-canvas);
  --color-input-background: var(--btc-recessed);
  --color-input-toggle-background: var(--btc-fill);
  --color-input-border: var(--btc-line);
  --color-input-border-hover: var(--steel-450);
  --color-light-border: var(--btc-hairline);
  --color-hover: var(--btc-fill);
  --color-active: var(--btc-fill);
  --color-menu: var(--btc-base);
  --color-card: var(--btc-base);
  --fancy-card-bg: var(--btc-base);
  --fancy-card-border: var(--btc-line);
  --color-button: var(--btc-base);
  --color-code-bg: var(--btc-recessed);
  --color-markup-code-block: var(--btc-recessed);
  --color-markup-code-inline: var(--btc-fill);
  --color-secondary-bg: var(--btc-fill);
  --color-label-bg: var(--btc-fill);
  --color-label-hover-bg: var(--btc-line);
  --color-console-bg: var(--btc-recessed);
  --color-console-border: var(--btc-line);
  --color-overlay-backdrop: #0b0b0cc0;
  --color-selection-bg: var(--btc-brand);
  --color-selection-fg: var(--btc-on-brand);

  /* radius: 8 buttons and inputs, 12 cards and dialogs */
  --border-radius: 8px;
  --border-radius-medium: 12px;

  /* Geist for everything you read, Geist Mono for everything you copy (code, hashes, IPs) */
  --fonts-proportional: "Geist", -apple-system, "Segoe UI", system-ui, "Noto Sans", Roboto, Arial;
  --fonts-monospace: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace, var(--fonts-emoji);
}

/* links in the manual's "brand-text" caramel, not the button caramel */
a {
  color: var(--btc-brand-text);
}

/* headings: weight 600 and the manual's negative tracking; README/issue content (.markup) keeps Forgejo's */
:is(h1, h2, h3, .ui.header):not(.markup *) {
  font-weight: 600;
  letter-spacing: -0.02em;
}
