:root {
  --bg: #0d1422;
  --panel: #0f1a2d;
  --panel-2: #15233a;
  --text: #e8efff;
  --muted: #b6c2e2;
  --accent: #f0a35e;
  --accent-2: #79e0cc;
  --border: rgba(255, 255, 255, 0.11);
  --shadow: 0 24px 50px rgba(4, 10, 24, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  font-family: "Trebuchet MS", "Verdana", "Gill Sans", sans-serif;
  background: radial-gradient(circle at 12% 12%, rgba(120, 225, 191, 0.2), transparent 35%),
    radial-gradient(circle at 84% 8%, rgba(240, 163, 94, 0.22), transparent 42%),
    linear-gradient(120deg, #091222 8%, #0d1a2d 45%, #091a2e 100%);
  padding: 20px;
}

.aurora,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

.aurora {
  background:
    radial-gradient(circle at 20% 20%, rgba(121, 224, 204, 0.14), transparent 30%),
    radial-gradient(circle at 80% 80%, rgba(240, 163, 94, 0.13), transparent 35%);
}

.grain {
  background-image: repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 3px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px,
      transparent 3px
    );
  mix-blend-mode: overlay;
  opacity: 0.25;
  z-index: -1;
}

.page-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 0 30px;
}

.site-header {
  margin-bottom: 24px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(23, 38, 63, 0.88), rgba(10, 18, 35, 0.7));
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 700;
}

.site-header h1 {
  margin: 8px 0 4px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.1;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

section {
  margin-bottom: 20px;
}

.section-title-wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

#refresh-btn {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(240, 163, 94, 0.25), rgba(121, 224, 204, 0.25));
  color: var(--text);
  padding: 9px 16px;
  font-weight: 700;
  cursor: pointer;
}

#refresh-btn:hover,
#refresh-btn:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.status-text {
  color: var(--muted);
  margin: 0 0 12px;
}

.news-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(130deg, rgba(21, 36, 59, 0.95), rgba(11, 20, 37, 0.9));
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  overflow: hidden;
  transform: translateY(8px);
  opacity: 0;
  animation: rise 0.45s ease forwards;
  min-height: 100%;
}

.news-card--pinned {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
  min-height: 240px;
}

.pinned-section {
  margin-bottom: 24px;
}

.pinned-section .news-card {
  background: linear-gradient(120deg, rgba(28, 50, 85, 0.9), rgba(14, 29, 52, 0.95));
  border-color: rgba(121, 224, 204, 0.42);
}

.image-wrap {
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(120deg, rgba(240, 163, 94, 0.25), rgba(121, 224, 204, 0.25));
  aspect-ratio: 16 / 9;
  min-height: 170px;
}

.image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.image-wrap img.has-image {
  opacity: 1;
}

.news-card-body {
  display: grid;
  gap: 8px;
}

.news-source {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.news-title {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.25;
}

.news-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  max-height: 4.7em;
  overflow: hidden;
}

.news-footer {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.news-link {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 700;
}

.news-link:hover,
.news-link:focus-visible {
  text-decoration: underline;
}

.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

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

@media (min-width: 780px) {
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .news-card--pinned {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  body {
    padding: 14px;
  }

  .site-header,
  .news-card {
    border-radius: 16px;
  }

  .section-title-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .news-footer {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
}
