/* AslGsap.css */
#asl-section {
  --asl-bg: #000000;
  --asl-surface: #1e1e1e;
  --asl-surface-2: #141414;
  --asl-ink: #ffffff;
  --asl-muted: rgba(255, 255, 255);
  --asl-faint: rgba(255, 255, 255);
  --asl-hair: rgba(255, 255, 255);
  --asl-accent: #9fc086;
  --asl-accent-dim: rgba(159, 192, 134);

  --asl-font:
    "Poppins", "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont,
    sans-serif;

  --asl-tracking-wide: 0.08em;
  --asl-tracking-wider: 0.2em;
  --asl-tracking-widest: 0.42em;

  --asl-stage-w: 1920px;
  --asl-stage-h: 1080px;

  position: relative;
  background: radial-gradient(
    ellipse 120% 90% at 50% 30%,
    #0b0b0b 0%,
    #000000 65%
  );
  padding: 0;
  margin: 0;
  display: block;
}

#asl-section * {
  box-sizing: border-box;
}

/* ---------------------------------------------------------------------
   FILM / STAGE / CAMERA / WORLD
   --------------------------------------------------------------------- */
.asl-film {
  position: relative;
  width: 100%;
  background: var(--asl-bg);
}

.asl-stage {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--asl-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.asl-camera {
  position: relative;
  width: var(--asl-stage-w);
  height: var(--asl-stage-h);
  flex: none;
  transform-origin: center center;
  overflow: hidden;
}

.asl-world {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.asl-particle-layer {
  position: absolute;
  inset: 0;
  opacity: 0.08;
}
.asl-particle-field {
  width: 100%;
  height: 100%;
}
.asl-particle-field circle {
  fill: var(--asl-ink);
}

.asl-corner-marks {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0.4;
}
.asl-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  fill: none;
  transition: opacity 0.3s ease;
}
.asl-corner path {
  fill: none;
  stroke: var(--asl-muted);
  stroke-width: 1.25;
}
.asl-corner.tl {
  top: 46px;
  left: 46px;
}
.asl-corner.tr {
  top: 46px;
  right: 46px;
  transform: rotate(90deg);
}
.asl-corner.br {
  bottom: 46px;
  right: 46px;
  transform: rotate(180deg);
}
.asl-corner.bl {
  bottom: 46px;
  left: 46px;
  transform: rotate(270deg);
}

/* ---------------------------------------------------------------------
   BEATS
   --------------------------------------------------------------------- */
.asl-beat {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.asl-tech-label,
.asl-idle-label,
.asl-lock-label,
.asl-detected-label {
  position: absolute;
  font-family: var(--asl-font);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: var(--asl-tracking-widest);
  text-transform: uppercase;
  color: var(--asl-muted);
  opacity: 0;
  white-space: nowrap;
}
.asl-lock-label {
  color: var(--asl-accent);
  text-shadow: 0 0 18px var(--asl-accent-dim);
}
.asl-detected-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 22px;
  letter-spacing: var(--asl-tracking-wide);
  color: var(--asl-ink);
  font-weight: 300;
  font-variant-numeric: tabular-nums;
}
.asl-detected-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: var(--asl-tracking-widest);
  color: var(--asl-accent);
}

.asl-hand-mini-svg { 
  width: 100%; 
  height: 100%; 
  overflow: visible; 
}
.asl-hand-mini-svg path { 
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.4)); 
}

#aslHandOpenState, #aslLetterBState {
  transform-box: fill-box;
  transform-origin: center;
}

#aslHandSvg {
  transform: scale(2);
}

#aslLetterB {
  transition: opacity 0.3s ease;
  transform-origin: center center;
}

#aslHandTransition,
#aslHandTransition2 {
  transition: opacity 0.3s ease;
  transform-origin: center center;
}

#aslBeatClosure {
  transition: opacity 0.5s ease;
}

