/* JetStream Labs — editorial craft layer
   Typography: Syne (display) + Figtree (body)
   Direction: ink night sky + signal teal — globe remains the visual anchor */

@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap");

:root {
  --ink: #05080f;
  --ink-soft: #0a1220;
  --fog: #9fb0c7;
  --snow: #f4f7fb;
  --signal: #3eb7e5;
  --signal-deep: #1a8fbd;
  --line: rgba(158, 190, 220, 0.16);
  --panel: rgba(8, 14, 26, 0.72);
  --font-display: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--snow);
  letter-spacing: 0.01em;
}

h1, h2, h3, .section-title, .hero-headline, .spotlight-title, .studio-title {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

/* ── Hero: one composition ─────────────────────────── */
.hero {
  /* Match the globe canvas, which is centered on the 100vh viewport. */
  height: 100vh;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 0 1.5rem;
  text-align: center;
  background: transparent;
}

.hero::before {
  background:
    radial-gradient(ellipse 70% 50% at 50% 42%, rgba(30, 90, 140, 0.22), transparent 70%),
    radial-gradient(ellipse 90% 60% at 50% 100%, rgba(5, 8, 15, 0.55), transparent 55%);
}

.hero-stage {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero .logo-container {
  position: relative;
  width: min(420px, 86vw);
  flex: 0 0 auto;
  aspect-ratio: 4.687;
}

.hero .logo,
.hero .logo.logo-dropped {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
  overflow: visible;
  opacity: 1;
  transform: none;
  animation: none;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
}

.hero .logo .jsl-mark,
.hero .logo .jsl-jet,
.hero .logo .jsl-stream,
.hero .logo .jsl-labs {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
}

.hero .logo .jsl-mark { transform: translateX(-46vw); }
.hero .logo .jsl-stream { transform: translateY(-32vh); }
.hero .logo .jsl-labs { transform: translateX(46vw); }
.hero .logo .jsl-jet { transform: translateY(28vh) scale(0.6); }

.hero .logo-container.is-introduced .jsl-mark {
  animation: jsl-from-left 0.95s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero .logo-container.is-introduced .jsl-stream {
  animation: jsl-from-top 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.06s both;
}

.hero .logo-container.is-introduced .jsl-labs {
  animation: jsl-from-right 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.hero .logo-container.is-introduced .jsl-jet {
  animation: jsl-from-bottom 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.16s both;
}

@keyframes jsl-from-left {
  0% { opacity: 0; transform: translateX(-46vw); }
  74% { opacity: 1; transform: translateX(12px); }
  100% { opacity: 1; transform: none; }
}

@keyframes jsl-from-right {
  0% { opacity: 0; transform: translateX(46vw); }
  74% { opacity: 1; transform: translateX(-10px); }
  100% { opacity: 1; transform: none; }
}

@keyframes jsl-from-top {
  0% { opacity: 0; transform: translateY(-32vh); }
  74% { opacity: 1; transform: translateY(8px); }
  100% { opacity: 1; transform: none; }
}

@keyframes jsl-from-bottom {
  0% { opacity: 0; transform: translateY(28vh) scale(0.6); }
  74% { opacity: 1; transform: translateY(-6px) scale(1.04); }
  100% { opacity: 1; transform: none; }
}

.hero .logo-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  /* viewBox is wider than the ring so the fade isn't clipped on iOS */
  width: 152%;
  height: auto;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(-90deg);
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}

.hero .logo-ring circle {
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

/* A radial fade across the stroke. Flat strokes and CSS filters stay solid or vanish on iPhone and iPad. */
.hero .logo-ring .logo-ring-shade {
  stroke-width: 22;
}

.hero .logo-container.is-introduced .logo-ring circle {
  animation: logo-ring-evolve 1.7s cubic-bezier(0.45, 0, 0.2, 1) 1.05s both;
}

@keyframes logo-ring-evolve {
  0% { stroke-dashoffset: 1; opacity: 0; transform: scale(0.97); }
  10% { opacity: 1; }
  52% { stroke-dashoffset: 0; opacity: 1; transform: scale(1); }
  74% { stroke-dashoffset: 0; opacity: 1; transform: scale(1); }
  100% { stroke-dashoffset: 0; opacity: 0; transform: scale(1.02); }
}

.hero-copy {
  display: grid;
  grid-template-rows: 0fr;
  width: 100%;
  margin-top: 0;
  opacity: 0;
  transition: grid-template-rows 0.9s var(--ease-out), margin-top 0.9s var(--ease-out), opacity 0.55s ease;
}

.hero.is-settled .hero-copy {
  grid-template-rows: 1fr;
  margin-top: 1.2rem;
  opacity: 1;
}

.hero-copy-inner {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.hero-headline {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1.55rem, 3.6vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--snow);
  max-width: 24ch;
  opacity: 0;
  transform: translateY(18px);
  animation: none;
}

.hero-lede {
  margin: 0;
  font-size: clamp(1rem, 2.1vw, 1.18rem);
  font-weight: 400;
  line-height: 1.45;
  color: var(--fog);
  max-width: 36ch;
  opacity: 0;
  transform: translateY(14px);
  animation: none;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.55rem;
  opacity: 0;
  transform: translateY(12px);
  animation: none;
}

.hero.is-settled .hero-headline {
  animation: craft-rise 0.75s var(--ease-out) 0.12s forwards;
}

.hero.is-settled .hero-lede {
  animation: craft-rise 0.75s var(--ease-out) 0.24s forwards;
}

.hero.is-settled .hero-actions {
  animation: craft-rise 0.75s var(--ease-out) 0.36s forwards;
}

.tagline { display: none; } /* replaced by hero-lede */

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

.btn-craft,
.btn-craft-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.35rem;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn-craft {
  background: var(--signal);
  color: #041018;
  border: 1px solid transparent;
}

.btn-craft:hover {
  background: #63c8ef;
  color: #041018;
  transform: translateY(-1px);
}

.btn-craft-ghost {
  background: transparent;
  color: var(--snow);
  border: 1px solid var(--line);
}

.btn-craft-ghost:hover {
  border-color: rgba(62, 183, 229, 0.55);
  color: #c8eefc;
}

/* ── Flagship spotlights ───────────────────────────── */
.spotlights {
  position: relative;
  z-index: 1;
  padding: 1.25rem 0 0.5rem;
}

.spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(1.1rem, 2.5vw, 2rem);
  align-items: center;
  width: min(920px, calc(100% - 2.5rem));
  margin: 0 auto 2.25rem;
  padding: clamp(1.1rem, 2vw, 1.5rem);
  border-radius: 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(14, 28, 48, 0.88), rgba(6, 10, 18, 0.78));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.spotlight.is-in {
  opacity: 1;
  transform: translateY(0);
}

.spotlight--flip {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}

.spotlight--flip .spotlight-visual { order: 2; }
.spotlight--flip .spotlight-copy { order: 1; }

.spotlight-kicker {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal);
}

.spotlight-title {
  margin: 0 0 0.45rem;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--snow);
}

.spotlight-text {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--fog);
  max-width: 40ch;
}

