/*
 * Fold 1: HERO, "Aurora Night" (visual-v2.md section 7; copy and data: direction.md section 4, fold-hero.json).
 * Scoped to main.itil-v1 #hero / .v1-hero__*.
 *
 * Desktop (from 1000px): dark aurora. Left = eyebrow pill, big H1 with the gradient accent, certificate line
 * with a shield badge, intro, team-quote link, the two version routes. Right = the picker in a glowing glass
 * card on a "stage" (halo, slow orbit rings, two floating icon badges). Base = the fact counters in a slim
 * glass band, then the full-width course-name ticker pinned to the foot of the fold.
 * Below 1000px one column: head, picker, team link, routes, counters, ticker.
 *
 * Motion (all behind html.v1-motion, transform / opacity only): the shared load sequence (data-reveal,
 * data-split, data-stagger), orbit rings turning, badges bobbing, halo breathing, a pointer tilt on the
 * card (fold-hero.js), the result cross-fade and a small pop on a new price. Default state: all visible.
 * Nothing below 16px. One --act button (the card's).
 */

/* ---------- Layout ---------- */
main.itil-v1 #hero > .v1-container { width: 100%; }
main.itil-v1 #hero .v1-hero__inner { gap: 18px; }
main.itil-v1 .v1-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; }
main.itil-v1 .v1-hero__copy { min-width: 0; }

/* ---------- Left column ---------- */
main.itil-v1 .v1-hero__eyebrow { --v1-mb: 12px; }
main.itil-v1 .v1-hero__h1 {
    font-size: clamp(40px, 0.6rem + 3.55vw, 60px);
    text-wrap: balance;
    color: var(--on-dark);
    text-shadow: 0 2px 40px rgba(10, 9, 38, .5);
}
main.itil-v1 .v1-hero__h1 .v1-grad { text-shadow: none; }
main.itil-v1 .v1-hero__approved {
    display: flex; align-items: center; gap: 12px;
    margin-top: 14px;
    max-width: 36rem;
    color: var(--on-dark); font-size: 18px; font-weight: 600; line-height: 1.35;
}
main.itil-v1 .v1-hero__shield { flex: none; width: 34px; height: 34px; border-radius: 11px; color: var(--cyan); }
main.itil-v1 .v1-hero__shield .v1-i { width: 19px; height: 19px; }
main.itil-v1 .v1-hero__intro { margin-top: 10px; max-width: 36rem; font-size: 17px; line-height: 1.58; color: var(--on-dark-2); }
main.itil-v1 .v1-hero__team { font-size: 17px; font-weight: 600; line-height: 1.5; }
main.itil-v1 .v1-hero__route { max-width: 37rem; gap: 8px; line-height: 1.45; color: var(--on-dark-2); }
main.itil-v1 .v1-hero__route > li { align-items: center; gap: 12px; }
main.itil-v1 .v1-hero__route .v1-pill { min-height: 30px; padding: 1px 12px 1px 10px; }
main.itil-v1 .v1-hero__to { display: inline-block; margin: 0 2px; color: var(--link-on-dark); }

