:root {
  color-scheme: dark;
  --bg: #0a0d0b;
  --ink: #f4f7ef;
  --muted: #9ba59a;
  --line: rgba(214, 255, 225, 0.16);
  --panel: rgba(18, 23, 20, 0.88);
  --panel-strong: rgba(30, 39, 34, 0.96);
  --accent: #45f6a3;
  --accent-2: #63d7ff;
  --accent-3: #ff6ea8;
  --warning: #ffc857;
  --shadow: 0 18px 65px rgba(0, 0, 0, 0.45);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(69, 246, 163, 0.13), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(255, 110, 168, 0.11), transparent 26%),
    linear-gradient(90deg, rgba(214, 255, 225, 0.035) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(rgba(214, 255, 225, 0.035) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: stretch;
  min-height: 210px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 18% 28%, rgba(69, 246, 163, 0.22), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(99, 215, 255, 0.14), transparent 30%),
    linear-gradient(135deg, rgba(15, 20, 17, 0.98) 0%, rgba(20, 31, 26, 0.95) 54%, rgba(12, 15, 13, 0.98) 100%);
  background-position: 0 0, 0 0;
  background-size: 120% 120%, 100% 100%;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  animation: heroGlow 9s ease-in-out infinite;
}

.hero::after {
  content: none;
}

.hero-copy,
.hero-panel {
  position: relative;
  z-index: 1;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.brand-mark img {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(99, 215, 255, 0.28);
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(69, 246, 163, 0.2);
}

.brand-mark .eyebrow {
  margin: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(2.6rem, 5vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.18rem;
  letter-spacing: 0;
}

.summary {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.community-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.community-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 14px;
  background: rgba(7, 10, 8, 0.58);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.community-link:hover {
  border-color: rgba(69, 246, 163, 0.52);
  transform: translateY(-1px);
}

.community-link.primary {
  border-color: rgba(69, 246, 163, 0.42);
  background: linear-gradient(135deg, rgba(69, 246, 163, 0.2), rgba(99, 215, 255, 0.14));
}

.hero-panel {
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(214, 255, 225, 0.15);
  border-radius: var(--radius);
  background: rgba(7, 10, 8, 0.52);
  backdrop-filter: blur(14px);
}

.hero-panel strong {
  display: block;
  margin-top: 4px;
  font-size: 1.45rem;
}

.brief-meta {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.brief-meta p {
  margin: 0;
  color: #c7d0c5;
  font-size: 0.87rem;
  line-height: 1.45;
}

.panel-label,
.metric-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.pulse-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  height: 42px;
  align-items: end;
}

.pulse-track span {
  display: block;
  height: 34%;
  border-radius: 3px;
  background: var(--accent);
  animation: pulseBar 1.4s ease-in-out infinite;
}

.pulse-track span:nth-child(2) {
  animation-delay: 0.12s;
  background: var(--accent-2);
}

.pulse-track span:nth-child(3) {
  animation-delay: 0.24s;
  background: var(--warning);
}

.pulse-track span:nth-child(4) {
  animation-delay: 0.36s;
  background: var(--accent-3);
}

.control-bar,
.archive-bar,
.metrics,
.dashboard-grid {
  margin-top: 18px;
}

.archive-bar {
  display: grid;
  grid-template-columns: minmax(230px, 0.55fr) minmax(440px, 1fr);
  gap: 24px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 44%),
    rgba(9, 13, 11, 0.88);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
}

.archive-copy h2 {
  font-size: 1.12rem;
}

.archive-summary,
.archive-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.archive-picker {
  display: grid;
  gap: 9px;
}

.archive-actions {
  display: grid;
  grid-template-columns: auto minmax(176px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.archive-date-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(8, 12, 10, 0.92);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.archive-date-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(69, 246, 163, 0.14);
  transform: translateY(-1px);
}

.archive-date-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  color-scheme: dark;
  font-weight: 700;
}

.brief-days {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.brief-days-label {
  margin: 2px 0 -2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brief-day {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(7, 10, 8, 0.58);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.brief-day:hover {
  border-color: rgba(69, 246, 163, 0.48);
  color: var(--ink);
  transform: translateY(-1px);
}

.brief-day.is-active {
  border-color: rgba(69, 246, 163, 0.52);
  background: rgba(69, 246, 163, 0.15);
  color: var(--ink);
}

.archive-nav {
  min-height: 42px;
  font-weight: 800;
}

.control-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, auto) auto;
  gap: 12px;
  align-items: center;
}

.search {
  display: grid;
  gap: 6px;
}

.search span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  background: rgba(8, 12, 10, 0.84);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(69, 246, 163, 0.14);
  transform: translateY(-1px);
}

.segments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 12, 10, 0.76);
}

.segment,
.ghost-btn {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.segment:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
}

.segment.is-active {
  background: linear-gradient(135deg, rgba(69, 246, 163, 0.22), rgba(99, 215, 255, 0.2));
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(69, 246, 163, 0.24), 0 10px 30px rgba(69, 246, 163, 0.08);
}

