/* =========================================================================
   Cosmica Biosciences — Brand stylesheet
   Shared design tokens, typography, nav, and base styles used across pages
   ========================================================================= */

:root {
  /* Base palette */
  --bg: #030308;
  --bg-elevated: #0C0C14;
  --bg-card: #14141E;
  --text-primary: #F5F5F7;
  --text-secondary: #A8A8B8;
  --text-tertiary: #6E6E7E;

  /* Cosmica parent brand — cool cosmic palette */
  --cosmic-violet: #6B7FD7;
  --cosmic-violet-soft: #9AA8E4;
  --cosmic-deep: #2A3470;
  --starlight: #E8EAFF;

  /* OrganAge — amber sunrise (product-specific, reserved) */
  --oa-deep: #5B2E0F;
  --oa-primary: #D4852E;
  --oa-accent: #F0A830;
  --oa-soft: #FFC97A;

  /* BeyondAge — telomere blue + solar core red (product-specific, reserved) */
  --ba-deep: #0F1547;
  --ba-primary: #2C33B4;
  --ba-accent: #4F58D9;
  --ba-soft: #8B92F0;
  --ba-red: #EB250F;

  /* Borders */
  --border-subtle: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.12);

  /* Typography */
  --display: "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ NAVIGATION ============ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 22px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(3,3,8,0.35);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s ease, background 0.4s ease, padding 0.3s ease;
}

.nav.scrolled {
  background: rgba(3,3,8,0.88);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 48px;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-logo img {
  height: 28px;
  width: auto;
  display: block;
  transition: opacity 0.2s ease;
}

.nav-logo:hover img { opacity: 0.85; }

.nav-links {
  display: flex;
  gap: 38px;
  align-items: center;
}

.nav-link {
  font-family: var(--body);
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  letter-spacing: 0.005em;
}

.nav-link:hover { color: var(--text-primary); }

.nav-cta {
  font-family: var(--body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--bg);
  background: var(--text-primary);
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 100px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(232,234,255,0.18);
}

/* ============ SHARED BUTTONS ============ */

.btn-primary {
  font-family: var(--body);
  font-size: 15px;
  font-weight: 500;
  color: var(--bg);
  background: var(--text-primary);
  text-decoration: none;
  padding: 16px 28px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, var(--cosmic-violet-soft), var(--cosmic-violet));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(107,127,215,0.3);
  color: var(--text-primary);
}

.btn-primary:hover::before { opacity: 1; }
.btn-primary svg { transition: transform 0.25s ease; }
.btn-primary:hover svg { transform: translateX(3px); }

.btn-secondary {
  font-family: var(--body);
  font-size: 15px;
  font-weight: 400;
  color: var(--text-primary);
  text-decoration: none;
  padding: 16px 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s ease;
}

.btn-secondary:hover { color: var(--cosmic-violet-soft); }
.btn-secondary svg { transition: transform 0.25s ease; }
.btn-secondary:hover svg { transform: translateX(3px); }

/* ============ SHARED ANIMATIONS ============ */

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

@keyframes lineReveal {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scrollPulse {
  0% { transform: translateY(-100%); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(400%); opacity: 0; }
}

@keyframes slowRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes counterRotate {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ============ RESPONSIVE — shared ============ */

@media (max-width: 768px) {
  .nav { padding: 16px 24px; }
  .nav.scrolled { padding: 12px 24px; }
  .nav-links { display: none; }
  .nav-logo img { height: 22px; }
  .btn-primary, .btn-secondary { padding: 14px 22px; font-size: 14px; }
}

/* ============ FOOTER ============ */

.footer {
  position: relative;
  background: var(--bg);
  border-top: 1px solid var(--border-subtle);
  padding: 80px 48px 40px;
  overflow: hidden;
}

/* Subtle violet glow at the top edge */
.footer::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 60%;
  max-width: 800px;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(154,168,228,0.30) 50%,
    transparent 100%
  );
  filter: blur(0.5px);
  pointer-events: none;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* Top band: brand block + link columns */
.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--border-subtle);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 320px;
}

.footer-logo img {
  height: 44px;
  width: auto;
  display: block;
}

.footer-tagline {
  font-family: var(--body);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 280px;
}

.footer-column-title {
  font-family: var(--body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-bottom: 20px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-link {
  font-family: var(--body);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}

.footer-link:hover { color: var(--text-primary); }

.footer-link-external svg {
  opacity: 0.5;
  transition: opacity 0.2s ease;
}
.footer-link:hover .footer-link-external svg {
  opacity: 1;
}

/* Bottom band: copyright + social */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-copyright {
  font-family: var(--body);
  font-size: 12.5px;
  color: var(--text-tertiary);
  letter-spacing: 0.005em;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  font-family: var(--body);
  font-size: 12.5px;
  color: var(--text-tertiary);
}

.footer-meta-divider {
  width: 1px;
  height: 12px;
  background: var(--border-strong);
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-social-link {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-tertiary);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-social-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.footer-social-link svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 968px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 40px 32px;
  }
  .footer-brand {
    grid-column: 1 / -1;
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .footer { padding: 60px 24px 32px; }
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 32px 24px;
    padding-bottom: 40px;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}
