:root {
  /* Tallberg: black + orange #ff5500 + white */
  --bg0: #000000;
  --bg1: #0a0a0a;
  --panel: rgba(12, 12, 12, 0.92);
  --border: rgba(255, 85, 0, 0.28);
  --text: #ffffff;
  --muted: #a3a3a3;
  --accent: #ff5500;
  --accent-dim: rgba(255, 85, 0, 0.18);
  --accent-strong: #ff6a1a;
  --cyan: var(--accent);
  --cyan2: var(--accent-strong);
  --mint: var(--accent);
  --danger: #ff6b6b;
  --ok: #ff5500;
  --warn: #ffb020;
  --radius: 16px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg0);
  color: var(--text);
  font-family: var(--font);
}

body {
  line-height: 1.5;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(255, 85, 0, 0.16), transparent 58%),
    radial-gradient(700px 400px at 92% 8%, rgba(255, 85, 0, 0.06), transparent 55%),
    linear-gradient(180deg, #0a0a0a 0%, #000000 55%, #000000 100%);
  z-index: -1;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.brand {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.brand h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  font-weight: 650;
  color: #ffffff;
}

.tagline {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-pill {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.85);
  color: var(--muted);
  white-space: nowrap;
}

.status-pill[data-state="live"] {
  color: var(--accent);
  border-color: rgba(255, 85, 0, 0.55);
}

.status-pill[data-state="connecting"] {
  color: var(--warn);
}

.status-pill[data-state="offline"] {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.4);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.hero {
  margin-bottom: 1rem;
  min-height: 160px;
}

.hero-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.latest {
  margin: 0;
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  font-weight: 500;
  line-height: 1.5;
  color: #ffffff;
  white-space: pre-wrap;
  max-height: min(50vh, 420px);
  overflow: auto;
}

.hero-meta {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-family: var(--mono);
}

.dot {
  opacity: 0.5;
}

.grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 1rem;
}

@media (max-width: 820px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.stats h2,
.feed-panel h2 {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.stats dl {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.stats dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.35rem;
}

.stats dt {
  color: var(--muted);
  font-size: 0.88rem;
}

.stats dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.88rem;
  text-align: right;
  color: #ffffff;
}

.energy-bar {
  margin-top: 1rem;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.energy-fill {
  height: 100%;
  width: 50%;
  border-radius: inherit;
  background: linear-gradient(90deg, #cc4400, var(--accent), #ff8844);
  transition: width 0.6s ease;
}

.hint {
  margin: 0.7rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  min-height: 1.2em;
}

.feed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 520px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.feed li {
  border-left: 2px solid rgba(255, 85, 0, 0.65);
  padding: 0.45rem 0.75rem;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 0 10px 10px 0;
  animation: in 0.35s ease;
}

@keyframes in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.feed .text {
  margin: 0;
  font-size: 0.95rem;
  white-space: pre-wrap;
  color: #ffffff;
}

.feed .meta {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--mono);
}

.muted {
  color: var(--muted);
}

.foot {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
}

.top-nav {
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem;
  backdrop-filter: blur(8px);
}

.top-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
}

.top-nav a[aria-current="page"],
.top-nav a:hover {
  color: #ffffff;
  background: var(--accent-dim);
  border: 1px solid transparent;
}

.top-nav a[aria-current="page"] {
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 85, 0, 0.35);
}

@media (max-width: 640px) {
  .top {
    flex-wrap: wrap;
  }
}

.feed::-webkit-scrollbar {
  width: 8px;
}
.feed::-webkit-scrollbar-thumb {
  background: rgba(255, 85, 0, 0.35);
  border-radius: 8px;
}

/* About teaser + modal */
.about-teaser {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.85rem;
  margin: 0 0 1.15rem;
  padding: 0.15rem 0.1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.about-teaser-text {
  font-style: italic;
  color: #b3b3b3;
}

.about-link {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.88rem;
  font-style: normal;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 85, 0, 0.35);
}

.about-link:hover {
  color: #ffffff;
  border-bottom-color: rgba(255, 85, 0, 0.75);
}

.about-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.about-modal[hidden] {
  display: none !important;
}

.about-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.about-modal-panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(85vh, 720px);
  overflow: auto;
  background: #0a0a0a;
  border: 1px solid rgba(255, 85, 0, 0.35);
  border-radius: 16px;
  padding: 1.5rem 1.5rem 1.75rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.about-modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.45rem;
}

.about-modal-close:hover {
  color: #ffffff;
}

.about-modal-panel h2 {
  margin: 0 2rem 1rem 0;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.about-modal-panel h3 {
  margin: 1.35rem 0 0.55rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.about-body {
  color: #e8e8e8;
  font-size: 0.98rem;
  line-height: 1.6;
}

.about-body p {
  margin: 0 0 0.85rem;
}

.about-body ul {
  margin: 0 0 0.85rem;
  padding-left: 1.15rem;
  color: #d4d4d4;
}

.about-body li {
  margin-bottom: 0.45rem;
}

.about-body li::marker {
  color: var(--accent);
}

body.about-open {
  overflow: hidden;
}
