/* ============================================================
   BEIQI — Brand Showcase
   Mobile-first. Off-black canvas, BEIQI blue accent.
   ============================================================ */

:root {
  --bg: #08080b;
  --bg-soft: #0e0e14;
  --ink: #f4f4f6;
  --ink-dim: rgba(244, 244, 246, 0.55);
  --ink-faint: rgba(244, 244, 246, 0.28);
  --blue: #3524e0;          /* BEIQI electric blue */
  --blue-bright: #6a5aff;   /* lighter blue for small text on dark bg */
  --blue-soft: rgba(53, 36, 224, 0.35);
  --font: "Sora", system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: auto;  /* Lenis owns scrolling */
  overflow-x: hidden;
}

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

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

/* ============ HERO ============ */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 6vw;
  overflow: hidden;
}

/* Soft blue aura behind the content — the only color on screen */
.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 130vmax;
  height: 130vmax;
  transform: translate(-50%, -55%);
  background:
    radial-gradient(closest-side, rgba(53, 36, 224, 0.28), transparent 62%);
  pointer-events: none;
  will-change: transform;
}

.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  will-change: transform;
}

/* Entrance-hidden states only apply when JS confirms animations will run
   (html.anim) — if the GSAP CDN fails, the page renders fully visible. */
.hero-logo {
  width: clamp(180px, 52vw, 340px);
  height: auto;
  margin-bottom: clamp(2rem, 6vh, 3.5rem);
  /* halo hugging the letterforms so the blue reads against the dark bg */
  filter:
    drop-shadow(0 0 18px rgba(93, 76, 255, 0.55))
    drop-shadow(0 0 60px rgba(53, 36, 224, 0.4));
}

html.anim .hero-logo { opacity: 0; }        /* revealed by JS */

