/* ======================================================
   AIKYA.BIO — "The Quiet Conviction"
   Clean, minimal, institutional. Stripe meets frontier lab.
   ====================================================== */

:root {
  --bg:          #F7F7F2; /* Warm Eggshell Off-white */
  --grid-dot:    rgba(148, 163, 184, 0.08); 
  --text:        #0F172A;
  --text-muted:  #475569;
  --accent:      #2E4F3E; /* Dark Green from reference image */
  --accent-hover:#1A2E24;
  --secondary:   #64748B;
  --border:      rgba(15, 23, 42, 0.1);
  --grid-ink:    rgba(15, 23, 42, 0.1);
  --font-body:   'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:   'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  /* Blueprint Dotted Grid Texture */
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Registry Canvas (Procedural Background) ──────────── */
#phylo-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--bg);
}

/* ── Navigation ──────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2.5rem 4%;
  z-index: 100;
}

.logo {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.logo:hover {
  color: var(--text);
}

/* ── Page Layout ─────────────────────────────────────── */
.page {
  position: relative;
  z-index: 10;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 4%;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  text-align: center;
  max-width: 760px;
  margin-bottom: 2rem;
}

.headline {
  font-family: var(--font-body);
  font-size: clamp(1.8rem, 3.8vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.subtext {
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 1.5rem auto; /* Reduced from 2.5rem to move CTA up */
}

.subtext strong {
  color: var(--text);
  font-weight: 600;
}

/* ── CTAs ─────────────────────────────────────────────── */
.cta-row {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.cta-button {
  padding: 1rem 3rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.cta-button.primary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: none;
}

.cta-button.primary:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 79, 62, 0.2);
}

/* ── Smooth Reveal Form ───────────────────────────────── */
.contact-reveal {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.6s ease,
              margin-top 0.6s ease;
  opacity: 0;
  margin-top: 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.contact-reveal.active {
  max-height: 600px;
  opacity: 1;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.contact-form-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.05);
}

.close-form {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.close-form:hover {
  color: var(--text);
}

.form-group .cta-input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.form-group .cta-input:focus {
  border-color: var(--accent);
}

.cta-button.submit {
  width: 100%;
  background: var(--accent);
  color: white;
  margin-top: 0.5rem;
}

.cta-button:hover {
  background: var(--accent-hover);
}

.cta-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Waitlist Feedback ────────────────────────────────── */
.waitlist-feedback {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  min-height: 1.2rem;
  margin-top: 0.6rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.waitlist-feedback:not(:empty) { opacity: 1; }
.waitlist-feedback--success { color: #10B981; }
.waitlist-feedback--warn    { color: #F59E0B; }
.waitlist-feedback--error   { color: #EF4444; }

/* ── Evidence Rotation ────────────────────────────────── */
.evidence-line {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.6;
  letter-spacing: 0.01em;
  transition: opacity 0.4s ease;
}

/* ── Pathogen Agent Grid (Feature Flagged) ───────────── */
[data-pathogens-enabled="false"] .pathogen-node {
  cursor: pointer;
  opacity: 0.9;
}

[data-pathogens-enabled="false"] .pathogen-node:active {
  transform: scale(0.97);
  opacity: 0.7;
  transition: transform 0.1s ease;
}

[data-pathogens-enabled="false"] .pathogen-node:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.85);
}

.agents {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
}

.pathogen-grid {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.pathogen-node {
  flex: 1;
  max-width: 170px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: default;
}

.pathogen-node:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.p-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.p-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.p-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.p-name {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.p-status {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.15rem;
}

/* ── Footer ───────────────────────────────────────────── */
.footer {
  position: fixed;
  bottom: 0;
  right: 0;
  padding: 1.5rem 4%;
  z-index: 1;
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.4;
  letter-spacing: 0.1em;
}

/* ── Animations ───────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero {
  animation: fadeInUp 0.8s ease-out;
}

.agents {
  animation: fadeInUp 0.8s ease-out 0.15s both;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }

  .page {
    height: auto;
    min-height: 100vh;
    padding: 6rem 6% 2rem 6%;
  }

  .headline {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }

  .pathogen-grid {
    flex-wrap: wrap;
  }

  .pathogen-node {
    flex: 1 1 calc(50% - 0.5rem);
    max-width: none;
  }

  .cta-button {
    border-radius: 0 0 8px 8px;
  }
}
