/* =========================================================
   Genefold landing page styles
   Sections:
     1. Tokens & resets
     2. Layout shell & utilities
     3. Hero
     4. Typography & shared text rules
     5. Buttons
     6. Cards & panels (hero-card, feature, paper, glass)
     7. Sections (manifesto, science, papers)
     8. Waitlist & contact
     9. Site social header (top-right pill)
    10. Site footer
    11. Animations & motion
    12. Responsive breakpoints
   ========================================================= */


/* 1. Tokens & resets ====================================== */

:root,
[data-theme="light"] {
  --bg: #0a1020;
  --font-body: 'IBM Plex Sans', 'Satoshi', Arial, sans-serif;
  --surface: rgba(12, 20, 40, 0.78);
  --surface-2: rgba(16, 28, 54, 0.88);
  --surface-3: rgba(27, 43, 77, 0.9);
  --text: #eef3ff;
  --muted: #a7b7db;
  --line: rgba(156, 181, 255, 0.18);
  --line-strong: rgba(156, 181, 255, 0.32);
  --primary: #68f0d3;
  --secondary: #89a8ff;
  --tertiary: #b783ff;
  --shadow: 0 20px 70px rgba(2, 6, 23, 0.35);
  --radius-s: 16px;
  --radius-m: 24px;
  --radius-l: 36px;
  --max: 1220px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'IBM Plex Sans', 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 122, 143, 0.18), transparent 22%),
    radial-gradient(circle at 84% 14%, rgba(255, 87, 112, 0.14), transparent 24%),
    radial-gradient(circle at 50% 0%, rgba(255, 203, 178, 0.08), transparent 28%),
    linear-gradient(180deg, #0b0210 0%, var(--bg) 48%, #050108 100%);
  color: var(--text);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }
canvas { display: block; }


/* 2. Layout shell & utilities ============================= */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--text);
  color: #050814;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  z-index: 100;
}
.skip-link:focus { top: 1rem; }

.site-shell {
  position: relative;
  width: min(calc(100% - 2rem), 1440px);
  margin: 0 auto;
  padding-bottom: 4rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* 3. Hero ================================================= */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: end;
  min-height: 90vh;
  padding: 2rem 0;
}

.hero__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: var(--radius-l);
  pointer-events: none;
}

#signal-canvas,
.grid-wave,
.orb {
  position: absolute;
  inset: 0;
}

.grid-wave {
  background-image:
    linear-gradient(rgba(255, 119, 139, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 119, 139, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.8), transparent);
}

.orb {
  filter: blur(60px);
  opacity: 0.65;
}
.orb--a {
  background: radial-gradient(circle, rgba(255, 98, 128, 0.58) 0%, transparent 55%);
  transform: translate(-8%, -10%);
}
.orb--b {
  background: radial-gradient(circle, rgba(255, 171, 153, 0.42) 0%, transparent 50%);
  transform: translate(52%, 6%);
}

.hero__content,
.hero-card,
.section {
  position: relative;
  z-index: 2;
}

.hero__lede {
  max-width: 62ch;
  margin: 1.5rem 0 0;
}

.hero__actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  padding: 0;
  list-style: none;
}

.hero__stats li {
  padding: 1rem;
  border-radius: var(--radius-m);
}
.hero__stats strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.45rem;
}
.hero__stats span {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.45;
}


/* 4. Typography & shared text rules ======================= */

.eyebrow {
  margin-bottom: 1rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.75rem;
  font-weight: 700;
}

h1, h2, h3 {
  margin: 0;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  line-height: 0.98;
}

h1 {
  max-width: 10ch;
  font-size: clamp(3.4rem, 8vw, 7.4rem);
  letter-spacing: -0.05em;
}

.hero__lede,
.section-heading p:last-child,
.feature-card p,
.science-panel p,
.paper-card p,
.contact-panel p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.05rem;
}

.text-link {
  display: inline-flex;
  margin-top: 1rem;
  font-weight: 600;
  color: var(--text);
}

