:root {
  color-scheme: dark;
  --bg: #020817;
  --bg-soft: #0f172a;
  --bg-muted: #1e293b;
  --card: #020817;
  --line: #1e293b;
  --line-strong: rgba(255, 255, 255, 0.24);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #cbd5e1;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --violet: #7c3aed;
  --pink: #c026d3;
  --shadow: 0 30px 100px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
}

a {
  color: inherit;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

.container {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 40px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.68);
  background: rgba(2, 8, 23, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  text-decoration: none;
}

.brand-logo {
  display: inline-flex;
  width: 72px;
  height: 40px;
  align-items: center;
}

.brand-logo img {
  width: auto;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.2));
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 15px;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a,
.join-link {
  color: var(--muted-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  transition: color 160ms ease;
}

.nav-links a:hover,
.join-link:hover {
  color: var(--cyan);
}

.join-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.04);
}

.hero-section {
  position: relative;
  min-height: 86vh;
  display: grid;
  align-items: center;
  overflow: hidden;
  padding: 82px 0 34px;
  background:
    linear-gradient(180deg, rgba(2, 8, 23, 0.25), rgba(2, 8, 23, 0.96)),
    linear-gradient(110deg, rgba(34, 211, 238, 0.25), rgba(124, 58, 237, 0.34), rgba(192, 38, 211, 0.22)),
    url("../images/chattracker-framework.png");
  background-size: cover;
  background-position: center;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 30%, rgba(34, 211, 238, 0.28), transparent 28%),
    radial-gradient(circle at 78% 18%, rgba(192, 38, 211, 0.22), transparent 26%),
    rgba(2, 8, 23, 0.18);
  pointer-events: none;
}

.hero-container {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 30px;
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.58);
  color: var(--muted-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.hero-badge span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 20px var(--cyan);
}

h1 {
  max-width: 980px;
  margin-bottom: 14px;
  font-size: clamp(54px, 7.4vw, 86px);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 14px;
}

.hero-title-row h1 {
  margin-bottom: 0;
}

.cite-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid rgba(34, 211, 238, 0.44);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.64);
  color: var(--cyan);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.cite-pill:hover,
.cite-pill:focus-visible {
  border-color: var(--cyan);
  color: white;
  outline: none;
}

.hero-subtitle {
  max-width: 900px;
  margin-bottom: 10px;
  color: var(--text);
  font-size: clamp(25px, 3.2vw, 38px);
  font-weight: 780;
  line-height: 1.08;
}

.publication-line {
  margin: 0 0 20px;
  color: var(--muted-2);
  font-size: 14px;
  font-weight: 750;
}

.glass-panel {
  width: min(980px, 100%);
  margin-bottom: 24px;
  padding: 24px 30px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.76), rgba(88, 28, 135, 0.32)),
    rgba(15, 23, 42, 0.58);
  box-shadow: var(--shadow);
  color: var(--muted-2);
  text-align: left;
  backdrop-filter: blur(20px);
}

.glass-panel p {
  margin-bottom: 14px;
  font-size: 17px;
}

.glass-panel p:last-child {
  margin-bottom: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  min-width: 238px;
  border-radius: 6px;
  padding: 13px 22px;
  text-decoration: none;
  font-weight: 750;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.button-primary {
  border: 0;
  background: linear-gradient(100deg, var(--violet), var(--pink));
  color: white;
  box-shadow: 0 16px 36px rgba(124, 58, 237, 0.28);
}

.button-outline {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.button-outline:hover {
  border-color: var(--cyan);
}

.section,
.project-section {
  padding: 88px 0;
}

.intro-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(30, 41, 59, 0.42);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1fr);
  gap: 54px;
  align-items: start;
}

.section-kicker {
  margin-bottom: 12px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: 0;
}

.lead-copy p,
.project-copy p {
  color: var(--muted);
  font-size: 20px;
}

.project-section {
  background: var(--bg);
}

.project-section-muted {
  background: rgba(30, 41, 59, 0.32);
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.12fr);
  gap: 44px;
  align-items: center;
}

.project-layout-reverse {
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.78fr);
}

.project-copy h2 {
  margin-bottom: 22px;
  font-size: clamp(34px, 4vw, 48px);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 30px;
}

.metric-row div {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.metric-row strong {
  display: block;
  color: var(--cyan);
  font-size: 44px;
  line-height: 1;
}

.metric-row span {
  color: var(--muted-2);
  font-weight: 650;
}

.media-frame {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  box-shadow: var(--shadow);
}

.media-frame img {
  width: 100%;
  background: white;
}

.text-link {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  color: var(--cyan);
  font-weight: 750;
  text-decoration: none;
}

.text-link:hover {
  color: white;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 24px;
}

#resources {
  padding-top: 64px;
  padding-bottom: 64px;
}

