/* ═══════════════════════════════════════════════════════════
   Ticket-Gather cinematic sequence — CSS
   Layout: two-column grid inside the pinned sticky container.
     • Right column  (52%, "tg-text-col")   → headline + counter
     • Left  column  (48%, "tg-visual-col") → phone  + 3D tickets
   On screens < 1024 px the layout stacks vertically.
═══════════════════════════════════════════════════════════ */

#ticket-gather { height: 380vh; position: relative; background: #ECEAE4; }

/* ── Sticky viewport-height pin ─────────────────────────── */
.ticket-gather-pin {
  position: sticky; top: 0;
  height: 100vh;
  overflow: hidden;
  /* perspective is now scoped to the visual column centre (24% from left
     = centre of the left 48% visual column). This keeps the 3-D card-fly
     effect's vanishing point aligned with the phone. */
  perspective: 1400px;
  perspective-origin: 24% 45%;
  background: linear-gradient(180deg, #F0EDE5 0%, #ECEAE4 50%, #DDE2D6 100%);
}

/* ── Two-column grid ─────────────────────────────────────── */
.tg-layout-grid {
  /* grid-template-areas maps physical columns so the assignment is
     explicit and immune to RTL auto-placement quirks. */
  display: grid;
  grid-template-columns: 48% 52%;  /* left=visual | right=text */
  grid-template-areas: "visual text";
  align-items: center;
  height: 100%;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 5;
}

/* ── Text column ─────────────────────────────────────────── */
.tg-text-col {
  grid-area: text;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 36px;
  padding-right: 20px;   /* breathing room from visual col (RTL: start side) */
  z-index: 30;
  position: relative;
}

/* ── Visual column — phone lives here, tickets orbit here ── */
.tg-visual-col {
  grid-area: visual;
  position: relative;          /* establishes containing block for .outer-ticket */
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;           /* tickets may temporarily exceed col bounds */
}

/* ── Soft mint glow — centred in visual column ──────────── */
.tg-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 640px; height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143,229,168,0.42) 0%, rgba(143,229,168,0) 60%);
  filter: blur(24px);
  pointer-events: none;
  z-index: 0;
}

/* ── Magnetic-field radial rings — centred in visual col ─── */
.tg-field {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 760px; height: 760px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.16;
  background:
    radial-gradient(circle, transparent 190px, rgba(14,17,22,0.08) 191px, transparent 192px),
    radial-gradient(circle, transparent 270px, rgba(14,17,22,0.06) 271px, transparent 272px),
    radial-gradient(circle, transparent 350px, rgba(14,17,22,0.05) 351px, transparent 352px);
}

/* ── Outer floating tickets ──────────────────────────────── */
/* These are absolutely positioned inside #tg-outer-tickets which
   fills .tg-visual-col.  left:50%; top:50% therefore means the
   visual-column centre — which is also where the phone sits. */
#tg-outer-tickets {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.outer-ticket {
  position: absolute;
  top: 50%; left: 50%;
  width: 280px; height: 132px;
  margin-top: -66px; margin-left: -140px;
  transform-style: preserve-3d;
  z-index: 5;
  will-change: transform, opacity;
  pointer-events: none;
}

.outer-ticket .ticket-card {
  width: 100%; height: 100%;
  background: #FFFFFF;
  border-radius: 20px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow:
    0 30px 60px -22px rgba(15,17,22,0.32),
    0 10px 26px -12px rgba(15,17,22,0.18),
    inset 0 1px 0 rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.5);
  position: relative;
}

