/*
    Smooth Grooving
    Colours come from the London skyline artwork, the same ones the mobile app uses.
    Blues and white carry the page. Bus red is the one accent: the play button and the donate button.
*/

@font-face {
    font-family: "Figtree";
    src: url("../fonts/Figtree-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Figtree";
    src: url("../fonts/Figtree-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "Figtree";
    src: url("../fonts/Figtree-ExtraBold.ttf") format("truetype");
    font-weight: 800;
    font-display: swap;
}

:root {
    /* Colours */
    --sky: #71cce7;
    --sky-pale: #e5f4f9;
    --cloud: #f4fafc;
    --cloud-shade: #bfe3f0;
    --river: #316594;
    --ink: #14324f;
    --ink-soft: #1f4f7a;
    --bus: #cf4322;
    --bus-dark: #b23a1d;
    --road: #14324f;
    --white: #ffffff;

    /* Shapes */
    --round: 24px;
    --round-small: 12px;

    /* Spacing */
    --gutter: clamp(16px, 4vw, 40px);
    --section: clamp(56px, 9vw, 112px);
    --width: 1120px;
}


/* Base */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--sky);
    color: var(--ink);
    font-family: "Figtree", system-ui, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.6;
}

img,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

h2 {
    font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
}

h3 {
    font-size: 1.25rem;
}

p {
    margin: 0;
}

a {
    color: inherit;
    text-underline-offset: 3px;
}

a:hover {
    text-decoration-thickness: 2px;
}

:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
    border-radius: 4px;
}

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

.skip {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    padding: 12px 16px;
    background: var(--ink);
    color: var(--white);
    border-radius: var(--round-small);
    transform: translateY(-150%);
}

.skip:focus {
    transform: none;
}


/* Raised panels look like the flat clouds in the artwork: solid white with a pale blue underside, no blur. */

.cloud,
.player,
.podcast,
.topbar {
    background: var(--cloud);
    border-radius: var(--round);
    box-shadow: 0 6px 0 var(--cloud-shade);
}


/* Header: the London skyline, the logo and the live player */

.hero {
    display: flex;
    flex-direction: column;
    min-height: min(100svh, 900px);
    padding: 16px var(--gutter) clamp(24px, 5vw, 56px);
    background: var(--sky) url("../img/london.jpg") center 78% / cover no-repeat;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    max-width: var(--width);
    margin: 0 auto;
    padding: 6px 6px 6px 12px;
    border-radius: 999px;
}

.brand {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 8px;
    font-size: 1.125rem;
    font-weight: 800;
    white-space: nowrap;
    text-decoration: none;
}

.menu {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
}

.menu a:hover,
.menu a[aria-current="page"] {
    background: var(--sky-pale);
}

.hero-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    width: 100%;
    max-width: var(--width);
    margin: 0 auto;
    padding-top: clamp(32px, 8vh, 96px);
}

.hero-title {
    display: grid;
    justify-items: center;
    gap: 0.25em;
    width: min(100%, 640px);
    container-type: inline-size;
}

/* Drawn like the logo above it: white letters with a thick black outline, so the two read as one title
   and stay readable over any part of the skyline. The size follows the logo's width (cqi), not the screen. */
.subtitle,
.place {
    color: var(--white);
    font-size: 8.6cqi;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.04em;
    text-align: center;
    -webkit-text-stroke: 0.2em #000;
    paint-order: stroke fill;
    filter: drop-shadow(0 0.08em 0 rgba(0, 0, 0, 0.25));
}

/* A smaller third line, tucked up under the subtitle. */
.place {
    margin-top: -0.2em;
    font-size: 6cqi;
    letter-spacing: 0.05em;
    -webkit-text-stroke-width: 0.17em;
}


/* Player */

.player {
    display: flex;
    align-items: center;
    gap: 16px;
    width: min(100%, 560px);
    padding: 12px 20px 12px 12px;
}

