/* =========================================
   RUNNING FREE
   ========================================= */

:root {
    --navy: #000f25;
    --green: #6ced96;
    --white: #ffffff;
    --blue: #168cff;

    /* Per-section colours (overridden by .light and .coaching) */
    --heading: var(--blue);
    --card-title: var(--blue);

    /* One side edge for every section, header, footer and the carousel.
       Equals the gutter, or centres content once the viewport passes --max-width. */
    --gutter: clamp(28px, 7.2vw, 110px);
    --max-width: 1400px;
    --edge: max(var(--gutter), (100vw - var(--max-width)) / 2);

    --radius: 8px;

    /* Gap between the two statistics */
    --split-gap: clamp(40px, 8vw, 130px);

    --text-lg: clamp(15px, 1.25vw, 20px);
    --title: clamp(18px, 1.55vw, 25px);

    /* Line height for running text (headings stay at the body's 1.2) */
    --leading-text: 1.35;
}

/* -----------------------------------------
   Base
   ----------------------------------------- */

* {
    box-sizing: border-box;
}

html {
    scroll-padding-top: 80px;
}

body {
    margin: 0;
    background: var(--navy) url("../images/background-1.svg") center top / cover no-repeat;
    color: var(--white);
    font-family: "filson-pro", sans-serif;
    font-weight: 400;
    line-height: 1.2;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
video {
    display: block;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

a,
button {
    -webkit-tap-highlight-color: transparent;
}

h2 {
    margin: 0;
    color: var(--heading);
    font-size: clamp(40px, 2.4vw + 24px, 68px);
    font-weight: 500;
    letter-spacing: -0.045em;
}

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 4px;
}

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

@media (prefers-reduced-motion: no-preference) {
    html,
    .carousel {
        scroll-behavior: smooth;
    }
}

/* -----------------------------------------
   Header
   ----------------------------------------- */

.site-header {
    position: fixed;
    z-index: 20;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px 40px;
    padding: 22px var(--edge) 55px;
    background: linear-gradient(
        to bottom,
        rgba(0, 6, 18, 0.46) 0%,
        rgba(0, 6, 18, 0.325) 35%,
        rgba(0, 6, 18, 0) 100%
    );
}

.brand {
    color: var(--green);
    text-decoration: none;
    font-size: clamp(30px, 2.3vw, 38px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.025em;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px clamp(15px, 2.2vw, 38px);
}

.site-nav a {
    text-decoration: none;
    font-size: var(--text-lg);
    line-height: 1;
    transition: color 180ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--green);
}

/* -----------------------------------------
   Sections
   ----------------------------------------- */

.section {
    padding: clamp(70px, 8vw, 125px) var(--edge);
}

.light {
    --heading: var(--navy);
    --card-title: var(--navy);
    background: var(--white);
    color: var(--navy);
}

.coaching {
    --card-title: var(--green);
}

.section-heading {
    margin-bottom: clamp(35px, 4vw, 60px);
}

.section-heading p {
    max-width: 850px;
    margin: 22px 0 0;
    font-size: var(--text-lg);
    line-height: var(--leading-text);
    letter-spacing: -0.02em;
}

/* -----------------------------------------
   Hero
   ----------------------------------------- */

.hero {
    --hero-size: clamp(56px, 5.5vw + 24px, 120px);
    padding-top: 0;
}

/* Video and text share one grid cell: the video sets the height (full screen),
   the text sits on top of it at the bottom left. */
.hero-media {
    display: grid;
    margin-inline: calc(-1 * var(--edge));
}

.hero-video,
.hero-content {
    grid-area: 1 / 1;
}

.hero-video {
    width: 100%;
    height: 100vh;
    height: 100svh;
    object-fit: cover;
}

/* Covers the whole video; the navy tint fades up from the bottom so the text stands out */
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0 var(--edge) clamp(40px, 6vw, 90px);
    background: linear-gradient(
        to top,
        rgba(0, 15, 37, 0.85) 0%,
        rgba(0, 15, 37, 0.55) 30%,
        rgba(0, 15, 37, 0) 65%
    );
}