.spotlight-points {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.spotlight-points li {
  position: relative;
  padding-left: 1rem;
  color: #d7e3f2;
  font-size: 0.88rem;
  line-height: 1.35;
}

.spotlight-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 5px;
  height: 5px;
  border-radius: 2px;
  background: var(--signal);
}

.spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.spotlight-actions .btn-craft,
.spotlight-actions .btn-craft-ghost {
  min-height: 40px;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
}

.spotlight-visual {
  position: relative;
  min-height: 180px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(158, 190, 220, 0.12);
  background:
    radial-gradient(circle at 30% 25%, rgba(62, 183, 229, 0.18), transparent 45%),
    linear-gradient(160deg, #0d1a2c, #071018 70%);
  display: grid;
  place-items: center;
}

.spotlight-visual::after {
  content: "";
  position: absolute;
  inset: auto 12% 12% 12%;
  height: 28%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.45), transparent 70%);
  pointer-events: none;
}

.spotlight-device {
  position: relative;
  z-index: 1;
  width: min(120px, 42%);
  aspect-ratio: 1;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
  transform: translateY(6px) scale(0.96);
  transition: transform 0.9s var(--ease-out);
}

.spotlight.is-in .spotlight-device {
  transform: translateY(0) scale(1);
}

.spotlight-orbit {
  position: absolute;
  inset: 20%;
  border: 1px solid rgba(62, 183, 229, 0.2);
  border-radius: 50%;
  animation: orbit-spin 18s linear infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.spotlight.is-in .spotlight-orbit { opacity: 1; }

.spotlight-orbit::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--signal);
}

