:root {
  --bg: #0a0f1e;
  --bg-alt: #0d1426;
  --surface: #111b32;
  --surface-2: #16213d;
  --border: #223154;
  --text: #e7ecf7;
  --text-dim: #9fb0d0;
  --text-faint: #6d7fa3;
  --blue: #3b82f6;
  --blue-bright: #5b9dff;
  --blue-deep: #1e3a8a;
  --green: #22c55e;
  --green-dim: #16a34a;
  --red: #f87171;
  --red-dim: #5a2b38;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: 0.2px;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--blue-bright), var(--green));
  display: inline-block;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
}

.brand-dim { color: var(--text-dim); font-weight: 500; }

/* Eleven links and the brand have to fit inside the 1140px container, so the
   row is tighter and a little smaller than a default nav would be. The client
   login button that used to sit beside these is gone with the portal, which is
   what let the hamburger breakpoint come down. Below it none of this applies. */
.main-nav {
  display: flex;
  gap: 14px;
}

.main-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  /* Two-word labels must not fold onto a second line in the header row. */
  white-space: nowrap;
  transition: color 0.15s ease;
}

.main-nav a:hover { color: var(--blue-bright); }

/* Links that leave this site carry a marker, so "Podcast" in the nav is not
   mistaken for another in-page section. */
.nav-external-mark {
  margin-left: 4px;
  font-size: 0.78em;
  color: var(--text-faint);
}
.main-nav a:hover .nav-external-mark,
.footer-nav a:hover .nav-external-mark { color: var(--blue-bright); }

/* Hamburger toggle. Hidden at desktop widths, where .header-menu is
   display:contents so brand / nav / actions stay direct flex children of
   .header-inner and the header lays out exactly as it did before. */
.header-menu { display: contents; }

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 42px;
  height: 38px;
  padding: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.nav-toggle:hover { border-color: var(--blue-bright); }

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Keyboard users need to see where they are inside the header. */
.nav-toggle:focus-visible,
.main-nav a:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: white;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--blue-bright), var(--blue)); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--blue-bright); color: var(--blue-bright); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--green); color: var(--green); }

.btn-block { width: 100%; }

/* Hero */
.hero {
  padding: 110px 0 90px;
  background:
    radial-gradient(ellipse at top right, rgba(59,130,246,0.18), transparent 55%),
    radial-gradient(ellipse at bottom left, rgba(34,197,94,0.10), transparent 50%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}

.hero-inner { max-width: 760px; }

.eyebrow {
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0 0 14px;
}

.hero h1 {
  font-size: 2.6rem;
  line-height: 1.15;
  margin: 0 0 18px;
  color: var(--text);
}

.lead {
  color: var(--text-dim);
  font-size: 1.08rem;
  margin: 0 0 34px;
  max-width: 620px;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* Sections */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-title {
  font-size: 1.8rem;
  margin: 0 0 8px;
}

.section-lead {
  color: var(--text-dim);
  margin: 0 0 40px;
  max-width: 640px;
}

.fine-print {
  color: var(--text-faint);
  font-size: 0.82rem;
  margin-top: 20px;
}

/* Grids */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card-icon {
  font-size: 1.4rem;
  color: var(--blue-bright);
  margin-bottom: 12px;
}

.card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--text-dim); font-size: 0.92rem; }

/* Card pointing at the standalone media site. */
.moved-card { max-width: 560px; }
.moved-card h3 { color: var(--blue-bright); }
.moved-card p { margin-bottom: 20px; }

/* Plan cards */
.plan-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
}

.plan-featured {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue), var(--shadow);
}

.plan-badge {
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--blue);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.4px;
}

.plan-card h3 { margin: 4px 0 4px; }
.plan-desc { color: var(--text-dim); margin: 0 0 18px; font-size: 0.9rem; }

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  flex: 1;
}

.plan-features li {
  padding: 8px 0;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.9rem;
}
.plan-features li:first-child { border-top: none; }

/* About */
.about-grid { align-items: start; }

.about-copy p {
  margin: 0 0 16px;
  color: var(--text-dim);
  font-size: 0.96rem;
}
.about-copy p:last-child { margin-bottom: 0; }

.about-card h3 { margin: 0 0 16px; font-size: 1.05rem; }
.about-card .plan-features { margin-bottom: 20px; }

/* Infrastructure */
.infra-grid { margin-bottom: 8px; }

.infra-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.infra-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue-bright);
  box-shadow: 0 0 10px rgba(91,157,255,0.7);
  margin-bottom: 14px;
}

