/* =====================================
   Home page: aligned with the essay design system
   (Geist + Geist Mono, cobalt accent, bordered cards).
   Loaded after main.css and overrides it.
   ===================================== */

:root {
  --font-family: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --text-secondary: #3f3f46;
  --text-muted: #71717a;
  --border-color: #e9e9ec;
  --accent: #2e5bff;
  --accent-soft: #eef2ff;
  --accent-line: #c3cffd;
}

body {
  letter-spacing: -0.006em;
}

/* Labels in mono, like the posts */

.card-kicker,
.section-header,
.writing-group-title {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.card-kicker {
  color: var(--accent);
}

/* Tabs */

.category-tab.active::after {
  background-color: var(--accent);
}

/* Cards: white with a hairline border */

.card {
  position: relative;
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -20px rgba(9, 9, 11, 0.25);
}

.card-title {
  letter-spacing: -0.015em;
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

a.card-action {
  color: var(--accent);
}

span.card-action {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* The whole card is clickable when it has a link */
.card:has(a.card-action) a.card-action::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

/* Tags */

.tag {
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background-color: #fff;
  color: var(--text-secondary);
}

/* Writing tab */

.writing-title {
  font-size: 1.75rem;
  letter-spacing: -0.03em;
}

/* Blog card thumbnails */

.card-thumb {
  display: block;
  width: calc(100% + 2 * var(--card-padding) - 2px);
  aspect-ratio: 16 / 9;
  margin: calc(-1 * var(--card-padding) + 1px) calc(-1 * var(--card-padding) + 1px) 20px;
  object-fit: cover;
  object-position: top center;
  border-bottom: 1px solid var(--border-color);
  border-radius: 11px 11px 0 0;
  background: #f6f6f7;
}

.card-thumb.is-contain {
  object-fit: contain;
  object-position: center;
  background: #fff;
}

/* =====================================
   Research teaser: a doorway into the report
   ===================================== */

.research-feature-grid {
  max-width: none;
}

.research-teaser {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 340px;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background:
    radial-gradient(700px 420px at 78% 50%, rgba(229, 72, 77, 0.14), transparent 62%),
    #0a0a0b;
  color: #f3f1ec;
  isolation: isolate;
}

.research-teaser:hover {
  border-color: transparent;
  box-shadow: 0 24px 50px -30px rgba(10, 10, 11, 0.7);
}

.research-teaser::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1.4px);
  background-size: 24px 24px;
}

.teaser-copy {
  display: flex;
  flex-direction: column;
  padding: 32px;
}

.research-teaser .card-kicker {
  color: #e5484d;
}

.teaser-title {
  margin: 4px 0 14px;
  font-family: "Source Serif 4", Georgia, serif;
  font-optical-sizing: auto;
  font-size: clamp(1.75rem, 2.6vw, 2.375rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #f3f1ec;
}

.teaser-title em {
  font-style: italic;
  color: #e5484d;
}

.research-teaser .card-subtitle {
  max-width: 440px;
  color: rgba(243, 241, 236, 0.62);
}

.teaser-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 0 0 20px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(243, 241, 236, 0.45);
}

.research-teaser a.card-action {
  margin-top: auto;
  color: #f3f1ec;
}

.research-teaser a.card-action span {
  color: #e5484d;
}

.teaser-art {
  position: relative;
  margin: 0;
  pointer-events: none;
}

.teaser-art svg {
  position: absolute;
  top: 50%;
  left: -4%;
  width: 112%;
  height: auto;
  transform: translateY(-50%);
}

.teaser-art .network-link {
  fill: none;
  stroke: rgba(243, 241, 236, 0.16);
  stroke-width: 1;
}

.teaser-art .network-link--strong {
  stroke: rgba(229, 72, 77, 0.6);
  stroke-width: 1.4;
}

.teaser-art .network-link--soft {
  stroke: rgba(243, 241, 236, 0.07);
  stroke-dasharray: 3 6;
}

.teaser-art .network-connectors circle {
  fill: rgba(243, 241, 236, 0.35);
}

.teaser-art .network-node circle {
  fill: #0a0a0b;
  stroke: rgba(243, 241, 236, 0.55);
  stroke-width: 1.3;
}

.teaser-art .network-node--secondary circle {
  fill: #f3f1ec;
  stroke: none;
}

.teaser-art .network-node--primary circle {
  fill: #e5484d;
  stroke: none;
}

.teaser-art .network-node--primary {
  animation: teaser-pulse 3.2s ease-in-out infinite;
}

.teaser-art text {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: rgba(243, 241, 236, 0.6);
}

.teaser-art .network-node--primary text,
.teaser-art .network-node--secondary text {
  display: block;
}

.teaser-art .network-node--primary text {
  fill: #e5484d;
}

@keyframes teaser-pulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(229, 72, 77, 0)); }
  50% { filter: drop-shadow(0 0 12px rgba(229, 72, 77, 0.7)); }
}

@media (max-width: 900px) {
  .research-teaser {
    grid-template-columns: 1fr;
  }

  .teaser-art {
    height: 220px;
    order: -1;
  }

  .teaser-art svg {
    left: -10%;
    width: 120%;
  }

  .teaser-copy {
    padding: 8px 24px 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .card:hover {
    transition: none;
    transform: none;
  }

  .teaser-art .network-node--primary {
    animation: none;
  }
}

/* =====================================
   Desktop sidebar: fit the viewport, never scroll
   ===================================== */

@media (min-width: 901px) {
  .sidebar {
    overflow: hidden;
  }

  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 20px;
  }

  .photo-grid img {
    border-radius: 6px;
  }
}

@media (min-width: 901px) and (max-height: 720px) {
  .photo-grid {
    display: none;
  }
}