@keyframes orbit-spin {
  to { transform: rotate(360deg); }
}

.spotlight--quake .spotlight-visual {
  background:
    radial-gradient(circle at 70% 30%, rgba(255, 140, 66, 0.16), transparent 40%),
    radial-gradient(circle at 30% 70%, rgba(62, 183, 229, 0.14), transparent 45%),
    linear-gradient(160deg, #121820, #070b10 72%);
}

.spotlight--trip .spotlight-visual {
  background:
    radial-gradient(circle at 40% 35%, rgba(56, 189, 248, 0.2), transparent 42%),
    linear-gradient(160deg, #0a1828, #050a12 70%);
}

.spotlight--perk .spotlight-visual {
  background:
    radial-gradient(circle at 55% 40%, rgba(52, 211, 153, 0.14), transparent 45%),
    linear-gradient(160deg, #0c1a18, #070f0e 72%);
}

.spotlight-mark {
  position: absolute;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.spotlight-visual:not(:has(.spotlight-device)) .spotlight-mark {
  position: relative;
  font-size: clamp(3rem, 8vw, 4.5rem);
  color: rgba(62, 183, 229, 0.22);
}

/* ── Apps catalog (secondary) ──────────────────────── */
.apps-section {
  padding-top: 2rem;
}

.apps-section > .section-title {
  margin-bottom: 0.65rem;
}

.section-intro {
  text-align: center;
  color: var(--fog);
  max-width: 42ch;
  margin: 0 auto 2.5rem;
  font-size: 1.02rem;
}

.apps-grid .app-card,
.web-tools-grid .app-card {
  background: var(--panel);
  border-color: var(--line);
}

.app-name,
.section-title,
.tools-section-title {
  font-family: var(--font-display);
}

.app-badge {
  border-radius: 8px;
  background: rgba(62, 183, 229, 0.08);
  border-color: rgba(62, 183, 229, 0.28);
  color: #9adcf5;
}

.app-download-btn,
.app-cta .btn {
  border-radius: 10px;
}

/* PerkPulse lives in spotlights now — keep id target if linked */
.perkpulse-section { display: none; }

/* ── Studio strip ──────────────────────────────────── */
.studio-section {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100% - 2.5rem));
  margin: 1rem auto 4rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(10, 20, 36, 0.9), rgba(6, 12, 22, 0.75));
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1.75rem;
  align-items: end;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
}

.studio-section.is-in {
  opacity: 1;
  transform: translateY(0);
}

.studio-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.25;
  max-width: 22ch;
}

.studio-text {
  margin: 0;
  color: var(--fog);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 46ch;
}

.studio-meta {
  display: grid;
  gap: 0.85rem;
}

.studio-meta strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--snow);
  line-height: 1.1;
}

.studio-meta span {
  color: var(--fog);
  font-size: 0.88rem;
}

