/* ============================================
   OYSTER DESIGN SYSTEM — Pearl in Orbit
   Shared chrome (fonts, vars, body, cosmos, nav,
   buttons, headline patterns, footer) used by
   every oyster.to page.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Sora:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #04060d;
  --bg-2: #080b1c;
  --bg-3: #0d1126;
  --ink: #f3f4ff;
  --ink-2: rgba(243, 244, 255, 0.66);
  --ink-3: rgba(243, 244, 255, 0.42);
  --ink-4: rgba(243, 244, 255, 0.22);
  --accent: #8b76ff;
  --accent-2: #a99eff;
  --signal: #7be7ff;
  --plasma: #ff8de0;
  --star: #ffd97a;
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;

  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-padding-top: 80px;
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100vw;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: clip;
  max-width: 100vw;
  position: relative;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01' on, 'cv11' on;
}

/* ============================================
   COSMIC BACKGROUND
   ============================================ */
.cosmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 1100px 700px at 22% 8%, rgba(139, 118, 255, 0.09) 0%, transparent 60%),
    radial-gradient(ellipse 800px 600px at 80% 18%, rgba(123, 231, 255, 0.05) 0%, transparent 65%),
    linear-gradient(180deg, #04060d 0%, #050714 50%, #04060d 100%);
  /* Very slow hue drift on the nebula. Stars are white so they're
     unaffected; only the colored radial gradients breathe. */
  animation: cosmos-hue-drift 90s ease-in-out infinite;
}
@keyframes cosmos-hue-drift {
  0%, 100% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(18deg); }
}
@media (prefers-reduced-motion: reduce) {
  .cosmos { animation: none; }
}
.cosmos::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
  opacity: 0.4;
}
/* Overscan so parallax.js drift + mouse offset (peaks ~74px on near) never
   exposes a starless edge inside the cosmos container. */
