@font-face {
  font-family: Oxanium;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/oxanium.woff2") format("woff2");
}

/* Latin subset only, which covers everything on the page */
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
}

/* Mirrors the InOps login page in its failed state: kuroha.co.uk's tiles with an authentication readout between them */
:root {
  --bg: #07060c;
  --surface: #07060c;
  --surface-2: #110e1a;
  --border: #241e36;
  --border-2: #2a2340;
  --border-3: #2f2648;
  --border-hover: #5b4691;
  --text: #ece8f6;
  --text-soft: #c9c2dc;
  --muted: #9c95b2;
  --faint: #6f6888;
  --accent: #a78bfa;
  --offline: #f85149;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --col: min(100vw - 2rem, 26rem);   /* the column's width */
  --label: 6.25rem;                  /* the readout's label column */

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 2rem 1rem;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Oxanium, system-ui, sans-serif;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* Behind everything: a label-free InOps-style map, soft and dim, with a dot grid and a darker middle */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.backdrop img {
  position: absolute;
  inset: -2%;
  width: 104%;
  height: 104%;
  object-fit: cover;
  filter: blur(1.6px) brightness(0.62) saturate(0.9);
  opacity: 0.75;
}

.backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgb(167 139 250 / 0.16) 1px, transparent 1.2px);
  background-size: 22px 22px;
}

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 34rem 30rem at 50% 50%, rgb(7 6 12 / 0.72), rgb(7 6 12 / 0.18) 70%, rgb(7 6 12 / 0.55) 100%),
    radial-gradient(56rem 26rem at 50% -9rem, rgb(124 58 237 / 0.22), transparent 70%);
}

main {
  display: grid;
  gap: 0.75rem;
  width: var(--col);
}

.tile {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--surface);
}

/* The header tile: the wordmark and a small live map */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 10rem;
  padding: 1.5rem;
  border-color: var(--border-2);
  background:
    radial-gradient(circle 16rem at 90% 88%, rgb(124 58 237 / 0.34), transparent 70%),
    var(--surface);
}

h1 {
  position: relative;
  margin: 0;
  font-size: clamp(2.6rem, 11vw, 3.25rem);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.slashes {
  color: var(--accent);
}

.tag {
  margin-left: 0.3rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.art {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 11.5rem;
  pointer-events: none;
  mask-image: radial-gradient(130% 120% at 75% 20%, #000 55%, transparent 95%);
}

.art svg {
  display: block;
  width: 100%;
  height: auto;
}

.m-node { fill: #13101e; stroke: #2a2340; }
.m-cable { fill: none; stroke: #2a2340; stroke-width: 1.2; }
.m-glow { fill: none; stroke: #7c3aed; stroke-opacity: 0.22; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; filter: url(#m-blur); }
.m-dots { fill: none; stroke: #c4b5fd; stroke-width: 1.3; stroke-linecap: round; stroke-dasharray: 0.01 5 0.01 9 0.01 3 0.01 11; animation: run 2.4s linear infinite; }
.m-dots.b { stroke: #a78bfa; stroke-dasharray: 0.01 7 0.01 4 0.01 13; animation-duration: 3.1s; }
.m-dots.c { stroke: #ede9fe; stroke-opacity: 0.7; stroke-width: 1; stroke-dasharray: 0.01 11 0.01 6 0.01 17; animation-duration: 3.7s; }
.m-dots.quiet { stroke-dasharray: 0.01 22 0.01 31; }

@keyframes run {
  to { stroke-dashoffset: -28; }
}

.led {
  animation: blink var(--d, 1.6s) steps(1, end) var(--o, 0s) infinite;
}

@keyframes blink {
  50% { opacity: 0.15; }
}

/* The readout: two stepped rules that run the full width of the window, with the text between them */
.hud {
  position: relative;
  padding: 0.9rem 0 1rem;
}

.rule {
  position: relative;
  height: 14px;
  margin-inline: calc((var(--col) - 100vw) / 2);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.rule svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.rule path {
  fill: none;
  stroke: var(--accent);
  stroke-opacity: 0.7;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 3px rgb(167 139 250 / 0.55));
}

.rule .block {
  fill: var(--accent);
  stroke: none;
  opacity: 0.85;
}

.rows {
  display: grid;
  grid-template-columns: var(--label) 1fr;
  column-gap: 0.9rem;
  row-gap: 0.1rem;
  padding: 0.7rem 0 0.55rem;
  align-items: baseline;
}

.k {
  justify-self: end;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* A touch smaller than the login page's, so "Network authentication" fits on one line */
.v {
  font-size: clamp(1rem, 4.4vw, 1.3rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.state {
  grid-column: 2;
  color: var(--offline);
  font-size: clamp(1.05rem, 5vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgb(248 81 73 / 0.45);
}

/* The actions tile, where the login page has its form */
.panel {
  display: grid;
  gap: 0.625rem;
  padding: 1.25rem 1.5rem 1.5rem;
}

.note {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font: 0.75rem/1.5 var(--mono);
  letter-spacing: 0.02em;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-hover);
  border-radius: 0.875rem;
  background: linear-gradient(180deg, rgb(124 58 237 / 0.32), rgb(124 58 237 / 0.18));
  color: var(--text);
  font: 600 0.9375rem Oxanium, system-ui, sans-serif;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.btn.quiet {
  border-color: var(--border-2);
  background: var(--surface-2);
  color: var(--text-soft);
}

.btn svg {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--accent);
  transition: translate 0.15s;
}

.btn:hover,
.btn:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgb(124 58 237 / 0.42), rgb(124 58 237 / 0.24));
}

.btn.quiet:hover,
.btn.quiet:focus-visible {
  border-color: var(--border-hover);
  background: var(--surface-2);
  color: var(--text);
}

.btn:hover svg,
.btn:focus-visible svg {
  translate: 2px -2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
