/* OPS DESK — broadcast control surface
   Deep charcoal, status amber/green/cyan, system fonts only.
   No gradients, no glass, no Inter. */

:root {
  --bg: #0a0c10;
  --surface: #12151c;
  --surface-2: #1a1e28;
  --border: #2a3140;
  --text: #d8dde8;
  --text-dim: #8a93a8;
  --amber: #f0a020;
  --green: #3dcc7a;
  --cyan: #3db8cc;
  --red: #e05050;
  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  --radius: 2px;
  --gap: 12px;
  --pad: 16px;
  --transition: 160ms ease;
}

[data-theme="light"] {
  --bg: #e8eaf0;
  --surface: #f4f5f8;
  --surface-2: #ffffff;
  --border: #c8ceda;
  --text: #1a1e28;
  --text-dim: #5a6478;
}

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--amber);
  color: #000;
  padding: 8px 12px;
  z-index: 100;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  top: 8px;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.topbar-left,
.topbar-center,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  color: var(--amber);
  font-size: 1.1rem;
  animation: pulse 2.4s ease-in-out infinite;
}
body.no-motion .brand {
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.brand-text {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.callsign {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.status-pill.live {
  border-color: var(--green);
  color: var(--green);
}
.status-pill.live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.clock {
  color: var(--text-dim);
  min-width: 9ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: color var(--transition), border-color var(--transition);
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
  color: var(--text);
  border-color: var(--text-dim);
  outline: none;
}
.btn-ghost[aria-pressed="true"] {
  color: var(--amber);
  border-color: var(--amber);
}

/* Main surface */
.surface {
  flex: 1;
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.panel-header h1,
.panel-header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex: 1;
}

.panel-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.panel-body {
  padding: var(--pad);
}

.lede {
  font-size: 1.15rem;
  line-height: 1.4;
  margin: 0 0 12px;
  color: var(--text);
}

.identity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.meta-item strong {
  color: var(--text);
  font-weight: 600;
  margin-right: 6px;
}

/* Channel grid */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}

.channel {
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.channel:hover,
.channel:focus-visible {
  border-color: var(--amber);
}
.channel[aria-expanded="true"] {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan);
  grid-column: 1 / -1;
}

.channel-id {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.amber { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.status-dot.cyan { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.status-dot.red { background: var(--red); }

.expand-hint {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-left: auto;
  min-width: 1.2em;
  text-align: center;
  line-height: 1;
  transition: color var(--transition);
}
.channel:hover .expand-hint,
.channel:focus-visible .expand-hint {
  color: var(--amber);
}
.channel[aria-expanded="true"] .expand-hint {
  color: var(--cyan);
}

.panel-preview {
  padding: 12px 14px;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.panel-preview p {
  margin: 0;
}

.panel-detail {
  padding: 0 14px 16px;
  border-top: 1px solid var(--border);
}
.panel-detail[hidden] {
  display: none;
}

.panel-detail dl {
  margin: 12px 0 0;
  display: grid;
  gap: 12px;
}
.panel-detail dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 2px;
}
.panel-detail dd {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.45;
}

/* Ticker */
.ticker {
  overflow: hidden;
}
.ticker-track {
  display: flex;
  gap: 40px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
  width: max-content;
  animation: scroll 48s linear infinite;
}
body.no-motion .ticker-track {
  animation: none;
  flex-wrap: wrap;
  white-space: normal;
  width: auto;
  gap: 8px 24px;
}
.ticker-item {
  flex-shrink: 0;
}
.ticker-item::before {
  content: "› ";
  color: var(--amber);
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (max-width: 640px) {
  .ticker-track {
    animation-duration: 36s;
    gap: 28px;
  }
}

/* Contact */
.contact-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.contact-body p {
  margin: 0;
  flex: 1 1 200px;
}
.contact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--amber);
  color: #0a0c10;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: filter var(--transition);
}
.btn:hover,
.btn:focus-visible {
  filter: brightness(1.1);
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
.contact-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Footer */
.footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* Mobile */
@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .topbar-center {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
  .callsign {
    display: none;
  }
  .channel-grid {
    grid-template-columns: 1fr;
  }
  .identity-meta {
    flex-direction: column;
    gap: 6px;
  }
}

/* Focus visible for keyboard */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
.channel:focus-visible {
  outline-offset: 0;
}
