/* ==========================================================================
   tickets.css — membership timeline, tabs and cards

   The largest section on the page. Three parts:
     1. Milestone timeline
     2. Tab strip (ARIA tablist, wired by main.js)
     3. Membership cards (.pass-card), with nested accordions for the detail
   ========================================================================== */

.tickets {
  position: relative;
}

/* --------------------------------------------------------------------------
   1. Membership timeline
   -------------------------------------------------------------------------- */

.tickets__timeline {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--ds-space-4);
  margin-bottom: var(--ds-space-8);
  padding: var(--ds-space-5);
  border: var(--ds-border-width) solid var(--ds-color-border-default);
  border-radius: var(--ds-radius-card);
  background-color: var(--ds-color-bg-surface-3);
}

@media (min-width: 768px) {
  .tickets__timeline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--ds-space-5);
  }
}

/* The rule is split in two so it has something to sweep across: the border is
   an unfilled track, and ::after is the accent drawn over it. The track is
   derived from the accent rather than a fixed token, so it stays the dimmer of
   the two under any theme. The overlay rests at full width, which is what
   no-JS and reduced-motion readers get — identical to a plain solid rule. */
.milestone {
  --milestone-accent: var(--ds-color-border-subtle);
  position: relative;
  padding-top: var(--ds-space-5);
  border-top: var(--ds-border-width-thick) solid
    color-mix(in srgb, var(--milestone-accent) 35%, transparent);
}

.milestone::after {
  content: '';
  position: absolute;
  top: calc(var(--ds-border-width-thick) * -1);
  left: 0;
  width: 100%;
  height: var(--ds-border-width-thick);
  background-color: var(--milestone-accent);
  transform-origin: left center;
  pointer-events: none;
}

/* Dot sitting on the rule, marking each milestone */
.milestone::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 0;
  z-index: 1;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--ds-color-border-strong);
}

.milestone--done {
  --milestone-accent: var(--ds-color-border-hover);
}

.milestone--done::before {
  background-color: var(--ds-color-text-description);
}

.milestone--current {
  --milestone-accent: var(--ds-color-brand);
}

.milestone--current::before {
  background-color: var(--ds-color-brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ds-color-brand) 25%, transparent);
}

/* Stagger index. Four is the designed length; a fifth step would simply
   start with the first rather than break. */
.milestone:nth-child(1) {
  --trail-i: 0;
}

.milestone:nth-child(2) {
  --trail-i: 1;
}

.milestone:nth-child(3) {
  --trail-i: 2;
}

.milestone:nth-child(4) {
  --trail-i: 3;
}

/* Gated on .is-visible, which the reveal observer adds. So the trail fires on
   scroll-in where the timeline sits mid-page (index.html) and on load where it
   sits above the fold (join.html) — one rule covers both.

   Set --trail-base inline to hold the trail back behind a page-header
   entrance; it defaults to 0ms, which is what a mid-page timeline wants. */
.js .tickets__timeline.is-visible .milestone::after {
  animation: ds-trail-line 520ms var(--ds-ease-out) backwards;
  animation-delay: calc(var(--trail-base, 0ms) + var(--trail-i, 0) * 110ms);
}

.js .tickets__timeline.is-visible .milestone::before {
  animation: ds-trail-dot 420ms var(--ds-ease-out) backwards;
  animation-delay: calc(var(--trail-base, 0ms) + var(--trail-i, 0) * 110ms + 300ms);
}

.js .tickets__timeline.is-visible .milestone__date,
.js .tickets__timeline.is-visible .milestone__text {
  --enter-y: 8px;
  animation: ds-hero-enter 520ms var(--ds-ease-out) backwards;
  animation-delay: calc(var(--trail-base, 0ms) + var(--trail-i, 0) * 110ms + 200ms);
}

.milestone__date {
  font-family: var(--ds-font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-color-text-description);
}

.milestone--current .milestone__date {
  color: var(--ds-color-brand);
}

.milestone__text {
  margin-top: var(--ds-space-2);
  font-size: 14px;
  line-height: 160%;
  color: var(--ds-color-text-secondary);
}

/* --------------------------------------------------------------------------
   2. Tabs — a pill segmented control
   -------------------------------------------------------------------------- */

.tabs__list {
  display: flex;
  width: fit-content;
  /* Three pills can exceed a narrow viewport, and a segmented control should
     not wrap — so let it scroll instead of forcing the page wider. */
  max-width: 100%;
  overflow-x: auto;
  gap: var(--ds-space-1);
  margin-bottom: var(--ds-space-7);
  padding: var(--ds-space-1);
  border: var(--ds-border-width) solid var(--ds-color-border-default);
  border-radius: var(--ds-radius-pill);
  background-color: var(--ds-color-bg-surface-2);
  backdrop-filter: blur(var(--ds-blur-glass));
  -webkit-backdrop-filter: blur(var(--ds-blur-glass));
  scrollbar-width: none;
}

.tabs__list::-webkit-scrollbar {
  display: none;
}

.tabs__tab {
  flex: 0 0 auto;
  padding: var(--ds-space-2) var(--ds-space-5);
  border-radius: var(--ds-radius-pill);
  color: var(--ds-color-text-description);
  font-family: var(--ds-font-sans);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--ds-duration-base) var(--ds-ease-standard),
    background-color var(--ds-duration-base) var(--ds-ease-standard);
}