/* BEAT 01 -- idle viewport frame */
.asl-viewport-wrap {
  position: absolute;
  opacity: 0.7;
  filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.03));
}
.asl-viewport-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* BEAT 02 -- hand entrance */
.asl-hand-wrap {
  position: absolute;
  opacity: 1;
  will-change: transform;
}
.asl-hand-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.asl-hand-svg path {
  opacity: 0.96;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.6));
}

/* BEAT 03 -- capture lock */
.asl-lock-frame-wrap {
  position: absolute;
  filter: drop-shadow(0 0 24px var(--asl-accent-dim));
}
.asl-lock-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.asl-reg-marks,
.asl-focus-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.asl-reg-mark {
  fill: none;
  stroke: var(--asl-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  filter: drop-shadow(0 0 6px var(--asl-accent-dim));
}

/* BEAT 04 -- landmark field + hand side by side */
.asl-hand-mini-wrap {
  position: absolute;
}
.asl-hand-mini-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.asl-hand-mini-svg path {
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
}

.asl-arrow {
  position: absolute;
  opacity: 0.3;
}

.asl-landmark-wrap {
  position: absolute;
  opacity: 0;
}
.asl-landmark-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.asl-landmark-svg line.asl-bone {
  stroke: rgba(255, 255, 255, 0.32);
  stroke-width: 1.25;
  stroke-linecap: round;
}
.asl-landmark-svg circle.asl-point {
  fill: var(--asl-ink);
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
}
.asl-landmark-svg circle.asl-point.is-key {
  fill: var(--asl-accent);
  filter: drop-shadow(0 0 8px var(--asl-accent-dim));
}
.asl-landmark-svg text.asl-coord-label {
  font-family: var(--asl-font);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  fill: var(--asl-muted);
  opacity: 0;
}

/* BEAT 05 -- closure / forming B */
#aslHandTransition,
#aslHandTransition2 {
  transition: all 0.3s ease;
}
#aslLetterB {
  transition: all 0.3s ease;
}

/* BEAT 06 -- letter */
.asl-letter-wrap {
  position: absolute;
  opacity: 0;
}
.asl-letter-svg {
  width: 460px;
  height: 460px;
  overflow: visible;
}
.asl-letter-outline,
.asl-letter-fill {
  font-family: var(--asl-font);
  font-weight: 700;
  font-size: 400px;
}
.asl-letter-outline {
  fill: none;
  stroke: var(--asl-ink);
  stroke-width: 1.5;
  opacity: 0;
}
.asl-letter-fill {
  fill: var(--asl-ink);
  opacity: 0;
  filter: drop-shadow(0 0 60px rgba(255, 255, 255, 0.12));
}

/* ---------------------------------------------------------------------
   Persistent chrome
   --------------------------------------------------------------------- */
.asl-chrome {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 45;
  pointer-events: none;
}
.asl-chrome-top {
  top: 0;
  padding: 40px 48px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.asl-num {
  font-family: var(--asl-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: var(--asl-tracking-wide);
  color: var(--asl-faint);
}
.asl-eyebrow-desc {
  font-family: var(--asl-font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--asl-tracking-wider);
  text-transform: uppercase;
  color: var(--asl-faint);
}
.asl-chrome-bottom {
  bottom: 0;
  padding: 0 48px 48px;
  display: flex;
  justify-content: center;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  padding-top: 90px;
}
.asl-chrome-bottom .asl-cta-wrap {
  pointer-events: all;
  text-align: center;
  max-width: 620px;
}
.asl-title {
  font-family: var(--asl-font);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--asl-ink);
  margin: 0 0 14px;
}
.asl-project-summary {
  margin: 0 auto 22px;
  font-family: var(--asl-font);
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--asl-muted);
  font-weight: 300;
}

.asl-switch {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.asl-btn {
  padding: 10px 20px;
  border-radius: 100px;
  border: 1px solid var(--asl-hair);
  background: rgba(255, 255, 255, 0.02);
  color: var(--asl-muted);
  font-family: var(--asl-font);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.asl-btn:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--asl-ink);
}
.asl-btn.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}
.asl-btn:focus-visible {
  outline: 2px solid var(--asl-accent);
  outline-offset: 2px;
}
.asl-panel {
  min-height: 42px;
  margin-bottom: 22px;
  transition: opacity 0.15s ease;
}
.asl-panel p {
  font-family: var(--asl-font);
  font-size: 13.5px;
  color: var(--asl-muted);
  line-height: 1.7;
  margin: 0;
}