.hero-tagline {
  font-size: clamp(2.6rem, 11vw, 6.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.04;
}

/* Each line masks its inner span for a rise-up reveal */
.hero-tagline .line {
  display: block;
  overflow: hidden;
}
.hero-tagline .line-inner { display: block; }

html.anim .hero-tagline .line-inner {
  transform: translateY(110%);      /* revealed by JS */
}

.accent { color: var(--blue); }

/* Scroll cue */
.scroll-cue {
  position: absolute;
  bottom: clamp(1.5rem, 4vh, 3rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

html.anim .scroll-cue { opacity: 0; }       /* revealed by JS */

.scroll-cue-label {
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.scroll-cue-track {
  position: relative;
  width: 1px;
  height: 44px;
  background: rgba(244, 244, 246, 0.12);
  overflow: hidden;
}

.scroll-cue-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: var(--ink);
  animation: cue-drop 2.2s var(--ease-out) infinite;
}

@keyframes cue-drop {
  0%   { transform: translateY(-110%); }
  55%  { transform: translateY(160%); }
  100% { transform: translateY(260%); }
}

/* ============ SHARED SECTION RHYTHM ============ */

.section {
  position: relative;
  padding: clamp(6rem, 18vh, 11rem) 6vw;
  max-width: 46rem;
  margin: 0 auto;
}

.kicker {
  --kglow: 0;               /* 0..1, driven by mouse proximity (JS) */
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--blue-bright);
  margin-bottom: 1.5rem;
  text-shadow: 0 0 calc(8px + 16px * var(--kglow))
    rgba(93, 76, 255, calc(0.35 + 0.6 * var(--kglow)));
}

@media (min-width: 900px) {
  .kicker { font-size: 0.9rem; }
}

/* ============ 2. BRAND ============ */

.brand { text-align: center; }

.brand-heading {
  font-size: clamp(1.9rem, 6.5vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1.75rem;
}

.brand-copy {
  font-size: clamp(1rem, 2.6vw, 1.15rem);
  color: var(--ink-dim);
  max-width: 38rem;
  margin: 0 auto;
}

/* Elements revealed on scroll (JS sets initial state) */
.reveal { will-change: transform, opacity; }

/* ============ 3–5. MACHINE TIERS ============ */

.tier {
  padding: clamp(6rem, 18vh, 11rem) 0;
  max-width: 78rem;
  margin: 0 auto;
}

.tier-head {
  text-align: center;
  padding: 0 6vw;
  margin-bottom: clamp(2.5rem, 7vh, 4.5rem);
}

.tier-title {
  font-size: clamp(2.4rem, 9vw, 4.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1.1rem;
}

.tier-sub {
  font-size: clamp(1rem, 2.6vw, 1.15rem);
  color: var(--ink-dim);
}

/* 3D stage */
.tier-stage {
  position: relative;
  height: clamp(420px, 62svh, 640px);
  will-change: transform, opacity;
}

.tier-stage::before {
  /* blue floor-glow beneath the machine */
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: min(88vw, 780px);
  height: 150px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(53, 36, 224, 0.34), transparent 70%);
  filter: blur(14px);
  pointer-events: none;
}

.tier-stage::after {
  /* wide ambient aura behind the whole machine, sized to the stage
     so large floor models get the same presence as small countertops */
  content: "";
  position: absolute;
  inset: -8% 0;
  background: radial-gradient(ellipse 62% 55% at 50% 55%, rgba(53, 36, 224, 0.17), transparent 72%);
  pointer-events: none;
}

model-viewer {
  position: relative;
  z-index: 1;               /* keep the machine above the stage glows */
  width: 100%;
  height: 100%;
  --poster-color: transparent;
  background: transparent;
  cursor: grab;             /* second hint that the model is draggable */
}

model-viewer:active { cursor: grabbing; }

/* "Drag to rotate" hint — faded in by JS when the model loads,
   faded out after a few seconds or on first interaction */
.drag-hint {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%) translateY(6px);
  padding: 0.45rem 1rem;
  border: 1px solid rgba(244, 244, 246, 0.14);
  border-radius: 999px;
  background: rgba(8, 8, 11, 0.55);
  backdrop-filter: blur(6px);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.drag-hint.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Entry-tier stat row */
.stat-row {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: clamp(1.5rem, 7vw, 5rem);
  margin-top: clamp(2rem, 5vh, 3rem);
  padding: 0 6vw;
  text-align: center;
}

.stat { display: flex; flex-direction: column; gap: 0.35rem; }

.stat-value {
  font-size: clamp(1.15rem, 4.4vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.tier-link {
  text-align: center;
  margin-top: 2.25rem;
}

/* Specs links */
.specs-link {
  display: inline-block;
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(244, 244, 246, 0.18);
  padding-bottom: 0.2rem;
  transition: color 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
}

.specs-link:hover { color: var(--ink); border-color: var(--blue); }

.specs-link .arrow { color: var(--blue); }

/* Comparison rows: swipe carousel on mobile, centered wrap on desktop */
.compare {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.5rem 6vw 1.5rem;
  margin-top: clamp(2rem, 6vh, 3.5rem);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.compare::-webkit-scrollbar { display: none; }

.card {
  flex: 0 0 76vw;
  max-width: 330px;
  scroll-snap-align: center;
  padding: 2rem 1.6rem;
  border: 1px solid rgba(244, 244, 246, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(244, 244, 246, 0.035), rgba(244, 244, 246, 0.012));
  display: flex;
  flex-direction: column;
  transition:
    border-color 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out),
    transform 0.35s var(--ease-out);
}

.card:hover {
  border-color: rgba(106, 90, 255, 0.75);
  box-shadow:
    0 0 28px rgba(53, 36, 224, 0.35),
    0 14px 48px rgba(53, 36, 224, 0.22);
  transform: translateY(-3px);
}

.card-tag {
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.6rem;
}

.card-flagship { border-color: rgba(53, 36, 224, 0.45); }

.card-name {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.card-line {
  font-size: 0.92rem;
  color: var(--ink-dim);
  margin-bottom: 1.4rem;
}

.card-features {
  list-style: none;
  margin-bottom: 1.8rem;
  flex: 1;
}

.card-features li {
  font-size: 0.88rem;
  color: var(--ink-dim);
  padding: 0.55rem 0;
  border-top: 1px solid rgba(244, 244, 246, 0.07);
}

.card-features li:first-child { border-top: 0; }

@media (min-width: 900px) {
  .compare {
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
    gap: 1.4rem;
  }
  .card { flex: 0 0 300px; }
}

/* ============ 6. CONSUMABLES ============ */

.consumables { text-align: center; }

.consumables-line {
  font-size: clamp(1.3rem, 4.6vw, 2.1rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.35;
  margin-bottom: 1.75rem;
}

/* ============ 7. CLOSING CTA ============ */

.cta {
  position: relative;
  min-height: 82svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(6rem, 16vh, 10rem) 6vw;
  overflow: hidden;
}

.cta-glow {
  position: absolute;
  bottom: -40vmax;
  left: 50%;
  width: 110vmax;
  height: 90vmax;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(53, 36, 224, 0.18), transparent 65%);
  pointer-events: none;
}

.cta-heading {
  position: relative;
  font-size: clamp(2.6rem, 11vw, 6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: clamp(2.25rem, 6vh, 3.5rem);
}

.cta-button {
  position: relative;
  display: inline-block;
  padding: 1.15rem 2.6rem;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
  box-shadow: 0 0 0 rgba(53, 36, 224, 0);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 44px rgba(53, 36, 224, 0.45);
}

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

.footer {
  padding: 2.5rem 6vw 3rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--ink-faint);
  border-top: 1px solid rgba(244, 244, 246, 0.06);
}

/* ============ RESOURCES (floating button + panel) ============ */

.resources-fab {
  position: fixed;
  z-index: 40;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vh, 2rem);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border: 1px solid rgba(244, 244, 246, 0.14);
  border-radius: 999px;
  background: rgba(14, 14, 20, 0.75);
  backdrop-filter: blur(10px);
  color: var(--ink-dim);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.3s var(--ease-out), border-color 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}

.resources-fab:hover {
  color: var(--ink);
  border-color: rgba(106, 90, 255, 0.6);
  box-shadow: 0 0 24px rgba(53, 36, 224, 0.3);
}

.resources-fab svg { color: var(--blue-bright); }

.resources-panel {
  margin: auto;
  width: min(92vw, 34rem);
  max-height: 80svh;
  padding: 2rem 1.75rem;
  border: 1px solid rgba(244, 244, 246, 0.12);
  border-radius: 20px;
  background: #0e0e14;
  color: var(--ink);
  font-family: var(--font);
}

.resources-panel::backdrop {
  background: rgba(4, 4, 7, 0.7);
  backdrop-filter: blur(6px);
}

.resources-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.resources-head h2 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.resources-close {
  border: 0;
  background: none;
  color: var(--ink-dim);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
}

.resources-close:hover { color: var(--ink); }

.resources-list {
  list-style: none;
  overflow-y: auto;
}

.resources-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.8rem 0;
  border-top: 1px solid rgba(244, 244, 246, 0.07);
}

.res-model {
  flex: 1 0 5.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.res-chip {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(244, 244, 246, 0.12);
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

a.res-chip:hover { color: var(--ink); border-color: var(--blue-bright); }

.res-chip.is-pending {
  opacity: 0.45;
  font-style: italic;
}

/* ============ REDUCED MOTION ============ */

@media (prefers-reduced-motion: reduce) {
  .scroll-cue-bar { animation: none; transform: translateY(30%); }
}
