:root {
  --ink: #f7f1e8;
  --muted: #b9b1a5;
  --paper: #101010;
  --panel: #181818;
  --line: rgba(255, 255, 255, 0.12);
  --amber: #ffb347;
  --red: #e74646;
  --teal: #49d0c2;
  --green: #8bd450;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.hero {
  min-height: 92vh;
  position: relative;
  display: grid;
  align-items: end;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(10, 10, 10, 0.92) 0%, rgba(10, 10, 10, 0.68) 42%, rgba(10, 10, 10, 0.18) 100%),
    linear-gradient(0deg, rgba(16, 16, 16, 1) 0%, rgba(16, 16, 16, 0.2) 38%);
}

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px clamp(18px, 5vw, 64px);
}

.brand {
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-button,
.outline-link {
  min-width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(16, 16, 16, 0.38);
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  border-radius: 6px;
  backdrop-filter: blur(12px);
}

.icon-button {
  cursor: pointer;
}

.outline-link {
  padding: 0 16px;
  font-size: 0.88rem;
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  padding: 140px clamp(18px, 5vw, 64px) 44px;
}

.kicker,
.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

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

h1 {
  margin-bottom: 18px;
  max-width: 690px;
  font-size: clamp(3rem, 9vw, 6.8rem);
  line-height: 0.93;
  letter-spacing: 0;
}

.lede {
  max-width: 590px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.55;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  width: min(520px, 100%);
  margin-top: 32px;
  background: var(--line);
  border: 1px solid var(--line);
}

.hero-metrics div {
  padding: 16px;
  background: rgba(15, 15, 15, 0.72);
}

.hero-metrics strong {
  display: block;
  font-size: 1.4rem;
}

.hero-metrics span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

main {
  display: grid;
  gap: 34px;
  padding: 28px clamp(16px, 4vw, 52px) 56px;
}

.controls {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) minmax(220px, 0.8fr);
  gap: 14px;
  align-items: end;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  background: #232323;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px;
}

.segment {
  min-height: 42px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.segment.active {
  color: #111;
  background: var(--amber);
}

.search-box,
.watch-box {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171717;
  color: var(--ink);
  padding: 0 16px;
  outline: 0;
}

input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(73, 208, 194, 0.16);
}

.ticker {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  min-height: 54px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ticker-label {
  color: #111;
  background: var(--teal);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 9px 10px;
  border-radius: 4px;
}

.ticker-track {
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
}

.section-heading > p {
  color: var(--muted);
  margin-bottom: 4px;
  text-align: right;
}

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

.story-card {
  grid-column: span 4;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.story-card:nth-child(1),
.story-card:nth-child(7n) {
  grid-column: span 6;
}

.story-link {
  display: grid;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.art-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #262626;
  overflow: hidden;
}

.story-art,
.art-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.story-art {
  object-fit: cover;
}

.art-fallback {
  display: none;
  background:
    linear-gradient(135deg, rgba(16, 16, 16, 0.16), rgba(16, 16, 16, 0.58)),
    radial-gradient(circle at 82% 22%, rgba(73, 208, 194, 0.85), transparent 28%),
    linear-gradient(135deg, #ffb347, #c53737);
  padding: 22px;
  align-content: end;
}

.art-fallback::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
}

.art-fallback::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 22px;
  width: 54px;
  height: 54px;
  border: 12px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
}

.fallback-kicker,
.art-fallback strong {
  position: relative;
  z-index: 1;
  display: block;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.24);
}

.fallback-kicker {
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.art-fallback strong {
  max-width: 12ch;
  color: #fff;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  line-height: 0.94;
  text-transform: uppercase;
}

.story-card.no-image .story-art {
  display: none;
}

.story-card.no-image .art-fallback {
  display: block;
}

.story-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tag {
  color: #111;
  background: var(--green);
  padding: 5px 7px;
  border-radius: 4px;
  font-weight: 900;
}

.story-card[data-kind="news"] .tag {
  background: var(--red);
  color: white;
}

.story-body h3 {
  margin-bottom: 0;
  font-size: 1.2rem;
  line-height: 1.18;
}

.story-body p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.source-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #171717;
}

.source-item strong {
  display: block;
  margin-bottom: 8px;
}

.source-item span {
  color: var(--muted);
  font-size: 0.88rem;
}

.source-item.good {
  border-color: rgba(139, 212, 80, 0.42);
}

.source-item.warn {
  border-color: rgba(255, 179, 71, 0.5);
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

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

  .story-card,
  .story-card:nth-child(1),
  .story-card:nth-child(7n) {
    grid-column: span 6;
  }
}

@media (max-width: 680px) {
  .hero {
    min-height: 86vh;
  }

  .topbar {
    padding: 16px;
  }

  .brand {
    font-size: 0.78rem;
  }

  .outline-link {
    display: none;
  }

  .hero-copy {
    padding: 110px 16px 30px;
  }

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

  main {
    padding-inline: 14px;
  }

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

  .ticker,
  .section-heading {
    display: grid;
  }

  .section-heading > p {
    text-align: left;
  }

  .story-card,
  .story-card:nth-child(1),
  .story-card:nth-child(7n) {
    grid-column: 1 / -1;
  }
}