/* ---------- Right column: the stage ---------- */
main.itil-v1 .v1-hero__stage { position: relative; min-width: 0; }
main.itil-v1 .v1-hero__halo {
    position: absolute; z-index: 0; inset: 8% -6% -4% -6%;
    border-radius: 40%;
    background: radial-gradient(closest-side, rgba(124, 92, 255, .55), rgba(240, 72, 155, .22) 55%, transparent 100%);
    filter: blur(46px);
    opacity: .7;
    pointer-events: none;
}
main.itil-v1 .v1-hero__orbit {
    position: absolute; z-index: 0; left: 50%; top: 50%;
    width: 132%; max-width: none; aspect-ratio: 1;
    transform: translate(-50%, -50%);
    pointer-events: none;
    -webkit-mask-image: radial-gradient(circle closest-side, #000 78%, transparent 100%);
            mask-image: radial-gradient(circle closest-side, #000 78%, transparent 100%);
}
main.itil-v1 .v1-hero__ring { transform-box: view-box; transform-origin: 50% 50%; }
main.itil-v1 .v1-hero__float { position: absolute; z-index: 2; pointer-events: none; }
main.itil-v1 .v1-hero__float--a { top: -20px; right: -18px; transform: rotate(8deg); box-shadow: 0 16px 34px -12px rgba(109, 59, 230, .9), inset 0 1px 0 rgba(255, 255, 255, .35); }
main.itil-v1 #hero .v1-hero__float--b { bottom: 30px; left: -36px; transform: rotate(-8deg); color: var(--cyan); background: rgba(29, 26, 82, .78); }

main.itil-v1 .v1-hero__panel {
    z-index: 1;
    display: flex; flex-direction: column;
    padding: 22px 24px;
    background: linear-gradient(165deg, rgba(255, 255, 255, .14) 0%, rgba(255, 255, 255, .05) 46%, rgba(124, 92, 255, .10) 100%);
}
main.itil-v1 .v1-hero__label { color: var(--on-dark-2); line-height: 1.5; }
main.itil-v1 .v1-hero__formats { margin-top: 14px; min-width: 0; border: 0; padding: 0; }
main.itil-v1 .v1-hero__formats > legend { margin-bottom: var(--s-2); padding: 0; float: none; width: auto; }
@media (min-width: 480px) {
    main.itil-v1 .v1-hero__seg { grid-auto-flow: row; grid-template-columns: 1.16fr 1.1fr 1.08fr .82fr; gap: 2px; }
    main.itil-v1 .v1-hero__seg .v1-choice > span { padding-inline: 4px; white-space: nowrap; }
}

/* Result: one inset "ticket" with the next date on the left and the price on the right. */
main.itil-v1 .v1-hero__result {
    display: flex; align-items: center; gap: 0;
    margin-top: 14px; min-height: 74px;
    padding: 9px 16px;
    border: 1px solid var(--line-dark); border-radius: 18px;
    background: linear-gradient(180deg, rgba(10, 9, 38, .5), rgba(10, 9, 38, .3));
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35);
    color: var(--on-dark);
}
main.itil-v1 .v1-hero__result > [hidden] { display: none; }
main.itil-v1 .v1-hero__cell { display: grid; align-content: center; min-width: 0; }
main.itil-v1 .v1-hero__next { flex: 1 1 auto; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; }
main.itil-v1 .v1-hero__price { flex: 0 0 auto; }
main.itil-v1 .v1-hero__next:not([hidden]) + .v1-hero__price { margin-left: 16px; padding-left: 18px; border-left: 1px solid var(--line-dark); }
main.itil-v1 .v1-hero__k { grid-column: 1; grid-row: 1; font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--on-dark-2); }
main.itil-v1 .v1-hero__v { grid-column: 1 / -1; grid-row: 2; font-size: 20px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; color: var(--on-dark); }
main.itil-v1 .v1-hero__next > .v1-hero__v:first-child { grid-row: 1; font-size: 19px; }
main.itil-v1 .v1-hero__venue {
    grid-column: 2; grid-row: 1; justify-self: end;
    display: inline-flex; align-items: center; gap: 7px; min-width: 0;
    font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--on-dark);
}
main.itil-v1 .v1-hero__venue::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--grad); }
main.itil-v1 .v1-hero__price .v1-price { grid-row: 2; font-size: 30px; line-height: 1.08; font-variant-numeric: lining-nums proportional-nums; }
main.itil-v1 .v1-hero__vat { grid-row: 3; font-size: 16px; font-weight: 600; color: var(--on-dark-2); letter-spacing: 0; }
main.itil-v1 .v1-hero__msg { flex: 1 1 auto; font-size: 17px; font-weight: 500; line-height: 1.5; color: var(--on-dark); }

main.itil-v1 .v1-hero__btn { margin-top: 14px; }
/* main.css forces p { text-align: left !important }, so the line is centred with flex. */
main.itil-v1 .v1-hero__micro { display: flex; justify-content: center; margin-top: 8px; font-size: 16px; line-height: 1.4; color: var(--on-dark-2); }
main.itil-v1 .v1-hero__noscript { margin-top: var(--s-2); font-size: 16px; text-align: center; }