.tabs__tab:hover {
  color: var(--ds-color-text-primary);
}

.tabs__tab[aria-selected='true'] {
  background-color: var(--ds-color-bg-surface-raised);
  color: var(--ds-color-text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* --------------------------------------------------------------------------
   3. Pass cards
   -------------------------------------------------------------------------- */

.pass-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--ds-space-4);
}

@media (min-width: 700px) {
  .pass-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .pass-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.pass-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--ds-space-6);
  border: var(--ds-border-width) solid var(--ds-color-border-default);
  border-radius: var(--ds-radius-card);
  background-color: var(--ds-color-bg-surface-3);
  transition: border-color var(--ds-duration-slow) var(--ds-ease-standard),
    background-color var(--ds-duration-slow) var(--ds-ease-standard);
}

.pass-card:hover {
  border-color: var(--ds-color-border-hover);
  background-color: var(--ds-color-bg-surface-1);
}

/* Cards cascade in rather than appearing as a block. A hidden tab panel is
   display:none, which resets the animation — so switching tabs replays the
   cascade for the panel you land on, and the segmented control gets some
   weight behind it. Same .is-visible gate as the timeline. */
.pass-card:nth-child(1) {
  --card-i: 0;
}

.pass-card:nth-child(2) {
  --card-i: 1;
}

.pass-card:nth-child(3) {
  --card-i: 2;
}

.js .tickets__tabs.is-visible .tabs__panel:not([hidden]) .pass-card {
  --enter-y: 18px;
  animation: ds-hero-enter 560ms var(--ds-ease-out) backwards;
  animation-delay: calc(var(--card-i, 0) * 90ms);
}

.pass-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ds-space-3);
  margin-bottom: var(--ds-space-4);
}

.pass-card__heading {
  font-family: var(--ds-font-mono);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ds-color-text-primary);
}

.pass-card__slash {
  color: var(--ds-color-brand);
  font-weight: 400;
}

.pass-card__badge {
  flex: 0 0 auto;
  padding: 4px var(--ds-space-2);
  border-radius: var(--ds-radius-pill);
  background-color: var(--ds-color-bg-surface-5);
  font-family: var(--ds-font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ds-color-text-secondary);
  white-space: nowrap;
}

/* Accent variants tint the heading rule and badge only, so the cards stay
   quiet as a set */
.pass-card--cyan .pass-card__badge {
  background-color: color-mix(in srgb, var(--cyan-40) 22%, transparent);
  color: var(--cyan-30);
}

.pass-card--purple .pass-card__badge {
  background-color: color-mix(in srgb, var(--purple-50) 22%, transparent);
  color: var(--purple-40);
}

.pass-card--magenta .pass-card__badge {
  background-color: color-mix(in srgb, var(--magenta-50) 22%, transparent);
  color: var(--magenta-40);
}

.pass-card--teal .pass-card__badge {
  background-color: color-mix(in srgb, var(--teal-40) 22%, transparent);
  color: var(--teal-40);
}

.pass-card__desc {
  font-size: 15px;
  line-height: 165%;
  color: var(--ds-color-text-description);
}

.pass-card__pricing {
  margin-top: var(--ds-space-5);
}

.pass-card__price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--ds-space-2);
}

.pass-card__price {
  font-family: var(--ds-font-display);
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ds-color-text-primary);
}

.pass-card__price--free {
  color: var(--ds-color-brand);
}

.pass-card__price-was {
  font-size: 15px;
  color: var(--ds-color-text-placeholder);
  text-decoration: line-through;
}

.pass-card__price-unit {
  font-size: 13px;
  color: var(--ds-color-text-description);
}

.pass-card__price-note {
  margin-top: var(--ds-space-2);
  font-family: var(--ds-font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ds-color-text-placeholder);
}

.pass-card__body {
  flex: 1;
}

.pass-card__cta {
  margin-top: var(--ds-space-6);
}

.pass-card__cta .btn {
  width: 100%;
}

/* Accordion inside a pass card sits tighter than the FAQ variant */
.pass-card .accordion {
  margin-top: var(--ds-space-5);
  border-top: 0;
}

.pass-card .accordion__trigger {
  padding: var(--ds-space-3) 0;
  font-size: 14px;
  border-bottom-color: var(--ds-color-border-default);
}

.pass-card .accordion__panel {
  padding: var(--ds-space-2) 0 var(--ds-space-4);
  border-bottom: 0;
}

.pass-card .accordion__panel li,
.pass-card .accordion__panel p {
  font-size: 14px;
  line-height: 165%;
  color: var(--ds-color-text-description);
}

.pass-card .accordion__panel li {
  position: relative;
  padding-left: var(--ds-space-4);
}

.pass-card .accordion__panel li + li {
  margin-top: var(--ds-space-2);
}

.pass-card .accordion__panel li::before {
  content: '';
  position: absolute;
  top: 0.6em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--ds-color-brand);
}

/* Breadcrumb, used on join.html */
.tickets__breadcrumb {
  margin-bottom: var(--ds-space-5);
  font-family: var(--ds-font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ds-color-text-description);
}

.tickets__breadcrumb a {
  color: var(--ds-color-text-description);
}

.tickets__breadcrumb a:hover {
  color: var(--ds-color-brand);
}
