/* ============================================
   SIRIUS — Design System
   Deep-space aesthetic. Editorial typography.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Palette — deep space */
  --void: #04060d;
  --space: #0a0f1f;
  --midnight: #111835;
  --slate: #1a2240;
  --fog: #2a3358;

  /* Light accents — stars */
  --star: #ffffff;
  --star-warm: #fff4e0;
  --moon: #c9d4f5;
  --dust: #8a96bf;
  --shadow: #5a6589;

  /* Signature accent — Sirius blue */
  --sirius: #6ea8ff;
  --sirius-bright: #a8c8ff;
  --sirius-deep: #2d5fcc;
  --ember: #ffb86b;

  /* Type */
  --display: 'Fraunces', Georgia, serif;
  --body: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;

  /* Rhythm */
  --max: 1280px;
  --gutter: clamp(1.5rem, 4vw, 3rem);
  --section: clamp(5rem, 10vw, 9rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--void);
  color: var(--moon);
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   STARFIELD BACKGROUND
   ============================================ */
.starfield {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(110, 168, 255, 0.08), transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(45, 95, 204, 0.06), transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 184, 107, 0.025), transparent 60%),
    var(--void);
}

.starfield::before,
.starfield::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, var(--star) 50%, transparent),
    radial-gradient(1px 1px at 60% 70%, var(--star) 50%, transparent),
    radial-gradient(1px 1px at 80% 20%, var(--star-warm) 50%, transparent),
    radial-gradient(2px 2px at 15% 80%, var(--star) 50%, transparent),
    radial-gradient(1px 1px at 45% 15%, var(--moon) 50%, transparent),
    radial-gradient(1px 1px at 75% 50%, var(--star) 50%, transparent),
    radial-gradient(1.5px 1.5px at 90% 85%, var(--star-warm) 50%, transparent),
    radial-gradient(1px 1px at 35% 60%, var(--star) 50%, transparent),
    radial-gradient(1px 1px at 5% 45%, var(--moon) 50%, transparent),
    radial-gradient(2px 2px at 55% 90%, var(--star) 50%, transparent);
  background-size: 100% 100%;
  opacity: 0.6;
}

.starfield::after {
  background-image:
    radial-gradient(1px 1px at 25% 55%, var(--star) 50%, transparent),
    radial-gradient(1px 1px at 70% 25%, var(--star-warm) 50%, transparent),
    radial-gradient(1px 1px at 10% 65%, var(--star) 50%, transparent),
    radial-gradient(1.5px 1.5px at 85% 40%, var(--moon) 50%, transparent),
    radial-gradient(1px 1px at 50% 5%, var(--star) 50%, transparent),
    radial-gradient(2px 2px at 95% 60%, var(--star-warm) 50%, transparent),
    radial-gradient(1px 1px at 40% 85%, var(--star) 50%, transparent);
  animation: drift 240s linear infinite;
  opacity: 0.4;
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(-100vh); }
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.025;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 400;
  color: var(--star);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
}

h1 {
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  font-weight: 300;
}

h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--sirius-bright);
}

h2 {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 300;
}

h2 em {
  font-style: italic;
  color: var(--sirius-bright);
}

h3 {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 500;
  font-variation-settings: "opsz" 72;
}

h4 {
  font-size: 1.125rem;
  font-weight: 500;
  font-variation-settings: "opsz" 36;
}

p { color: var(--moon); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sirius);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--sirius);
}

.lead {
  font-size: clamp(1.1rem, 1.4vw, 1.25rem);
  color: var(--moon);
  max-width: 60ch;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }

/* ============================================
   LAYOUT
   ============================================ */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section {
  padding: var(--section) 0;
  position: relative;
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  background: rgba(4, 6, 13, 0.65);
  border-bottom: 1px solid rgba(110, 168, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--star);
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 2.25rem;
  align-items: center;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--dust);
  transition: color 0.25s ease;
  position: relative;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--star);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--sirius);
}

.nav-cta {
  font-family: var(--body);
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  background: var(--sirius);
  color: #061224 !important;
  border-radius: 100px;
  transition: all 0.25s ease;
  letter-spacing: 0.01em;
}

.nav-cta:hover {
  background: var(--sirius-bright);
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(110, 168, 255, 0.3);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--star);
  cursor: pointer;
  padding: 0.5rem;
}

@media (max-width: 820px) {
  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(4, 6, 13, 0.95);
    backdrop-filter: blur(20px);
    padding: 2rem var(--gutter);
    gap: 1.5rem;
    border-bottom: 1px solid rgba(110, 168, 255, 0.08);
    transform: translateY(-150%);
    transition: transform 0.3s ease;
  }
  .nav-links.open { transform: translateY(0); }
  .menu-toggle { display: block; }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--body);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.95rem 1.6rem;
  border-radius: 100px;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--sirius);
  color: var(--void);
}

.btn-primary:hover {
  background: var(--sirius-bright);
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(110, 168, 255, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--star);
  border: 1px solid rgba(201, 212, 245, 0.2);
}

.btn-ghost:hover {
  border-color: var(--sirius);
  color: var(--sirius-bright);
}

.btn .arrow {
  transition: transform 0.3s ease;
}
.btn:hover .arrow { transform: translateX(4px); }

/* ============================================
   PAGE INTRO (non-home pages)
   ============================================ */
.page-intro {
  padding-top: calc(var(--section) + 4rem);
  padding-bottom: var(--section);
  position: relative;
}

.page-intro h1 {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  max-width: 18ch;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: linear-gradient(170deg, rgba(26, 34, 64, 0.4), rgba(10, 15, 31, 0.4));
  border: 1px solid rgba(110, 168, 255, 0.1);
  border-radius: 20px;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(110, 168, 255, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.card:hover {
  border-color: rgba(110, 168, 255, 0.3);
  transform: translateY(-4px);
  background: linear-gradient(170deg, rgba(42, 51, 88, 0.5), rgba(17, 24, 53, 0.5));
}

.card:hover::before { opacity: 1; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 1px solid rgba(110, 168, 255, 0.1);
  padding: 4rem var(--gutter) 2rem;
  background: rgba(4, 6, 13, 0.6);
  position: relative;
  z-index: 1;
}

.footer-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--shadow);
  max-width: 30ch;
}

.footer h4 {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--sirius);
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.footer ul { list-style: none; }
.footer li { margin-bottom: 0.6rem; }
.footer a {
  font-size: 0.9rem;
  color: var(--dust);
  transition: color 0.2s;
}
.footer a:hover { color: var(--star); }

.footer-bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(110, 168, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--shadow);
}

.footer-bottom .mono {
  font-family: var(--mono);
}

@media (max-width: 820px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand { grid-column: 1 / -1; }
}

/* ============================================
   FADE-IN ANIMATIONS
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.stagger > * {
  opacity: 0;
  transform: translateY(20px);
  animation: rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.stagger > *:nth-child(1) { animation-delay: 0.1s; }
.stagger > *:nth-child(2) { animation-delay: 0.2s; }
.stagger > *:nth-child(3) { animation-delay: 0.3s; }
.stagger > *:nth-child(4) { animation-delay: 0.4s; }
.stagger > *:nth-child(5) { animation-delay: 0.5s; }
.stagger > *:nth-child(6) { animation-delay: 0.6s; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   UTILITIES
   ============================================ */
.mono { font-family: var(--mono); }
.text-center { text-align: center; }
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(110, 168, 255, 0.2), transparent);
  margin: var(--section) 0;
}