/* ---------- Base: counters band ---------- */
main.itil-v1 .v1-hero__band { padding: 7px 22px; border-radius: 20px; }
main.itil-v1 .v1-hero__stats { margin: 0; padding: 0; list-style: none; flex-wrap: nowrap; justify-content: space-between; gap: 0; }
main.itil-v1 .v1-hero__stats > .v1-stat { flex: 0 1 auto; padding-right: 16px; }
main.itil-v1 .v1-hero__stats > .v1-stat:not(.v1-hero__fact-city) .v1-stat__label { white-space: nowrap; }
main.itil-v1 .v1-hero__stats > .v1-stat + .v1-stat { padding-left: 16px; }
main.itil-v1 .v1-hero__stats > .v1-stat:last-child { padding-right: 0; }
main.itil-v1 .v1-hero__stats .v1-stat__num { font-size: 32px; }
main.itil-v1 .v1-hero__stats .v1-stat__label { color: var(--on-dark); font-weight: 500; }
main.itil-v1 .v1-hero__pin { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .1); color: var(--cyan); box-shadow: var(--glass-hi); }
main.itil-v1 .v1-hero__pin .v1-i { width: 18px; height: 18px; }

/* ---------- Base: full-width course-name ticker ---------- */
main.itil-v1 .v1-hero__ticker {
    position: relative; z-index: 1;
    padding: 7px 0;
    border-block: 1px solid rgba(255, 255, 255, .1);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .05) 20%, rgba(255, 255, 255, .05) 80%, rgba(255, 255, 255, 0));
}
main.itil-v1 .v1-hero__ticker .v1-marquee__item { color: var(--on-dark-2); font-weight: 600; }

/* ---------- Desktop: two columns, one screen ---------- */
@media (min-width: 1000px) {
    main.itil-v1 .v1-hero__grid { grid-template-columns: minmax(0, 1fr) clamp(430px, 38vw, 476px); column-gap: clamp(36px, 5vw, 72px); }
    main.itil-v1 .v1-hero__team { margin-top: 12px; }
    main.itil-v1 .v1-hero__route { margin-top: 14px; }
}
@media (min-width: 768px) {
    /* The ticker sits at the foot of the visible fold; the content block stays centred above it. */
    main.itil-v1 #hero > .v1-container { margin-block: auto; }
    main.itil-v1 #hero { justify-content: flex-start; }
    main.itil-v1 .v1-hero__ticker { margin-top: 12px; margin-bottom: -27px; }
    /* Very tall shared header: drop the city fact on desktop only (fold-hero.js sets the class). */
    main.itil-v1 .v1-hero--tall-hdr .v1-hero__fact-city { display: none; }
}
/* The band's fourth item needs room: drop the formats counter first on narrower desktops. */
@media (min-width: 768px) and (max-width: 1199.98px) {
    main.itil-v1 .v1-hero__fact-formats { display: none; }
}
/* Short screens (1280x720 and similar): tighten so the fold is still one screen. */
@media (min-width: 1000px) and (max-height: 739.98px) {
    main.itil-v1 .v1-hero__eyebrow { display: none; }
    main.itil-v1 #hero .v1-hero__inner { gap: 10px; }
    main.itil-v1 .v1-hero__panel { padding: 20px 22px; }
    main.itil-v1 .v1-hero__ticker { margin-top: 8px; }
}
/* Tall, wide screens: let the hero breathe and grow. */
@media (min-width: 1200px) and (min-height: 860px) {
    main.itil-v1 #hero .v1-hero__inner { gap: 32px; }
    main.itil-v1 .v1-hero__h1 { font-size: clamp(60px, 0.6rem + 3.2vw, 68px); }
    main.itil-v1 .v1-hero__grid { grid-template-columns: minmax(0, 1fr) 500px; column-gap: 44px; }
    main.itil-v1 .v1-hero__eyebrow { --v1-mb: 20px; }
    main.itil-v1 .v1-hero__approved { margin-top: 22px; }
    main.itil-v1 .v1-hero__intro { margin-top: 14px; font-size: 18px; }
    main.itil-v1 .v1-hero__team { margin-top: 20px; }
    main.itil-v1 .v1-hero__route { margin-top: 26px; gap: 10px; }
    main.itil-v1 .v1-hero__panel { padding: 32px; }
    main.itil-v1 .v1-hero__formats, main.itil-v1 .v1-hero__result, main.itil-v1 .v1-hero__btn { margin-top: 20px; }
    main.itil-v1 .v1-hero__band { padding: 14px 28px; }
    main.itil-v1 .v1-hero__ticker { padding: 12px 0; margin-top: 24px; }
}