.nav a:hover,
.nav a:focus-visible,
.text-link:hover,
.text-link:focus-visible {
  color: var(--primary);
}


/* 5. Buttons ============================================== */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-weight: 600;
  font-size: 0.97rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(109, 243, 216, 0.55);
}

.button--primary {
  color: #0d1f15;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  box-shadow: 0 4px 24px rgba(104, 240, 211, 0.22), 0 1px 4px rgba(0, 0, 0, 0.18);
  border-color: transparent;
}

.button--primary:hover,
.button--primary:focus-visible {
  box-shadow: 0 8px 32px rgba(104, 240, 211, 0.36), 0 2px 8px rgba(0, 0, 0, 0.22);
  border-color: transparent;
}

.button--ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}


/* 6. Cards & panels ======================================= */

.hero__stats li,
.glass-panel,
.feature-card,
.paper-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 1.35rem;
  border-radius: var(--radius-l);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(37, 10, 22, 0.84), rgba(16, 4, 11, 0.94));
  box-shadow: var(--shadow);
}

.hero-card__head,
.paper-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.hero-card h2 {
  margin-top: 1rem;
  font-size: clamp(2rem, 4vw, 3rem);
}

.hero-card p {
  color: var(--muted);
  line-height: 1.7;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 122, 143, 0.28);
  background: rgba(255, 122, 143, 0.11);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pulse-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 0 rgba(255, 122, 143, 0.7);
  animation: pulse 1.8s infinite;
}

.feature-card {
  padding: 1.5rem;
  border-radius: var(--radius-m);
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 180ms ease, border-color 180ms ease, translate 180ms ease;
}

.feature-card:hover,
.paper-card:hover {
  border-color: rgba(109, 243, 216, 0.45);
  translate: 0 -2px;
}

.feature-card--accent {
  background: linear-gradient(180deg, rgba(255, 122, 143, 0.14), rgba(255, 255, 255, 0.04));
}

.feature-index,
.paper-year {
  color: var(--muted);
  font-size: 0.84rem;
}

.feature-index {
  display: inline-block;
  margin-bottom: 1rem;
}

.feature-card h3,
.paper-card h3,
.science-panel h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.glass-panel,
.contact-panel {
  padding: 1.5rem;
  border-radius: var(--radius-l);
}

.paper-card {
  padding: 1.4rem;
  border-radius: var(--radius-m);
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 180ms ease, border-color 180ms ease, translate 180ms ease;
}

.paper-card--spotlight {
  background: linear-gradient(180deg, rgba(255, 122, 143, 0.16), rgba(255, 255, 255, 0.04));
}


/* 7. Sections ============================================= */

.section {
  margin-top: 2rem;
  padding: 2rem 0;
}

.section-heading {
  display: grid;
  gap: 0.8rem;
  max-width: 58rem;
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  font-size: clamp(2.2rem, 4vw, 4.5rem);
  letter-spacing: -0.04em;
}

.manifesto-grid,
.papers-grid,
.science-layout {
  display: grid;
  gap: 1rem;
}

.manifesto-grid {
  grid-template-columns: repeat(12, 1fr);
}

.feature-card:nth-child(1),
.feature-card:nth-child(2),
.feature-card:nth-child(3) { grid-column: span 4; }
.feature-card.wide { grid-column: span 12; }

.science-layout {
  grid-template-columns: 1.15fr 0.85fr;
}

.mini-flow {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.4rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.mini-flow > div {
  position: relative;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
  font-weight: 600;
}

.science-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.9rem;
}

.science-list li {
  padding-left: 1.3rem;
  position: relative;
  color: var(--muted);
  line-height: 1.6;
}

.science-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.papers-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}


/* 8. Waitlist & contact =================================== */

.contact-panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 1.5rem;
}

.waitlist-panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 2rem;
  background: linear-gradient(135deg, rgba(104, 240, 211, 0.07), rgba(137, 168, 255, 0.06));
  border-color: rgba(104, 240, 211, 0.22);
}

