/*--------------------------------------------------------------
# Book Travel — Card to Boarding Pass
# A metal card that turns over into a boarding pass: the points
# on the front, the seat they buy on the back. The metal catches
# the light as the pointer moves across it.
--------------------------------------------------------------*/

/* ── Section ──
   Top padding only: the hero above has none to give, and .bt-pricing below
   brings its own top padding, so this needs none at the bottom. Steps
   100 / 80 / 72 / 56px, like the rest of the page.
   overflow-x: clip, because the card's near edge grows as it turns in 3D
   and could otherwise nudge a phone screen sideways for a moment. */
.bt-boarding-pass {
	/* The theme loads no monospace font; the same system stack the other
	   concept-built sections use. */
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);

	background: var(--tpp-white);
	padding: 100px 0 0;
	overflow-x: clip;
}

.bt-boarding-pass__container {
	width: 100%;
	max-width: var(--tpp-container-max);
	margin: 0 auto;
	padding: 0 var(--tpp-container-padding);
	text-align: center;
}

.bt-boarding-pass__heading {
	font-family: var(--tpp-font-heading);
	font-size: clamp(2rem, 4.5vw + 0.5rem, 3.5rem);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.03em;
	color: var(--tpp-black);
	margin: 0 0 48px;
}


/* ──────────────────────────────────────────────
   The card
   ────────────────────────────────────────────── */

/* Also what everything on both sides is sized against (cqi): the card's
   width. The boarding pass is wider than the card, and this way it keeps the
   card's type size and simply gains room, rather than scaling up with it. */
.bt-boarding-pass__stage {
	width: min(100%, 460px);
	margin: 0 auto;
	perspective: 1400px;
	container-type: inline-size;
}

/* --rx / --ry come from js/book-travel-boarding-pass.js as the mouse moves */
.bt-boarding-pass__tilt {
	transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
	transform-style: preserve-3d;
	transition: transform 0.25s ease-out;
}

.bt-boarding-pass__card {
	position: relative;
	aspect-ratio: 1.586;
	transform-style: preserve-3d;
	transition: transform 1.2s var(--ease);
}

/* Clickable only once the script can turn it */
.bt-boarding-pass.is-armed .bt-boarding-pass__card {
	cursor: pointer;
}

.bt-boarding-pass.is-flipped .bt-boarding-pass__card {
	transform: rotateY(180deg);
}

/* Sizes on both faces are in cqi of the stage above, with px fallbacks
   first for browsers without container units. */
.bt-boarding-pass__face {
	position: absolute;
	inset: 0;
	overflow: hidden;
	border-radius: 22px;
	text-align: left;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}


/* ── The front: a metal card ── */
.bt-boarding-pass__face--front {
	color: #E8E8E8;
	background:
		repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 3px),
		radial-gradient(130% 100% at 0% 0%, #3B3B3B 0%, #171717 55%, #0E0E0E 100%);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.12),
		0 44px 70px -36px rgba(0, 0, 0, 0.6);
}

/* The light, which follows the pointer (--mx / --my) */
.bt-boarding-pass__sheen {
	position: absolute;
	inset: 0;
	background: radial-gradient(60% 80% at var(--mx, 30%) var(--my, 20%), rgba(255, 255, 255, 0.16), transparent 60%);
	pointer-events: none;
}

.bt-boarding-pass__kicker {
	position: absolute;
	left: 8%;
	top: 11%;
	font-family: var(--mono);
	font-size: 11px;
	font-size: 2.6cqi;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.55);
}

.bt-boarding-pass__chip {
	position: absolute;
	left: 8%;
	top: 34%;
	width: 13%;
	aspect-ratio: 1.35;
	border-radius: 6px;
	background: linear-gradient(135deg, #ECECEC, #A7A7A7);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.bt-boarding-pass__chip::before {
	content: '';
	position: absolute;
	inset: 26% 0;
	border-top: 1px solid rgba(0, 0, 0, 0.2);
	border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.bt-boarding-pass__chip::after {
	content: '';
	position: absolute;
	inset: 0 34%;
	border-left: 1px solid rgba(0, 0, 0, 0.2);
	border-right: 1px solid rgba(0, 0, 0, 0.2);
}

.bt-boarding-pass__nfc {
	position: absolute;
	left: 24%;
	top: 36.5%;
	width: 6%;
	height: auto;
	opacity: 0.6;
}

.bt-boarding-pass__digits {
	position: absolute;
	left: 8%;
	bottom: 30%;
	font-family: var(--mono);
	font-size: 18px;
	font-size: 4.4cqi;
	letter-spacing: 0.16em;
	white-space: nowrap;
	color: rgba(255, 255, 255, 0.75);
}

.bt-boarding-pass__holder {
	position: absolute;
	left: 8%;
	bottom: 10%;
	font-family: var(--mono);
	font-size: 12px;
	font-size: 2.8cqi;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.bt-boarding-pass__holder small {
	display: block;
	margin-bottom: 2px;
	font-size: 9px;
	font-size: 2cqi;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.45);
}

.bt-boarding-pass__mark {
	position: absolute;
	right: 7%;
	bottom: 9%;
	width: 10%;
	height: auto;
	color: var(--tpp-accent);
	transform: rotate(45deg);
}


/* ── The back: a boarding pass ──
   Wider than the card, reaching 20% past it on each side, so it has a
   boarding pass's long shape rather than a card's. It turns about the same
   centre, so it stays centred under the heading. */
.bt-boarding-pass__face--back {
	inset: 0 -20%;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 27%;
	background: var(--tpp-white);
	color: var(--tpp-black);
	box-shadow:
		0 0 0 1px var(--tpp-border-light),
		0 44px 70px -36px rgba(0, 0, 0, 0.35);
	transform: rotateY(180deg);
}

/* While the card shows its front, the turned-away boarding pass reaches past
   it on both sides: that part mustn't catch clicks or show a pointer. */
.bt-boarding-pass:not(.is-flipped) .bt-boarding-pass__face--back {
	pointer-events: none;
}

.bt-boarding-pass__main {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-width: 0;
	padding: 7% 7% 6%;
}

.bt-boarding-pass__top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	font-family: var(--mono);
	font-size: 10px;
	font-size: 2.3cqi;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--tpp-text-light);
}

