:root {
  --page: #05060b;
  --panel: #0b0e18;
  --panel-2: #101424;
  --text: #f7f8fb;
  --muted: #aeb6c8;
  --line: rgba(255, 255, 255, 0.10);

  --blue: #2c8cff;
  --blue-deep: #0c2f83;
  --red: #ff3148;
  --red-deep: #7a1028;

  --shell: 1180px;
  --radius: 18px;
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 12%, rgba(44, 140, 255, 0.10), transparent 28rem),
    radial-gradient(circle at 85% 12%, rgba(255, 49, 72, 0.10), transparent 28rem),
    var(--page);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.shell {
  width: min(calc(100% - 32px), var(--shell));
  margin-inline: auto;
}

/* Header + banner now come from the shared css/site-header.css. */

/* Section eyebrow (kept: used by the archive heading and article-detail). */
.eyebrow {
  margin: 0 0 8px;
  color: #d7dcec;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.hero-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 28px;
  padding: 0 22px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(44, 140, 255, 0.92), rgba(255, 49, 72, 0.92));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  text-decoration: none;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-button:hover,
.hero-button:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

/* Listing section */

.articles-section {
  /* Sits directly under the shared header, so only a comfortable top gap. */
  padding-block: 44px 90px;
  scroll-margin-top: 90px;
}

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

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -0.025em;
}

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

.filter-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  font-weight: 800;
}

.filter-button:hover,
.filter-button:focus-visible,
.filter-button.is-active {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.09);
}

.article-results {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Article grid — two large cards per row, four rows per page */

.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  grid-auto-rows: 1fr;
  gap: 28px;
}

.article-card {
  --accent: var(--blue);
  position: relative;
  height: 100%;
  overflow: hidden;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 34%),
    var(--panel);
  box-shadow: var(--shadow);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.article-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent) 82%, white 4%);
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.48),
    0 0 32px color-mix(in srgb, var(--accent) 18%, transparent);
}

.article-card:focus-within {
  border-color: color-mix(in srgb, var(--accent) 82%, white 4%);
}

.article-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.article-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(44, 140, 255, 0.20), rgba(255, 49, 72, 0.20)),
    #d8d8dc;
}

.article-card__media::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  height: 46%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.68));
}

.article-card__image {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.article-card:hover .article-card__image {
  transform: scale(1.025);
}

/* Tall / portrait graphics: show the whole image (contain) over a blurred,
   darkened, slightly scaled copy of itself so the sidebars read as a poster
   presentation rather than empty letterboxing. The card's fixed 16/9 media box
   and outer dimensions are unchanged. */

.article-card__media.is-portrait {
  background: #070912;
}

.article-card__media.is-portrait::before {
  content: "";
  position: absolute;
  inset: -20px;
  z-index: 0;
  background-image: var(--card-image);
  background-position: center;
  background-size: cover;
  filter: blur(22px) brightness(0.35);
  transform: scale(1.08);
}

.article-card__media.is-portrait .article-card__image {
  object-fit: contain;
}

/* The whole image is already visible; don't nudge it on hover. */
.article-card:hover .article-card__media.is-portrait .article-card__image {
  transform: none;
}

.article-card__badge {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  color: #fff;
  background: color-mix(in srgb, var(--accent) 72%, #05060b);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.36);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 260px;
  padding: 24px 24px 26px;
}

.article-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.article-card__meta span + span::before {
  content: "•";
  margin-right: 8px;
  color: color-mix(in srgb, var(--accent) 80%, white);
}

.article-card h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 2.05rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.article-card__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin: 14px 0 0;
  color: #d5daea;
  font-size: 0.98rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.article-card__cta {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
  color: color-mix(in srgb, var(--accent) 72%, white);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.article-card__cta::after {
  content: "→";
  font-size: 1.1em;
  transition: transform 160ms ease;
}

.article-card:hover .article-card__cta::after {
  transform: translateX(4px);
}

.article-card--message {
  grid-column: 1 / -1;
}

.article-card--message:hover {
  transform: none;
}

/* Loading skeletons */

.article-card--skeleton {
  border-color: var(--line);
  box-shadow: none;
}

.article-card--skeleton:hover {
  transform: none;
  box-shadow: none;
}

.article-card--skeleton .article-card__media {
  background: var(--panel-2);
}

.article-card--skeleton .article-card__media::after {
  display: none;
}

.skeleton-line,
.article-card--skeleton .article-card__media {
  position: relative;
  overflow: hidden;
}

.skeleton-line {
  display: block;
  height: 13px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--panel-2);
}

.skeleton-line--meta {
  width: 45%;
  height: 10px;
  margin-bottom: 18px;
}

.skeleton-line--title {
  height: 24px;
  margin-bottom: 10px;
}

.skeleton-line--short {
  width: 62%;
}

.skeleton-line::after,
.article-card--skeleton .article-card__media::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.06),
    transparent
  );
  animation: skeleton-sweep 1.25s ease-in-out infinite;
}

@keyframes skeleton-sweep {
  to {
    transform: translateX(100%);
  }
}

/* Pagination */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 44px;
}

.pagination[hidden] {
  display: none;
}

.pagination__numbers {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pagination__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel-2);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0.05em;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.pagination__number {
  min-width: 46px;
  padding: 0 6px;
  font-size: 0.95rem;
}

.pagination__step {
  padding: 0 20px;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.pagination__item:hover,
.pagination__item:focus-visible {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.28);
  background: #171c2d;
}

/* Current page — branded red/blue gradient with the house glow */
.pagination__number.is-current {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
  background:
    linear-gradient(90deg, rgba(44, 140, 255, 0.95), rgba(255, 49, 72, 0.95));
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.42),
    0 0 22px rgba(255, 49, 72, 0.28),
    0 0 22px rgba(44, 140, 255, 0.22);
  cursor: default;
}

.pagination__number.is-current:hover {
  background:
    linear-gradient(90deg, rgba(44, 140, 255, 0.95), rgba(255, 49, 72, 0.95));
}

.pagination__item.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 46px;
  color: var(--muted);
  font-weight: 900;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: #030409;
}

.site-footer__inner {
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 0.86rem;
}

/* Responsive */

@media (max-width: 900px) {
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .article-card__body {
    min-height: 230px;
  }
}

@media (max-width: 720px) {
  /* One card per row on mobile. Page size stays at 8. */
  .article-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .article-card__body {
    min-height: 0;
    padding: 20px 20px 22px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(calc(100% - 22px), var(--shell));
  }

  .articles-section {
    padding-block: 32px 70px;
  }

  .filters {
    width: 100%;
  }

  .filter-button {
    flex: 1 1 auto;
  }

  .site-footer__inner {
    min-height: 110px;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    padding-block: 24px;
  }

  .site-footer__inner p {
    margin: 0;
  }
}

@media (max-width: 560px) {
  /* Keep the control inside the viewport: tighter items, wrapping rows,
     and the script drops to zero sibling pages at this width. */
  .pagination {
    gap: 8px;
  }

  .pagination__item {
    min-height: 44px;
  }

  .pagination__number {
    min-width: 44px;
  }

  .pagination__step {
    padding: 0 14px;
    font-size: 0.76rem;
  }
}
