@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;1,9..144,400&display=swap');

:root {
  --ink: #1a1918;
  --ink-soft: #5a5651;
  --ink-faint: #8a867f;
  --ink-faded: #a8a49d;
  --paper: #fafaf8;
  --line: #e4e1da;
  --accent: #7a1f2b;
  --accent-soft: #f4e9ea;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.nav-mark-icon {
  display: block;
  height: 24px;
  width: auto;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-cta {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 9px 18px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.nav-cta:hover {
  background: var(--ink);
  color: var(--paper);
}

.nav-toggle {
  display: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.nav-drawer {
  display: none;
}

/* Hero */
.hero {
  padding: 120px 0 96px;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.6rem, 5.2vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  max-width: 15ch;
  margin: 0 0 28px;
}

.hero p {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 40px;
}

/* Remy hero: text column + large icon column (remy.html) */
.hero-remy-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero-remy-icon {
  display: flex;
  justify-content: center;
}

.hero-remy-icon img {
  display: block;
  width: 100%;
  max-width: 380px;
  height: auto;
}

/* Legal pages (privacy, terms) */
.hero--legal {
  padding-bottom: 64px;
}

.hero--legal h1 {
  font-size: 2.4rem;
  max-width: none;
}

/* Research article pages */
.hero--article {
  padding-bottom: 56px;
}

.hero--article h1 {
  font-size: 2.3rem;
  max-width: none;
}

.btn-primary {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 500;
  padding: 14px 28px;
  border-radius: 3px;
  transition: background 0.15s ease;
}

.btn-primary:hover {
  background: var(--accent);
}

/* Section */
.section {
  padding: 88px 0;
  border-bottom: 1px solid var(--line);
}

.section--flush {
  border-bottom: none;
}

.section-narrow {
  max-width: 640px;
}

.eyebrow {
  font-size: 0.9rem;
  color: var(--accent);
  margin: 0 0 14px;
  font-weight: 500;
}

.section h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 22px;
  max-width: 20ch;
}

.section p {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0 0 20px;
}

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

/* Remy intro split */
.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: start;
}

.split-visual {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 40px 32px;
  background: #fff;
}

.split-visual .glyph {
  width: 44px;
  height: 44px;
  margin-bottom: 24px;
}

.split-visual .line {
  height: 1px;
  background: var(--line);
  margin: 20px 0;
}

.split-visual .msg {
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0 0 20px;
}

.split-visual .msg:last-child {
  margin-bottom: 0;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.stat {
  background: var(--paper);
  padding: 32px 24px;
  position: relative;
}

.stat .num {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2.1rem;
  font-weight: 500;
  display: block;
  margin-bottom: 8px;
}

.stat .num.cap-title {
  font-size: 1.3rem;
  line-height: 1.25;
  min-height: 2.5em;
}

.stat .label {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.stat .foot {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px dotted var(--ink-soft);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.stat .foot:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Footer */
.footer {
  padding: 56px 0 48px;
}

/* Extra clearance so the fixed chat bubble never sits over the footer
   links in the bottom-right corner on pages where it's present. */
body:has(.remy-widget) .footer {
  padding-bottom: 104px;
}

.footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-tagline {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.footer-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-top: 28px;
}

/* Chat widget */
.chat-box {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.chat-messages {
  height: 420px;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.msg {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.96rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.msg-remy {
  align-self: flex-start;
  background: var(--accent-soft);
  color: var(--ink);
  border-bottom-left-radius: 2px;
}

.msg-user {
  align-self: flex-end;
  background: var(--ink);
  color: var(--paper);
  border-bottom-right-radius: 2px;
}

.msg-typing {
  align-self: flex-start;
  color: var(--ink-soft);
  font-style: italic;
  font-size: 0.9rem;
  padding: 4px 16px;
}

.chat-input-row {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.chat-input-row input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.96rem;
  background: #fff;
  color: var(--ink);
}

.chat-input-row input:focus {
  outline: none;
  border-color: var(--accent);
}

.chat-input-row button {
  padding: 12px 22px;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.chat-input-row button:disabled,
.chat-input-row input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
  margin: 14px 0 0;
}

/* About page */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.team-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--accent);
  background: #fff;
  margin-bottom: 18px;
}

.team-card h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 1.15rem;
  margin: 0 0 2px;
}

.team-card .role {
  font-size: 0.88rem;
  color: var(--accent);
  margin: 0 0 14px;
}

.team-card p {
  font-size: 0.96rem;
  color: var(--ink-soft);
  margin: 0;
}

.motto-section {
  padding: 96px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.motto-mark {
  width: 26px;
  height: 26px;
  margin: 0 auto 26px;
  display: block;
  opacity: 0.6;
}

.motto {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 1.5rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  margin: 0;
}

.status-block {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px 24px;
  background: #fff;
}

.status-line {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.9;
  margin: 0;
}

/* Research page */
.post-list {
  display: flex;
  flex-direction: column;
}

.post-card {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  display: block;
}

.post-card:first-child {
  padding-top: 0;
}

.post-card:last-child {
  border-bottom: none;
}

.post-card h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 1.3rem;
  margin: 0 0 6px;
  transition: color 0.15s ease;
}

.post-card:hover h3 {
  color: var(--accent);
}

.post-card .byline {
  font-size: 0.85rem;
  color: var(--accent);
  margin: 0 0 10px;
}

.post-card p {
  font-size: 0.98rem;
  color: var(--ink-soft);
  margin: 0;
  max-width: 60ch;
}

/* Careers page */
.benefits-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 32px;
}

.benefits-list li {
  font-size: 0.98rem;
  color: var(--ink-soft);
  padding-left: 20px;
  position: relative;
}

.benefits-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.roles-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.roles-table th {
  text-align: left;
  font-weight: 500;
  color: var(--ink-soft);
  font-size: 0.85rem;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

.roles-table td {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.roles-table td:last-child,
.roles-table th:last-child {
  color: var(--ink-soft);
}

/* Press page */
.press-card {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.press-card:first-child {
  padding-top: 0;
}

.press-card:last-child {
  border-bottom: none;
}

.press-card h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 1.2rem;
  margin: 0 0 6px;
}

.press-card .byline {
  font-size: 0.85rem;
  color: var(--accent);
  margin: 0 0 10px;
}

.press-card p {
  font-size: 0.98rem;
  color: var(--ink-soft);
  margin: 0;
  max-width: 60ch;
}

.awards-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.awards-list li {
  font-size: 0.98rem;
  color: var(--ink-soft);
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.awards-list li:last-child {
  border-bottom: none;
}

.older-mentions {
  margin-top: 12px;
}

.older-mentions .caption {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.older-mentions .scrubbed {
  font-size: 0.92rem;
  color: var(--ink-faded);
  text-decoration: line-through;
}

/* Legal pages */
.legal h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 1.1rem;
  margin: 36px 0 10px;
}

.legal h3:first-child {
  margin-top: 0;
}

.legal p {
  font-size: 0.98rem;
  color: var(--ink-soft);
  margin: 0 0 14px;
  max-width: 68ch;
}

.legal .updated {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-bottom: 36px;
}

/* Article pages */
.article-byline {
  font-size: 0.9rem;
  color: var(--accent);
  margin: 0 0 8px;
}

.back-link {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-decoration: none;
  margin-bottom: 24px;
}

.back-link:hover {
  color: var(--ink);
}

/* Floating Remy chat widget (injected by chat-widget.js on every page
   except remy.html, which already carries the full chat panel inline) */
.remy-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
}

.remy-bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(26, 25, 24, 0.22);
  transition: background 0.15s ease, transform 0.15s ease;
}

.remy-bubble:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

.remy-bubble .remy-glyph {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.remy-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: 340px;
  max-width: calc(100vw - 48px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 12px 32px rgba(26, 25, 24, 0.16);
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.remy-panel--visible {
  opacity: 1;
  transform: translateY(0);
}

.remy-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.remy-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--ink);
}

.remy-panel-title .remy-glyph {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.remy-panel-close {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--ink-soft);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease;
}

.remy-panel-close:hover {
  color: var(--ink);
  background: var(--accent-soft);
}

.remy-panel .chat-messages {
  height: 320px;
}

.remy-panel .chat-note {
  padding: 0 16px 14px;
  margin: 0;
}

@media (max-width: 760px) {
  .benefits-list {
    grid-template-columns: 1fr;
  }

  .team-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .nav-links,
  .nav-cta {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-drawer {
    display: block;
    max-height: 0;
    overflow: hidden;
    background: var(--paper);
    border-bottom: 1px solid transparent;
    transition: max-height 0.25s ease, border-color 0.25s ease;
  }

  .nav-drawer.open {
    max-height: 360px;
    border-bottom-color: var(--line);
  }

  .nav-drawer-links {
    list-style: none;
    margin: 0;
    padding: 4px 32px 20px;
    display: flex;
    flex-direction: column;
  }

  .nav-drawer-links a {
    display: block;
    padding: 13px 0;
    text-decoration: none;
    font-size: 1rem;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
  }

  .nav-drawer-links li:last-child a {
    border-bottom: none;
  }

  .nav-drawer-cta {
    margin: 4px 32px 24px;
    display: block;
    text-align: center;
  }

  .split {
    grid-template-columns: 1fr;
  }
  .hero-remy-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .hero-remy-icon img {
    max-width: 220px;
    margin: 0 auto;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero {
    padding: 80px 0 64px;
  }
  .section {
    padding: 64px 0;
  }

  .remy-widget {
    right: 16px;
    bottom: 16px;
  }

  .remy-panel {
    width: 320px;
    max-width: calc(100vw - 32px);
  }

  .remy-panel .chat-messages {
    height: 280px;
  }
}
