/* === ScriptRiva local fonts START === */
@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/quicksand-01.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/quicksand-02.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/quicksand-03.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/quicksand-04.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/quicksand-05.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/quicksand-06.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/quicksand-07.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/quicksand-08.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/quicksand-09.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/quicksand-10.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/quicksand-11.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/quicksand-12.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Railway';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/railway-01.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: 'Railway';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/railway-02.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Railway';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/railway-03.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: 'Railway';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/railway-04.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Railway';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/railway-05.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Railway';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/railway-06.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: 'Railway';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/railway-07.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Railway';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/railway-08.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: 'Railway';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/railway-09.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Railway';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url(/assets/fonts/scriptriva/railway-10.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* === ScriptRiva local fonts END === */

gitea-theme-meta-info {
  --theme-display-name: "ScriptRiva";
  --theme-description: "ScriptRiva black, violet, and glass-dark theme";
}

:root {
  --is-dark-theme: true;

  /* Brand */
  --sr-bg: #111111;
  --sr-bg-deep: #080809;
  --sr-panel: #17111f;
  --sr-panel-soft: rgba(33, 22, 48, 0.72);
  --sr-purple: #8b5cf6;
  --sr-purple-strong: #7c3aed;
  --sr-purple-soft: rgba(139, 92, 246, 0.24);

  /* Gitea core palette */
  --color-primary: #8b5cf6;
  --color-primary-dark-1: #7c3aed;
  --color-primary-dark-2: #6d28d9;
  --color-primary-dark-3: #5b21b6;
  --color-primary-dark-4: #4c1d95;
  --color-primary-dark-5: #3b176f;
  --color-primary-dark-6: #2d1255;
  --color-primary-dark-7: #211039;
  --color-primary-light-1: #9f7aea;
  --color-primary-light-2: #a78bfa;
  --color-primary-light-3: #c4b5fd;
  --color-primary-light-4: #ddd6fe;
  --color-primary-light-5: #ede9fe;
  --color-primary-light-6: #f5f3ff;
  --color-primary-light-7: #faf5ff;

  --color-body: #111111;
  --color-box-header: #18121f;
  --color-box-body: #100f12;
  --color-box-body-highlight: #18121f;
  --color-text: rgba(255, 255, 255, 0.94);
  --color-text-light: rgba(255, 255, 255, 0.72);
  --color-text-light-1: rgba(255, 255, 255, 0.64);
  --color-text-light-2: rgba(255, 255, 255, 0.54);
  --color-text-light-3: rgba(255, 255, 255, 0.44);
  --color-footer: #0b0b0c;
  --color-timeline: rgba(139, 92, 246, 0.22);

  --color-input-background: #111014;
  --color-input-border: rgba(139, 92, 246, 0.28);
  --color-input-text: rgba(255, 255, 255, 0.94);
  --color-input-toggle-background: #18121f;

  --color-navbar: #0b0b0c;
  --color-navbar-transparent: rgba(11, 11, 12, 0.92);

  --color-menu: #111014;
  --color-card: #111014;
  --color-markup-table-row: #111014;
  --color-markup-code-block: #0b0b0c;
  --color-markup-code-inline: rgba(139, 92, 246, 0.18);

  --color-secondary: rgba(255, 255, 255, 0.08);
  --color-secondary-dark-1: rgba(255, 255, 255, 0.10);
  --color-secondary-dark-2: rgba(255, 255, 255, 0.12);
  --color-secondary-dark-3: rgba(255, 255, 255, 0.15);
  --color-secondary-dark-4: rgba(255, 255, 255, 0.18);
  --color-secondary-dark-5: rgba(255, 255, 255, 0.22);
  --color-secondary-light-1: rgba(255, 255, 255, 0.10);
  --color-secondary-light-2: rgba(255, 255, 255, 0.13);
  --color-secondary-light-3: rgba(255, 255, 255, 0.16);
  --color-secondary-light-4: rgba(255, 255, 255, 0.20);

  --color-border: rgba(139, 92, 246, 0.22);
  --color-light-border: rgba(255, 255, 255, 0.10);
  --color-hover: rgba(139, 92, 246, 0.12);
  --color-active: rgba(139, 92, 246, 0.20);
  --color-small-accent: #8b5cf6;

  --color-code-bg: #0b0b0c;
  --color-code-sidebar-bg: #111014;
  --color-diff-removed-row-bg: rgba(248, 81, 73, 0.12);
  --color-diff-added-row-bg: rgba(46, 160, 67, 0.12);

  --fonts-proportional: "Quicksand", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --fonts-monospace: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* General surface polish */
body {
  background:
    radial-gradient(circle at 12% 0%, rgba(124, 58, 237, 0.20), transparent 32rem),
    radial-gradient(circle at 88% 8%, rgba(139, 92, 246, 0.12), transparent 28rem),
    linear-gradient(180deg, #111111 0%, #0d0d0e 48%, #111111 100%) !important;
  color: var(--color-text) !important;
  font-family: var(--fonts-proportional) !important;
}

body,
.ui,
.ui.button,
.ui.input input,
.ui.menu,
.repository,
.markdown,
.markup {
  font-family: var(--fonts-proportional) !important;
}

/* Navbar */
.following.bar.light,
.following.bar,
.ui.secondary.menu,
#navbar {
  background: rgba(10, 10, 11, 0.88) !important;
  border-bottom: 1px solid rgba(139, 92, 246, 0.18) !important;
  backdrop-filter: blur(18px);
}

.ui.menu .item,
.ui.secondary.menu .item {
  color: rgba(255, 255, 255, 0.78) !important;
}

.ui.menu .item:hover,
.ui.secondary.menu .item:hover {
  color: #ffffff !important;
  background: rgba(139, 92, 246, 0.10) !important;
}

/* Panels/cards */
.ui.segment,
.ui.segments,
.ui.card,
.ui.cards > .card,
.repository .header-wrapper,
.repository .repo-header,
.repo-description,
.repository.file.list #repo-files-table,
.repository.view.issue .comment-list .comment,
.timeline-item .content,
.ui.attached.segment {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.045), rgba(139,92,246,0.025)),
    rgba(10,10,11,0.72) !important;
  border-color: rgba(139, 92, 246, 0.18) !important;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

/* Repository/file tables */
.repository.file.list #repo-files-table th,
.repository.file.list #repo-files-table td,
.ui.table,
.ui.table tr,
.ui.table td,
.ui.table th {
  background-color: transparent !important;
  border-color: rgba(139, 92, 246, 0.14) !important;
}

.ui.table tbody tr:hover,
.repository.file.list #repo-files-table tbody tr:hover {
  background: rgba(139, 92, 246, 0.10) !important;
}

