:root {
  color-scheme: dark;
  --background: #0d0c10;
  --surface: #17151b;
  --surface-hover: #1d1a22;
  --border: #2b2731;
  --text: #f2eef5;
  --muted: #9e96a7;
  --accent: #c7a8db;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 80px 0;
}

.page-header {
  width: 100%;
  margin: 0 auto 48px;
  text-align: center;
}

.eyebrow,
.story-number {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.35rem, 7vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.055em;
  white-space: nowrap;
}

.intro {
  margin: 20px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 24px;
}

.story-card {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.story-card:hover {
  background: var(--surface-hover);
  border-color: #51475b;
}

.story-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.story-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.thumbnail-wrap {
  position: relative;
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #222028;
}

.thumbnail-wrap::after {
  content: "";
  position: absolute;
  inset: 28% 0 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(13, 12, 16, 0.9));
}

.thumbnail {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.8);
  transition: filter 250ms ease, transform 350ms ease;
}

.story-card:hover .thumbnail {
  filter: saturate(1);
  transform: scale(1.04);
}

.story-content {
  grid-area: 1 / 1;
  align-self: end;
  z-index: 3;
  display: flex;
  flex-direction: column;
  padding: 72px 24px 24px;
  pointer-events: none;
}

.story-card-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 14px;
}

.story-card-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.story-content h2 {
  min-height: 2.5em;
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.story-title-link {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  color: inherit;
  text-decoration: none;
  pointer-events: auto;
}

.story-title-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
}

.story-title-link:focus-visible {
  border-radius: 3px;
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.story-summary {
  min-height: 3em;
  margin: 12px 0 22px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.story-actions {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 4;
  display: flex;
  gap: 10px;
  margin: 0;
}

.icon-link {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(13, 12, 16, 0.62);
  border: 0;
  border-radius: 9px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: color 180ms ease, background-color 180ms ease;
}

.icon-link:hover {
  color: var(--accent);
  background: rgba(13, 12, 16, 0.82);
}

.icon-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon-link svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.youtube-link svg {
  fill: currentColor;
  stroke: none;
}

.youtube-link {
  order: -1;
}

.youtube-link .play {
  fill: var(--surface);
}

/* Keeps manually written cards compatible with the older markup in index.html. */
.read-more {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-top: auto;
  color: var(--accent);
  background: #211e26;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 0;
}

.read-more::before {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2.75h7.5L18 7.25v14H6v-18.5Z M13.5 2.75v4.5H18 M9 12h6 M9 16h6' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2.75h7.5L18 7.25v14H6v-18.5Z M13.5 2.75v4.5H18 M9 12h6 M9 16h6' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.read-more > span {
  display: none;
}

.story-content h2:has(+ .read-more) {
  margin-bottom: 22px;
}

@media (max-width: 600px) {
  .page-shell {
    width: min(100% - 28px, 1120px);
    padding: 48px 0;
  }

  .page-header { margin-bottom: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { transition-duration: 0.01ms !important; }
}