/* ticket-stub perforation */
.outer-ticket .ticket-card::after {
  content: '';
  position: absolute;
  top: 16px; bottom: 16px; right: 52px;
  width: 1px;
  background-image: linear-gradient(to bottom, #C9C4B8 50%, transparent 50%);
  background-size: 1px 6px; background-repeat: repeat-y;
}
.outer-ticket .ticket-card::before {
  content: '';
  position: absolute;
  top: -6px; right: 47px;
  width: 12px; height: 12px;
  background: #ECEAE4; border-radius: 50%;
  box-shadow: 0 56px 0 #ECEAE4;
}

.outer-ticket .tc-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; color: #5B6270;
}
.outer-ticket .tc-co {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: #0E1116;
}
.outer-ticket .tc-dot { width: 6px; height: 6px; border-radius: 50%; background: #8FE5A8; }

.outer-ticket .tc-route {
  display: flex; align-items: center; gap: 8px;
  padding-right: 50px;
}
.outer-ticket .tc-leg-time {
  font-family: 'Rubik'; font-weight: 700; font-size: 18px;
  letter-spacing: -0.5px; direction: ltr; font-variant-numeric: tabular-nums;
}
.outer-ticket .tc-leg-city { font-size: 9px; color: #8B919C; margin-top: 1px; }
.outer-ticket .tc-line {
  flex: 1; height: 16px; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.outer-ticket .tc-line::before,
.outer-ticket .tc-line::after {
  content: ''; flex: 1; height: 0; border-top: 1.5px dashed #C9C4B8;
}
.outer-ticket .tc-bus {
  width: 22px; height: 22px; border-radius: 50%;
  background: #F5F2EC;
  display: flex; align-items: center; justify-content: center;
  color: #0E1116;
}
.outer-ticket .tc-footer {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; color: #5B6270; padding-right: 50px;
}
.outer-ticket .tc-price {
  font-family: 'Rubik'; font-weight: 700; font-size: 13px;
  color: #0E1116; direction: ltr; font-variant-numeric: tabular-nums;
}
.outer-ticket .tc-stub {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px;
  background-image:
    linear-gradient(#0E1116 2px, transparent 2px),
    linear-gradient(90deg, #0E1116 2px, transparent 2px);
  background-size: 5px 5px; border-radius: 3px; opacity: 0.85;
}

/* ── Phone container ─────────────────────────────────────── */
.tg-phone {
  position: relative;
  width: 320px; height: 660px;
  z-index: 10;
  filter: drop-shadow(0 60px 80px rgba(15,17,22,0.28));
  transform-style: preserve-3d;
  flex-shrink: 0;
}

.tg-phone-frame {
  width: 100%; height: 100%;
  background: linear-gradient(160deg, #1c1c22 0%, #0c0c10 100%);
  border-radius: 48px; padding: 12px; position: relative;
  box-shadow:
    inset 0 0 0 1.5px #2A2F37,
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -1px 0 rgba(0,0,0,0.4);
}
.tg-phone-notch {
  position: absolute;
  top: 22px; left: 50%; transform: translateX(-50%);
  width: 102px; height: 28px;
  background: #000; border-radius: 18px; z-index: 20;
}
.tg-phone-screen {
  width: 100%; height: 100%;
  background: #ECEAE4; border-radius: 38px;
  overflow: hidden;
  position: relative; font-family: 'Rubik', system-ui; direction: rtl;
}

/* Status bar */
.tg-statusbar {
  position: absolute; top: 0; left: 0; right: 0; height: 50px;
  padding: 18px 28px 0;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 600; color: #0E1116;
  z-index: 15; direction: ltr;
}
.tg-statusbar-icons { display: flex; gap: 4px; }

/* App header inside phone */
.tg-app-header {
  position: relative; padding: 56px 18px 14px;
  background: #FFFFFF; z-index: 12;
}
.tg-app-row { display: flex; align-items: center; justify-content: space-between; }
.tg-app-greet { font-size: 11px; color: #5B6270; }
.tg-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: #0E1116; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px;
}
.tg-app-title { margin: 8px 0 12px; font-size: 26px; font-weight: 800; letter-spacing: -0.8px; }
.tg-tabs {
  display: flex; gap: 4px;
  background: #F0EDE5; padding: 4px; border-radius: 10px;
}
.tg-tab {
  flex: 1; text-align: center;
  padding: 6px 0; font-size: 11px; font-weight: 600;
  border-radius: 7px; color: #5B6270;
}
.tg-tab.active { background: #0E1116; color: #fff; }

/* Stack container — inner settled tickets */
.tg-stack {
  position: relative; padding: 14px 14px 0;
  display: flex; flex-direction: column; gap: 8px;
}

/* Inner ticket */
.inner-ticket {
  width: 100%; background: #fff; border-radius: 14px; padding: 10px 14px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03), 0 4px 12px -4px rgba(15,17,22,0.08);
  opacity: 0; transform: translateY(40px);
  will-change: transform, opacity; position: relative;
}
.inner-ticket::after {
  content: ''; position: absolute;
  top: 12px; bottom: 12px; right: 42px; width: 1px;
  background-image: linear-gradient(to bottom, #C9C4B8 50%, transparent 50%);
  background-size: 1px 5px; background-repeat: repeat-y;
}
.inner-ticket .it-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 9px; color: #5B6270; padding-right: 36px;
}
.inner-ticket .it-co {
  font-size: 10px; font-weight: 700; color: #0E1116;
  display: inline-flex; align-items: center; gap: 5px;
}
.inner-ticket .it-route {
  display: flex; align-items: center; gap: 6px;
  margin-top: 5px; padding-right: 36px;
}
.inner-ticket .it-time {
  font-family: 'Rubik'; font-weight: 700; font-size: 14px;
  direction: ltr; font-variant-numeric: tabular-nums; letter-spacing: -0.3px;
}
.inner-ticket .it-city { font-size: 9px; color: #8B919C; margin-top: 1px; }
.inner-ticket .it-line { flex: 1; height: 1px; border-top: 1px dashed #C9C4B8; }
.inner-ticket .it-stub-mark {
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  width: 22px; height: 22px;
  background:
    linear-gradient(#0E1116 1px, transparent 1px),
    linear-gradient(90deg, #0E1116 1px, transparent 1px);
  background-size: 4px 4px; border-radius: 3px; opacity: 0.85;
}
.inner-ticket .it-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px; padding-right: 36px; font-size: 9px; color: #5B6270;
}
.inner-ticket .it-price {
  font-family: 'Rubik'; font-weight: 700; font-size: 11px;
  color: #0E1116; direction: ltr;
}

/* ── Headline — in the text column (no longer absolute) ──── */
.tg-headline-wrap {
  /* Remove the old absolute-centred positioning; layout handled by tg-text-col */
  position: relative;
  top: auto; left: auto; right: auto;
  text-align: right;   /* RTL: right = start of reading direction */
  z-index: 30;
  padding: 0;
  pointer-events: auto;
}

/* ── Counter — below headline in same text column ────────── */
.tg-counter {
  position: relative;
  bottom: auto; left: auto; right: auto;
  text-align: right;
  z-index: 30;
  pointer-events: none;
}
.tg-counter-num {
  font-family: 'Rubik'; font-weight: 800;
  font-size: 56px; letter-spacing: -2px;
  direction: ltr; font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, #0E1116, #2A2F37);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ── Responsive: stack vertically on tablet / mobile ─────── */
@media (max-width: 1023px) {
  .ticket-gather-pin {
    perspective-origin: 50% 45%;  /* restore centred perspective */
  }

  .tg-layout-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "text"
      "visual";
    padding: 0 24px;
    gap: 0;
    /* extra top pad so headline clears the notch on small screens */
    padding-top: 88px;
    align-content: start;
  }

  .tg-text-col {
    gap: 20px;
    padding-right: 0;
  }

  .tg-headline-wrap { text-align: center; }
  .tg-counter       { text-align: center; }

  .tg-visual-col {
    height: 55vh;
  }

  .outer-ticket { transform: scale(0.65); }
  .tg-phone     { transform: scale(0.78); }
}