.hero-eyebrow {
    margin: 0 0 clamp(8px, 1vw, 14px);
    font-size: var(--text-lg);
    letter-spacing: -0.02em;
}

.hero-title {
    margin: 0;
    color: var(--green);
    font-size: var(--hero-size);
    line-height: 0.9;
    font-weight: 500;
    letter-spacing: -0.055em;
}

.hero-tagline {
    max-width: 700px;
    margin: clamp(14px, 1.6vw, 24px) 0 clamp(22px, 2.4vw, 36px);
    font-size: clamp(22px, 2.2vw + 4px, 36px);
    letter-spacing: -0.03em;
}

/* Letters have a little space built in at their left side, which grows with the font size.
   This pulls each line back so the first letters line up with the button's left edge. */
.hero-content > :not(.button) {
    margin-left: -0.075em;
}

/* Intro text centred, with the two statistics side by side underneath */
.hero-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(50px, 6vw, 90px);
    margin-top: clamp(45px, 5vw, 75px);
    text-align: center;
}

.centred {
    text-align: center;
}

.intro {
    max-width: 800px;
    margin-inline: auto;
    font-size: var(--text-lg);
    line-height: var(--leading-text);
    letter-spacing: -0.02em;
}

.intro p {
    margin: 0 0 1em;
}

.intro p:last-child {
    margin-bottom: 0;
}

/* Section headings inside a centred intro use the standard h2 style */
.intro h2 {
    margin-bottom: 22px;
    line-height: 1.2;
    text-wrap: balance;
}

/* The first line is the title: same size and weight as the card titles, but white */
.journey-intro {
    margin-bottom: clamp(40px, 5vw, 70px);
}

/* Five stages: outlined boxes whose colour fades from blue to green,
   joined by short lines. --i (0-4) is set on each step in the HTML. */
.steps {
    --link: clamp(30px, 3.5vw, 48px);
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.step {
    --from: color-mix(in srgb, var(--green) calc(var(--i) * 25%), var(--blue));
    --to: color-mix(in srgb, var(--green) calc((var(--i) + 1) * 25%), var(--blue));
    position: relative;
    margin-bottom: var(--link);
    padding: clamp(24px, 3vw, 40px);
    border: 2px solid var(--from);
    border-radius: var(--radius);
}

.step p:first-child {
    color: var(--from);
}

.step:last-child {
    margin-bottom: 0;
}

.step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 100%;
    left: calc(50% - 1px);
    width: 2px;
    height: var(--link);
    background: linear-gradient(var(--from), var(--to));
}

.intro p:first-child {
    margin-bottom: 0.6em;
    font-size: var(--title);
    font-weight: 500;
    letter-spacing: -0.04em;
}

.intro strong {
    font-weight: inherit;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--split-gap);
    width: 100%;
    max-width: 1000px;
}

/* Each figure sizes itself from its own column width (cqw), so "£20.9b"
   always fits on one line. */
.stat {
    container-type: inline-size;
    margin: 0;
}

.stat-figure,
.stat-label {
    display: block;
}

