:root {
  --bg0: #070b14;
  --bg1: #0b1220;
  --bg2: #121a2b;
  --text: #e8eef8;
  --muted: #8b9bb4;
  --line: rgba(232, 238, 248, 0.08);
  --crit: #ff4d6d;
  --warn: #ffb020;
  --info: #4da3ff;
  --ok: #3dd68c;
  --flare: #ff7a59;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Instrument Serif", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg0);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.sky {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(77, 163, 255, 0.18), transparent 55%),
    radial-gradient(ellipse 40% 30% at 80% 20%, rgba(255, 122, 89, 0.08), transparent 50%),
    linear-gradient(180deg, #0b1220 0%, #070b14 100%);
  animation: drift 28s ease-in-out infinite alternate;
}
@keyframes drift {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(12deg); }
}

.landing { position: relative; min-height: 100vh; }
.landing .top, .landing .hero, .landing .foot { position: relative; z-index: 1; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.75rem; gap: 1rem;
}
.bar { border-bottom: 1px solid var(--line); background: rgba(7, 11, 20, 0.72); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 10; }
.brand {
  font-family: var(--display); font-size: 1.65rem; letter-spacing: 0.02em;
}
.nav { display: flex; gap: 1rem; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.nav a.active, .nav a:hover { color: var(--text); }
.user { color: var(--muted); font-size: 0.85rem; }
.board-title { color: var(--muted); font-size: 0.95rem; }

.hero {
  max-width: 42rem; padding: 18vh 1.75rem 4rem;
}
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); font-size: 0.72rem; font-weight: 600; }
.hero h1 {
  font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.05; margin: 0.4rem 0 1rem;
}
.lede { color: var(--muted); font-size: 1.05rem; line-height: 1.55; max-width: 36rem; }
.hint { margin-top: 2rem; color: var(--muted); font-size: 0.9rem; opacity: 0.85; }
.foot { padding: 1.5rem 1.75rem; color: var(--muted); font-size: 0.8rem; }

.board { padding: 1.25rem 1.5rem 3rem; max-width: 1100px; margin: 0 auto; }
.nominal {
  min-height: 55vh; display: grid; place-items: center; text-align: center;
  animation: fadeIn 0.8s ease;
}
.nominal h2 { font-family: var(--display); font-weight: 400; font-size: 2.4rem; margin: 0 0 0.5rem; }
.nominal p { color: var(--muted); margin: 0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.widgets { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 860px) {
  .widgets { grid-template-columns: 1.4fr 1fr; }
  .widget.span-2 { grid-column: 1 / -1; }
}

.widget {
  background: linear-gradient(180deg, rgba(18, 26, 43, 0.9), rgba(11, 18, 32, 0.95));
  border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem;
}
.widget h3 { margin: 0 0 0.75rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }

.alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.alert {
  display: grid; grid-template-columns: 6px 1fr auto; gap: 0.75rem; align-items: start;
  padding: 0.7rem 0.8rem; border-radius: 10px; background: rgba(0,0,0,0.25);
  border: 1px solid var(--line); animation: flareIn 0.35s ease;
}
@keyframes flareIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: none; } }
.alert .sev { width: 6px; border-radius: 4px; min-height: 100%; align-self: stretch; }
.alert.critical .sev { background: var(--crit); box-shadow: 0 0 12px rgba(255, 77, 109, 0.45); }
.alert.warning .sev { background: var(--warn); }
.alert.info .sev { background: var(--info); }
.alert .title { font-weight: 600; margin: 0 0 0.2rem; }
.alert .msg { color: var(--muted); font-size: 0.88rem; margin: 0; }
.alert .meta { color: var(--muted); font-size: 0.75rem; text-align: right; }
.alert a { color: var(--info); text-decoration: none; font-size: 0.8rem; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.6rem; }
.tile {
  border-radius: 10px; padding: 0.75rem; background: rgba(0,0,0,0.22); border: 1px solid var(--line);
}
.tile .n { font-size: 1.5rem; font-weight: 700; }
.tile .l { color: var(--muted); font-size: 0.75rem; margin-top: 0.15rem; }
.tile.ok .n { color: var(--ok); }
.tile.hot .n { color: var(--crit); }

.links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.links a { color: var(--text); text-decoration: none; font-size: 0.92rem; }
.links a:hover { color: var(--info); }

.builder-panel { display: grid; gap: 1rem; }
.builder-panel input, .builder-panel textarea, .builder-panel select {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 0.55rem 0.7rem; font: inherit;
}
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--bg2); color: var(--text);
  border-radius: 8px; padding: 0.5rem 0.9rem; font-weight: 600; cursor: pointer;
}
.btn.primary { background: linear-gradient(135deg, #2a4a7a, #1a2f52); border-color: transparent; }
.btn:hover { filter: brightness(1.08); }
.share-box { font-family: ui-monospace, monospace; font-size: 0.8rem; color: var(--muted); word-break: break-all; }

.view-only .nav { display: none; }
