@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600&display=swap");

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-subtle: #f6f7f9;
  --surface: #ffffff;
  --text: #0b0d12;
  --text-soft: #3d4452;
  --muted: #6b7280;
  --border: #e6e8ec;
  --border-strong: #d6d9df;
  --accent: #2f6df6;
  --accent-ink: #1d4ed8;
  --accent-soft: rgba(47, 109, 246, 0.1);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 10px 30px -12px rgba(16, 24, 40, 0.18);
  --nav-height: 64px;
  --content-width: min(1180px, 92vw);
  --radius: 16px;
}

body:not(.light-mode) {
  --bg: #0a0d12;
  --bg-subtle: #0e131a;
  --surface: #11161e;
  --text: #f3f5f8;
  --text-soft: #c4ccd8;
  --muted: #8b97a7;
  --border: #1e2733;
  --border-strong: #2a3543;
  --accent: #6ea8ff;
  --accent-ink: #9ac1ff;
  --accent-soft: rgba(110, 168, 255, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 18px 40px -18px rgba(0, 0, 0, 0.65);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ============ HEADER / NAV ============ */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(1.5rem, calc((100vw - var(--content-width)) / 2));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 30px;
  width: auto;
}

.nav-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav-btn {
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  color: var(--muted);
  border-radius: 9px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-btn:hover {
  color: var(--text);
  background: var(--bg-subtle);
}

.nav-btn.active {
  color: var(--text);
  font-weight: 600;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  width: 2rem;
  height: 2rem;
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
  margin-left: 0.35rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.theme-toggle-btn .toggle-label {
  display: none;
}

.theme-toggle-btn .toggle-icon {
  font-size: 0.95rem;
}

/* ============ LAYOUT ============ */
.page {
  width: var(--content-width);
  margin: 0 auto;
}

/* ============ HERO (HOME) ============ */
.hero {
  width: var(--content-width);
  margin: 0 auto;
  padding: 4.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 1rem;
}

.hero-text h2 {
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  max-width: 16ch;
  margin-bottom: 1.1rem;
}

.hero-text .main-paragraph {
  color: var(--text-soft);
  font-size: 1.18rem;
  max-width: 60ch;
}

.social-icons {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.8rem;
}

.social-icon {
  width: 26px;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.social-icon:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.social-icon.x-logo {
  width: 24px;
}

/* ============ SECTION HEADINGS ============ */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: var(--content-width);
  margin: 3rem auto 1.4rem;
}

.section-head h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-head .section-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.section-head .section-link:hover {
  color: var(--accent-ink);
}

/* ============ BLOG PAGE HEADER ============ */
.blog-hero {
  width: var(--content-width);
  margin: 0 auto;
  padding: 4rem 0 2.4rem;
}

.blog-hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 0.7rem;
}

.blog-hero p {
  color: var(--text-soft);
  font-size: 1.12rem;
  max-width: 56ch;
}

/* ============ FEATURED CARD ============ */
.featured {
  width: var(--content-width);
  margin: 0 auto;
}

.featured-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 2.2rem;
  align-items: center;
  padding: 1.6rem 0 2.6rem;
  border-bottom: 1px solid var(--border);
}

.featured-card .card-cover {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
}

.featured-title {
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin: 0.9rem 0;
}

.featured-title a:hover {
  color: var(--accent-ink);
}

.featured-excerpt {
  color: var(--text-soft);
  font-size: 1.08rem;
  margin-bottom: 1.3rem;
}

/* ============ POST GRID ============ */
.post-grid {
  width: var(--content-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem 1.6rem;
  padding-bottom: 3.5rem;
}

.post-card {
  display: flex;
  flex-direction: column;
}

.post-card-body {
  padding-top: 1rem;
}

/* ============ COVERS ============ */
.card-cover {
  display: flex;
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card:hover .card-cover img,
.featured-card:hover .card-cover img {
  transform: scale(1.04);
}

.card-cover--text {
  flex-direction: column;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  color: #fff;
  border: none;
}

.card-cover--text::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 85% -10%, rgba(255, 255, 255, 0.22), transparent 55%);
  pointer-events: none;
}

.cover-mark {
  position: relative;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  opacity: 0.85;
  z-index: 1;
}

.cover-title {
  position: relative;
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  z-index: 1;
}

.featured-card .cover-title {
  font-size: 2.1rem;
}

/* gradient palette */
.g-blue   { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.g-violet { background: linear-gradient(135deg, #4c1d95, #8b5cf6); }
.g-teal   { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.g-amber  { background: linear-gradient(135deg, #b45309, #f59e0b); }
.g-rose   { background: linear-gradient(135deg, #9f1239, #fb7185); }
.g-slate  { background: linear-gradient(135deg, #1e293b, #64748b); }
.g-cyan   { background: linear-gradient(135deg, #155e75, #22d3ee); }
.g-indigo { background: linear-gradient(135deg, #312e81, #6366f1); }

/* ============ TAGS ============ */
.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--muted);
  border: 1px solid var(--border);
}

.tag--research { color: #2563eb; background: rgba(37, 99, 235, 0.08); border-color: rgba(37, 99, 235, 0.2); }
.tag--release  { color: #7c3aed; background: rgba(124, 58, 237, 0.08); border-color: rgba(124, 58, 237, 0.2); }
.tag--platform { color: #0d9488; background: rgba(13, 148, 136, 0.08); border-color: rgba(13, 148, 136, 0.2); }
.tag--news     { color: #d97706; background: rgba(217, 119, 6, 0.08); border-color: rgba(217, 119, 6, 0.2); }

.post-card-title {
  font-size: 1.16rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin: 0.7rem 0 0.5rem;
}

.post-card-title a:hover {
  color: var(--accent-ink);
}

.post-card-excerpt {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.82rem;
}

.post-card-authors {
  color: var(--text-soft);
  font-weight: 500;
}

.post-card-date {
  color: var(--muted);
}

/* ============ TEAM ============ */
#team {
  width: var(--content-width);
  margin: 0 auto;
  padding: 1.5rem 0 3.5rem;
}

#team > h2 {
  display: none;
}

.team-group {
  margin-bottom: 2.6rem;
}

.team-group h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.team-grid,
.contributors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.1rem;
}

.team-member {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.team-member:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.team-member a {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 188px;
  padding: 1.3rem 0.75rem 1rem;
}

.team-member img {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  margin-bottom: 0.95rem;
}

.team-member h4 {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
}

/* ============ FOOTER ============ */
footer {
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

footer p {
  width: var(--content-width);
  margin: 0 auto;
  padding: 1.8rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .featured-card {
    grid-template-columns: 1fr;
    gap: 1.3rem;
  }
  .featured-card .card-cover {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 620px) {
  .nav-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.88rem;
  }
  .post-grid {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }
  .hero {
    padding: 3rem 0 2rem;
  }
  .logo-img {
    height: 26px;
  }
}
