/* Intro section. Static layout (normal page flow) = the reduced-motion version;
   the pinned sequence later layers the same elements in one viewport.
   Materials come from the cinematic-hero component, recolored to Violet nocturne. */

.intro {
  display: grid;
  justify-items: center;
  gap: var(--space-9);
  padding-block-end: var(--space-9);
  text-align: center;
}

/* --- Hero: name and role --------------------------------------------------- */

.intro__hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: var(--space-4);
  max-width: 100%;
}

.intro__title {
  font-size: var(--step-6);
  /* "matte 3D" glow from the source component, in palette colors */
  text-shadow:
    0 10px 30px color-mix(in srgb, var(--color-violet) 35%, transparent),
    0 2px 4px color-mix(in srgb, var(--color-bg) 40%, transparent);
}

.intro__tagline {
  max-width: 22ch;
  font-size: var(--step-4);
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
  /* "silver matte" gradient text */
  background: linear-gradient(180deg, var(--color-text) 0%, color-mix(in srgb, var(--color-text) 70%, transparent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- CTA ------------------------------------------------------------------- */

.intro__cta {
  display: grid;
  justify-items: center;
  gap: var(--space-5);
  max-width: 40rem;
}

.intro__cta-heading {
  font-size: var(--step-5);
  background: linear-gradient(180deg, var(--color-text) 0%, color-mix(in srgb, var(--color-text) 70%, transparent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro__cta-description {
  font-size: var(--step-1);
  color: var(--color-text-muted);
}

.intro__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

/* Tactile buttons (light primary, dark secondary) */
.intro__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  min-width: 12rem; /* equal widths when the buttons stack on phones */
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-m);
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
    box-shadow 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.intro__btn--primary {
  color: var(--color-bg);
  background: linear-gradient(180deg, var(--color-text) 0%, color-mix(in srgb, var(--color-text) 88%, var(--color-indigo)) 100%);
  box-shadow:
    0 2px 4px color-mix(in srgb, var(--color-bg) 30%, transparent),
    0 12px 24px -4px color-mix(in srgb, var(--color-bg) 60%, transparent),
    inset 0 -3px 6px color-mix(in srgb, var(--color-indigo) 12%, transparent);
}

.intro__btn--secondary {
  color: var(--color-text);
  background: linear-gradient(180deg, var(--color-line) 0%, var(--color-surface) 100%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--color-text) 12%, transparent),
    0 12px 24px -4px color-mix(in srgb, var(--color-bg) 90%, transparent),
    inset 0 1px 1px color-mix(in srgb, var(--color-text) 15%, transparent);
}

.intro__btn:hover {
  transform: translateY(-3px);
}

.intro__btn:active {
  transform: translateY(1px);
}

/* --- Skip button (shown only during the pinned sequence) ------------------ */

.intro__skip {
  position: fixed;
  right: var(--gutter);
  bottom: var(--space-5);
  z-index: var(--z-header);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid color-mix(in srgb, var(--color-text) 25%, transparent);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--color-bg) 55%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
}

.intro__skip[hidden] {
  display: none;
}

/* Lucide icons inherit the text color and size */
.intro .icon,
.intro__skip .icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

/* --- Card: deep physical card with phone, badges, "10M+" ------------------- */

.intro__card {
  position: relative;
  overflow: hidden;
  width: min(100%, 80rem);
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  align-items: center;
  gap: var(--space-7);
  padding: var(--space-7) var(--space-5);
  border: 1px solid color-mix(in srgb, var(--color-text) 5%, transparent);
  border-radius: var(--radius-l);
  background: linear-gradient(145deg, var(--color-indigo) 0%, color-mix(in srgb, var(--color-indigo) 25%, var(--color-bg)) 100%);
  box-shadow:
    0 40px 100px -20px color-mix(in srgb, var(--color-bg) 90%, transparent),
    0 20px 40px -20px color-mix(in srgb, var(--color-bg) 80%, transparent),
    inset 0 1px 2px color-mix(in srgb, var(--color-text) 20%, transparent),
    inset 0 -2px 4px color-mix(in srgb, var(--color-bg) 80%, transparent);
}

/* Soft light that follows the pointer (position set later from JS) */
.intro__card-sheen {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 30%), color-mix(in srgb, var(--color-text) 6%, transparent) 0%, transparent 40%);
  mix-blend-mode: screen;
}

.intro__card-text {
  position: relative;
  z-index: 3;
  display: grid;
  gap: var(--space-4);
  max-width: 28rem;
}

.intro__card-heading {
  font-size: var(--step-4);
  color: var(--color-text);
}

.intro__card-description {
  font-size: var(--step-1);
  color: color-mix(in srgb, var(--color-text) 72%, transparent);
}

/* Huge "10M+" with the silver "card" gradient */
.intro__brand {
  position: relative;
  z-index: 3;
  font-size: clamp(4rem, 2.6rem + 6vw, 8rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.05em;
  background: linear-gradient(180deg, var(--color-text) 0%, color-mix(in srgb, var(--color-text) 55%, var(--color-indigo)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(0 12px 24px color-mix(in srgb, var(--color-bg) 80%, transparent))
    drop-shadow(0 4px 8px color-mix(in srgb, var(--color-bg) 60%, transparent));
}

/* Phones: "10M+" first, then the phone, then the text (as in the source) */
.intro__brand { order: 1; }
.intro__stage { order: 2; }
.intro__card-text { order: 3; }

@media (min-width: 1024px) {
  .intro__card {
    grid-template-columns: 1fr auto 1fr;
    padding: var(--space-8) var(--space-7);
  }

  .intro__card-text { order: 1; justify-self: start; text-align: start; }
  .intro__stage { order: 2; }
  .intro__brand { order: 3; justify-self: end; }
}

/* --- Phone ----------------------------------------------------------------- */

.intro__stage {
  position: relative;
  z-index: 3;
  perspective: 1000px;
}

.intro__phone {
  position: relative;
  width: 280px;
  height: 580px;
  max-width: 100%;
  border-radius: 3rem;
  background: var(--color-bg);
  box-shadow:
    inset 0 0 0 2px var(--color-line),
    inset 0 0 0 7px var(--color-bg),
    0 40px 80px -15px color-mix(in srgb, var(--color-bg) 90%, transparent),
    0 15px 25px -5px color-mix(in srgb, var(--color-bg) 70%, transparent);
  transform-style: preserve-3d;
}

/* Hardware buttons */
.intro__hw {
  position: absolute;
  width: 3px;
  background: linear-gradient(90deg, var(--color-line) 0%, var(--color-bg) 100%);
}

.intro__hw--l1 { top: 120px; left: -3px; height: 25px; border-radius: 4px 0 0 4px; }
.intro__hw--l2 { top: 160px; left: -3px; height: 45px; border-radius: 4px 0 0 4px; }
.intro__hw--l3 { top: 220px; left: -3px; height: 45px; border-radius: 4px 0 0 4px; }
.intro__hw--r1 { top: 170px; right: -3px; height: 70px; border-radius: 0 4px 4px 0; }

.intro__screen {
  position: absolute;
  inset: 7px;
  overflow: hidden;
  border-radius: 2.5rem;
  background: var(--color-surface);
  box-shadow: inset 0 0 15px var(--color-bg);
}

.intro__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro__glare {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(110deg, color-mix(in srgb, var(--color-text) 8%, transparent) 0%, transparent 45%);
}

.intro__island {
  position: absolute;
  top: 5px;
  left: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100px;
  height: 28px;
  padding-inline: 12px;
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  translate: -50% 0;
}

.intro__island-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent);
}

/* Glass views counter on the lower part of the video */
.intro__counter {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 1.75rem;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-m);
  background: color-mix(in srgb, var(--color-bg) 55%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-text) 10%, transparent);
}