.play {
    display: grid;
    flex: none;
    place-items: center;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 4px solid var(--white);
    border-radius: 50%;
    background: var(--bus);
    color: var(--white);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.play:hover {
    background: var(--bus-dark);
    transform: scale(1.05);
}

.play:active {
    transform: scale(0.97);
}

.play svg {
    width: 32px;
    fill: currentColor;
}

.icon-stop,
.player[data-state="loading"] .icon-play,
.player[data-state="playing"] .icon-play {
    display: none;
}

.player[data-state="loading"] .icon-stop,
.player[data-state="playing"] .icon-stop {
    display: block;
}

.player[data-state="loading"] .play {
    animation: tuning 1.2s ease-in-out infinite;
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-title {
    font-weight: 800;
    font-size: 1.125rem;
    line-height: 1.3;
}

.player-status {
    color: var(--ink-soft);
    font-size: 0.9375rem;
    line-height: 1.4;
}

.player[data-state="error"] .player-status {
    color: var(--bus-dark);
    font-weight: 700;
}

.volume {
    display: flex;
    flex: none;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
}

.volume[hidden] {
    display: none;
}

.volume svg {
    width: 24px;
    fill: currentColor;
}

.volume input {
    width: 96px;
    min-height: 44px;
    accent-color: var(--river);
    cursor: pointer;
}

/* Equaliser bars: only shown while the stream is actually playing, so they mark a real state. */

.bars {
    display: none;
    align-items: flex-end;
    gap: 3px;
    height: 24px;
}

.player[data-state="playing"] .bars {
    display: flex;
}

.bars i {
    width: 4px;
    height: 100%;
    border-radius: 2px;
    background: var(--river);
    transform-origin: bottom;
    animation: bounce 0.9s ease-in-out infinite alternate;
}

.bars i:nth-child(2) {
    animation-delay: -0.3s;
}

.bars i:nth-child(3) {
    animation-delay: -0.6s;
}

.bars i:nth-child(4) {
    animation-delay: -0.15s;
}

@keyframes bounce {
    from { transform: scaleY(0.25); }
    to { transform: scaleY(1); }
}

@keyframes tuning {
    50% { opacity: 0.7; }
}


/* Sections */

main > section {
    width: 100%;
    max-width: calc(var(--width) + var(--gutter) * 2);
    margin: 0 auto;
    padding: var(--section) var(--gutter);
}


/* Intro: what the station is, with the smart speaker phrases beside it */

.intro {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    align-items: center;
    gap: clamp(32px, 6vw, 80px);
}

.intro-text {
    display: grid;
    gap: 16px;
}

.lead {
    font-size: clamp(1.25rem, 1rem + 1vw, 1.5rem);
    font-weight: 700;
    line-height: 1.4;
}

.speakers {
    display: grid;
    gap: 24px;
}

/* Speech bubbles in bus red, with the darker red of the bus's lower body as their flat underside.
   White text on bus red is 4.69:1, which passes for normal text. */
.bubble {
    position: relative;
    justify-self: start;
    max-width: 100%;
    padding: 16px 20px;
    border-radius: var(--round);
    background: var(--bus);
    box-shadow: 0 6px 0 var(--bus-dark);
    color: var(--white);
    font-size: 1.125rem;
    font-weight: 700;
}

/* The little tail that makes a panel read as speech. */
.bubble::after {
    content: "";
    position: absolute;
    bottom: -30px;
    left: 28px;
    border: 16px solid transparent;
    border-top-color: var(--bus-dark);
}

.bubble-right {
    justify-self: end;
}

.bubble-right::after {
    left: auto;
    right: 28px;
}

.speakers-note {
    margin-top: 8px;
    color: var(--ink-soft);
}


/* TV: the Twitch show announcement, a river blue panel between the intro and the app.
   It borrows the speech bubbles' flat underside. White on river blue is 6.6:1. */

main > .tv {
    padding-block: 0;
}

.tv-card {
    display: flex;
    align-items: center;
    gap: 24px 40px;
    padding: clamp(24px, 4vw, 48px);
    border-radius: var(--round);
    background: var(--river);
    box-shadow: 0 8px 0 var(--ink);
    color: var(--white);
}

.tv-icon {
    flex: none;
    width: 88px;
    height: 88px;
    padding: 18px;
    border-radius: 50%;
    background: var(--white);
    color: var(--river);
    fill: currentColor;
}

.tv-text {
    display: grid;
    flex: 1;
    gap: 12px;
}

.tv-text > p:last-child {
    max-width: 56ch;
}

/* A small label above the heading. */
.tv-tag {
    justify-self: start;
    padding: 4px 14px;
    border-radius: 999px;
    background: var(--ink);
    font-size: 0.875rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tv .button {
    flex: none;
}


/* App: screenshot, store badges and the podcast note */

.app {
    display: grid;
    grid-template-columns: minmax(200px, 320px) 1fr;
    align-items: center;
    gap: clamp(32px, 7vw, 96px);
    padding-top: 0;
}

.app-shot img {
    border: 8px solid var(--ink);
    border-radius: 40px;
    transform: rotate(-3deg);
}

.app-text {
    display: grid;
    gap: 20px;
}

.app-text > p {
    max-width: 56ch;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.badges a {
    display: block;
    border-radius: 8px;
}

/* Apple's badge is drawn edge to edge; Google's image has padding built in, so it is set taller to match. */
.badge-apple {
    width: auto;
    height: 52px;
}

.badge-google {
    width: auto;
    height: 76px;
    margin: -12px;
}

.podcast {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding: 24px;
}

/* Stands in for the podcast app badges until the new season is out. */
.coming-soon {
    justify-self: start;
    margin-top: 8px;
    padding: 16px 28px;
    border-radius: var(--round-small);
    background: var(--sky-pale);
    color: var(--ink);
    font-size: 1.5rem;
    font-weight: 800;
}


/* Support: the dark road from the artwork, with the bus red button */

.support {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px 48px;
}

main > .support {
    max-width: none;
    padding-inline: max(var(--gutter), calc((100% - var(--width)) / 2));
    background: var(--road);
    color: var(--white);
}

.support-text {
    display: grid;
    gap: 12px;
    max-width: 60ch;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 0 32px;
    border: 3px solid var(--white);
    border-radius: 999px;
    background: var(--bus);
    color: var(--white);
    font-size: 1.125rem;
    font-weight: 800;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.button:hover {
    background: var(--bus-dark);
}

.support :focus-visible,
.footer :focus-visible {
    outline-color: var(--white);
}


/* Footer: the road continues, with its white lane markings along the top */

.footer {
    display: grid;
    justify-items: center;
    gap: 16px;
    padding: 40px var(--gutter) 48px;
    background:
        repeating-linear-gradient(90deg, var(--white) 0 48px, transparent 48px 96px) top / 100% 6px no-repeat,
        var(--road);
    color: var(--white);
    text-align: center;
}

/* Subfooter: the designer credit, a shade darker than the footer above it */

.subfooter {
    display: flex;
    justify-content: center;
    padding: 8px var(--gutter);
    background: #0c2238;
}

.credit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    color: var(--sky-pale);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
}

.credit:hover {
    color: var(--white);
}

.credit:focus-visible {
    outline-color: var(--white);
}

/* The sketch R from rod.ac, used as a mask so it takes the link colour. */
.credit-logo {
    width: 1.75em;
    height: 1.75em;
    background: currentColor;
    -webkit-mask: url("../img/rod-logo.png") center / contain no-repeat;
    mask: url("../img/rod-logo.png") center / contain no-repeat;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-weight: 700;
}

.footer p {
    font-size: 0.9375rem;
}


/* Donate page */

.hero-short {
    min-height: auto;
    background-position: center 70%;
}

.hero-short .hero-body {
    padding-block: clamp(24px, 6vw, 64px) clamp(8px, 3vw, 32px);
}

.hero-short .hero-title {
    width: min(100%, 440px);
}

.donate {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: clamp(32px, 6vw, 80px);
}

.donate-text {
    display: grid;
    gap: 16px;
}

.donate-text p {
    max-width: 56ch;
}

.paypal {
    display: grid;
    gap: 16px;
    padding: clamp(24px, 4vw, 40px);
}

.paypal form {
    text-align: center;
    padding: 24px;
}

.paypal-slot {
    display: grid;
    place-items: center;
    min-height: 160px;
    padding: 24px;
    border: 3px dashed var(--river);
    border-radius: var(--round-small);
    color: var(--ink-soft);
    font-weight: 700;
    text-align: center;
}

.ways {
    display: grid;
    gap: 24px;
    padding-top: 0;
}

.ways ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ways li {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 24px;
}


/* Tablet and small laptop: keep two columns but give the text more room */

@media (max-width: 960px) {
    .intro,
    .donate {
        grid-template-columns: 1fr;
    }

    .speakers {
        max-width: 480px;
    }

    .tv-card {
        flex-wrap: wrap;
    }

    .tv-text {
        flex-basis: calc(100% - 128px);
    }
}


/* Phone */

@media (max-width: 640px) {
    body {
        font-size: 1rem;
    }

    .hero {
        min-height: min(100svh, 760px);
        padding-top: 12px;
        background-position: center 70%;
    }

    .hero-short {
        min-height: auto;
    }

    /* The name and three links don't fit in one row on a phone, so the name sits above the links. */
    .topbar {
        flex-direction: column;
        gap: 0;
        padding: 6px;
        border-radius: var(--round);
    }

    .menu {
        justify-content: center;
        width: 100%;
    }

    .menu a {
        padding: 0 12px;
    }

    .player {
        flex-wrap: wrap;
        padding: 12px;
    }

    .play {
        width: 64px;
        height: 64px;
    }

    .volume {
        width: 100%;
        padding: 0 4px;
    }

    .volume input {
        flex: 1;
        width: auto;
    }

    .tv-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .tv-icon {
        width: 64px;
        height: 64px;
        padding: 13px;
    }

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

    .app-shot {
        width: min(70%, 260px);
        margin: 0 auto;
    }

    .support {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* Respect the system setting for reduced motion */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