/* Large desktops (1920x1080 and up): a bigger headline and more air, still one screen. */
@media (min-width: 1600px) and (min-height: 980px) {
    main.itil-v1 #hero .v1-hero__inner { gap: 48px; }
    main.itil-v1 .v1-hero__h1 { font-size: 72px; }
    main.itil-v1 .v1-hero__approved { margin-top: 26px; }
    main.itil-v1 .v1-hero__intro { margin-top: 16px; }
    main.itil-v1 .v1-hero__team { margin-top: 24px; }
    main.itil-v1 .v1-hero__route { margin-top: 30px; }
    main.itil-v1 .v1-hero__panel { padding: 36px; }
    main.itil-v1 .v1-hero__formats, main.itil-v1 .v1-hero__result, main.itil-v1 .v1-hero__btn { margin-top: 24px; }
    main.itil-v1 .v1-hero__band { padding: 18px 28px; }
}

/* ---------- Below 1000px: one column, the primary action straight after the intro ---------- */
@media (max-width: 999.98px) {
    main.itil-v1 .v1-hero__copy { display: contents; }
    main.itil-v1 .v1-hero__head { order: 1; }
    main.itil-v1 .v1-hero__stage { order: 2; margin-top: var(--s-6); max-width: 560px; }
    main.itil-v1 .v1-hero__team { order: 3; margin-top: var(--s-6); }
    main.itil-v1 .v1-hero__route { order: 4; margin-top: var(--s-5); }
    main.itil-v1 .v1-hero__orbit { width: 118%; opacity: .7; }
    main.itil-v1 .v1-hero__float--b { display: none; }
    main.itil-v1 .v1-hero__float--a { right: -8px; }
}
@media (max-width: 767.98px) {
    main.itil-v1 .v1-hero__h1 { font-size: clamp(36px, 10.4vw, 44px); --v1-lh: 1.06; }
    main.itil-v1 .v1-hero__approved { align-items: flex-start; margin-top: 14px; }
    main.itil-v1 .v1-hero__stage { max-width: none; }
    main.itil-v1 .v1-hero__panel { padding: var(--s-5); }
    main.itil-v1 .v1-hero__halo { inset: 6% 0 0 0; }
    main.itil-v1 .v1-hero__orbit { display: none; }
    main.itil-v1 .v1-hero__float--a { top: -18px; right: 6px; width: 46px; height: 46px; border-radius: 15px; }
    main.itil-v1 .v1-hero__route > li { grid-template-columns: minmax(0, 1fr); gap: 6px; justify-items: start; }
    main.itil-v1 .v1-hero__route { gap: 14px; }
    main.itil-v1 .v1-hero__band { padding: 16px 18px; }
    main.itil-v1 .v1-hero__stats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
    main.itil-v1 .v1-hero__stats > .v1-stat, main.itil-v1 .v1-hero__stats > .v1-stat + .v1-stat { padding: 0; }
    main.itil-v1 .v1-hero__stats .v1-stat__num { min-width: 44px; }
    main.itil-v1 .v1-hero__stats > .v1-stat:not(.v1-hero__fact-city) .v1-stat__label { white-space: normal; }
    main.itil-v1 .v1-hero__micro { text-wrap: balance; }
    main.itil-v1 .v1-hero__pin { margin-right: 10px; }
    main.itil-v1 .v1-hero__ticker { margin-top: var(--s-8); }
}
/* Narrow phones: the 2 x 2 format grid and the longest course label must not clip at 360px. */
@media (max-width: 479.98px) {
    main.itil-v1 .v1-hero__seg { border-radius: 26px; }
    main.itil-v1 .v1-hero__result { padding: 12px 14px; }
    main.itil-v1 .v1-hero__next:not([hidden]) + .v1-hero__price { margin-left: 12px; padding-left: 14px; }
    main.itil-v1 .v1-hero__v { font-size: 19px; }
    main.itil-v1 .v1-hero__next { grid-template-columns: minmax(0, 1fr); }
    main.itil-v1 .v1-hero__venue { grid-column: 1; grid-row: 3; justify-self: start; }
}
@media (max-width: 399.98px) {
    main.itil-v1 .v1-hero__panel { padding: var(--s-4); }
    main.itil-v1 .v1-hero__panel .v1-select { padding-left: 12px; padding-right: 34px; background-position: right 10px center; font-size: 16px; }
    main.itil-v1 .v1-hero__v { font-size: 18px; }
    main.itil-v1 .v1-hero__price .v1-price { font-size: 27px; }
}

