/*
 * brand-lockup.css
 *
 * "BorderTanker <word>" and the lit orange text, as the app draws them
 * (App/src/components/ui/BrandLockup.tsx and LitText.tsx). Same sizes, colours
 * and timings, so the website's Pro page looks like the app's:
 *
 *  - lit text: the orange face, a 1px light line along its top edge
 *    (primaryLit #f7af8c) and an orange glow underneath (primaryGlow)
 *  - the word's letters rise one after another (45ms apart, 520ms, a small
 *    overshoot) after 300ms
 *  - then a glint, leaning 20°, crosses the word in 900ms, every 4s
 *  - with reduced motion the word just stands there
 *
 * Markup: components/brand-lockup.php renderBrandLockup() / renderLitWord().
 */

:root {
    --bt-lit-face: var(--color-primary, #F38651);
    --bt-lit-line: #f7af8c;
    --bt-lit-glow: rgba(243, 134, 81, 0.35);
    /* The app uses the platform's own font, weight 800. */
    --bt-lockup-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.bt-lit {
    color: var(--bt-lit-face);
    text-shadow: 0 -1px 0 var(--bt-lit-line), 0 2px 6px var(--bt-lit-glow);
}

.bt-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- The lockup: logo + word --------------------------------------------- */
.bt-lockup {
    /* lg in the app: logo 46, word 38 */
    --bt-logo-h: 46px;
    --bt-word-size: 38px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: calc(var(--bt-logo-h) * 0.24);
    margin: 0;
}

.bt-lockup--xl { --bt-logo-h: 58px; --bt-word-size: 48px; }
.bt-lockup--sm { --bt-logo-h: 34px; --bt-word-size: 29px; }
.bt-lockup--xs { --bt-logo-h: 26px; --bt-word-size: 22px; }

.bt-lockup-logo {
    display: block;
    height: var(--bt-logo-h);
    width: auto;
}

/* --- The word: rising letters + glint ------------------------------------ */
.bt-word {
    --bt-size: var(--bt-word-size, 1em);
    position: relative;
    display: inline-flex;
    font-family: var(--bt-lockup-font);
    font-weight: 800;
    font-size: var(--bt-size);
    line-height: 1.2;
    letter-spacing: calc(var(--bt-size) * -0.01);
    white-space: nowrap;
}

.bt-letter {
    display: inline-block;
    animation: bt-rise 520ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-delay: calc(300ms + var(--i, 0) * 45ms);
}

@keyframes bt-rise {
    from { opacity: 0; transform: translateY(0.45em) scale(0.9); }
    62% { opacity: 1; }
    to { opacity: 1; transform: none; }
}

/*
 * The glint: a white copy of the word, seen through a slanted band that slides
 * left to right — a wide faint band with a narrower brighter core, as the
 * app's two bands. It starts once the letters are up
 * (300 + (letters - 1) × 45 + 520 ms, set per word as --bt-shine-delay).
 */
.bt-shine {
    position: absolute;
    inset: 0;
    display: inline-flex;
    color: #fff;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(110deg, transparent 38%, rgba(0, 0, 0, 0.35) 44%, rgba(0, 0, 0, 0.85) 50%, rgba(0, 0, 0, 0.35) 56%, transparent 62%);
    mask-image: linear-gradient(110deg, transparent 38%, rgba(0, 0, 0, 0.35) 44%, rgba(0, 0, 0, 0.85) 50%, rgba(0, 0, 0, 0.35) 56%, transparent 62%);
    -webkit-mask-size: 300% 100%;
    mask-size: 300% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
    animation: bt-shine 4000ms ease-in-out infinite;
    animation-delay: var(--bt-shine-delay, 910ms);
}

/* Laid out exactly as .bt-letter (inline-block, kept spaces), minus the rise. */
.bt-shine-letter { display: inline-block; white-space: pre; }
.bt-letter { white-space: pre; }

/* 900ms of travel out of every 4000ms; position 100% = band left of the word, 0% = right of it. */
@keyframes bt-shine {
    0% { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
    22.5% { -webkit-mask-position: 0% 0; mask-position: 0% 0; }
    100% { -webkit-mask-position: 0% 0; mask-position: 0% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .bt-letter { animation: none; }
    .bt-shine { display: none; }
}

/* --- The Pro badge ------------------------------------------------------- */
/*
 * renderProBadge(): the lit, glinting "Pro" beside a Pro-gated option. It
 * replaces the old outlined "PRO" box; the !important lines beat that box's
 * leftover .pro-badge rules in station.php, map.php and city-pages.css.
 * Inside a dropdown the letters rise again each time the menu opens.
 */
.bt-pro-badge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 0.15em;
    vertical-align: middle;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1;
}

.bt-pro-badge .bt-word {
    --bt-size: 15px;
}

/* In a dropdown option it sits at the right edge, as the old box did. */
.custom-dropdown-menu .bt-pro-badge,
.city-dropdown-option .bt-pro-badge {
    margin-left: auto;
}

/* --- The lit button ------------------------------------------------------ */
/*
 * The app's primary button (App/src/components/ui/Button.tsx): the brand
 * orange, black label, and `primaryShadow` — a 1px light line along the top
 * edge and an orange glow underneath, the lit treatment LitSymbol and LitText
 * wear. The lit word's glint crosses it when the pointer comes onto it.
 */
.bt-lit-button {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 24px;
    border: 1px solid var(--color-primary, #F38651);
    border-radius: 16px;
    /* The website's primary-action tokens (colors.css), as the Login button and every .btn-primary wear. */
    background-color: var(--primary-action-background, #F38651);
    color: #000;
    font-weight: 600;
    font-size: 1.06rem;
    text-decoration: none;
    box-shadow: var(--primary-action-shadow, 0 6px 14px rgba(243, 134, 81, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.34)) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.05s ease;
}

.bt-lit-button:hover,
.bt-lit-button:focus-visible {
    text-decoration: none;
}

.bt-lit-button:hover {
    color: #000;
    transform: translateY(-2px);
    box-shadow: var(--primary-action-hover-shadow, 0 10px 22px rgba(243, 134, 81, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.42)) !important;
}

.bt-lit-button:active { transform: scale(0.98); }
.bt-lit-button:focus-visible { outline: none; box-shadow: var(--primary-action-focus-shadow, 0 0 0 3px rgba(243, 134, 81, 0.32), 0 6px 14px rgba(243, 134, 81, 0.28)) !important; }

/* The glint, only while the pointer is on the button (or it has keyboard focus). */
.bt-lit-button::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, 0.18) 44%, rgba(255, 255, 255, 0.42) 50%, rgba(255, 255, 255, 0.18) 56%, transparent 62%) no-repeat;
    background-size: 300% 100%;
    background-position: 100% 0;
}

.bt-lit-button:hover::after,
.bt-lit-button:focus-visible::after {
    animation: bt-button-shine 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes bt-button-shine {
    from { background-position: 100% 0; }
    to { background-position: 0% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .bt-lit-button { transition: none; }
    .bt-lit-button:hover, .bt-lit-button:active { transform: none; }
    .bt-lit-button::after { animation: none; display: none; }
}

/* --- The inline lockup --------------------------------------------------- */
/*
 * renderInlineBrandLockup(): "BorderTanker" on one line, then the lit word,
 * as the upgrade banner draws it. The logo's lettering sits at 0.7 × the
 * word's size, so both read as one line of type.
 */
.bt-lockup--inline {
    --bt-word-size: 24px;
    flex-wrap: nowrap;
    gap: calc(var(--bt-word-size) * 0.3);
}

.bt-inline-brand {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--bt-word-size) * 0.1);
    flex: 0 0 auto;
}

.bt-inline-brand svg {
    display: block;
    width: auto;
    height: calc(var(--bt-word-size) * 0.7);
}
