/* =====================================================================
   WebLauncher — weblauncher.in  |  3D, scroll-driven, mobile-first
   The 3D world lives on one fixed canvas. HTML sections scroll over it
   and each section is a "station" the camera flies to.
   ===================================================================== */

/* ---------- 1. Design tokens -------------------------------------------- */
:root {
  --bg: #06070d;
  --glass: rgba(11, 13, 26, 0.62);
  --glass-brd: rgba(255, 255, 255, 0.1);
  --text: #f3f4fb;
  --text-dim: #a3a9be;
  --text-faint: #626880;

  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-3: #ff7a59;
  --grad: linear-gradient(120deg, var(--accent), var(--accent-2));

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --step-hero: clamp(2.3rem, 6.2vw, 5rem);
  --step-h2: clamp(1.6rem, 3.4vw, 2.6rem);

  --gutter: clamp(1rem, 5vw, 5rem);
  --radius: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 2. Base ----------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  /* Vertical swipes scroll the page; horizontal swipes reach our JS and
     rotate the 3D object. pinch-zoom stays enabled for accessibility. */
  touch-action: pan-y pinch-zoom;
  background-image:
    radial-gradient(70vw 70vw at 85% -10%, rgba(124, 92, 255, 0.16), transparent 60%),
    radial-gradient(60vw 60vw at 0% 30%, rgba(34, 211, 238, 0.1), transparent 55%);
  background-attachment: fixed;
}

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

ul,
ol {
  list-style: none;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

::selection {
  background: var(--accent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 6px;
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 3. The 3D canvas ------------------------------------------- */
/* lvh = the *largest* viewport height, so the canvas doesn't resize (and
   re-render) every time the mobile address bar shows or hides. */
.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100lvh;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* ---------- 4. Boot terminal (preloader) ------------------------------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity .6s var(--ease), visibility .6s;
}

.boot.is-done {
  opacity: 0;
  visibility: hidden;
}

.boot__log {
  font: 400 clamp(.8rem, 2.6vw, 1rem)/1.8 var(--font-mono);
  color: var(--text-dim);
  min-width: min(28rem, 86vw);
  white-space: pre-wrap;
}

.boot__log .ok {
  color: #4ade80;
}

.boot__log .prompt {
  color: var(--accent-2);
}

/* ---------- 5. Nav ------------------------------------------------------ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(.9rem, env(safe-area-inset-top)) var(--gutter) .9rem;
  background: linear-gradient(to bottom, rgba(6, 7, 13, .85), transparent);
}

.nav__logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  display: flex;
  gap: .5rem;
  align-items: center;
}

.nav__mark {
  color: var(--accent-2);
}

/* ---------- 6. Buttons -------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .7rem 1.4rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: .95rem;
  transition: transform .3s var(--ease), background .3s, border-color .3s;
}

.btn:active {
  transform: scale(.96);
}

.btn--primary {
  background: var(--grad);
  color: #fff;
}

.btn--ghost {
  border: 1px solid var(--glass-brd);
  background: rgba(255, 255, 255, .04);
}

.btn--ghost:hover {
  border-color: rgba(255, 255, 255, .3);
}

.btn--pill {
  min-height: 40px;
  padding: .5rem 1.1rem;
  border: 1px solid var(--glass-brd);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: .9rem;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--glass-brd);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background .3s, transform .3s var(--ease);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, .12);
}

.icon-btn:active {
  transform: scale(.92);
}

/* ---------- 7. Pipeline progress / nav -------------------------------- */
/* Desktop: vertical list on the right edge. */
.pipeline {
  position: fixed;
  z-index: 20;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
}

.pipeline ol {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  position: relative;
}

.pipeline ol::before {
  /* the "pipe" connecting the stages */
  content: "";
  position: absolute;
  right: 5px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--glass-brd);
}

.pipeline a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .6rem;
  padding: .3rem 0;
  font: 500 .72rem/1 var(--font-mono);
  color: var(--text-faint);
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: color .3s;
}

.pipeline a::after {
  /* stage node */
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: none;
  border: 1px solid var(--text-faint);
  background: var(--bg);
  position: relative;
  z-index: 1;
  transition: background .3s, border-color .3s, box-shadow .3s;
}

.pipeline__label {
  opacity: 0;
  transform: translateX(6px);
  transition: opacity .3s, transform .3s var(--ease);
}

.pipeline:hover .pipeline__label,
.pipeline li.is-active .pipeline__label {
  opacity: 1;
  transform: none;
}

.pipeline li.is-done a::after {
  background: var(--accent);
  border-color: var(--accent);
}

.pipeline li.is-active a {
  color: var(--text);
}

.pipeline li.is-active a::after {
  background: var(--accent-2);
  border-color: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
}

.pipeline__now {
  display: none;
}

/* ---------- 8. Stations (sections) & glass panels ---------------------- */
main {
  position: relative;
  z-index: 1;
}

.station {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 6rem var(--gutter);
  position: relative;
}

/* Desktop: panel sits left; the 3D object is shifted right via the
   camera's view offset in script.js. */
