/* 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 { 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 { width: 100%; height: 100%; }
.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="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 { 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; }

.cta { margin-top: 2.2rem; }
.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; }
}
