/* JARVIS HUD: the films' interface language, pushed into cyberpunk. Primary colour is the logo blue. */

@font-face { font-family: "Orbitron"; font-weight: 600; font-display: swap; src: url("vendor/fonts/orbitron-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Orbitron"; font-weight: 800; font-display: swap; src: url("vendor/fonts/orbitron-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Rajdhani"; font-weight: 500; font-display: swap; src: url("vendor/fonts/rajdhani-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Rajdhani"; font-weight: 600; font-display: swap; src: url("vendor/fonts/rajdhani-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Rajdhani"; font-weight: 700; font-display: swap; src: url("vendor/fonts/rajdhani-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("vendor/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }

:root {
  --bg: #050b14;
  --bg-2: #08121f;
  --panel: rgba(10, 24, 40, 0.82);
  --line: #1b4f78;
  --blue: #3498db;
  --blue-hi: #5dbbff;
  --blue-dim: #1b4f78;
  --text: #d7e6f5;
  --muted: #8fa9c2;
  --danger: #ff3c5f;
  --warn: #ffb020;
  --ok: #3ddc97;
  --glow: 0 0 12px rgba(52, 152, 219, 0.45);
  --cut: 14px;
  --font-body: "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --font-display: "Orbitron", "Rajdhani", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(52, 152, 219, 0.18), transparent 60%),
    linear-gradient(rgba(52, 152, 219, 0.045) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(52, 152, 219, 0.045) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

/* faint scan-lines over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, 0.12) 3px);
  z-index: 50;
}

a { color: var(--blue-hi); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--blue-hi); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 0.6em; line-height: 1.2; }
h1 { font-size: clamp(1.5rem, 4vw, 2.3rem); color: #fff; text-shadow: var(--glow); }
h2 { font-size: 1.15rem; color: var(--blue-hi); }
h3 { font-size: 0.95rem; color: var(--muted); }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--font-mono); font-size: 0.85em; color: var(--blue-hi); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- layout ---- */
.wrap { width: min(1100px, 100% - 2rem); margin-inline: auto; }
main { flex: 1; padding: 2rem 0 3rem; }

.topbar { border-bottom: 1px solid var(--line); background: rgba(5, 11, 20, 0.88); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 20; }
.topbar .wrap { display: flex; align-items: center; gap: 1.2rem; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-weight: 800; letter-spacing: 0.18em; color: #fff; }
.brand img { width: 38px; height: 38px; filter: drop-shadow(0 0 6px rgba(52, 152, 219, 0.8)); }
.brand:hover { text-decoration: none; }
nav.main { display: flex; gap: 1.1rem; flex: 1; flex-wrap: wrap; }
nav.main a { color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; font-size: 0.95rem; padding: 0.3rem 0; border-bottom: 2px solid transparent; }
nav.main a:hover, nav.main a[aria-current="page"] { color: #fff; border-bottom-color: var(--blue); text-decoration: none; }
.who { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; }
.who img { width: 30px; height: 30px; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; padding: 1.2rem 0; }
footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---- HUD panels ---- */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.4rem;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  box-shadow: inset 0 0 30px rgba(52, 152, 219, 0.06);
}
.panel::before { /* corner brackets */
  content: "";
  position: absolute; inset: 6px;
  border: 1px solid transparent;
  border-image: linear-gradient(135deg, var(--blue) 0 14px, transparent 14px calc(100% - 14px), var(--blue) calc(100% - 14px)) 1;
  pointer-events: none; opacity: 0.55;
}
.panel > :last-child { margin-bottom: 0; }
.panel h2:first-child { border-bottom: 1px solid var(--blue-dim); padding-bottom: 0.5rem; }

.grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid .panel { margin: 0; }

.notice, .error-box { border-left: 3px solid var(--blue); background: rgba(52, 152, 219, 0.1); padding: 0.7rem 1rem; margin-bottom: 1.4rem; }
.error-box { border-color: var(--danger); background: rgba(255, 60, 95, 0.1); }

/* ---- hero ---- */
.hero { position: relative; text-align: center; padding: 3.5rem 0 3rem; isolation: isolate; }
.hero .ring, .console-hero .ring { position: absolute; left: 50%; top: calc(50% + 3.5rem); width: min(520px, 85vw); aspect-ratio: 1; transform: translate(-50%, -50%); z-index: -1; opacity: 0.4; animation: reactor 4.5s ease-in-out infinite; }
.hero .ring img, .console-hero .ring img { width: 100%; height: 100%; }
.console-hero { position: relative; isolation: isolate; }
.console-hero .ring { left: 28%; top: 50%; width: min(400px, 70vw); }
.hero .tag { font-family: var(--font-mono); color: var(--blue-hi); font-size: 0.85rem; letter-spacing: 0.15em; text-transform: uppercase; }
.hero h1 { font-size: clamp(2rem, 7vw, 3.8rem); letter-spacing: 0.2em; }
.hero p.lead { max-width: 40rem; margin-inline: auto; color: var(--text); font-size: 1.3rem; }
.hero .actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 1.6rem; }
/* an arc reactor's slow breathing glow: the logo itself brightens and its light spreads, then settles */
@keyframes reactor {
  0%, 100% { opacity: 0.32; filter: drop-shadow(0 0 5px rgba(52, 152, 219, 0.18)); }
  50% { opacity: 0.48; filter: drop-shadow(0 0 19px rgba(93, 187, 255, 0.48)) drop-shadow(0 0 45px rgba(52, 152, 219, 0.28)); }
}

/* ---- buttons and forms ---- */
.btn, button {
  font: inherit; font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
  display: inline-block; cursor: pointer; color: #fff; background: rgba(52, 152, 219, 0.18); border: 1px solid var(--blue);
  padding: 0.7rem 1.3rem; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: background 0.15s, box-shadow 0.15s;
}
.btn:hover, button:hover { background: rgba(52, 152, 219, 0.4); box-shadow: var(--glow); text-decoration: none; }
.btn.primary { background: var(--blue); color: #02101c; }
.btn.primary:hover { background: var(--blue-hi); }
button.danger, .btn.danger { border-color: var(--danger); background: rgba(255, 60, 95, 0.14); }
button.danger:hover { background: rgba(255, 60, 95, 0.4); box-shadow: 0 0 12px rgba(255, 60, 95, 0.5); }
button.link { background: none; border: 0; clip-path: none; padding: 0; color: var(--muted); font-size: 0.8rem; }

label { display: block; font-weight: 700; margin-bottom: 0.25rem; letter-spacing: 0.04em; }
.field { margin-bottom: 1.1rem; }
.field .hint { color: var(--muted); font-size: 0.95rem; margin: 0.2rem 0 0; }
input[type="text"], input[type="search"], input[type="number"], input[type="datetime-local"], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #030810; border: 1px solid var(--blue-dim);
  padding: 0.55rem 0.7rem; border-radius: 0;
}
select[multiple] { min-height: 9rem; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-hi); box-shadow: var(--glow); outline: none; }
.form-grid { display: grid; gap: 0 1.4rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.inline { display: flex; gap: 0.8rem; align-items: end; flex-wrap: wrap; }
.inline .field { margin: 0; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--blue-dim); white-space: nowrap; }
td { padding: 0.55rem 0.7rem; border-bottom: 1px solid rgba(27, 79, 120, 0.4); vertical-align: top; }
tr:hover td { background: rgba(52, 152, 219, 0.06); }

.badge { display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; padding: 0.05rem 0.5rem; border: 1px solid currentColor; text-transform: uppercase; letter-spacing: 0.08em; }
.badge.ok { color: var(--ok); } .badge.off { color: var(--muted); } .badge.bad { color: var(--danger); } .badge.warn { color: var(--warn); }

/* ---- cards ---- */
.server { display: flex; gap: 0.9rem; align-items: center; color: inherit; }
.server:hover { text-decoration: none; }
.server .icon { width: 54px; height: 54px; flex: none; background: var(--blue-dim); display: grid; place-items: center; font-family: var(--font-display); color: #fff; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }
.server .icon img { width: 100%; height: 100%; object-fit: cover; }
.server strong { display: block; color: #fff; font-size: 1.2rem; }
.stat { font-family: var(--font-display); font-size: 1.9rem; color: #fff; text-shadow: var(--glow); }
.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.tabs a { padding: 0.35rem 0.9rem; border: 1px solid var(--blue-dim); color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 0.9rem; letter-spacing: 0.08em; }
.tabs a[aria-current="page"], .tabs a:hover { color: #fff; border-color: var(--blue); background: rgba(52, 152, 219, 0.15); text-decoration: none; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1rem; }

@media (max-width: 560px) {
  body { font-size: 1.05rem; }
  .topbar .wrap { padding-block: 0.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hero .ring, .console-hero .ring { animation: none; opacity: 0.4; filter: drop-shadow(0 0 12px rgba(52, 152, 219, 0.3)); }
  html { scroll-behavior: auto; }
}

/* long-form documents (privacy, terms) */
.legal h1, .legal h2, .legal h3, .legal h4 { text-transform: none; letter-spacing: 0.03em; margin-top: 1.4em; }
.legal h1:first-child { margin-top: 0; }
.legal h4 { font-size: 1rem; color: var(--text); }
.legal ul { padding-left: 1.4rem; }

.hero.compact { padding-top: 2rem; }

/* ---- offline screen (WEBUI_OFFLINE) ---- */
body.offline { align-items: center; justify-content: center; overflow-x: hidden; }
.offline-screen { flex: 0 1 auto; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 2rem 1rem; max-width: 100%; }
.offline-logo { width: 110px; height: 110px; opacity: 0.35; filter: grayscale(0.6) drop-shadow(0 0 8px rgba(255, 60, 95, 0.4)); animation: flicker 3.2s infinite; }
.glitch { position: relative; display: inline-block; margin: 1.2rem 0 0.6rem; font-size: clamp(1.7rem, 8vw, 4rem); letter-spacing: 0.14em; color: #fff; text-shadow: 0 0 14px rgba(255, 60, 95, 0.5); }
.glitch::before, .glitch::after, .glitch-sub::before, .glitch-sub::after {
  content: attr(data-text); position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.glitch::before, .glitch-sub::before { color: var(--blue-hi); transform: translateX(-3px); animation: glitch-a 2.6s infinite steps(1); }
.glitch::after, .glitch-sub::after { color: var(--danger); transform: translateX(3px); animation: glitch-b 3.1s infinite steps(1); }
.glitch-sub { position: relative; display: block; max-width: 100%; margin: 0; font-family: var(--font-mono); font-size: clamp(0.8rem, 3vw, 1.4rem); letter-spacing: 0.14em; overflow-wrap: anywhere; text-transform: uppercase; color: var(--blue-hi); }
.cursor { animation: blink 1s steps(1) infinite; }
@keyframes glitch-a {
  0%, 100% { clip-path: inset(0 0 100% 0); }
  8% { clip-path: inset(12% 0 62% 0); } 12% { clip-path: inset(70% 0 8% 0); }
  16% { clip-path: inset(0 0 100% 0); } 52% { clip-path: inset(40% 0 38% 0); }
  56% { clip-path: inset(0 0 100% 0); } 84% { clip-path: inset(82% 0 2% 0); } 88% { clip-path: inset(0 0 100% 0); }
}
@keyframes glitch-b {
  0%, 100% { clip-path: inset(100% 0 0 0); }
  6% { clip-path: inset(55% 0 20% 0); } 10% { clip-path: inset(5% 0 80% 0); }
  14% { clip-path: inset(100% 0 0 0); } 46% { clip-path: inset(25% 0 55% 0); }
  50% { clip-path: inset(100% 0 0 0); } 78% { clip-path: inset(62% 0 18% 0); } 82% { clip-path: inset(100% 0 0 0); }
}
@keyframes flicker { 0%, 100% { opacity: 0.35; } 41% { opacity: 0.35; } 42% { opacity: 0.1; } 43% { opacity: 0.4; } 46% { opacity: 0.15; } 47% { opacity: 0.35; } }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .glitch::before, .glitch::after, .glitch-sub::before, .glitch-sub::after, .offline-logo, .cursor { animation: none; }
  .glitch::before, .glitch::after, .glitch-sub::before, .glitch-sub::after { display: none; }
}

/* ---- member search, member page, audit trail ---- */
.member-search { margin-bottom: 0.6rem; }
.results { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.results li { display: flex; gap: 0.8rem; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid rgba(27, 79, 120, 0.4); }
.results img, .profile img { flex: none; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }
.results li > span:nth-child(2) { flex: 1; min-width: 0; }
.result-links { display: flex; gap: 0.9rem; font-weight: 700; text-transform: uppercase; font-size: 0.9rem; letter-spacing: 0.06em; }
.profile { display: flex; gap: 1.2rem; align-items: center; }
.profile h2 { border: 0 !important; padding: 0 !important; margin-bottom: 0.2rem; }
.profile p { margin: 0.2rem 0; }
.case { padding: 0.6rem 0; border-bottom: 1px solid rgba(27, 79, 120, 0.4); }
blockquote { margin: 0.4rem 0 0.4rem 0.4rem; padding: 0.3rem 0.9rem; border-left: 2px solid var(--blue-dim); background: rgba(52, 152, 219, 0.06); }
.changes { margin: 0.3rem 0 0; padding-left: 1.2rem; font-size: 0.95rem; }
.changes del { color: var(--danger); text-decoration-thickness: 1px; }
.changes ins { color: var(--ok); text-decoration: none; }

/* ---- appeals ---- */
.appeal-text { white-space: pre-wrap; overflow-wrap: anywhere; }
textarea { resize: vertical; }

/* ---- alternative page layouts ---- */
.code { color: var(--blue-hi); letter-spacing: 0.1em; }
.actions.left { justify-content: flex-start; }
/* console */
.console-hero { display: grid; gap: 2rem; grid-template-columns: 1.1fr 1fr; align-items: center; padding: 2.5rem 0 1.5rem; }
.console-copy h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); letter-spacing: 0.18em; margin-bottom: 0.3em; }
.console-copy .tag { font-family: var(--font-mono); color: var(--blue-hi); font-size: 0.85rem; letter-spacing: 0.15em; text-transform: uppercase; }
.console-copy .lead { font-size: 1.25rem; }
.console-copy .actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.4rem; }
.console-lines { list-style: none; margin: 0; padding: 0; font-size: 1rem; }
.console-lines li { display: grid; grid-template-columns: 0.9rem 4.6rem 1fr auto; gap: 0.7rem; align-items: center; padding: 0.38rem 0; border-bottom: 1px dashed rgba(27, 79, 120, 0.6); }
.console-lines .state { color: var(--ok); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.12em; }
.led { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: blink-led 3.2s ease-in-out infinite; }
.console-lines li:nth-child(3n) .led { animation-delay: 0.9s; }
.console-lines li:nth-child(3n+1) .led { animation-delay: 1.8s; }
@keyframes blink-led { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.console-notes { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 1rem; }
.console-notes .panel { margin: 0; }

/* index */
.index-layout { display: grid; gap: 2rem; grid-template-columns: 240px 1fr; align-items: start; }
.index-nav { position: sticky; top: 84px; padding: 1rem 0; }
.index-nav ul { list-style: none; margin: 0 0 1.2rem; padding: 0; border-left: 1px solid var(--line); }
.index-nav li a { display: block; padding: 0.3rem 0.9rem; color: var(--muted); font-weight: 600; }
.index-nav li a:hover { color: #fff; background: rgba(52, 152, 219, 0.1); text-decoration: none; }
.index-nav .mono { color: var(--blue-hi); margin-right: 0.4rem; }
.index-section { padding: 1.4rem 0; border-bottom: 1px solid rgba(27, 79, 120, 0.5); scroll-margin-top: 84px; }
.index-section h2 { border: 0; font-size: 1.5rem; margin: 0.2rem 0 0.5rem; }
.index-section p { max-width: 42rem; }
.commands-line code { margin-right: 0.4rem; padding: 0.1rem 0.5rem; border: 1px solid var(--blue-dim); }

@media (max-width: 800px) {
  .console-hero, .catalog-row, .index-layout { grid-template-columns: 1fr; }
  .commands { justify-content: flex-start; }
  .index-nav { position: static; }
}
@media (prefers-reduced-motion: reduce) { .led, .reactor img { animation: none; } }

/* ---- tags ---- */
.chip-inline { display: inline-flex; gap: 0.4rem; align-items: center; margin-right: 0.6rem; padding: 0.1rem 0.5rem; border: 1px solid var(--blue-dim); }
.inline-form { display: inline; margin: 0; }

/* Sections that load after the page (webui/lazy.py) */
.lazy .loading { display: flex; align-items: center; gap: 0.7rem; color: var(--muted); font-family: var(--font-mono); margin: 0.6rem 0; }
.spinner { width: 1rem; height: 1rem; border: 2px solid var(--blue-dim); border-top-color: var(--blue-hi); border-radius: 50%; animation: spin 0.9s linear infinite; box-shadow: var(--glow); }
.lazy.failed .spinner { animation: none; border-color: var(--danger); box-shadow: none; }
.lazy.failed .loading { color: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-top-color: var(--blue-dim); } }

/* Admin pages: alert strip and the small status light */
.notice.critical { border-color: var(--danger); background: rgba(255, 60, 95, 0.1); }
.notice.warning { border-color: var(--warn); background: rgba(255, 190, 60, 0.1); }
p .led { display: inline-block; margin-right: 0.4rem; vertical-align: middle; }
#admin-alerts { margin-bottom: 1rem; min-height: 1.4rem; }
