:root {
  --ink: #142019;
  --muted: #667168;
  --paper: #f4f3ec;
  --card: #fffef9;
  --line: #d9dcd3;
  --accent: #edff73;
  --orange: #ef6b43;
  --dark: #101713;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0%, rgba(237, 255, 115, .25), transparent 25rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.site-header {
  min-height: 78px;
  padding: 18px clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 850;
  letter-spacing: -1.2px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--accent);
  font-size: 18px;
  letter-spacing: -1px;
}

.brand-dot {
  color: var(--orange);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3d9e58;
  box-shadow: 0 0 0 4px rgba(61, 158, 88, .12);
}

.status-divider {
  width: 1px;
  height: 14px;
  margin: 0 4px;
  background: var(--line);
}

main {
  width: min(1440px, 100%);
  margin: auto;
  padding: 0 clamp(20px, 5vw, 72px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(250px, .65fr);
  gap: 48px;
  align-items: end;
  padding: clamp(52px, 8vw, 100px) 0 56px;
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .2em;
}

h1 {
  margin: 0;
  max-width: 900px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(45px, 7vw, 94px);
  font-weight: 500;
  line-height: .97;
  letter-spacing: -.055em;
}

h1 em {
  color: var(--muted);
  font-weight: 400;
}

.hero-copy {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.search-box {
  width: min(410px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.search-box span {
  font-size: 25px;
}

.search-box input {
  width: 100%;
  padding: 9px 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 13px;
}

#refresh-button {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--ink);
  border-radius: 100px;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}

#refresh-button:hover {
  background: var(--ink);
  color: white;
}

#refresh-button:disabled {
  cursor: wait;
  opacity: .55;
}

#refresh-button:disabled .refresh-icon {
  animation: spin 1s linear infinite;
}

.notice {
  margin: 20px 0 0;
  padding: 12px 16px;
  border: 1px solid #e3b7a9;
  border-radius: 8px;
  color: #8b3b22;
  background: #fff0e9;
  font-size: 14px;
}

.trends-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 30px 0 80px;
}

.trend-card {
  min-width: 0;
  min-height: 300px;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--card);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.trend-card:hover {
  transform: translateY(-4px);
  border-color: #b5baae;
  box-shadow: 0 16px 45px rgba(20, 32, 25, .09);
}

.trend-card:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.card-image {
  position: relative;
  height: 145px;
  overflow: hidden;
  background: linear-gradient(135deg, #263b2e, #87975a);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.trend-card:hover .card-image img {
  transform: scale(1.035);
}

.rank {
  position: absolute;
  left: 14px;
  top: 14px;
  min-width: 34px;
  padding: 6px 9px;
  border-radius: 100px;
  background: rgba(16, 23, 19, .85);
  color: white;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  backdrop-filter: blur(6px);
}

.new-badge {
  position: absolute;
  right: 14px;
  top: 14px;
  padding: 6px 9px;
  border-radius: 100px;
  color: var(--ink);
  background: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
}

.card-body {
  flex: 1;
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.card-source {
  margin-bottom: 12px;
  color: var(--orange);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.card-body h2 {
  margin: 0 0 13px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.025em;
}

.card-summary {
  display: -webkit-box;
  margin: 0 0 22px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-footer {
  margin-top: auto;
  padding-top: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.read-story {
  color: var(--ink);
  font-weight: 800;
}

.loading {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 30px 0 80px;
}

.loading div {
  height: 300px;
  border-radius: 15px;
  background: linear-gradient(100deg, #e6e6de 25%, #f2f2eb 40%, #e6e6de 60%);
  background-size: 300% 100%;
  animation: shimmer 1.4s infinite;
}

.empty-state {
  padding: 80px 20px 120px;
  text-align: center;
}

.empty-state h2 {
  font-family: Georgia, serif;
  font-size: 34px;
  font-weight: 500;
}

.empty-state p {
  color: var(--muted);
}

footer {
  padding: 35px clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  gap: 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

footer p {
  margin: 0;
}

footer p:last-child {
  margin-left: auto;
}

.footer-brand {
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -.7px;
}

.reader-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(7, 13, 9, .58);
  backdrop-filter: blur(4px);
}

.reader {
  position: fixed;
  z-index: 21;
  top: 0;
  right: 0;
  width: min(680px, 100%);
  height: 100dvh;
  overflow-y: auto;
  color: var(--ink);
  background: var(--card);
  box-shadow: -20px 0 70px rgba(0, 0, 0, .2);
  animation: slide-in .25s ease-out;
}

.reader-topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 18px clamp(24px, 6vw, 52px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 249, .94);
  backdrop-filter: blur(12px);
}

.reader-label {
  color: var(--orange);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
}

.close-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  font-size: 26px;
  line-height: 1;
}

.close-button:hover {
  background: var(--paper);
}

#reader-content {
  padding: 42px clamp(24px, 6vw, 52px) 70px;
}

.reader-source {
  color: var(--orange);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

#reader-title {
  margin: 18px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(37px, 6vw, 58px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.04em;
}

.reader-meta {
  padding-bottom: 24px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.reader-image {
  width: 100%;
  max-height: 320px;
  margin: 28px 0;
  border-radius: 12px;
  object-fit: cover;
}

.reader-headline {
  margin: 32px 0 12px;
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.25;
}

.reader-summary {
  color: #3f4942;
  font-family: Georgia, serif;
  font-size: 19px;
  line-height: 1.7;
}

.coverage-title {
  margin: 38px 0 10px;
  font-size: 11px;
  letter-spacing: .15em;
}

.coverage-item {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.coverage-item strong {
  display: block;
  margin-bottom: 8px;
  color: var(--orange);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.coverage-item h3 {
  margin: 0 0 8px;
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
}

.coverage-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.briefing-note {
  margin-top: 32px;
  padding: 16px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--paper);
  font-size: 11px;
  line-height: 1.6;
}

.toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 13px 20px;
  border-radius: 100px;
  color: white;
  background: var(--dark);
  box-shadow: 0 10px 35px rgba(0, 0, 0, .2);
  font-size: 13px;
}

.noscript {
  position: fixed;
  inset: auto 20px 20px;
  padding: 16px;
  color: white;
  background: #8b3b22;
  text-align: center;
}

body.reader-open {
  overflow: hidden;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  to { background-position-x: -150%; }
}

@keyframes slide-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@media (max-width: 1000px) {
  .trends-grid,
  .loading {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .hero-copy {
    max-width: 600px;
  }
}

@media (max-width: 650px) {
  .site-header {
    align-items: flex-start;
  }

  .header-status {
    justify-content: flex-end;
    flex-wrap: wrap;
    max-width: 140px;
    text-align: right;
    font-size: 9px;
  }

  .status-divider,
  .header-status > span:nth-child(2) {
    display: none;
  }

  .hero {
    padding-top: 48px;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .trends-grid,
  .loading {
    grid-template-columns: 1fr;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  footer p:last-child {
    margin-left: 0;
  }
}