.infra-item h4 { margin: 0 0 6px; font-size: 0.98rem; }
.infra-item p { margin: 0; color: var(--text-dim); font-size: 0.88rem; }

/* Status */
.status-board {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.status-row:last-child { border-bottom: none; }

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-green {
  background: var(--green);
  box-shadow: 0 0 10px rgba(34,197,94,0.8);
}

.status-name { flex: 1; font-weight: 600; font-size: 0.95rem; }

.status-label {
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Docs */
.doc-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease;
}
.doc-card:hover { border-color: var(--blue-bright); }
.doc-card h4 { margin: 0 0 8px; font-size: 0.98rem; color: var(--blue-bright); }
.doc-card p { margin: 0; color: var(--text-dim); font-size: 0.88rem; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 12px; }

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.96rem;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "+";
  color: var(--blue-bright);
  margin-right: 10px;
  font-weight: 700;
}
.faq-item[open] summary::before { content: "–"; }

.faq-item p {
  margin: 12px 0 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* Contact form */
.contact-form {
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.form-row { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }

.form-row label {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 600;
}

.form-row input,
.form-row select,
.form-row textarea {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--blue-bright);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  background: var(--bg-alt);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-nav { display: flex; flex-wrap: wrap; gap: 12px 22px; }
.footer-nav a { color: var(--text-dim); text-decoration: none; font-size: 0.88rem; }
.footer-nav a:hover { color: var(--blue-bright); }

/* Media Server control panel */
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

.media-gate {
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.media-gate .form-row { margin-bottom: 16px; }

.media-error {
  color: var(--red);
  font-size: 0.85rem;
  margin-top: 12px;
}

.media-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.media-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.media-status-bar .status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}
.media-status-bar .status-dot.online {
  background: var(--green);
  box-shadow: 0 0 10px rgba(34,197,94,0.8);
}
.media-status-bar .status-dot.offline {
  background: var(--red);
  box-shadow: 0 0 10px rgba(248,113,113,0.7);
}

#mediaStatusText { flex: 1; font-size: 0.9rem; color: var(--text-dim); }

.btn-small { padding: 6px 14px; font-size: 0.82rem; }

.media-decks { margin-bottom: 24px; }

.deck-panel {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.deck-panel h3 { margin: 0 0 14px; font-size: 1rem; }

.deck-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.media-global {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}

.media-log {
  min-height: 20px;
  font-size: 0.85rem;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Below this the full row no longer fits the container without shrinking the
   links to an unreadable size, so the header collapses to the hamburger. The
   panel is positioned against .site-header (sticky, so it is the containing
   block) and spans the full viewport width under it.

   Retuned from 1155px to 1060px when the Client Login button left the header
   with the client portal. Measured minimum for brand + 11 links + the 24px
   container gutters is 994px; 1060px leaves ~66px of breathing room between
   the brand and the first link. Keep NAV_BREAKPOINT in script.js in step. */
@media (max-width: 1060px) {
  .nav-toggle { display: flex; }

  .header-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 8px 24px 20px;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
  }

  .header-menu.is-open { display: block; }

  .main-nav { flex-direction: column; gap: 0; }

  .main-nav a {
    display: block;
    padding: 13px 4px;
    font-size: 0.98rem;
    border-bottom: 1px solid var(--border);
  }
  .main-nav a:last-child { border-bottom: none; }
}

@media (max-width: 800px) {
  .hero h1 { font-size: 2rem; }
}

/* Utilities */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Empty, loading & error states ----------
   "Nothing published yet" and "we could not reach the server" are
   different problems for the reader, so they are drawn differently:
   the first is a dashed, quiet box; the second is solid, red-edged and
   offers a retry, because it is the one that might fix itself. */
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 34px 24px;
  text-align: center;
}

.empty-state-icon {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.empty-state h4 { margin: 0 0 6px; font-size: 1rem; }

.empty-state p {
  margin: 0 auto;
  max-width: 440px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.empty-state .btn { margin-top: 18px; }

.empty-state-error {
  border-style: solid;
  border-color: var(--red-dim);
}
.empty-state-error .empty-state-icon { color: var(--red); }

.empty-state-loading .empty-state-icon { animation: state-pulse 1.4s ease-in-out infinite; }

@keyframes state-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .empty-state-loading .empty-state-icon { animation: none; }
  .nav-toggle-bar { transition: none; }
  html { scroll-behavior: auto; }
}