.bt-boarding-pass__cabin {
	padding: 3px 9px;
	border-radius: var(--tpp-radius-pill);
	background: var(--tpp-accent);
	color: var(--tpp-black);
}

/* From on the left, To on the right, the plane between, using the width */
.bt-boarding-pass__route {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 12px;
	gap: 3cqi;
}

.bt-boarding-pass__route small,
.bt-boarding-pass__info small,
.bt-boarding-pass__stub small {
	display: block;
	font-family: var(--mono);
	font-size: 9px;
	font-size: 2cqi;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--tpp-text-light);
}

.bt-boarding-pass__route b {
	display: block;
	font-family: var(--tpp-font-heading);
	font-size: 26px;
	font-size: 6.2cqi;
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -0.03em;
}

.bt-boarding-pass__plane {
	flex: none;
	width: 24px;
	width: 5.5cqi;
	height: auto;
	margin-bottom: 5px;
	margin-bottom: 1.2cqi;
	transform: rotate(90deg);
}

.bt-boarding-pass__info {
	display: flex;
	justify-content: space-between;
	gap: 28px;
	gap: 7cqi;
}

/* The destination and the fare share a right-hand edge */
.bt-boarding-pass__route > div:last-child,
.bt-boarding-pass__info > div:last-child {
	text-align: right;
}

.bt-boarding-pass__info b {
	display: block;
	font-size: 14px;
	font-size: 3.2cqi;
	font-weight: 700;
}

.bt-boarding-pass__barcode {
	display: block;
	height: 28px;
	height: 7cqi;
	background: repeating-linear-gradient(90deg, var(--tpp-black) 0 2px, transparent 2px 4px, var(--tpp-black) 4px 5px, transparent 5px 8px, var(--tpp-black) 8px 11px, transparent 11px 13px);
	opacity: 0.85;
}

/* The stub, torn off along the dashed line */
.bt-boarding-pass__stub {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 12px;
	gap: 3cqi;
	padding: 6% 9%;
	border-left: 2px dashed var(--tpp-border);
	background: var(--tpp-off-white);
}

/* Notches at either end of the perforation, the colour of the page */
.bt-boarding-pass__stub::before,
.bt-boarding-pass__stub::after {
	content: '';
	position: absolute;
	left: -10px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--tpp-white);
}

.bt-boarding-pass__stub::before {
	top: -9px;
}

.bt-boarding-pass__stub::after {
	bottom: -9px;
}

.bt-boarding-pass__stub b {
	display: block;
	font-family: var(--tpp-font-heading);
	font-size: 38px;
	font-size: 9cqi;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.04em;
}

.bt-boarding-pass__stub .bt-boarding-pass__bed {
	font-size: 16px;
	font-size: 3.4cqi;
	letter-spacing: -0.01em;
}

.bt-boarding-pass__stamp {
	align-self: flex-start;
	padding: 4px 7px;
	padding: 1cqi 1.6cqi;
	/* Maroon ink, like a real rubber stamp, so it pops off the stub */
	border: 1.5px solid #9B2C2C;
	border-radius: 6px;
	color: #9B2C2C;
	font-family: var(--mono);
	font-size: 8px;
	font-size: 1.9cqi;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	transform: rotate(-6deg);
}


/* ──────────────────────────────────────────────
   Caption and buttons
   ────────────────────────────────────────────── */

/* A fixed minimum height, so the two captions don't move the buttons */
.bt-boarding-pass__caption {
	min-height: 1.6em;
	margin: 32px auto 0;
	font-family: var(--tpp-font-body);
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.6;
	color: var(--tpp-black);
}

.bt-boarding-pass__caption span {
	font-weight: 500;
	color: var(--tpp-text-light);
}

.bt-boarding-pass__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: 20px;
}

/* Two classes on the button rules: style.css styles every <button>, its
   :hover and its :focus, at up to one class plus an element. */
