/* ============================================================================
 * theme-exiles-overgrown.css — git.exil.es forge skin
 * ----------------------------------------------------------------------------
 * "Overgrown Keep" — the Exiles gold-on-dark palette (lifted verbatim from
 * db.exil.es' coa-db-exiles.css) re-cast over mossy-stone charcoal, with the
 * overgrownkeep biome's moss-green (#a8d878) as the living accent.
 *
 * Mechanism: Forgejo loads exactly ONE theme CSS for the selected theme. We
 * @import the stock forgejo-dark theme (served same-origin) so every semantic
 * token keeps resolving, then override only the two ladders that drive the
 * whole UI — `--steel-*` (all backgrounds/greys) and `--color-primary-*`
 * (accent/links/buttons) — plus the green family (success → moss) and type.
 * Re-tint those and body, boxes, header, footer, nav, inputs all follow.
 *
 * Registered via app.ini [ui] THEMES/DEFAULT_THEME = exiles-overgrown.
 * ========================================================================== */

@import url("/assets/css/theme-forgejo-dark.css");

/* ============ FONTS ============ */
@font-face {
    font-family: 'Inter';
    src: url('https://i.sub-net.at/fonts/inter-variable.woff2') format('woff2-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&display=swap");

:root {
    /* ---- Mossy-stone charcoal ladder (replaces the blue steel ramp) ----
     * Low numbers = light text, high numbers = dark backgrounds. Kept at the
     * stock luminance steps so contrast stays valid; just shifted from cold
     * blue to a faint green-grey weathered-stone cast. */
    --steel-100: #d8d6cb;
    --steel-150: #c7c5b8;
    --steel-200: #b4b3a6;
    --steel-250: #a2a194;
    --steel-300: #908f82;
    --steel-350: #7f7e72;
    --steel-400: #6f6f64;
    --steel-450: #5f6056;
    --steel-500: #4f5147;
    --steel-550: #41443b;
    --steel-600: #353930;
    --steel-650: #2a2e26;
    --steel-700: #21251d;   /* cards / secondary */
    --steel-750: #1a1e17;   /* box body */
    --steel-800: #151813;   /* page body */
    --steel-850: #11140f;   /* header wrapper */
    --steel-900: #0c0e0a;   /* footer / nav — near-black mossy */

    /* ---- Exiles gold (replaces orange primary) ---- */
    --color-primary:          #c89058;
    --color-primary-contrast: #1c1305;
    --color-primary-hover:    #e6b074;
    --color-primary-active:   #e6b074;
    --color-primary-light-1:  #e6b074;
    --color-primary-light-2:  #c89058;
    --color-primary-light-3:  #a07238;
    --color-primary-light-4:  #6b4f2e;
    --color-primary-light-5:  #6b4f2e;
    --color-primary-light-6:  #3e2c18;
    --color-primary-light-7:  #3e2c18;
    --color-primary-dark-1:   #e6b074;
    --color-primary-dark-2:   #eec092;
    --color-primary-dark-3:   #f2cda6;
    --color-primary-dark-4:   #f2cda6;
    --color-primary-dark-5:   #f7dcc1;
    --color-primary-dark-6:   #f7dcc1;
    --color-primary-dark-7:   #fbeede;
    --color-primary-alpha-10: #c8905819;
    --color-primary-alpha-20: #c8905833;
    --color-primary-alpha-30: #c890584b;
    --color-primary-alpha-40: #c8905866;
    --color-primary-alpha-50: #c8905880;
    --color-primary-alpha-60: #c8905899;
    --color-primary-alpha-70: #c89058b3;
    --color-primary-alpha-80: #c89058cc;
    --color-primary-alpha-90: #c89058e1;

    /* ---- Moss accent: success/green family → overgrownkeep #a8d878 ---- */
    --color-green:        #5e8c3a;
    --color-green-dark-1: #527e31;
    --color-green-light:  #a8d878;

    /* ---- Warm rim borders (gold-tinged, matches db.exil.es) ---- */
    --color-secondary:      #41443b;
    --color-input-border:   #4a4036;
    --color-input-border-hover: #6b4f2e;

    /* ---- Custom tokens used by the rules below ---- */
    --xe-gold:        #c89058;
    --xe-gold-bright: #e6b074;
    --xe-moss:        #a8d878;
}

/* ============ TYPE ============
 * Inter everywhere for body; Cinzel for the brand + section headings to carry
 * the Warcraft-keep feel without hurting code/diff legibility (those stay
 * mono via the stock --fonts-monospace). */
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.ui.header,
h1.ui.header, h2.ui.header, h3.ui.header,
.repository .header-wrapper .repo-header .repo-title,
.repo-title, .repository-summary,
.ui.dividing.header,
.markup h1, .markup h2 {
    font-family: 'Cinzel', 'Inter', serif;
    letter-spacing: 0.01em;
}
/* The site brand / logo text in the top bar */
.full.height > .following.bar .logo + .text,
#navbar .item.brand,
.navbar-brand,
.ui.secondary.menu .item.brand strong {
    font-family: 'Cinzel', serif;
    letter-spacing: 0.02em;
    color: var(--xe-gold);
}

/* ============ BRAND MARK ============
 * The stock Forgejo logo ships neon-orange; a warm sepia tint pulls it into
 * the gold family so the hero + navbar mark stop fighting the palette. */
img.logo, .logo img, #navbar .logo, .home .logo {
    filter: sepia(0.7) saturate(1.1) hue-rotate(1deg) brightness(0.9);
}

/* ============ ACCENT POLISH ============ */
/* Active top-nav item gets a moss underline instead of the stock bar */
.ui.secondary.menu .active.item {
    box-shadow: inset 0 -2px 0 0 var(--xe-moss);
}
/* Primary buttons: gold with a thin bright-gold rim */
.ui.primary.button,
.ui.primary.buttons .button {
    border: 1px solid var(--xe-gold-bright);
}
/* Green/success buttons + labels lean moss-bright */
.ui.green.button, .ui.green.buttons .button,
.ui.basic.green.label {
    color: #14180e;
}

/* ============ OVERGROWN-KEEP BACKDROP ============
 * The keep silhouette (overgrownkeep-mask.webp is an alpha silhouette) painted
 * as a faint moss→gold gradient watermark, fixed to the bottom of the viewport,
 * behind everything. Low opacity so it never fights the content; mask-image
 * lets us colour it ourselves instead of showing the raw mask. */
body::after {
    content: "";
    position: fixed;
    inset: auto 0 0 0;
    height: 46vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.07;
    background: linear-gradient(180deg, var(--xe-moss) 0%, var(--xe-gold) 70%);
    -webkit-mask-image: url('https://i.exil.es/exiles-landing/scenes/overgrownkeep-mask.webp');
            mask-image: url('https://i.exil.es/exiles-landing/scenes/overgrownkeep-mask.webp');
    -webkit-mask-size: cover;     mask-size: cover;
    -webkit-mask-position: center bottom; mask-position: center bottom;
    -webkit-mask-repeat: no-repeat;       mask-repeat: no-repeat;
}
/* Keep real content above the watermark (stock layout is z-auto/static). */
.full.height, .page-content, footer.page-footer { position: relative; z-index: 1; }