/* Buttons */
.ui.primary.button,
.ui.primary.buttons .button,
button.ui.primary.button,
a.ui.primary.button {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  box-shadow: 0 12px 36px rgba(124, 58, 237, 0.24);
}

.ui.primary.button:hover,
.ui.primary.buttons .button:hover,
button.ui.primary.button:hover,
a.ui.primary.button:hover {
  background: linear-gradient(135deg, #9f7aea, #8b5cf6) !important;
}

.ui.button,
.ui.buttons .button {
  background: rgba(255,255,255,0.07) !important;
  color: rgba(255,255,255,0.88) !important;
  border-color: rgba(139, 92, 246, 0.18) !important;
}

.ui.button:hover,
.ui.buttons .button:hover {
  background: rgba(139, 92, 246, 0.16) !important;
  color: #ffffff !important;
}

/* Inputs */
input,
textarea,
.ui.input input,
.ui.form input,
.ui.form textarea,
.ui.dropdown,
.ui.selection.dropdown {
  background: rgba(8, 8, 9, 0.80) !important;
  color: rgba(255,255,255,0.94) !important;
  border-color: rgba(139, 92, 246, 0.26) !important;
}

input:focus,
textarea:focus,
.ui.input input:focus,
.ui.form input:focus,
.ui.form textarea:focus,
.ui.selection.dropdown:focus {
  border-color: rgba(168, 85, 247, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15) !important;
}

/* Labels and badges */
.ui.label,
.repository .ui.label,
.issue.list .labels .label {
  background: rgba(139, 92, 246, 0.16) !important;
  color: rgba(255,255,255,0.92) !important;
  border-color: rgba(139, 92, 246, 0.26) !important;
}

/* Links */
a,
.ui.breadcrumb a,
.repository .repo-title a {
  color: #c4b5fd;
}

a:hover,
.ui.breadcrumb a:hover,
.repository .repo-title a:hover {
  color: #ffffff;
}

/* Code blocks */
.markup pre,
.markup code,
.code-view,
.blob-excerpt,
.lines-code,
.lines-num {
  background: #09090a !important;
}

.lines-num,
.code-line-menu {
  color: rgba(255,255,255,0.42) !important;
}

/* Tabs */
.ui.tabular.menu .active.item,
.ui.tabular.menu .item:hover {
  background: rgba(139, 92, 246, 0.12) !important;
  border-color: rgba(139, 92, 246, 0.22) !important;
  color: #ffffff !important;
}

/* Footer */
footer,
.page-footer {
  background: #080809 !important;
  border-top: 1px solid rgba(139, 92, 246, 0.16) !important;
  color: rgba(255,255,255,0.58) !important;
}

/* === ScriptRiva local-font theme overrides START === */

body,
.ui,
.ui.button,
.ui.input input,
.ui.menu,
.repository,
.markdown,
.markup {
  font-family: "Quicksand", "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

/* Keep the purple corporate theme, but avoid global heavy blur effects. */
.following.bar,
.following.bar.light,
#navbar {
  backdrop-filter: none !important;
}

:root {
  --fonts-proportional: "Quicksand", "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* === ScriptRiva local-font theme overrides END === */

/* === ScriptRiva smooth gradients START === */

/*
  Fixes the visible horizontal/rectangular gradient banding on long Gitea pages.
  Gradients are CSS images; without explicit repeat/size/attachment rules, they
  can appear as tiled or sectioned surfaces on long repository/README pages.
*/

html {
  background-color: #111111 !important;
}

body {
  min-height: 100vh;
  background-color: #111111 !important;
  background-image:
    radial-gradient(900px 620px at 12% -8%, rgba(124,58,237,.22), transparent 72%),
    radial-gradient(860px 620px at 88% -4%, rgba(139,92,246,.14), transparent 72%),
    radial-gradient(760px 520px at 50% 10%, rgba(255,255,255,.045), transparent 70%),
    linear-gradient(180deg, #121212 0%, #0d0d0e 52%, #111111 100%) !important;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat !important;
  background-size: 900px 620px, 860px 620px, 760px 520px, 100% 100% !important;
  background-position: left -180px top -160px, right -160px top -120px, center top -120px, center center !important;
  background-attachment: fixed, fixed, fixed, fixed !important;
  font-family: "Quicksand", "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

/* Keep Gitea's page containers from painting large opaque rectangles over the gradient. */
.full.height,
.page-content,
.repository,
.repository .ui.container,
.repository .ui.container.fluid {
  background: transparent !important;
}

/* Keep content surfaces readable without large, expensive shadow/blur fields. */
.ui.segment,
.ui.segments,
.ui.card,
.ui.cards > .card,
.repository .header-wrapper,
.repository .repo-header,
.repository.file.list #repo-files-table,
.repository.view.issue .comment-list .comment,
.timeline-item .content,
.ui.attached.segment,
.markup {
  background:
    linear-gradient(135deg, rgba(35,22,52,.72), rgba(12,12,13,.88) 44%, rgba(12,12,13,.94)),
    rgba(0,0,0,.26) !important;
  border-color: rgba(139,92,246,.18) !important;
  box-shadow: 0 18px 58px rgba(0,0,0,.20) !important;
}

/* README / markdown content should feel integrated, not boxed into a flat purple slab. */
.repository .markup,
.repository .file-view,
.repository .render-content,
.repository .readme {
  background:
    linear-gradient(135deg, rgba(20,14,30,.54), rgba(12,12,13,.86) 42%, rgba(12,12,13,.92)) !important;
  border-color: rgba(139,92,246,.14) !important;
}

body,
.ui,
.ui.button,
.ui.input input,
.ui.menu,
.repository,
.markdown,
.markup {
  font-family: "Quicksand", "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

:root {
  --fonts-proportional: "Quicksand", "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Reduce expensive global visual effects while preserving the dark-violet palette. */
.following.bar,
.following.bar.light,
#navbar {
  backdrop-filter: none !important;
  background: rgba(10,10,11,.94) !important;
}

@media (max-width: 800px) {
  body {
    background-attachment: scroll, scroll, scroll, scroll !important;
    background-size: 760px 520px, 720px 520px, 660px 460px, 100% 100% !important;
  }
}

/* === ScriptRiva smooth gradients END === */


/* === ScriptRiva unified background layer START === */

/*
  This fixes the visible "chunked gradient" on repository/README pages.
  The gradient must be a single viewport layer, not a background repeatedly
  painted by README panels, repository containers, or rendered markdown blocks.
*/

html {
  background: #111111 !important;
}

body {
  position: relative !important;
  isolation: isolate !important;
  min-height: 100vh !important;
  background: #111111 !important;
  overflow-x: hidden !important;
}

/* One continuous gradient layer for the entire viewport. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 620px at 10% -10%, rgba(124, 58, 237, .24), transparent 72%),
    radial-gradient(850px 620px at 92% -8%, rgba(139, 92, 246, .15), transparent 74%),
    radial-gradient(740px 520px at 50% 4%, rgba(255,255,255,.045), transparent 70%),
    linear-gradient(180deg, #121212 0%, #0d0d0e 52%, #111111 100%);
  background-repeat: no-repeat;
  background-size: 900px 620px, 850px 620px, 740px 520px, 100% 100%;
  background-position: left -150px top -140px, right -140px top -130px, center top -120px, center center;
}

/* Keep actual Gitea content above the fixed background layer. */
body > *:not(script):not(style) {
  position: relative;
  z-index: 1;
}

/*
  Stop large page wrappers from painting their own rectangular backgrounds.
  These were causing the obvious purple/black horizontal bands.
*/
.full.height,
.page-content,
.repository,
.repository .ui.container,
.repository .ui.container.fluid,
.repository .repo-content,
.repository .repo-header,
.repository .header-wrapper,
.repository .repository-summary,
.repository .repository-menu,
.repository .file-view,
.repository .render-content,
.repository .readme,
.repository .markup {
  background: transparent !important;
  background-image: none !important;
}

/* Give actual readable content a local panel, but not a giant gradient slab. */
.repository .file-view,
.repository .readme,
.repository .render-content,
.repository .markup,
.repository.file.list #repo-files-table,
.repository .diff-detail-box,
.repository .issue-content,
.ui.segment,
.ui.attached.segment,
.ui.segments,
.ui.card,
.ui.cards > .card {
  background:
    linear-gradient(180deg, rgba(18,18,20,.88), rgba(10,10,12,.92)) !important;
  border-color: rgba(139, 92, 246, .16) !important;
  box-shadow: none !important;
}

/* README markdown should sit inside the panel without painting another full layer. */
.repository .markup.markdown,
.repository .markdown,
.markup {
  background: transparent !important;
  background-image: none !important;
}

/* Tables and file lists should not create their own gradient rectangles. */
.ui.table,
.ui.table tr,
.ui.table td,
.ui.table th,
.repository.file.list #repo-files-table th,
.repository.file.list #repo-files-table td {
  background: transparent !important;
  background-image: none !important;
  border-color: rgba(139, 92, 246, .12) !important;
}

.ui.table tbody tr:hover,
.repository.file.list #repo-files-table tbody tr:hover {
  background: rgba(139, 92, 246, .10) !important;
}

/* Navbar remains solid enough to avoid repaint artifacts. */
.following.bar,
.following.bar.light,
#navbar {
  background: rgba(10,10,11,.96) !important;
  backdrop-filter: none !important;
}

/* Keep code surfaces clean and cheap. */
.markup pre,
.markup code,
.code-view,
.blob-excerpt,
.lines-code,
.lines-num {
  background: #09090a !important;
}

/* Prevent tiled/repeated gradients on any common Gitea wrappers. */
body,
.full.height,
.page-content,
.repository,
.ui.segment,
.ui.attached.segment,
.repository .readme,
.repository .markup,
.repository .render-content {
  background-repeat: no-repeat !important;
}

/* Mobile: fixed pseudo backgrounds can be janky on some browsers. */
@media (max-width: 800px) {
  body::before {
    position: absolute;
    min-height: 100vh;
  }
}

/* === ScriptRiva unified background layer END === */


/* === ScriptRiva repository vertical background START === */

/*
  Repository pages only:
  Replace the horizontal/radial purple field with a vertical-only gradient.
  This avoids the visible horizontal chunking/banding around file lists and README blocks.
*/

body:has(.repository) {
  background: #111111 !important;
  background-image: none !important;
}

/* Override the previous global body::before gradient only on repository pages. */
body:has(.repository)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  background:
    linear-gradient(
      180deg,
      rgba(124, 58, 237, .20) 0%,
      rgba(31, 20, 45, .18) 18%,
      rgba(17, 17, 17, .98) 42%,
      rgba(17, 17, 17, 1) 58%,
      rgba(31, 20, 45, .22) 78%,
      rgba(124, 58, 237, .16) 100%
    ) !important;

  background-repeat: no-repeat !important;
  background-size: 100% 100vh !important;
  background-position: center top !important;
}

/* Keep repository content above the fixed background layer. */
body:has(.repository) > *:not(script):not(style) {
  position: relative;
  z-index: 1;
}

/*
  Force repository wrappers to stop painting horizontal/radial surfaces.
  They should be transparent or simple local panels only.
*/
body:has(.repository) .full.height,
body:has(.repository) .page-content,
body:has(.repository) .repository,
body:has(.repository) .repository .ui.container,
body:has(.repository) .repository .ui.container.fluid,
body:has(.repository) .repository .repo-content,
body:has(.repository) .repository .repo-header,
body:has(.repository) .repository .header-wrapper,
body:has(.repository) .repository .repository-summary,
body:has(.repository) .repository .repository-menu {
  background: transparent !important;
  background-image: none !important;
}

/* File list and README become plain dark-glass panels, not gradient slabs. */
body:has(.repository) .repository.file.list #repo-files-table,
body:has(.repository) .repository .file-view,
body:has(.repository) .repository .readme,
body:has(.repository) .repository .render-content,
body:has(.repository) .repository .markup,
body:has(.repository) .ui.segment,
body:has(.repository) .ui.attached.segment,
body:has(.repository) .ui.segments {
  background:
    linear-gradient(
      180deg,
      rgba(18, 18, 20, .92),
      rgba(10, 10, 12, .94)
    ) !important;
  background-repeat: no-repeat !important;
  background-size: 100% 100% !important;
  border-color: rgba(139, 92, 246, .15) !important;
  box-shadow: none !important;
}

/* Markdown inside README should not create another background rectangle. */
body:has(.repository) .repository .markup.markdown,
body:has(.repository) .repository .markdown {
  background: transparent !important;
  background-image: none !important;
}

/* File tables should remain transparent inside their panel. */
body:has(.repository) .ui.table,
body:has(.repository) .ui.table tr,
body:has(.repository) .ui.table td,
body:has(.repository) .ui.table th,
body:has(.repository) .repository.file.list #repo-files-table th,
body:has(.repository) .repository.file.list #repo-files-table td {
  background: transparent !important;
  background-image: none !important;
  border-color: rgba(139, 92, 246, .12) !important;
}

