/* Research Page - inherits site-wide dark mode */

.research-page {
  --bg: #fff;
  --text: #111;
  --text-secondary: #3c3c3c;
  --text-muted: #8b8b8b;
  --border: rgba(0,0,0,0.1);
  --border-hover: rgba(0,0,0,0.18);
  --btn-bg: #111;
  --btn-text: #fff;

  width: 100%;
  background: var(--bg);
  max-width: 760px;
  margin: 0 auto;
  font-family: "Inter", sans-serif;
  padding-bottom: 48px;
}

@media (prefers-color-scheme: dark) {
  .research-page {
    --bg: #0a0a0a;
    --text: #fafafa;
    --text-secondary: #d4d4d4;
    --text-muted: #a3a3a3;
    --border: rgba(255,255,255,0.08);
    --border-hover: rgba(255,255,255,0.2);
    --btn-bg: #fafafa;
    --btn-text: #0a0a0a;
  }
}

.page > h1 { display: none; }

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.r-fade { opacity: 0; animation: fadeUp 0.6s ease forwards; }
.r-fade-d1 { animation-delay: 0.1s; }
.r-fade-d2 { animation-delay: 0.2s; }
.r-fade-d3 { animation-delay: 0.3s; }

/* Hero */
.r-hero {
  padding: 40px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: flex-start;
}
.r-hero h2 {
  font-size: clamp(1.8rem, 3.8vw, 2.8rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 12px;
  font-family: "Inter", sans-serif;
}
.r-sub-statement {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-family: "Inter", sans-serif;
  color: var(--text-secondary);
  line-height: 1.2;
  max-width: 28rem;
  margin-top: 0px;
  margin-bottom: 20px;
}

/* Hero Actions */
.r-hero-actions {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 0;
  margin-bottom: 30px;
}

/* Sections */
.r-section { padding: 56px 0 }
.r-section:first-child { border-top: none; }
.r-section--no-top-padding { padding: 0; }
.r-section--no-bottom-padding { padding-bottom: 0; }
.r-section-label {
  font-size: 24px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}
.r-section p {
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.r-section a {
  color: var(--text);
  text-decoration: none;
}
.r-section a:hover {
  color: var(--text-secondary);
}

/* Tags */
.r-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.r-tag {
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 4px 12px;
  font-weight: 500;
  transition: border-color 0.15s ease;
}
.r-tag:hover { border-color: var(--text-muted); }

/* Waitlist Form - also works outside .research-page (in posts) */
.r-waitlist-form {
  --r-border: rgba(0,0,0,0.1);
  --r-border-focus: #3c3c3c;
  --r-text: #111;
  --r-text-muted: #8b8b8b;
  --r-btn-bg: #111;
  --r-btn-text: #fff;
}

@media (prefers-color-scheme: dark) {
  .r-waitlist-form {
    --r-border: rgba(255,255,255,0.08);
    --r-border-focus: #d4d4d4;
    --r-text: #fafafa;
    --r-text-muted: #a3a3a3;
    --r-btn-bg: #fafafa;
    --r-btn-text: #0a0a0a;
  }
}

.r-waitlist-form form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: min(100%, 540px);
  max-width: 540px;
  margin: 0 auto;
  border: 1px solid var(--r-border, var(--border));
  border-radius: 9999px;
  padding: 6px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.3s ease;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}
.r-waitlist-form form:focus-within {
  border-color: var(--r-border-focus, var(--text-secondary));
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.06);
}
.r-waitlist-form input[type="email"] {
  font-size: 1.05rem;
  padding: 12px 0 12px 24px;
  border: none;
  background: transparent;
  color: var(--r-text, var(--text));
  width: 100%;
  max-width: none;
  min-width: 0;
  outline: none;
}
.r-waitlist-form input[type="email"]::placeholder { color: var(--r-text-muted, var(--text-muted)); }
.r-waitlist-form button {
  font-size: 1.05rem;
  font-weight: 500;
  padding: 14px 30px;
  background: var(--r-btn-bg, var(--btn-bg));
  color: var(--r-btn-text, var(--btn-text));
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease, box-shadow 0.3s ease, transform 0.2s ease;
}
.r-waitlist-form button:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}
.r-waitlist-form button:active { transform: translateY(0); }

