/* =============================================================================
 * Putki brand theme for Forgejo — matches www.putki.io and demo.putki.io.
 *
 * Both of those sites are built on one palette: navy #131f35 ground, brand blue
 * #1e7fb1, pale blue #c8e7fa accent, #e9f2f7 text, DM Sans / DM Mono type.
 * This file re-tints Forgejo with the same tokens.
 *
 * HOW IT WORKS
 * Forgejo's dark theme is a single :root block built on two scales: --steel-*
 * (17 neutral stops that drive every surface, border and text colour) and
 * --color-primary-* (the accent ramp). So instead of forking the whole theme we
 * @import the stock one and redefine only those two scales plus the fonts. Our
 * :root comes after the import, so it wins on order at equal specificity.
 *
 * UPGRADE SAFETY
 * Because the base is imported rather than copied, a Forgejo bump picks up
 * upstream's new variables automatically — unlike templates/repo/release/list.tmpl,
 * this file is NOT pinned to a Forgejo version. Only re-check it if upstream
 * renames the --steel or --color-primary scales, or stops shipping
 * theme-forgejo-dark.css.
 * Assets are served with max-age=21600, so a browser can hold the old base for
 * up to 6h after an upgrade; a hard reload clears it.
 *
 * Activated in compose/docker-compose.yml via FORGEJO__ui__DEFAULT_THEME=putki.
 * The stock themes stay in THEMES so anyone who prefers light can switch.
 * ========================================================================== */

@import url("theme-forgejo-dark.css");
/* Same font request www.putki.io and demo.putki.io make, so a visitor arriving
   from either already has it cached. Falls back to the system UI stack offline. */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");

:root {
  /* --- Neutral scale ------------------------------------------------------
     Putki navy, generated in OKLCH against three fixed brand anchors:
       800 = #131f35  (site background)   -> --color-body
       850 = #101a2d  (panel background)  -> --color-header-wrapper
       100 = #e9f2f7  (body text)         -> --color-text
     The remaining stops interpolate on upstream's lightness spacing, with hue
     easing 263deg -> 232deg so the pale end picks up the #c8e7fa accent tilt
     instead of going lavender. Text on body lands at 14.5:1. */
  --steel-900: #0c1527;
  --steel-850: #101a2d;
  --steel-800: #131f35;
  --steel-750: #1a283e;
  --steel-700: #203047;
  --steel-650: #283952;
  --steel-600: #344861;
  --steel-550: #425871;
  --steel-500: #4f6780;
  --steel-450: #5f7890;
  --steel-400: #6e88a0;
  --steel-350: #7f99af;
  --steel-300: #92aabe;
  --steel-250: #a5bdce;
  --steel-200: #bbcfdc;
  --steel-150: #d2e0ea;
  --steel-100: #e9f2f7;

  /* --- Accent ramp --------------------------------------------------------
     Putki blue at upstream's tonal spacing. Two stops are exact brand values:
     #1e7fb1 (the www.putki.io button fill) and #c8e7fa (the accent).
     Like every Forgejo dark theme the ramp is inverted: -light-N goes *darker*
     (away from the text), -dark-N goes lighter. */
  --color-primary: #2e98cf;
  --color-primary-contrast: #08121f;
  /* Upstream darkens on hover (hover -> light-1). The Putki sites lighten
     (#1e7fb1 -> #2596cc), so hover/active point at -dark-N instead. */
  --color-primary-hover: var(--color-primary-dark-1);
  --color-primary-active: var(--color-primary-dark-2);

  --color-primary-light-1: #1e7fb1;
  --color-primary-light-2: #136288;
  --color-primary-light-3: #16506e;
  --color-primary-light-4: #16506e;
  --color-primary-light-5: #123f57;
  --color-primary-light-6: #123f57;
  --color-primary-light-7: #0e3145;

  --color-primary-dark-1: #4dabde;
  --color-primary-dark-2: #71bae6;
  --color-primary-dark-3: #9fd1f1;
  --color-primary-dark-4: #9fd1f1;
  --color-primary-dark-5: #c8e7fa;
  --color-primary-dark-6: #e3f3fd;
  --color-primary-dark-7: #f3f9fe;

  /* Keyed to the brand blue, so tints match the portal's rgba(30,127,177,.12). */
  --color-primary-alpha-10: #1e7fb119;
  --color-primary-alpha-20: #1e7fb133;
  --color-primary-alpha-30: #1e7fb14b;
  --color-primary-alpha-40: #1e7fb166;
  --color-primary-alpha-50: #1e7fb180;
  --color-primary-alpha-60: #1e7fb199;
  --color-primary-alpha-70: #1e7fb1b3;
  --color-primary-alpha-80: #1e7fb1cc;
  --color-primary-alpha-90: #1e7fb1e1;

  /* --- Surfaces upstream hardcodes off-scale ------------------------------
     These are slate greys in the stock theme and would read as a cold patch
     against the navy. Same lightness, re-tinted to the brand hue. The CI job
     log viewer is the visible one. */
  --color-black: #101827;
  --color-black-dark-1: #0e1624;
  --color-black-dark-2: #101827;
  --color-black-light: #202937;
  --color-console-bg: #192230;
  --color-console-border: #313d50;
  --color-console-menu-bg: #313d50;
  --color-console-menu-border: #576479;
  --color-console-active-bg: #3e4b5f;
  --color-expand-button: #354155;

  /* --- Type ---------------------------------------------------------------
     --fonts-regular resolves as var(--fonts-override, var(--fonts-proportional)),
     so this one variable swaps the UI face while keeping upstream's fallback
     chain and per-locale CJK overrides intact.
     Monospace is deliberately left alone: DM Mono is the brand's label face, not
     a code face, and this UI renders diffs and job logs. */
  --fonts-override: "DM Sans";
}

/* The ambient glow both Putki sites carry behind their content. Fixed to the
   viewport like the portal's body::before, and painted under Forgejo's own
   opaque panels so only the page ground shows it. */
body {
  background-image:
    radial-gradient(ellipse 80% 50% at 30% 0%, rgba(30, 127, 177, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 95% 8%, rgba(200, 231, 250, 0.05), transparent 50%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}
