/* The pass picker of a made-up seaside festival, Lowtide: a graphite card on a near black page, a steel rail with three
   woven lanyards, the passes moved by the physics in script.js (an element for the physics, its child for CSS), and the
   recessed order tray with the pocket where the chosen pass lands. */
:root {
  --page: #0b0b0d;          /* the page */
  --card: #141417;          /* the body of the card */
  --edge: rgba(255, 255, 255, 0.075); /* the 1px edge that catches the light */
  --ink: #efede8;           /* the words */
  --muted: #8b8a92;         /* the small words */
  --accent: #ff7440;        /* the tangerine of the weekend pass, the price and the button */
  --paper: #ebe6db;         /* the bone paper of the day pass */
  --foil: #c9ccd4;          /* the silver foil of the VIP pass */
  --tray: #0e0e10;          /* the recessed order tray */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: radial-gradient(120% 80% at 50% 0%, #17171b 0%, var(--page) 60%);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 12px;
  overflow: hidden;
}

.card {
  position: relative;
  width: min(94vw, 520px);
  height: min(92vh, 560px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  padding: clamp(12px, 3.4vh, 22px) clamp(12px, 3.6vw, 22px) clamp(10px, 2.6vh, 18px);
  background: linear-gradient(180deg, #18181c 0%, var(--card) 46%, #121214 100%);
  box-shadow:
    inset 0 0 0 1px var(--edge),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 1px 2px rgba(0, 0, 0, 0.6),
    0 18px 40px -18px rgba(0, 0, 0, 0.85),
    0 50px 90px -40px rgba(0, 0, 0, 0.9);
  opacity: 0;
  overflow: hidden;
}

.card__grain {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.32;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  z-index: 3;
}

.head__who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.head__mark {
  flex: none;
  width: clamp(26px, 5vh, 32px);
  height: clamp(26px, 5vh, 32px);
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.head__brand {
  margin: 0;
  font-size: clamp(10px, 1.9vh, 12px);
  color: var(--muted);
  font-stretch: 105%;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.head__sep {
  opacity: 0.5;
}

.head__title {
  margin: 2px 0 0;
  font-size: clamp(16px, 3.6vh, 22px);
  font-weight: 640;
  font-stretch: 112%;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.head__chip {
  margin: 2px 0 0;
  flex: none;
  padding: 4px 9px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 560;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
  white-space: nowrap;
}

/* the scene: the physics works in its pixels */
.scene {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: clamp(6px, 1.6vh, 12px);
}

.rail {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 0;
  height: 6px;
}

.rail__bar {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: linear-gradient(180deg, #74747c 0%, #3c3c42 48%, #232327 52%, #4a4a51 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 8px rgba(0, 0, 0, 0.55);
}

.ropes {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
}

/* the passes: .pass is moved by the physics, .pass__face takes the hover and press */
.pass {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}

.pass.is-free {
  z-index: 4;
}

.pass__face {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--pw) * 0.1);
  padding: calc(var(--pw) * 0.2) calc(var(--pw) * 0.1) calc(var(--pw) * 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
  color: #1b1a18;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12),
    0 1px 1px rgba(0, 0, 0, 0.45),
    0 8px 16px -6px rgba(0, 0, 0, 0.7),
    0 22px 30px -18px rgba(0, 0, 0, 0.8);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}

.pass.is-hot .pass__face {
  transform: scale(1.04);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12),
    0 1px 1px rgba(0, 0, 0, 0.45),
    0 12px 22px -6px rgba(0, 0, 0, 0.75),
    0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent),
    0 0 24px -4px color-mix(in srgb, var(--accent) 45%, transparent);
}

.pass.is-down .pass__face {
  transform: scale(0.96);
  transition-duration: 0.12s;
}

/* the light on the surface slides with the swing (--sheen comes from the angle) */
.pass__face::after {
  content: '';
  position: absolute;
  inset: -40%;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.42) 48%, rgba(255, 255, 255, 0.08) 54%, transparent 62%);
  transform: translateX(calc(var(--sheen, 0) * 1%));
  mix-blend-mode: soft-light;
}

.pass__hole {
  position: absolute;
  left: 50%;
  top: calc(var(--pw) * 0.075);
  width: calc(var(--pw) * 0.3);
  height: calc(var(--pw) * 0.075);
  margin-left: calc(var(--pw) * -0.15);
  border-radius: 99px;
  background: #0d0d0f;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255, 255, 255, 0.4);
}

.pass__brand {
  margin: 0;
  font-size: calc(var(--pw) * 0.1);
  font-weight: 640;
  font-stretch: 125%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.62;
  white-space: nowrap;
}

.pass__tier {
  margin: calc(var(--pw) * 0.08) 0 0;
  font-size: calc(var(--pw) * 0.2);
  line-height: 1;
  font-weight: 720;
  font-stretch: 78%;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.pass__days {
  margin: calc(var(--pw) * 0.04) 0 0;
  font-size: calc(var(--pw) * 0.1);
  opacity: 0.66;
  white-space: nowrap;
}

.pass__foot {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
}

.pass__price {
  font-size: calc(var(--pw) * 0.15);
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}

.pass__code {
  width: calc(var(--pw) * 0.3);
  height: calc(var(--pw) * 0.13);
  opacity: 0.7;
  background: repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 2.4px, currentColor 2.4px 3px, transparent 3px 4.6px);
}

.pass--weekend .pass__face {
  background: linear-gradient(160deg, #ff8a5a 0%, var(--accent) 45%, #e9592a 100%);
  color: #1a0d07;
}

.pass--vip .pass__face {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 40%),
    linear-gradient(160deg, #26262b 0%, #101013 100%);
  color: var(--foil);
}

.pass--vip .pass__tier {
  background: linear-gradient(100deg, #8e929c 0%, #f3f4f7 calc(40% + var(--sheen, 0) * 0.5%), #8e929c 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pass--vip .pass__face::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: calc(var(--pw) * 0.08);
  box-shadow: inset 0 0 0 1px rgba(201, 204, 212, 0.22);
  pointer-events: none;
}

/* the recessed order tray */
.tray {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(8px, 2.4vw, 16px);
  padding: 8px clamp(10px, 3vw, 16px);
  border-radius: 16px;
  background: linear-gradient(180deg, #0c0c0e, var(--tray));
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.8),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 1px 0 rgba(255, 255, 255, 0.05);
  z-index: 0;
}

.sum {
  min-width: 0;
}

.sum--right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.sum p {
  margin: 0;
}

.sum__label {
  font-size: clamp(9.5px, 1.8vh, 11px);
  color: var(--muted);
  letter-spacing: 0.02em;
}

.sum__name {
  margin-top: 3px !important;
  font-size: clamp(13px, 2.8vh, 17px);
  font-weight: 620;
  font-stretch: 108%;
  white-space: nowrap;
  overflow: hidden;
}

.sum__name span,
.sum__price span {
  display: inline-block;
}

.sum__note {
  margin-top: 2px !important;
  font-size: clamp(9.5px, 1.8vh, 11px);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sum__price {
  margin-top: 1px !important;
  font-size: clamp(17px, 3.8vh, 24px);
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.pocket {
  position: relative;
  border-radius: 12px;
  background: linear-gradient(180deg, #08080a, #0b0b0d);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  display: grid;
  place-items: center;
}

.pocket::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 9px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.pocket__hint {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.go {
  position: relative;
  margin-top: 6px;
  padding: 0 clamp(12px, 3vw, 16px);
  height: clamp(28px, 5.6vh, 34px);
  border: 0;
  border-radius: 99px;
  font: inherit;
  font-size: clamp(11px, 2.2vh, 13px);
  font-weight: 620;
  color: #8a8a92;
  background: #1d1d21;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.3s ease, box-shadow 0.3s ease;
}

.go:disabled {
  cursor: default;
}

.go__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #ff8a58, var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: scaleX(0);
  transform-origin: left center;
  z-index: -1;
}

.go.is-on {
  color: #1a0d07;
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}

.go__label {
  display: inline-block;
  font-stretch: 100%;
  transition: font-stretch 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (hover: hover) {
  .go.is-on:hover .go__label {
    font-stretch: 116%;
  }
}

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #ffffff;
  stroke: #15161c;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (max-width: 380px) {
  .head__chip {
    display: none;
  }
}
