/* ── Variables ── */
:root {
  --red: #EE0000;
  --dark: #151515;
  --gray: #6a6e73;
  --light-gray: #f0f0f0;
  --border: #d2d2d2;
  --white: #ffffff;
  --max-width: 1140px;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Red Hat Text", "Helvetica Neue", Arial, sans-serif;
  color: var(--dark);
  background: var(--white);
  line-height: 1.6;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Header ── */
.site-header {
  background: var(--dark);
  color: var(--white);
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--red);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-brand { display: flex; flex-direction: column; gap: 0.1rem; }

.site-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
}
.site-title:hover { text-decoration: none; color: #f0f0f0; }

.site-tagline {
  font-size: 0.78rem;
  color: #a0a0a0;
  letter-spacing: 0.02em;
}

.site-nav { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }

.site-nav a {
  color: #d0d0d0;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}
.site-nav a:hover { color: var(--white); text-decoration: none; }

.site-nav .nav-github {
  color: var(--white);
  background: var(--red);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
}
.site-nav .nav-github:hover { background: #cc0000; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: var(--white);
  padding: 4rem 0 3.5rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero h1 span { color: var(--red); }

.hero p {
  font-size: 1.1rem;
  color: #b0b8c8;
  max-width: 640px;
  margin: 0 auto 1.8rem;
}

.hero-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.88; text-decoration: none; }

.btn-primary { background: var(--red); color: var(--white); }
.btn-outline { border: 2px solid rgba(255,255,255,0.4); color: var(--white); }

/* ── Sections ── */
.section { padding: 3.5rem 0; }
.section:nth-child(even) { background: var(--light-gray); }

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--red);
}

.section-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
}

.section-header .count {
  font-size: 0.85rem;
  color: var(--gray);
  background: var(--border);
  padding: 0.15rem 0.55rem;
  border-radius: 12px;
}

/* ── Card Grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-color: var(--red);
}

.card h3 { font-size: 1rem; font-weight: 600; }
.card h3 a { color: var(--dark); }
.card h3 a:hover { color: var(--red); text-decoration: none; }

.card p {
  font-size: 0.88rem;
  color: var(--gray);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--gray);
  margin-top: 0.25rem;
}

.badge {
  display: inline-block;
  background: var(--light-gray);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.5rem;
  font-size: 0.78rem;
  color: var(--gray);
}

/* ── Talk cards with video embed ── */
.talk-card { flex-direction: column; }

.talk-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  margin-bottom: 0.75rem;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
}

.talk-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Blog compact list ── */
.blog-year {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray);
  margin: 1.5rem 0 0.5rem;
}
.blog-year:first-of-type { margin-top: 0; }

.blog-compact-list {
  list-style: none;
  border-left: 2px solid var(--border);
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.blog-compact-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.blog-compact-item a {
  font-size: 0.95rem;
  color: var(--dark);
  font-weight: 500;
}
.blog-compact-item a:hover { color: var(--red); text-decoration: none; }

.blog-meta { font-size: 0.78rem; color: var(--gray); white-space: nowrap; }

.blog-show-more-btn {
  display: block;
  margin: 1.5rem auto 0;
  padding: 0.5rem 1.8rem;
  background: none;
  border: 2px solid var(--red);
  border-radius: 4px;
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.blog-show-more-btn:hover { background: var(--red); color: var(--white); }

/* ── Conference list ── */
.conference-list { display: flex; flex-direction: column; gap: 0.85rem; }

.conference-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.4rem;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.conference-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: var(--red); }

.conf-date {
  min-width: 52px;
  text-align: center;
  background: var(--red);
  color: var(--white);
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
}

.conf-info h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.2rem; }
.conf-info h3 a { color: var(--dark); }
.conf-info h3 a:hover { color: var(--red); text-decoration: none; }
.conf-info .conf-location { font-size: 0.82rem; color: var(--gray); }
.conf-info .conf-talks { font-size: 0.82rem; color: var(--gray); margin-top: 0.3rem; }
.conf-info .conf-talks li { list-style: disc; margin-left: 1rem; }

/* ── Upstream projects ── */
.upstream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.upstream-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.upstream-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: var(--red); }

.upstream-card .org { font-size: 0.78rem; color: var(--gray); }
.upstream-card h3 { font-size: 1rem; font-weight: 600; }
.upstream-card h3 a { color: var(--dark); }
.upstream-card h3 a:hover { color: var(--red); text-decoration: none; }
.upstream-card p { font-size: 0.88rem; color: var(--gray); flex: 1; }
.upstream-card .role { font-size: 0.78rem; font-weight: 600; color: var(--red); }

/* ── Footer ── */
.site-footer {
  background: var(--dark);
  color: #888;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
}
.site-footer a { color: #aaa; }
.site-footer a:hover { color: var(--white); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.7rem; }
  .card-grid, .upstream-grid { grid-template-columns: 1fr; }
  .site-nav { gap: 0.9rem; }
  .header-content { flex-direction: column; align-items: flex-start; }
}