/* Waitlist button valid state - blue when email is valid */
.r-waitlist-form button.waitlist-btn.valid,
.r-waitlist-form button.valid {
  background: #0071E3;
  color: #fff;
}

/* Subscribe form in posts - matches waitlist styling */
.p-subscribe-form {
  --r-border: rgba(0,0,0,0.1);
  --r-border-focus: #3c3c3c;
  --r-text: #111;
  --r-text-muted: #8b8b8b;
  --r-btn-bg: #111;
  --r-btn-text: #fff;
}

@media (prefers-color-scheme: dark) {
  .p-subscribe-form {
    --r-border: rgba(255,255,255,0.08);
    --r-border-focus: #d4d4d4;
    --r-text: #fafafa;
    --r-text-muted: #a3a3a3;
    --r-btn-bg: #fafafa;
    --r-btn-text: #0a0a0a;
  }
}

.p-subscribe-form form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: min(100%, 540px);
  max-width: 540px;
  margin: 0 auto;
  border: 1px solid var(--r-border);
  border-radius: 9999px;
  padding: 6px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.3s ease;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}
.p-subscribe-form form:focus-within {
  border-color: var(--r-border-focus);
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.06);
}
.p-subscribe-form input[type="email"] {
  font-size: 1.05rem;
  padding: 12px 0 12px 24px;
  border: none;
  background: transparent;
  color: var(--r-text);
  width: 100%;
  max-width: none;
  min-width: 0;
  outline: none;
}
.p-subscribe-form input[type="email"]::placeholder { color: var(--r-text-muted); }
.p-subscribe-form button {
  font-size: 1.05rem;
  font-weight: 500;
  padding: 14px 30px;
  background: var(--r-btn-bg);
  color: var(--r-btn-text);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease, box-shadow 0.3s ease, transform 0.2s ease;
}
.p-subscribe-form button:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}
.p-subscribe-form button:active { transform: translateY(0); }

/* Post subscribe section */
.p-section p { text-align: center; }
.p-subscribe-form { margin-top: 12px; }

/* GitHub Link */
.r-github-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 8px 18px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.r-github-link:hover { border-color: var(--border-hover); color: var(--text); text-decoration: none; }
.r-github-link svg { flex-shrink: 0; }

/* Misc */
.r-audience { font-size: 13px; color: var(--text-muted); margin-top: 32px; margin-bottom: 40px }
.r-mono { font-family: 'Geist Mono', monospace; font-size: 12px; color: var(--text-muted); background: rgba(128,128,128,0.1); padding: 2px 8px; border-radius: 4px; }

/* Pricing note */
.r-section p.r-pricing-note { font-size: 14px; }

/* Waitlist Section */
#waitlist p { text-align: center; }

@media (min-width: 768px) {
  .r-hero {
    padding: 24px 0 0;
  }

  .r-hero h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 10px;
  }

  .r-sub-statement {
    font-size: clamp(0.98rem, 1.3vw, 1.15rem);
    line-height: 1.25;
    max-width: 26rem;
    margin-bottom: 16px;
  }

  .r-section-label {
    font-size: 22px;
    margin-bottom: 16px;
  }

  .r-section p {
    font-size: 16px;
    line-height: 1.45;
  }

  .r-pricing-graphic {
    margin: 18px 0;
  }
}

/* Responsive */
@media (max-width: 569px) {
  .r-hero {
    padding: 38px 0 0;
  }
  .r-section { padding: 42px 0 0; }
  .r-section--no-top-padding { padding: 0; }
  .r-sub-statement {
    font-size: 1.05rem;
    max-width: 18rem;
  }
  .r-waitlist-form form {
    width: 100%;
    gap: 6px;
    padding: 5px;
  }
  .r-waitlist-form input[type="email"] {
    font-size: 0.95rem;
    padding: 11px 0 11px 18px;
  }
  .r-waitlist-form button {
    font-size: 0.95rem;
    padding: 11px 18px;
  }
}