.panel {
  width: min(30rem, 100%);
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.station--hero .panel {
  width: min(36rem, 100%);
  background: transparent;
  border-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding-left: 0;
}

.panel--center {
  margin-inline: auto;
  text-align: center;
}

.panel h2 {
  font-size: var(--step-h2);
  margin-bottom: .8rem;
}

.panel p {
  color: var(--text-dim);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: .85rem;
  color: var(--text-dim);
  margin-bottom: 1.2rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, .6);
  animation: ping 2s infinite;
}

@keyframes ping {
  70% {
    box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
  }
}

.hero__title {
  font-size: var(--step-hero);
  margin-bottom: 1.2rem;
}

.lead {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  max-width: 32rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.8rem;
}

.tag {
  font: 500 .78rem/1 var(--font-mono);
  color: var(--accent-2) !important;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: 1.2rem;
}

.chips li {
  font: 400 .75rem/1 var(--font-mono);
  padding: .45rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--glass-brd);
  color: var(--text-dim);
  background: rgba(255, 255, 255, .03);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-top: 1.4rem;
}

.stats div {
  padding: .8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
}

.stats dt {
  font-size: .72rem;
  color: var(--text-faint);
  order: 2;
}

.stats dd {
  font: 600 1.5rem/1.1 var(--font-display);
}

.stats div {
  display: flex;
  flex-direction: column-reverse;
  gap: .2rem;
}

.project {
  min-height: 11rem;
  transition: opacity .25s;
}

.project.is-swapping {
  opacity: 0;
}

.carousel-ctl {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.2rem;
}

.carousel-ctl__count {
  font: 500 .85rem/1 var(--font-mono);
  color: var(--text-dim);
  min-width: 3.5rem;
  text-align: center;
}

.contact__title {
  font-size: var(--step-h2);
}

.contact__email {
  display: inline-block;
  margin-top: 1.4rem;
  font: 600 clamp(1.2rem, 3.4vw, 2rem)/1.2 var(--font-display);
  border-bottom: 1px solid var(--accent-2);
  padding-bottom: .2rem;
  word-break: break-all;
}

.socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-top: 1.6rem;
  color: var(--text-dim);
}

.socials a {
  display: inline-block;
  padding: .4rem 0;
  transition: color .3s;
}

.socials a:hover {
  color: var(--text);
}

.foot {
  margin-top: 2rem;
  font-size: .8rem;
  color: var(--text-faint) !important;
}

/* Scroll cue */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  font: 500 .7rem/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--text-faint);
}

.scroll-cue__line {
  width: 1px;
  height: 40px;
  background: linear-gradient(var(--accent-2), transparent);
  animation: drip 1.8s var(--ease) infinite;
  transform-origin: top;
}

@keyframes drip {
  0% {
    transform: scaleY(0);
  }

  60% {
    transform: scaleY(1);
  }

  100% {
    transform: scaleY(1);
    opacity: 0;
  }
}

/* Drag hint (shown while a draggable station is in view) */
.hint {
  position: fixed;
  z-index: 15;
  left: 50%;
  bottom: 1.2rem;
  transform: translate(-50%, 10px);
  font: 500 .72rem/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: .6rem .9rem;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s, transform .4s var(--ease);
}

.hint.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hint__arrow {
  display: inline-block;
  animation: nudge 1.4s ease-in-out infinite;
}

.hint__arrow:last-child {
  animation-direction: reverse;
}

@keyframes nudge {
  50% {
    transform: translateX(-4px);
  }
}

/* Reveal on enter */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ---------- 9. Mobile ---------------------------------------------------- */
/* The 3D object sits in the top half (camera view offset), the panel in
   the bottom half, and the pipeline becomes a slim progress bar. */
@media (max-width: 819px) {
  .station {
    align-items: flex-end;
    padding: 0 var(--gutter) calc(1.5rem + env(safe-area-inset-bottom));
    min-height: 115svh;
    /* a little extra scroll = dwell time per stage */
  }

  .station--hero {
    align-items: flex-end;
    min-height: 100svh;
    padding-bottom: 5.5rem;
  }

  .station--hero .panel {
    padding: 0;
  }

  .scroll-cue {
    display: none;
  }

  /* the buttons sit where it would go */
  .panel {
    width: 100%;
  }

  .panel p {
    font-size: .95rem;
  }

  .stats dd {
    font-size: 1.25rem;
  }

  .project {
    min-height: 12.5rem;
  }

  .pipeline {
    top: calc(3.6rem + env(safe-area-inset-top));
    right: var(--gutter);
    left: var(--gutter);
    transform: none;
  }

  .pipeline ol {
    flex-direction: row;
    gap: 4px;
  }

  .pipeline ol::before {
    display: none;
  }

  .pipeline li {
    flex: 1;
  }

  .pipeline a {
    display: block;
    height: 22px;
    padding: 9px 0;
  }

  /* 22px tap target, 4px visible bar */
  .pipeline a::after {
    display: block;
    width: 100%;
    height: 3px;
    border-radius: 2px;
    border: 0;
    background: rgba(255, 255, 255, .12);
  }

  .pipeline li.is-active a::after {
    box-shadow: 0 0 8px var(--accent-2);
  }

  .pipeline__no,
  .pipeline__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .pipeline__now {
    display: block;
    margin-top: .2rem;
    font: 500 .68rem/1 var(--font-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-dim);
  }

  .hint {
    bottom: auto;
    top: calc(6.2rem + env(safe-area-inset-top));
  }
}

/* ---------- 10. Reduced motion ----------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}