/* ---------- Motion (only with html.v1-motion; the static state above is complete) ---------- */
html.v1-motion main.itil-v1 .v1-hero__ring--a { animation: v1-hero-spin 90s linear infinite; }
html.v1-motion main.itil-v1 .v1-hero__ring--b { animation: v1-hero-spin 64s linear infinite reverse; }
html.v1-motion main.itil-v1 .v1-hero__ring--c { animation: v1-hero-spin 46s linear infinite; }
html.v1-motion main.itil-v1 .v1-hero__halo { animation: v1-hero-breathe 7s ease-in-out infinite alternate; }
html.v1-motion main.itil-v1 .v1-hero__float--a { animation: v1-hero-bob-a 6s ease-in-out infinite alternate; }
html.v1-motion main.itil-v1 .v1-hero__float--b { animation: v1-hero-bob-b 7.5s ease-in-out -2s infinite alternate; }
/* Everything decorative stops while the fold is off screen (motion.js pauses the aurora). */
html.v1-motion main.itil-v1 .v1-aurora.is-paused ~ .v1-container :is(.v1-hero__ring, .v1-hero__halo, .v1-hero__float) { animation-play-state: paused; }
@keyframes v1-hero-spin { to { transform: rotate(360deg); } }
@keyframes v1-hero-breathe { from { opacity: .5; transform: scale(.96); } to { opacity: .85; transform: scale(1.05); } }
@keyframes v1-hero-bob-a { from { transform: translate3d(0, 0, 0) rotate(8deg); } to { transform: translate3d(0, -10px, 0) rotate(3deg); } }
@keyframes v1-hero-bob-b { from { transform: translate3d(0, 0, 0) rotate(-8deg); } to { transform: translate3d(0, 9px, 0) rotate(-3deg); } }

/* Pointer tilt on the glass card (fold-hero.js sets --rx / --ry; mouse only). */
html.v1-motion main.itil-v1 .v1-hero__stage { perspective: 1400px; }
html.v1-motion main.itil-v1 .v1-hero__panel {
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 500ms var(--ease-out);
}
html.v1-motion main.itil-v1 .v1-hero__panel.is-tilting { transition-duration: 120ms; }

/* The result cross-fade (shared .v1-xfade) plus a small spring pop on the new price. */
html.v1-motion main.itil-v1 .v1-hero__result.is-fresh .v1-price { animation: v1-hero-pop 420ms var(--ease-spring) both; }
html.v1-motion main.itil-v1 .v1-hero__result.is-fresh .v1-hero__v { animation: v1-hero-rise 380ms var(--ease-out) both; }
@keyframes v1-hero-pop { from { opacity: 0; transform: translateY(8px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes v1-hero-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* The arrow in the route rows drifts once the pointer is on a row. */
@media (hover: hover) {
    main.itil-v1 .v1-hero__to { transition: transform 320ms var(--ease-out); }
    main.itil-v1 .v1-hero__route > li:hover .v1-hero__to { transform: translateX(4px); }
    main.itil-v1 .v1-hero__route .v1-pill { transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease; }
    main.itil-v1 .v1-hero__route > li:hover .v1-pill { border-color: rgba(169, 184, 255, .6); background: rgba(255, 255, 255, .16); }
}
