:root {
  --bg: #f4f9f1;
  --panel: #f8fbf5;
  --card: #ffffff;
  --card-alt: #edf6ea;

  --line: #dfeee0;

  --text: #18382c;
  --muted: #587266;

  --accent: #7dcf7a;
  --accent-strong: #4ea45e;
  --accent-deep: #1e5d39;

  --warning: #d9a631;
  --danger: #d96252;

  --shadow: rgba(30, 93, 57, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;

  font-family: "Inter", sans-serif;

  background: var(--bg);
  color: var(--text);

  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.container {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}


/* HEADER */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;

  background: rgba(231, 244, 231, 0.96);

  border-bottom: 1px solid var(--line);

  backdrop-filter: blur(12px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;

  min-height: 72px;

  gap: 18px;
}

.brand-wrap {
  display: flex;
  align-items: center;

  gap: 12px;

  min-width: 180px;
}

.brand-mark {
  width: 30px;
  height: 30px;

  border-radius: 8px;

  display: grid;
  place-items: center;

  font-weight: 800;

  background:
    linear-gradient(
      180deg,
      var(--accent),
      var(--accent-strong)
    );

  color: white;

  box-shadow:
    0 6px 16px rgba(94, 160, 90, 0.18);
}

.brand-text {
  display: flex;
  flex-direction: column;

  line-height: 1.1;
}

.brand-name {
  font-weight: 800;
  letter-spacing: -0.05em;
}

.brand-sub {
  font-size: 11px;

  color: var(--muted);

  letter-spacing: 0.08em;

  text-transform: uppercase;
}


/* NAVIGATION */

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 20px;

  font-size: 13px;
  font-weight: 600;

  flex-wrap: wrap;

  color: var(--muted);
}

.main-nav a {
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--accent-deep);
  transform: translateY(-1px);
}


/* TOOLBAR */

.toolbar {
  display: flex;
  align-items: center;

  gap: 10px;
}

.search-box {
  display: flex;
  align-items: center;

  gap: 8px;

  background: rgba(255, 255, 255, 0.85);

  border: 1px solid var(--line);

  border-radius: 999px;

  padding: 8px 12px;

  min-width: min(340px, 30vw);

  color: var(--muted);
}

.search-box input {
  width: 100%;

  border: none;

  background: transparent;

  outline: none;

  color: var(--text);
}

.search-box input::placeholder {
  color: var(--muted);
}


/* BUTTONS */

.cta-btn,
.secondary-btn,
.pill {
  border: 1px solid var(--line);

  border-radius: 999px;

  background: var(--card);

  color: var(--text);

  cursor: pointer;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;

  display: inline-flex;

  align-items: center;
  justify-content: center;

  text-decoration: none;
}

.cta-btn {
  background:
    linear-gradient(
      180deg,
      var(--accent),
      var(--accent-strong)
    );

  padding: 10px 16px;

  border: none;

  color: white;

  font-weight: 700;

  box-shadow:
    0 8px 20px rgba(78, 164, 94, 0.22);
}

.cta-btn:hover,
.secondary-btn:hover,
.pill:hover {
  transform: translateY(-1px);

  box-shadow:
    0 6px 16px rgba(30, 93, 57, 0.10);
}

.cta-btn:active,
.secondary-btn:active,
.pill:active {
  transform: translateY(0);
}

.secondary-btn {
  background: white;

  padding: 10px 14px;

  font-weight: 700;

  margin-top: 10px;
}

.pill {
  padding: 7px 12px;

  font-size: 12px;

  font-weight: 600;
}

.pill.active {
  background: var(--accent-deep);

  border-color: var(--accent-deep);

  color: #eefaf0;
}


/* MAIN */

.page-shell {
  display: grid;

  grid-template-columns:
    minmax(0, 2fr)
    minmax(260px, 0.9fr);

  gap: 26px;

  padding: 28px 0 52px;
}


/* FEED */

.feed-panel {
  background: rgba(255, 255, 255, 0.55);

  border: 1px solid var(--line);

  border-radius: 18px;

  box-shadow:
    0 18px 36px var(--shadow);

  overflow: hidden;
}

.feed-header {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 20px;

  padding: 20px 18px 14px;

  border-bottom: 1px solid var(--line);
}

.feed-header h1 {
  margin: 0;

  font-size: clamp(1.8rem, 2vw, 2.4rem);

  letter-spacing: -0.05em;
}

.eyebrow {
  font-size: 11px;

  letter-spacing: 0.14em;

  text-transform: uppercase;

  color: var(--muted);

  margin: 0 0 8px;

  font-weight: 700;
}

.feed-status {
  margin: 5px 0 0;

  color: var(--muted);

  font-size: 12px;
}

.feed-filters {
  display: flex;

  align-items: center;

  gap: 8px;

  flex-wrap: wrap;
}


/* STORIES */

.stories {
  padding: 6px 0 12px;
}

.story-card {
  display: grid;

  grid-template-columns:
    42px
    minmax(0, 1fr)
    auto;

  gap: 14px;

  align-items: start;

  padding: 18px;

  border-bottom: 1px solid var(--line);

  transition:
    background 0.2s ease;
}

.story-card:hover {
  background: rgba(125, 207, 122, 0.06);
}

.story-rank {
  color: var(--muted);

  font-size: 13px;

  font-weight: 700;

  text-align: center;

  padding-top: 4px;
}

.story-body {
  min-width: 0;
}

.story-head {
  display: flex;

  align-items: baseline;

  gap: 10px;

  flex-wrap: wrap;

  margin-bottom: 8px;
}