.intro__ring {
  width: 3.25rem;
  height: 3.25rem;
  flex: none;
  rotate: -90deg;
}

.intro__ring circle {
  fill: none;
  stroke-width: 14;
}

.intro__ring-track {
  stroke: color-mix(in srgb, var(--color-text) 10%, transparent);
}

.intro__ring-fill {
  stroke: var(--color-accent);
  stroke-linecap: round;
}

.intro__counter-text {
  display: grid;
  text-align: start;
  line-height: 1.1;
}

/* The phone is a fixed 280 px wide, so text inside it uses fixed sizes, not the fluid scale */
.intro__counter-value {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.intro__counter-label {
  font-size: 0.75rem;
  color: color-mix(in srgb, var(--color-text) 65%, transparent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* --- Floating glass badges -------------------------------------------------- */

.intro__badges {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.intro__badge {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 15rem;
  padding: var(--space-3);
  border-radius: var(--radius-m);
  text-align: start;
  background: linear-gradient(135deg, color-mix(in srgb, var(--color-text) 10%, transparent) 0%, color-mix(in srgb, var(--color-text) 2%, transparent) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--color-text) 10%, transparent),
    0 25px 50px -12px color-mix(in srgb, var(--color-bg) 80%, transparent),
    inset 0 1px 1px color-mix(in srgb, var(--color-text) 20%, transparent);
}

.intro__badge--1 { top: 1.5rem; left: -1rem; }
.intro__badge--2 { bottom: 9.5rem; right: -1rem; } /* clears the counter */

@media (min-width: 1024px) {
  .intro__badge { padding: var(--space-4); }
  .intro__badge--1 { top: 3rem; left: -5rem; }
  .intro__badge--2 { bottom: 9rem; right: -5rem; }
}

.intro__badge-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  border-radius: 50%;
  color: var(--color-accent);
  background: color-mix(in srgb, var(--color-violet) 22%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-accent) 30%, transparent);
}

.intro__badge-text {
  display: grid;
  gap: 0.1rem;
  line-height: 1.2;
}

.intro__badge-title {
  font-size: var(--step--1);
  font-weight: 700;
}

.intro__badge-subtitle {
  font-size: 0.75rem;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
}

/* Widen the narrow no-break spaces in "10 000 000" (nearly invisible in bold) */
.intro__digit-gap {
  margin-inline: 0.06em;
}

/* --- Stage layout: the pinned, animated version ----------------------------
   Added by intro.js only when motion is allowed (gsap.matchMedia). Hero, CTA
   and card are layered in one viewport; the scroll timeline moves them.
   Everything above stays the reduced-motion layout. */

.intro--stage {
  display: block;
  height: 100vh;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  perspective: 1500px;
}

.intro--stage .intro__hero,
.intro--stage .intro__cta {
  position: absolute;
  inset: 0;
  z-index: 1;
  min-height: 0;
  max-width: none;
  align-content: center;
  padding-inline: var(--gutter);
}

.intro--stage .intro__cta > * {
  max-width: 40rem;
}

/* Centered, framed card above the texts; the timeline grows it to full screen */
.intro--stage .intro__card {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: auto;
  width: 92%;
  height: 92%;
  max-width: none;
  align-content: center;
  padding: var(--space-5) var(--space-4);
  gap: var(--space-5);
  border-radius: 2rem;
  perspective: 1500px;
}

@media (min-width: 768px) {
  .intro--stage .intro__card {
    width: 85%;
    height: 85%;
    border-radius: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .intro--stage .intro__card {
    padding: var(--space-7) var(--space-8);
  }
}

/* The phone is scaled to fit short screens (zoom computed by intro.js) */
.intro--stage .intro__stage {
  zoom: var(--stage-zoom, 1);
}

/* Elements animated in 3D */
.intro--stage .intro__stage,
.intro--stage .intro__card-text,
.intro--stage .intro__brand,
.intro--stage .intro__title,
.intro--stage .intro__cta {
  will-change: transform;
}

/* Pause/play button on the phone screen (top right, clear of the island) */
.intro__video-toggle {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-bg) 55%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-text) 15%, transparent);
  cursor: pointer;
}

.intro__video-toggle[hidden] {
  display: none;
}

.intro__video-toggle .icon {
  width: 1rem;
  height: 1rem;
}