.stars { position: absolute; inset: -120px; }
.stars div {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  /* width/height/opacity are set per-star by assets/stars.js so the
     field has natural brightness and size variation. */
}
.star-twinkle {
  animation: oy-twinkle var(--dur, 6s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes oy-twinkle {
  0%, 100% { opacity: var(--peak, 0.65); }
  50% { opacity: var(--trough, 0.12); }
}
@media (prefers-reduced-motion: reduce) {
  .star-twinkle { animation: none; }
}

/* One tasteful drifting comet. ~35s flight, low intensity. */
.comet {
  position: absolute;
  top: var(--y, 18%);
  left: -12vw;
  width: 220px; height: 3px;
  /* Warm streak: long faint tail, building through orange/yellow to a
     bright white head — like a meteor burning through atmosphere. */
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 200, 130, 0.04) 20%,
    rgba(255, 210, 140, 0.18) 55%,
    rgba(255, 230, 180, 0.55) 85%,
    rgba(255, 250, 230, 0.95) 98%,
    #fff 100%
  );
  border-radius: 999px;
  /* Slight horizontal blur softens the edges so it doesn't read as a hard line. */
  filter: blur(0.6px) drop-shadow(0 0 8px rgba(255, 200, 120, 0.55));
  animation: comet-fly 35s linear infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0;
  transform: rotate(12deg);
}
.comet::after {
  content: '';
  position: absolute;
  right: -3px; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 4px;
  background: #fff;
  border-radius: 50%;
  /* Layered glow: tight white core, warm yellow halo, soft orange diffuse. */
  box-shadow:
    0 0 6px #fff,
    0 0 14px rgba(255, 220, 140, 0.75),
    0 0 28px rgba(255, 180, 100, 0.4);
}
@keyframes comet-fly {
  /* Parabolic arc — comet enters nearly horizontal, accelerates down
     as it crosses, exits steeply. Rotation at each step matches the
     tangent of the curve so the tail follows the path. Only ~12s of
     every 35s shows the comet — feels rare, not constant. */
  /* X advances at a steady rate so the comet doesn't appear to slow
     as it fades. Y follows a parabola of X so the curve still bends
     gradually — but each keyframe covers the same horizontal distance. */
  0%, 5% { transform: translate(0, 0) rotate(2deg); opacity: 0; }
  8% { transform: translate(8vw, 0.2vh) rotate(3deg); opacity: 0.5; }
  11% { transform: translate(16vw, 0.9vh) rotate(6deg); opacity: 0.9; }
  14% { transform: translate(24vw, 2vh) rotate(9deg); opacity: 0.9; }
  17% { transform: translate(33vw, 3.7vh) rotate(11deg); opacity: 0.9; }
  20% { transform: translate(41vw, 5.8vh) rotate(14deg); opacity: 0.9; }
  23% { transform: translate(49vw, 8.3vh) rotate(17deg); opacity: 0.88; }
  26% { transform: translate(57vw, 11.2vh) rotate(20deg); opacity: 0.78; }
  29% { transform: translate(65vw, 14.5vh) rotate(22deg); opacity: 0.62; }
  32% { transform: translate(73vw, 18vh) rotate(25deg); opacity: 0.42; }
  35% { transform: translate(81vw, 22vh) rotate(27deg); opacity: 0.22; }
  38% { transform: translate(89vw, 26vh) rotate(29deg); opacity: 0.08; }
  40% { transform: translate(95vw, 28vh) rotate(30deg); opacity: 0; }
  100% { transform: translate(95vw, 28vh) rotate(30deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .comet { display: none; }
}

/* ============================================
   NAV
   ============================================ */
.nav {
  position: fixed;
  top: 18px;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: max-content;
  max-width: calc(100vw - 20px);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 6px 5px 4px;
  background: rgba(13, 16, 36, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 4px 32px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(139, 118, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.nav-logo {
  width: 22px; height: 22px;
  margin: 0 6px 0 12px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(139, 118, 255, 0.5));
}
/* Logo wrapped in <a> — tight circular hover, no text-link padding */
.nav a:has(.nav-logo) {
  padding: 4px;
  margin: 0 2px 0 8px;
  border-radius: 50%;
  line-height: 0;
}
.nav a:has(.nav-logo):hover {
  background: rgba(139, 118, 255, 0.16);
}
.nav a:has(.nav-logo) .nav-logo {
  margin: 0;
  display: block;
}
.nav a {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding: 7px 16px;
  border-radius: 9999px;
  transition: color 0.2s ease, background 0.2s ease;
  letter-spacing: -0.01em;
}
.nav a:hover {
  color: #fff;
  background: rgba(139, 118, 255, 0.18);
}
.nav a.active {
  color: #fff;
  background: rgba(139, 118, 255, 0.16);
}
@media (max-width: 560px) {
  .nav { padding: 4px 4px 4px 2px; gap: 0; }
  .nav a { padding: 6px 10px; font-size: 12px; }
  .nav-logo { width: 20px; height: 20px; margin: 0 4px 0 8px; }
}
@media (max-width: 400px) {
  .nav a { padding: 5px 8px; font-size: 11px; }
  .nav-logo { margin: 0 2px 0 6px; }
}

@keyframes oy-breathe { 50% { opacity: 0.45; } }

/* ============================================
   CTA BUTTONS
   ============================================ */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 9999px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid transparent;
}
.cta:hover { transform: translateY(-1px); }
.cta-primary {
  background: linear-gradient(180deg, #9d8cff 0%, #8b76ff 100%);
  color: #fff;
  box-shadow:
    0 4px 24px rgba(139, 118, 255, 0.45),
    0 0 60px rgba(139, 118, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.cta-primary:hover {
  box-shadow:
    0 8px 36px rgba(139, 118, 255, 0.55),
    0 0 100px rgba(139, 118, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.cta-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}
.cta-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}
.cta svg { width: 14px; height: 14px; }
@keyframes oy-shimmer {
  0% { transform: translateX(-100%) skewX(-15deg); }
  100% { transform: translateX(200%) skewX(-15deg); }
}
.cta::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.22) 50%, transparent 100%);
  transform: translateX(-100%) skewX(-15deg);
}
.cta:hover::after {
  animation: oy-shimmer 0.85s ease-in-out 1 forwards;
}

.cta-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
/* Phone-sized screens only — stack the CTAs and let each one fill the width.
   Tablets keep the inline pill row. */
@media (max-width: 560px) {
  .cta-row { flex-direction: column; flex-wrap: nowrap; }
  .cta-row .cta { width: 100%; justify-content: center; }
}

/* ============================================
   TYPOGRAPHY PATTERNS
   ============================================ */

/* Editorial serif accent — for accent words inside headlines */
.accent-serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.005em;
  background: linear-gradient(180deg, #fff 0%, var(--accent-2) 50%, var(--signal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.accent-serif-soft {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--accent-2);
}

/* Section h2 used on supporting pages */
.section-h2 {
  font-family: var(--sans);
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  padding: 60px 28px 60px;
  letter-spacing: 0.06em;
}
.site-footer .heart { color: var(--plasma); }
.site-footer a { color: var(--ink-3); text-decoration: none; transition: color 0.2s; }
.site-footer a:hover { color: var(--ink); }

/* ============================================
   REVEAL ON SCROLL
   Children of [data-reveal] fade + lift in once when the
   wrapper enters the lower portion of the viewport.
   Activated only when JS sets .js-reveal on <html>
   (the head script omits it under prefers-reduced-motion).
   ============================================ */
.js-reveal [data-reveal] > * {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.4, 0.2, 1),
              transform 0.8s cubic-bezier(0.2, 0.4, 0.2, 1);
  will-change: opacity, transform;
}
.js-reveal [data-reveal] > *:nth-child(2) { transition-delay: 0.12s; }
.js-reveal [data-reveal] > *:nth-child(3) { transition-delay: 0.24s; }
.js-reveal [data-reveal] > *:nth-child(4) { transition-delay: 0.36s; }
.js-reveal [data-reveal].is-visible > * {
  opacity: 1;
  transform: none;
  will-change: auto;
}