.story-title {
  margin: 0;

  font-size:
    clamp(1.05rem, 1.7vw, 1.4rem);

  font-weight: 700;

  line-height: 1.35;

  letter-spacing: -0.03em;
}

.story-title a {
  color: var(--text);

  text-decoration: none;
}

.story-title a:hover {
  color: var(--accent-deep);

  text-decoration: underline;
}

.story-source {
  color: var(--muted);

  font-size: 12px;
}

.story-summary {
  margin: 0 0 10px;

  color: var(--muted);

  font-size: 0.95rem;

  line-height: 1.6;
}

.story-meta {
  display: flex;

  align-items: center;

  gap: 8px 12px;

  flex-wrap: wrap;

  color: var(--muted);

  font-size: 12px;

  font-weight: 600;
}

.story-meta .score {
  color: var(--accent-deep);
}

.story-tag,
.story-severity {
  display: inline-flex;

  align-items: center;

  border-radius: 999px;

  padding: 5px 9px;

  border: 1px solid var(--line);

  background: var(--card-alt);

  color: var(--accent-deep);

  font-weight: 700;
}

.story-severity.critical {
  background: #fff0ed;

  border-color: #f0c9c2;

  color: #9d392d;
}

.story-severity.high {
  background: #fff8e5;

  border-color: #ead9a7;

  color: #86641b;
}

.story-votes {
  display: flex;

  flex-direction: column;

  align-items: center;

  gap: 6px;

  padding-top: 4px;

  color: var(--muted);
}

.vote-button {
  border: none;

  background: transparent;

  color: var(--accent-strong);

  cursor: pointer;

  font-size: 18px;

  padding: 2px 6px;

  transition:
    transform 0.15s ease,
    color 0.15s ease;
}

.vote-button:hover {
  color: var(--accent-deep);

  transform: translateY(-2px);
}

.story-votes strong {
  font-size: 13px;

  color: var(--text);
}


/* SIDEBAR */

.sidebar {
  display: flex;

  flex-direction: column;

  gap: 18px;
}

.card {
  background: rgba(255, 255, 255, 0.6);

  border: 1px solid var(--line);

  border-radius: 18px;

  box-shadow:
    0 18px 32px rgba(20, 61, 38, 0.05);

  padding: 20px 18px;

  scroll-margin-top: 95px;
}

.hero-card {
  background:
    linear-gradient(
      180deg,
      rgba(146, 203, 141, 0.18),
      rgba(255, 255, 255, 0.7)
    );
}

.card h2,
.card h3 {
  margin: 0;

  letter-spacing: -0.05em;
}

.card p {
  color: var(--muted);

  line-height: 1.6;
}

.card-description {
  margin-bottom: 0;
}


/* RADAR */

.radar-list {
  list-style: none;

  padding: 0;

  margin: 18px 0 0;

  display: grid;

  gap: 12px;

  color: var(--text);

  font-weight: 600;
}

.radar-list li {
  display: flex;

  align-items: center;

  gap: 10px;

  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;

  border-radius: 50%;

  display: inline-block;

  flex: 0 0 auto;
}

.dot.green {
  background: var(--accent-strong);
}

.dot.amber {
  background: var(--warning);
}

.dot.red {
  background: var(--danger);
}


/* IOC GRID */

.ioc-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 16px;

  margin-top: 18px;
}

.ioc-grid div {
  background: var(--card-alt);

  border: 1px solid var(--line);

  border-radius: 12px;

  padding: 12px;

  display: flex;

  flex-direction: column;

  gap: 4px;
}

.ioc-grid strong {
  font-size: 1.1rem;

  color: var(--accent-deep);
}

.ioc-grid span {
  color: var(--muted);

  font-size: 12px;

  font-weight: 600;
}


/* STATES */

.loading,
.empty-state,
.error-state {
  padding: 50px 20px;

  text-align: center;

  color: var(--muted);
}

.error-state h3,
.empty-state h3 {
  margin-top: 0;

  color: var(--text);
}

.retry-button {
  margin-top: 10px;
}


/* FOOTER */

.footer {
  border-top: 1px solid var(--line);

  padding: 22px 0;

  color: var(--muted);

  font-size: 12px;
}

.footer-inner {
  display: flex;

  justify-content: space-between;

  gap: 15px;

  flex-wrap: wrap;
}


/* RESPONSIVE */

@media (max-width: 1100px) {

  .topbar-inner {
    flex-wrap: wrap;

    padding: 12px 0;
  }

  .main-nav {
    order: 3;

    width: 100%;

    justify-content: flex-start;

    overflow-x: auto;

    padding-bottom: 3px;
  }

  .toolbar {
    margin-left: auto;
  }
}


@media (max-width: 960px) {

  .page-shell {
    grid-template-columns: 1fr;
  }
}


@media (max-width: 680px) {

  .container {
    width: min(100% - 20px, 1200px);
  }

  .toolbar {
    width: 100%;

    margin-left: 0;
  }

  .search-box {
    min-width: 0;

    flex: 1;
  }

  .story-card {
    grid-template-columns:
      30px
      minmax(0, 1fr);
  }

  .story-votes {
    grid-column: 2;

    flex-direction: row;

    justify-content: flex-start;

    padding-top: 0;
  }

  .feed-header {
    flex-direction: column;

    align-items: flex-start;
  }

  .feed-filters {
    width: 100%;
  }

  .footer-inner {
    flex-direction: column;
  }
}