.bt-boarding-pass .bt-boarding-pass__turn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 13px 22px;
	border: 1px solid var(--tpp-border);
	border-radius: var(--tpp-radius-pill);
	background: var(--tpp-white);
	color: var(--tpp-black);
	font-family: var(--tpp-font-body);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: border-color 0.2s ease;
}

/* [hidden] alone loses to the display: inline-flex above */
.bt-boarding-pass .bt-boarding-pass__turn[hidden] {
	display: none;
}

.bt-boarding-pass .bt-boarding-pass__turn:hover,
.bt-boarding-pass .bt-boarding-pass__turn:focus {
	border-color: var(--tpp-black);
}

.bt-boarding-pass .bt-boarding-pass__turn:focus-visible {
	outline: 2px solid var(--tpp-black);
	outline-offset: 3px;
}

.bt-boarding-pass__turn svg {
	flex: none;
	width: 16px;
	height: 16px;
	transition: transform 0.6s var(--ease);
}

.bt-boarding-pass.is-flipped .bt-boarding-pass__turn svg {
	transform: rotate(180deg);
}

/* The page's black pill (.bt-pricing__cta). Colour restated for every link
   state: style.css sets :visited, :hover, :focus and :active to inherit, and
   the hover animation's letters take theirs from here. */
.bt-boarding-pass__cta,
.bt-boarding-pass__cta:visited,
.bt-boarding-pass__cta:hover,
.bt-boarding-pass__cta:focus,
.bt-boarding-pass__cta:active {
	color: var(--tpp-white);
}

.bt-boarding-pass__cta {
	padding: 14px 30px;
	font-size: 0.9375rem;
	border-radius: var(--tpp-radius-pill);
	background: var(--tpp-black);
	border: 1.5px solid var(--tpp-black);
}

.bt-boarding-pass__cta:hover,
.bt-boarding-pass__cta:focus-visible {
	background: var(--tpp-dark);
	border-color: var(--tpp-dark);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* While js/book-travel-boarding-pass.js turns the card back to its front at
   load, nothing animates: it should only turn over once, in view. */
.bt-boarding-pass.is-rewinding .bt-boarding-pass__card,
.bt-boarding-pass.is-rewinding .bt-boarding-pass__turn svg {
	transition: none;
}


/* ──────────────────────────────────────────────
   Scroll-reveal
   .is-visible comes from js/book-travel-boarding-pass.js
   ────────────────────────────────────────────── */

.bt-boarding-pass__heading,
.bt-boarding-pass__stage,
.bt-boarding-pass__caption,
.bt-boarding-pass__actions {
	opacity: 0;
	transform: translateY(24px);
	transition:
		opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.bt-boarding-pass.is-visible .bt-boarding-pass__heading,
.bt-boarding-pass.is-visible .bt-boarding-pass__stage,
.bt-boarding-pass.is-visible .bt-boarding-pass__caption,
.bt-boarding-pass.is-visible .bt-boarding-pass__actions {
	opacity: 1;
	transform: none;
}

.bt-boarding-pass.is-visible .bt-boarding-pass__stage {
	transition-delay: 0.12s;
}

.bt-boarding-pass.is-visible .bt-boarding-pass__caption,
.bt-boarding-pass.is-visible .bt-boarding-pass__actions {
	transition-delay: 0.24s;
}


/* ──────────────────────────────────────────────
   Responsive
   ────────────────────────────────────────────── */

/* Tablet (≤991px) */
@media screen and (max-width: 991px) {
	.bt-boarding-pass {
		padding: 80px 0 0;
	}
}

/* Mobile (≤767px) */
@media screen and (max-width: 767px) {
	.bt-boarding-pass {
		padding: 72px 0 0;
	}

	.bt-boarding-pass__heading {
		font-size: clamp(1.75rem, 7vw, 2.5rem);
		margin-bottom: 32px;
	}

	.bt-boarding-pass__face {
		border-radius: 18px;
	}

	/* Below tablet size there's seldom room for the boarding pass to reach
	   past the card (on a phone the card already spans the screen). It takes
	   the same longer shape by being a little shorter than the card instead. */
	.bt-boarding-pass__face--back {
		inset: 8% 0;
	}

	/* The front's caption wraps to two lines here, the back's doesn't */
	.bt-boarding-pass__caption {
		min-height: 3.2em;
		margin-top: 26px;
		font-size: 1rem;
	}
}

/* Small mobile (≤480px) — the two buttons stacked, full width */
@media screen and (max-width: 480px) {
	.bt-boarding-pass {
		padding: 56px 0 0;
	}

	.bt-boarding-pass .bt-boarding-pass__turn,
	.bt-boarding-pass__cta {
		width: 100%;
	}
}


/* ──────────────────────────────────────────────
   Reduced motion
   The script turns the card without the tilt; this takes out the rest.
   ────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.bt-boarding-pass__heading,
	.bt-boarding-pass__stage,
	.bt-boarding-pass__caption,
	.bt-boarding-pass__actions,
	.bt-boarding-pass__tilt,
	.bt-boarding-pass__card,
	.bt-boarding-pass__turn svg,
	.bt-boarding-pass .bt-boarding-pass__turn {
		transition: none;
	}
}