/* ── Support (FAQ / Privacy) demoted ───────────────── */
.support-band {
  position: relative;
  z-index: 1;
  width: min(900px, calc(100% - 2.5rem));
  margin: 0 auto 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.support-band .section-title {
  font-size: 1.45rem;
  margin-bottom: 1.25rem;
}

.faq-section,
.privacy-section {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  max-width: 900px;
}

.faq-section .section-title,
.privacy-section .section-title {
  font-size: 1.45rem;
  margin-bottom: 1.25rem;
}

/* Contact polish */
.contact-section .section-title {
  font-family: var(--font-display);
}

.footer {
  border-top: 1px solid var(--line);
  background: transparent;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.footer-links a {
  color: var(--fog);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover { color: var(--signal); }

/* Globe breathes when spotlights in view */
body.craft-active #globeScene {
  opacity: 0.78;
  transition: opacity 0.6s ease;
}

body:not(.craft-active) #globeScene {
  opacity: 0.58;
  transition: opacity 0.6s ease;
}

@media (max-width: 860px) {
  .spotlights {
    padding: 0.75rem 0 0.25rem;
  }

  .spotlight,
  .spotlight--flip {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 0.75rem 0.9rem;
    align-items: start;
    width: min(920px, calc(100% - 1.5rem));
    margin: 0 auto 1.15rem;
    padding: 0.95rem;
    border-radius: 14px;
  }

  /* Icon stays left; copy fills the right — no giant block below */
  .spotlight-visual,
  .spotlight--flip .spotlight-visual {
    order: 0;
    width: 72px;
    height: 72px;
    min-height: 72px;
    border-radius: 16px;
  }

  .spotlight-copy,
  .spotlight--flip .spotlight-copy {
    order: 1;
    min-width: 0;
  }

  .spotlight-orbit,
  .spotlight-mark,
  .spotlight-visual::after {
    display: none;
  }

  .spotlight-device,
  .spotlight.is-in .spotlight-device {
    width: 100%;
    border-radius: 16px;
    box-shadow: none;
    transform: none;
  }

  .spotlight-kicker {
    margin-bottom: 0.2rem;
    font-size: 0.62rem;
  }

  .spotlight-title {
    margin-bottom: 0.35rem;
    font-size: 1.2rem;
  }

  .spotlight-text {
    margin-bottom: 0.65rem;
    font-size: 0.9rem;
    max-width: none;
  }

  .spotlight-points {
    margin-bottom: 0.75rem;
    gap: 0.28rem;
  }

  .spotlight-points li {
    font-size: 0.84rem;
  }

  .spotlight-actions {
    gap: 0.45rem;
  }

  .spotlight-actions .btn-craft,
  .spotlight-actions .btn-craft-ghost {
    flex: 1 1 auto;
    min-height: 42px;
    font-size: 0.85rem;
    padding: 0.5rem 0.85rem;
  }

  .studio-section {
    grid-template-columns: 1fr;
    width: min(920px, calc(100% - 1.5rem));
    margin-bottom: 2.5rem;
  }
}

@media (max-width: 420px) {
  .spotlight,
  .spotlight--flip {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 0.65rem 0.75rem;
  }

  .spotlight-visual,
  .spotlight--flip .spotlight-visual {
    width: 56px;
    height: 56px;
    min-height: 56px;
    border-radius: 14px;
  }

  .spotlight-device,
  .spotlight.is-in .spotlight-device {
    border-radius: 14px;
  }

  .spotlight-actions {
    flex-direction: column;
  }

  .spotlight-actions .btn-craft,
  .spotlight-actions .btn-craft-ghost {
    width: 100%;
  }
}

/* Scroll reveal for content panels (class added by scripts.js) */
.panel-reveal {
  opacity: 0;
  transform:
    perspective(1200px)
    translate3d(var(--reveal-x, 0px), 140px, 0)
    rotateX(22deg)
    rotateY(var(--reveal-ry, 0deg))
    scale(0.86);
  transform-origin: 50% 100%;
  filter: blur(8px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 1.2s var(--ease-out),
    filter 0.9s var(--ease-out),
    border-color 0.3s ease,
    box-shadow 0.3s ease;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform, filter;
}

.panel-reveal.is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

.app-card.panel-reveal.is-in:hover {
  transform: translateY(-10px);
  transition-delay: 0ms;
}

.panel-reveal .app-icon {
  transform: scale(0.3) rotate(-35deg);
  opacity: 0;
  transition: transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
  transition-delay: calc(var(--reveal-delay, 0ms) + 350ms);
}

.panel-reveal.is-in .app-icon {
  transform: none;
  opacity: 1;
}

@media (max-width: 768px) {
  .hero .logo-container {
    width: min(290px, 86vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-headline,
  .hero-lede,
  .hero-actions,
  .hero-copy,
  .spotlight,
  .studio-section,
  .spotlight-orbit,
  .panel-reveal,
  .panel-reveal .app-icon {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-copy {
    grid-template-rows: 1fr;
    margin-top: 1.2rem;
  }

  .hero .logo .jsl-mark,
  .hero .logo .jsl-jet,
  .hero .logo .jsl-stream,
  .hero .logo .jsl-labs {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .hero .logo-ring {
    display: none;
  }
}