.asl-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  color: #000;
  font-weight: 700;
  font-family: var(--asl-font);
  font-size: 14.5px;
  padding: 16px 30px;
  border-radius: 100px;
  text-decoration: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  transition:
    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.25s,
    box-shadow 0.28s;
  border: none;
}
.asl-btn-primary:hover {
  transform: translateY(-3px);
  opacity: 0.92;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
}
.asl-btn-primary:focus-visible {
  outline: 2px solid var(--asl-accent);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------------
   RESPONSIVE -- MOBILE LANDSCAPE (existing letterbox behaviour, UNCHANGED)
   --------------------------------------------------------------------- */
@media (max-width: 720px) {
  .asl-corner {
    width: 13px;
    height: 13px;
  }
  .asl-corner.tl,
  .asl-corner.tr {
    top: 18px;
  }
  .asl-corner.bl,
  .asl-corner.br {
    bottom: 18px;
  }
  .asl-corner.tl,
  .asl-corner.bl {
    left: 18px;
  }
  .asl-corner.tr,
  .asl-corner.br {
    right: 18px;
  }
  .asl-chrome-top {
    padding: 20px;
  }
  .asl-chrome-bottom {
    padding: 60px 20px 26px;
  }
  .asl-title {
    font-size: 21px;
  }
  .asl-project-summary {
    font-size: 13px;
  }
  .asl-btn-primary {
    padding: 14px 24px;
    font-size: 13.5px;
  }
  .asl-letter-svg {
    width: 300px;
    height: 300px;
  }
  .asl-viewport-wrap {
    width: 90% !important;
    height: auto !important;
    aspect-ratio: 1/1;
    left: 5% !important;
    top: 10% !important;
  }
  .asl-hand-wrap {
    width: 90% !important;
    height: auto !important;
    aspect-ratio: 1/1;
    left: 5% !important;
    top: 10% !important;
  }
  .asl-lock-frame-wrap {
    width: 90% !important;
    height: auto !important;
    aspect-ratio: 1/1;
    left: 5% !important;
    top: 10% !important;
  }
  .asl-hand-mini-wrap {
    width: 40% !important;
    height: auto !important;
    aspect-ratio: 380/600;
    left: 5% !important;
    top: 18% !important;
  }
  .asl-landmark-wrap {
    width: 40% !important;
    height: auto !important;
    aspect-ratio: 380/600;
    left: 55% !important;
    top: 18% !important;
  }
  .asl-arrow {
    display: none;
  }
}

/* ---------------------------------------------------------------------
   RESPONSIVE -- MOBILE PORTRAIT (NEW: fluid layout, camera scale = 1)
   More specific than the block above, so it wins the cascade only for
   portrait phones; landscape mobile keeps the letterbox block above.
   --------------------------------------------------------------------- */
@media (max-width: 720px) and (orientation: portrait) {
  .asl-camera {
    width: 100% !important;
    height: 100dvh !important;
    transform: none !important;
  }
  .asl-stage {
    height: 100dvh;
  }
  .asl-world {
    width: 100%;
    height: 100%;
  }

  /* Each beat becomes a centered flex column instead of a pixel-absolute
     1920x1080 canvas. Beats stay position:absolute + opacity-driven so
     the GSAP cross-fade timing is untouched -- only the *inner* layout
     model changes. */
  .asl-beat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    text-align: center;
  }

  /* Neutralize the pixel left/top/width/height coming from inline
     styles (1920x1080 coordinate space) and let flex centering + fluid
     sizing take over. */
  .asl-viewport-wrap,
  .asl-hand-wrap,
  .asl-lock-frame-wrap,
  .asl-hand-mini-wrap,
  .asl-landmark-wrap,
  .asl-letter-wrap {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    width: min(78vw, 340px) !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
  }

  /* The persistent hand lives outside the beats (sibling of them), so it
     can't be centered by a beat's flexbox. Center it directly and let
     GSAP's `x` slide-in tween apply on top of this base position. */
  .asl-hand-wrap {
    position: absolute !important;
    left: 50% !important;
    top: 18% !important;
    margin-left: -140px !important;
    width: 280px !important;
    height: 280px !important;
  }

  .asl-viewport-wrap h1 {
    font-size: clamp(14px, 4.5vw, 20px);
    margin: 0 0 8px;
  }

  .asl-tech-label,
  .asl-idle-label,
  .asl-lock-label,
  .asl-detected-label {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    white-space: normal;
    font-size: clamp(10px, 3vw, 13px);
  }
  .asl-detected-label {
    font-size: clamp(16px, 5vw, 22px);
    justify-content: center;
  }

  /* Registration marks / scan line only read correctly on a wide
     landscape canvas -- hide on portrait phones. */
  .asl-reg-marks,
  .asl-focus-ring-svg {
    display: none;
  }

  /* Side-by-side hand + landmark layout collapses to stacked; arrows
     between them don't make sense vertically. */
  .asl-arrow {
    display: none;
  }

  .asl-letter-svg {
    width: min(60vw, 260px);
    height: min(60vw, 260px);
  }

  .asl-chrome-top {
    padding: 16px;
  }
  .asl-chrome-bottom {
    padding: 50px 16px 22px;
  }
  .asl-title {
    font-size: clamp(18px, 5.5vw, 22px);
  }
  .asl-project-summary {
    font-size: clamp(12px, 3.6vw, 14px);
  }

   /* Reduce gap between hand and landmark */
  .asl-beat {
    gap: 4px; /* Reduced from 14px */
    padding: 12px; /* Reduced from 24px */
    justify-content: flex-start; /* Start from top instead of center */
    padding-top: 40px; /* Add some top padding for the label */
  }

  /* Make the hand and landmark containers smaller and closer together */
  .asl-hand-mini-wrap,
  .asl-landmark-wrap {
    width: min(65vw, 280px) !important; /* Slightly smaller */
    aspect-ratio: 380/600;
    margin: 0 !important; /* Remove any margin */
  }

  /* The arrow is already hidden, but ensure it doesn't take space */
  .asl-arrow {
    display: none !important;
  }

  /* If you want them side by side instead of stacked */
  /* Uncomment this block to make them side by side */
  
  .asl-beat {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 12px;
  }
  .asl-hand-mini-wrap,
  .asl-landmark-wrap {
    width: min(42vw, 180px) !important;
  }
 

}