body:has(.repository) .ui.table tbody tr:hover,
body:has(.repository) .repository.file.list #repo-files-table tbody tr:hover {
  background: rgba(139, 92, 246, .09) !important;
}

/*
  If any older rule still injects radial gradients into repository panels,
  this suppresses them without affecting the homepage.
*/
body:has(.repository) .repository *,
body:has(.repository) .repository *::before,
body:has(.repository) .repository *::after {
  background-repeat: no-repeat;
}

/* Mobile fallback: avoid fixed pseudo-layer jank. */
@media (max-width: 800px) {
  body:has(.repository)::before {
    position: absolute;
    min-height: 100vh;
    background-size: 100% 100% !important;
  }
}

/* === ScriptRiva repository vertical background END === */








/* === ScriptRiva production footer START === */

footer,
.page-footer {
  width: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border-top: 1px solid rgba(139, 92, 246, .14) !important;
  background:
    linear-gradient(90deg, rgba(124, 58, 237, .075), rgba(8, 8, 9, .985) 24%, rgba(8, 8, 9, .985) 76%, rgba(124, 58, 237, .05)) !important;
  color: rgba(255,255,255,.64) !important;
}

/* Once mounted, only the custom footer bar is visible. */
footer.srf-mounted > *:not(.srf-frame):not(script):not(style),
.page-footer.srf-mounted > *:not(.srf-frame):not(script):not(style) {
  display: none !important;
}