.waitlist-copy h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: -0.04em;
  margin-bottom: 0.8rem;
}

.waitlist-copy p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.05rem;
  margin: 0;
}

.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.waitlist-input-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.waitlist-input {
  flex: 1 1 200px;
  min-height: 50px;
  padding: 0.9rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.waitlist-input::placeholder {
  color: var(--muted);
  opacity: 0.65;
}

.waitlist-input:focus {
  border-color: var(--primary);
  background: rgba(104, 240, 211, 0.06);
  box-shadow: 0 0 0 3px rgba(104, 240, 211, 0.12);
}

.waitlist-input.has-error {
  border-color: #ff7a8a;
  background: rgba(255, 122, 143, 0.06);
  box-shadow: 0 0 0 3px rgba(255, 122, 143, 0.14);
}

.waitlist-input.has-error:focus {
  border-color: #ff7a8a;
  box-shadow: 0 0 0 3px rgba(255, 122, 143, 0.22);
}

.waitlist-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.waitlist-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.waitlist-privacy {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0;
  padding-left: 0.2rem;
}

.waitlist-feedback {
  font-size: 0.95rem;
  min-height: 1.4em;
  margin: 0;
  padding-left: 0.2rem;
}

.waitlist-feedback.is-success { color: var(--primary); }
.waitlist-feedback.is-error   { color: #ff7a8a; }


/* 9. Site social header (top-right pill) ================== */

.site-social {
  position: absolute;
  top: 1.4rem;
  right: 2rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 8, 20, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-social .social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.site-social .social-icon:hover,
.site-social .social-icon:focus-visible {
  color: var(--text);
  background: rgba(255, 122, 143, 0.12);
  transform: translateY(-1px);
  outline: none;
}


/* 10. Site footer ========================================= */

.site-footer {
  margin-top: 3rem;
  padding: 1.8rem 1.2rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-align: center;
}

.site-footer p,
.site-footer__copy {
  margin: 0;
}

.site-footer__social {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.site-footer__social .social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid var(--line);
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.site-footer__social .social-icon:hover,
.site-footer__social .social-icon:focus-visible {
  color: var(--text);
  background: rgba(255, 122, 143, 0.12);
  border-color: var(--line-strong);
  transform: translateY(-1px);
  outline: none;
}


/* 11. Animations & motion ================================= */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(.22, 1, .36, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   rgba(255, 122, 143, 0.6); }
  70%  { box-shadow: 0 0 0 12px rgba(255, 122, 143, 0); }
  100% { box-shadow: 0 0 0 0   rgba(255, 122, 143, 0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}


/* 12. Responsive breakpoints ============================== */

@media (max-width: 1080px) {
  .hero,
  .science-layout,
  .contact-panel,
  .papers-grid,
  .hero__stats,
  .mini-flow,
  .waitlist-panel {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 3rem;
  }

  .feature-card:nth-child(1),
  .feature-card:nth-child(2),
  .feature-card:nth-child(3),
  .feature-card.wide {
    grid-column: span 12;
  }
}

@media (max-width: 760px) {
  .site-shell {
    width: min(calc(100% - 1rem), 100%);
  }

  .hero__stats {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 12ch;
    font-size: clamp(2.8rem, 16vw, 4.4rem);
  }

  .section-heading h2,
  .hero-card h2 {
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .button {
    width: 100%;
  }

  .contact-actions,
  .hero__actions {
    flex-direction: column;
  }

  .waitlist-input-row {
    flex-direction: column;
  }

  .waitlist-btn {
    width: 100%;
  }

  .site-social {
    top: 1rem;
    right: 1rem;
    padding: 0.3rem 0.4rem;
    gap: 0.35rem;
  }
  .site-social .social-icon {
    width: 32px;
    height: 32px;
  }
  .site-social .social-icon svg {
    width: 18px;
    height: 18px;
  }
}