.ghost-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.metric-card,
.panel,
.story-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 42%),
    var(--panel);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(16px);
}

.metric-card {
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto 14px 12px 14px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  transform: translateX(-105%);
  animation: scan 4s ease-in-out infinite;
}

.metric-card strong {
  display: block;
  margin: 8px 0 2px;
  font-size: 2rem;
}

.metric-card small {
  color: var(--muted);
}

.ticker {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #050705;
  color: var(--ink);
}

.ticker-track {
  display: flex;
  width: max-content;
  gap: 28px;
  padding: 12px 0;
  animation: ticker 34s linear infinite;
}

.ticker-item {
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
}

.ticker-item span {
  color: var(--accent);
  margin-right: 8px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.story-board,
.side-rail {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.section-head.compact {
  margin-bottom: 14px;
}

.count-pill,
.source-pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.story-list {
  display: grid;
  gap: 12px;
}

.story-card {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: stretch;
  padding: 14px;
  animation: cardIn 380ms ease both;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.story-card:hover {
  border-color: rgba(69, 246, 163, 0.48);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.story-stripe {
  border-radius: 999px;
  background: var(--accent);
}

.story-card[data-category="business"] .story-stripe {
  background: var(--accent-2);
}

.story-card[data-category="policy"] .story-stripe {
  background: var(--accent-3);
}

.story-card[data-category="product"] .story-stripe {
  background: var(--warning);
}

.story-card[data-category="research"] .story-stripe {
  background: #b28cff;
}

.story-main {
  min-width: 0;
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.story-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  line-height: 1.32;
  letter-spacing: 0;
}

.story-card p {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.technical-preview {
  display: -webkit-box;
  max-width: 74ch;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: #c4cec1;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.tech-tags span,
.tech-tag {
  border-color: rgba(99, 215, 255, 0.24);
  background: rgba(99, 215, 255, 0.08);
  color: #b7eeff;
}

.story-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.open-story,
.visit-link {
  min-height: 34px;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 0 12px;
  background: var(--panel-strong);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.visit-link {
  display: inline-flex;
  align-items: center;
}

.impact {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 4px;
  min-width: 68px;
}

.impact strong {
  font-size: 1.65rem;
}

.impact span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.side-rail {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 18px;
}

.panel {
  padding: 16px;
}

.bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-row header {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: capitalize;
}

.bar-shell {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(214, 255, 225, 0.1);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform-origin: left;
  animation: grow 700ms ease both;
}

.source-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-pill {
  min-height: 32px;
  background: rgba(255, 255, 255, 0.035);
}

.source-pill.is-muted {
  border-style: dashed;
  color: #737d73;
}

.automation {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.automation p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.clock-ring {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0 72deg, rgba(214, 255, 225, 0.1) 72deg 360deg);
}

.clock-ring span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}

.story-dialog {
  width: min(860px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.story-dialog::backdrop {
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(4px);
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
}

.dialog-kicker {
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
}

.dialog-title {
  margin: 8px 0 12px;
  font-size: 1.7rem;
}

.dialog-section {
  margin: 20px 0;
}

.dialog-section h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--accent-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dialog-section p {
  color: #cdd7ca;
  line-height: 1.7;
}

.dialog-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.dialog-list li {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.watch-box {
  border: 1px solid rgba(255, 200, 87, 0.25);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 200, 87, 0.06);
}

.empty {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

@keyframes heroGlow {
  0% {
    background-position: 0 0, 0 0;
  }
  50% {
    background-position: 18% 8%, 0 0;
  }
  100% {
    background-position: 0 0, 0 0;
  }
}

@keyframes pulseBar {
  0%,
  100% {
    height: 28%;
  }
  50% {
    height: 100%;
  }
}

@keyframes scan {
  0%,
  45% {
    transform: translateX(-105%);
  }
  80%,
  100% {
    transform: translateX(105%);
  }
}

@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

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

@media (max-width: 980px) {
  .hero,
  .archive-bar,
  .dashboard-grid,
  .control-bar {
    grid-template-columns: 1fr;
  }

  .archive-actions {
    grid-template-columns: auto minmax(185px, 1fr) auto;
  }

  .segments {
    justify-content: flex-start;
  }

  .side-rail {
    position: static;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding-top: 10px;
  }

  .hero {
    padding: 20px;
  }

  .archive-bar {
    padding: 14px;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .story-card {
    grid-template-columns: 7px minmax(0, 1fr);
  }

  .impact {
    grid-column: 2;
    grid-row: 2;
    justify-items: start;
    grid-auto-flow: column;
    align-items: baseline;
  }
}

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

  .archive-date-field {
    min-height: 40px;
  }

  .brief-days {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-nav {
    min-height: 38px;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .automation {
    grid-template-columns: 1fr;
  }
}