footer.srf-mounted .srf-frame,
.page-footer.srf-mounted .srf-frame {
  width: 100% !important;
  max-width: none !important;
  min-height: 64px !important;
  margin: 0 !important;
  padding: 0 clamp(1rem, 4vw, 3rem) !important;

  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  justify-content: space-between !important;

  border: 0 !important;
  background: transparent !important;
}

footer.srf-mounted .srf-zone,
.page-footer.srf-mounted .srf-zone {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  min-height: 64px !important;

  display: flex !important;
  align-items: center !important;

  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

/* No production divider lines. */
footer.srf-mounted .srf-zone + .srf-zone,
.page-footer.srf-mounted .srf-zone + .srf-zone {
  border-left: 0 !important;
}

footer.srf-mounted .srf-left,
.page-footer.srf-mounted .srf-left {
  justify-content: flex-start !important;
}

footer.srf-mounted .srf-center,
.page-footer.srf-mounted .srf-center {
  justify-content: center !important;
  text-align: center !important;
}

footer.srf-mounted .srf-right,
.page-footer.srf-mounted .srf-right {
  justify-content: flex-end !important;
}

footer.srf-mounted .srf-socials,
.page-footer.srf-mounted .srf-socials {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: .55rem !important;
}

footer.srf-mounted .srf-icon,
.page-footer.srf-mounted .srf-icon {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  padding: 0 !important;
  margin: 0 !important;
  border-radius: 11px !important;
  border: 1px solid rgba(139,92,246,.22) !important;
  background:
    linear-gradient(145deg, rgba(139,92,246,.16), rgba(255,255,255,.035)),
    rgba(0,0,0,.20) !important;
  text-decoration: none !important;
  overflow: hidden !important;
}

footer.srf-mounted .srf-icon:hover,
.page-footer.srf-mounted .srf-icon:hover {
  border-color: rgba(168,85,247,.48) !important;
  background:
    linear-gradient(145deg, rgba(139,92,246,.27), rgba(255,255,255,.055)),
    rgba(0,0,0,.24) !important;
  text-decoration: none !important;
}

footer.srf-mounted .srf-icon img,
.page-footer.srf-mounted .srf-icon img {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  display: block !important;
  object-fit: contain !important;
}

footer.srf-mounted .srf-copy,
.page-footer.srf-mounted .srf-copy {
  color: rgba(255,255,255,.66) !important;
  font-size: .86rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

footer.srf-mounted .srf-links,
.page-footer.srf-mounted .srf-links {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 1rem !important;
  white-space: nowrap !important;
}

footer.srf-mounted .srf-links a,
.page-footer.srf-mounted .srf-links a {
  color: rgba(255,255,255,.60) !important;
  font-size: .86rem !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}

footer.srf-mounted .srf-links a:hover,
.page-footer.srf-mounted .srf-links a:hover {
  color: #ffffff !important;
  text-decoration: none !important;
}

@media (max-width: 760px) {
  footer.srf-mounted .srf-frame,
  .page-footer.srf-mounted .srf-frame {
    min-height: 0 !important;
    padding: .8rem 1rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: .65rem !important;
  }

  footer.srf-mounted .srf-zone,
  .page-footer.srf-mounted .srf-zone {
    flex: 0 0 auto !important;
    min-height: auto !important;
    justify-content: center !important;
  }

  footer.srf-mounted .srf-copy,
  .page-footer.srf-mounted .srf-copy {
    white-space: normal !important;
    text-align: center !important;
  }
}

/* === ScriptRiva production footer END === */


/* === ScriptRiva mobile compositor fix START === */

/*
  Mobile optimization:
  The old fixed pseudo-background and multi-radial gradients can cause compositor
  lag, grey repaint boxes, and white gaps below the footer during fast scroll/zoom.
  Desktop keeps the richer styling. Mobile/touch gets a cheaper static surface.
*/

html {
  background: #0b0b0c !important;
  background-color: #0b0b0c !important;
  min-height: 100% !important;
}

body {
  background-color: #111111 !important;
  min-height: 100svh !important;
  overflow-x: hidden !important;
}

/* Make the bottom of the document dark even if the browser overscrolls past the footer. */
body::after {
  content: "";
  display: block;
  height: env(safe-area-inset-bottom, 0px);
  background: #080809;
}

/*
  Desktop-only: keep the global gradient layer if it exists.
  Do not force it on small/touch devices.
*/
@media (min-width: 901px) and (hover: hover) and (pointer: fine) {
  body::before {
    will-change: auto !important;
  }
}

/*
  Touch/mobile: disable fixed pseudo backgrounds and use one cheap static gradient.
  This is the main anti-lag fix.
*/
@media (max-width: 900px), (hover: none), (pointer: coarse) {
  html,
  body {
    background:
      linear-gradient(
        180deg,
        #151019 0%,
        #111111 22%,
        #0d0d0e 62%,
        #111111 100%
      ) !important;
    background-color: #111111 !important;
    background-image:
      linear-gradient(
        180deg,
        #151019 0%,
        #111111 22%,
        #0d0d0e 62%,
        #111111 100%
      ) !important;
    background-repeat: no-repeat !important;
    background-size: 100% 100% !important;
    background-attachment: scroll !important;
  }

  body::before {
    content: none !important;
    display: none !important;
    position: static !important;
    background: none !important;
  }

  .full.height,
  .page-content,
  .repository,
  .repository .ui.container,
  .repository .ui.container.fluid,
  .repository .repo-content,
  .repository .repo-header,
  .repository .header-wrapper,
  .repository .repository-summary,
  .repository .repository-menu {
    background: transparent !important;
    background-image: none !important;
    background-attachment: scroll !important;
  }

  /*
    Repository panels stay readable, but no large transparent gradient slabs.
    This prevents grey tile artifacts during fast scroll.
  */
  .repository .file-view,
  .repository .readme,
  .repository .render-content,
  .repository .markup,
  .repository.file.list #repo-files-table,
  .ui.segment,
  .ui.attached.segment,
  .ui.segments,
  .ui.card,
  .ui.cards > .card {
    background: #101012 !important;
    background-image: none !important;
    border-color: rgba(139,92,246,.14) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    filter: none !important;
  }

  .ui.table,
  .ui.table tr,
  .ui.table td,
  .ui.table th,
  .repository.file.list #repo-files-table th,
  .repository.file.list #repo-files-table td {
    background: transparent !important;
    background-image: none !important;
  }

  footer,
  .page-footer {
    background: #080809 !important;
    background-image: none !important;
    border-top-color: rgba(139,92,246,.14) !important;
  }

  footer.srf-mounted .srf-frame,
  .page-footer.srf-mounted .srf-frame {
    background: #080809 !important;
    background-image: none !important;
  }

  /*
    Disable expensive effects on mobile globally inside the theme.
    Transitions are kept mostly unnecessary on touch and can worsen scroll jank.
  */
  *,
  *::before,
  *::after {
    backdrop-filter: none !important;
  }

  .ui.segment,
  .ui.card,
  .ui.cards > .card,
  .repository .file-view,
  .repository .readme,
  .repository.file.list #repo-files-table {
    transition: none !important;
  }
}

/*
  Prevent white/grey overscroll flash in browsers that expose overscroll behavior.
*/
html,
body {
  overscroll-behavior-y: none;
}

/* === ScriptRiva mobile compositor fix END === */