.stat-figure {
    color: var(--blue);
    font-size: clamp(40px, 22cqw, 120px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.045em;
}

.stat-label {
    max-width: 16em;
    margin: clamp(8px, 1vw, 14px) auto 0;
    font-size: var(--text-lg);
    line-height: var(--leading-text);
    letter-spacing: -0.02em;
}

/* -----------------------------------------
   Button
   ----------------------------------------- */

.button {
    display: inline-block;
    padding: 0.85em 1.8em;
    border-radius: 999px;
    background: var(--green);
    color: var(--navy);
    font-size: var(--text-lg);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.015em;
    text-decoration: none;
    transition: background-color 180ms ease;
}

.button:hover,
.button:focus-visible {
    background: var(--white);
}

/* -----------------------------------------
   Cards (carousel, BecomingX, coaching)
   ----------------------------------------- */

.card img {
    width: 100%;
    aspect-ratio: 1.45 / 1;
    object-fit: cover;
    border-radius: var(--radius);
}

.card h3 {
    margin: 15px 0 8px;
    color: var(--card-title);
    font-size: var(--title);
    font-weight: 500;
    letter-spacing: -0.04em;
}

.card p {
    margin: 0;
    font-size: var(--text-lg);
    line-height: var(--leading-text);
    letter-spacing: -0.02em;
}

.card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 12px;
    font-size: var(--text-lg);
    line-height: var(--leading-text);
    font-weight: 500;
    text-underline-offset: 3px;
}

.card-grid {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(18px, 2vw, 32px);
}

/* -----------------------------------------
   Carousel
   ----------------------------------------- */

.carousel {
    display: flex;
    gap: clamp(16px, 1.8vw, 30px);
    margin: 0 calc(-1 * var(--edge));
    padding: 0 var(--edge);
    list-style: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

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

.carousel .card {
    flex: 0 0 min(78vw, 310px);
}

.carousel-controls {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 20px;
}

.carousel-button {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    cursor: pointer;
}

.carousel-button[data-carousel-prev] {
    background: url("../images/carousel-left.svg") center / contain no-repeat;
}

.carousel-button[data-carousel-next] {
    background: url("../images/carousel-right.svg") center / contain no-repeat;
}

/* -----------------------------------------
   Quote
   ----------------------------------------- */

.quote {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 310px);
    gap: clamp(40px, 8vw, 130px);
    align-items: end;
    padding-bottom: clamp(100px, 11vw, 170px);
}

.quote blockquote {
    max-width: 950px;
    margin: 0;
    color: var(--green);
    font-size: clamp(32px, 2.4vw + 24px, 62px);
    font-weight: 500;
    letter-spacing: -0.045em;
}

.quote figure {
    margin: 0;
}

.quote img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
}

.quote figcaption {
    margin-top: 15px;
}

.quote figcaption strong,
.quote figcaption span {
    display: block;
}

.quote figcaption strong {
    color: var(--blue);
    font-size: var(--title);
    font-weight: 500;
    letter-spacing: -0.035em;
}

.quote figcaption span {
    max-width: 310px;
    margin-top: 5px;
    font-size: var(--text-lg);
    line-height: var(--leading-text);
    letter-spacing: -0.015em;
}

/* -----------------------------------------
   Follow us
   ----------------------------------------- */

.simple p {
    max-width: 800px;
    margin: 25px 0;
    font-size: var(--text-lg);
    line-height: var(--leading-text);
}

.simple a {
    color: var(--green);
    text-underline-offset: 4px;
}

/* -----------------------------------------
   Footer
   ----------------------------------------- */

.site-footer {
    padding: 45px var(--edge) 60px;
    font-size: var(--text-lg);
}

.site-footer img {
    display: block;
    height: auto;
    /* Gap between the email address and the BecomingX logo */
    margin-top: 20px;
}

/* -----------------------------------------
   Responsive
   ----------------------------------------- */

@media (max-width: 1000px) {
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .quote {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .quote figure {
        width: min(65vw, 280px);
    }

    .carousel-controls {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* -----------------------------------------
   Password screen (js/gate.js)
   ----------------------------------------- */

html.locked body > *:not(#gate) {
    display: none;
}

#gate {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--navy);
    color: var(--white);
}

.gate-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: min(100%, 320px);
}

.gate-title {
    margin: 0 0 8px;
    color: var(--green);
    font-size: var(--title);
    font-weight: 500;
}

.gate-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gate-form input {
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius);
    background: transparent;
    color: var(--white);
    font: inherit;
}

.gate-error {
    margin: 0;
    color: #ff8a8a;
}

.gate-form .button {
    align-self: flex-start;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}