/* ---------------------------------------------------------------------
   REDUCED MOTION -- static, legible fallback (unchanged)
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .asl-film {
    height: auto !important;
  }
  .asl-stage {
    position: relative;
    height: auto;
    min-height: 100vh;
    padding: 100px 24px;
  }
  .asl-camera {
    transform: none !important;
    width: 100%;
    max-width: 700px;
    height: auto;
  }
  .asl-world {
    position: relative;
    transform: none !important;
  }
  .asl-beat {
    position: relative;
    opacity: 1 !important;
    inset: auto;
    display: block;
    margin-bottom: 40px;
  }
  .asl-particle-layer,
  .asl-corner-marks,
  .asl-reg-marks,
  .asl-focus-ring-svg {
    display: none;
  }
  .asl-viewport-wrap,
  .asl-hand-wrap,
  .asl-lock-frame-wrap,
  .asl-landmark-wrap,
  .asl-letter-wrap,
  .asl-tech-label,
  .asl-idle-label,
  .asl-lock-label,
  .asl-detected-label,
  .asl-hand-mini-wrap {
    opacity: 1 !important;
    transform: none !important;
    position: relative;
    left: auto !important;
    top: auto !important;
    margin: 16px auto;
  }
  .asl-letter-outline,
  .asl-letter-fill {
    opacity: 1 !important;
  }
  .asl-chrome {
    position: relative;
  }
  .asl-chrome-bottom {
    background: none;
  }
}