.resource-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.resource-card {
  min-height: 0;
  display: grid;
  grid-template-columns: 54px minmax(190px, 0.38fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(30, 41, 59, 0.38), rgba(2, 8, 23, 0.9)),
    var(--card);
  color: var(--text);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.resource-card:hover,
.resource-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(34, 211, 238, 0.68);
  outline: none;
  box-shadow: 0 16px 42px rgba(34, 211, 238, 0.1);
}

.card-index {
  color: var(--cyan);
  font-weight: 850;
}

.resource-card h3 {
  margin-bottom: 0;
  font-size: 21px;
  line-height: 1.15;
}

.resource-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.card-link {
  color: var(--muted-2);
  font-weight: 750;
  white-space: nowrap;
}

.publication-section {
  background: rgba(15, 23, 42, 0.82);
}

.paper-list {
  display: grid;
  gap: 10px;
  margin-bottom: 30px;
}

.paper-item {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.paper-meta {
  display: grid;
  align-content: start;
  gap: 8px;
  color: var(--muted);
}

.paper-meta span {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.paper-meta strong {
  color: var(--text);
  font-size: 21px;
}

.paper-body h3 {
  margin-bottom: 12px;
  font-size: 24px;
  line-height: 1.24;
}

.paper-body p {
  margin-bottom: 18px;
  color: var(--muted);
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.paper-links a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 12px;
  color: var(--muted-2);
  text-decoration: none;
  font-weight: 750;
}

.paper-links a:hover {
  border-color: var(--cyan);
  color: white;
}

.citation-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tab-button,
.copy-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted-2);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.tab-button {
  padding: 8px 16px;
}

.tab-button.is-active {
  border-color: transparent;
  background: linear-gradient(100deg, var(--violet), var(--pink));
  color: white;
}

.citation-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #030712;
  box-shadow: var(--shadow);
}

.citation-panel pre {
  min-height: 252px;
  margin: 0;
  padding: 28px;
  overflow-x: auto;
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.copy-button {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 76px;
  background: var(--bg-muted);
}

.copy-button:hover {
  border-color: var(--cyan);
  color: white;
}

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

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 96px;
  color: var(--muted);
}

.footer-inner p {
  margin-bottom: 0;
}

.footer-inner a {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 980px) {
  .site-header {
    padding: 0 24px;
  }

  .nav-links {
    gap: 16px;
  }

  .split-layout,
  .project-layout,
  .project-layout-reverse,
  .resource-grid,
  .paper-item {
    grid-template-columns: 1fr;
  }

  .project-layout-reverse .media-frame {
    order: 2;
  }

  .project-layout-reverse .project-copy {
    order: 1;
  }

  .resource-card {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 8px 14px;
  }

  .resource-card p,
  .card-link {
    grid-column: 2;
  }

  .card-link {
    white-space: normal;
  }
}

@media (max-width: 760px) {
  .nav-links {
    display: none;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 32px, 1180px);
  }

  .site-header {
    height: 66px;
    padding: 0 16px;
  }

  .brand-copy small,
  .join-link {
    display: none;
  }

  .hero-section {
    min-height: 94vh;
    padding: 72px 0 20px;
  }

  .hero-badge {
    margin-bottom: 22px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .publication-line {
    font-size: 13px;
    margin-bottom: 14px;
  }

  .hero-subtitle {
    display: none;
  }

  .glass-panel {
    margin-bottom: 16px;
    padding: 16px;
  }

  .glass-panel p,
  .lead-copy p,
  .project-copy p {
    font-size: 15px;
  }

  .glass-panel p {
    line-height: 1.45;
  }

  .glass-panel p:nth-child(2) {
    display: none;
  }

  .hero-actions,
  .paper-links,
  .citation-tabs {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .button {
    min-height: 48px;
  }

  .button,
  .paper-links a,
  .tab-button {
    width: 100%;
  }

  .section,
  .project-section {
    padding: 62px 0;
  }

  #resources {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .metric-row {
    grid-template-columns: 1fr;
  }

  .paper-item,
  .resource-card {
    padding: 14px 16px;
  }

  .resource-card {
    gap: 4px 12px;
  }

  .resource-card h3 {
    font-size: 19px;
  }

  .resource-card p {
    display: none;
  }

  .card-link {
    font-size: 14px;
  }

  .citation-panel pre {
    padding: 64px 16px 20px;
    font-size: 12px;
  }

  .footer-inner {
    display: block;
    padding: 26px 0;
  }

  .footer-inner p {
    margin-bottom: 8px;
  }
}
