/* ==========================================================================
   Base: reset, typography, container, buttons and small text helpers.
   ========================================================================== */

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

html {
    scroll-padding-top: var(--header-height);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--color-white);
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: var(--text-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* TT Commons Pro joins pairs of letters such as "fi" and "fl" into one shape (a ligature).
   The brand sets them apart, so ligatures are off everywhere, including in forms. */
body,
button,
input,
select,
textarea {
    font-variant-ligatures: no-common-ligatures;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    line-height: 1.1;
    font-weight: 700;
    /* Lines of a heading are kept to similar lengths, so one word is never left alone */
    text-wrap: balance;
}

h1 {
    font-size: var(--text-display);
    letter-spacing: -.4px;
    max-width: 14ch;
}

h2 {
    font-size: var(--text-heading);
    max-width: 22ch;
}

h3 {
    font-size: var(--text-title);
    line-height: 1.2;
    font-weight: 600;
}

p {
    margin: 0;
}

a {
    color: var(--color-funding-blue);
    text-decoration: none;
}

img,
svg,
video {
    max-width: 100%;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--color-funding-blue);
    outline-offset: 3px;
}

/* Container
   ========================================================================== */

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Text helpers
   ========================================================================== */

.eyebrow {
    margin-bottom: 14px;
    color: var(--color-funding-blue);
    font-size: var(--text-small);
    font-weight: 600;
}

.lead {
    max-width: 58ch;
    margin-top: 20px;
    color: var(--color-text-muted);
    font-size: var(--text-lead);
}

.lead strong {
    color: var(--color-deep-blue);
    font-weight: 700;
}

/* A blue pill label with an icon */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    background: var(--color-button-blue);
    color: var(--color-white);
    font-size: 15px;
    font-weight: 600;
}

.pill .icon {
    width: 18px;
    height: 18px;
    color: var(--color-white);
    --icon-accent: currentColor;
}

.highlight {
    color: var(--color-funding-blue);
}

.text-muted {
    color: var(--color-text-muted);
}

.text-small {
    color: var(--color-text-muted);
    font-size: 14px;
}

.text-centre {
    text-align: center;
}

/* Icons
   ========================================================================== */

.icon {
    width: 24px;
    height: 24px;
    color: var(--color-deep-blue);
}

/* Buttons
   ========================================================================== */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 14px 28px;
    border: 2px solid transparent;
    border-radius: var(--radius-pill);
    font: inherit;
    font-size: 17px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .35s ease, border-color .35s ease, color .35s ease, transform .15s;
}

.button:active {
    transform: translateY(1px);
}

.button-primary {
    border-color: var(--color-button-blue);
    background: var(--color-button-blue);
    color: var(--color-white);
}

.button-outline {
    border-color: var(--color-deep-blue);
    background: transparent;
    color: var(--color-deep-blue);
}

.button-white {
    border-color: var(--color-white);
    background: var(--color-white);
    color: var(--color-deep-blue);
}

.button-ghost {
    border-color: rgba(255, 255, 255, .55);
    background: transparent;
    color: var(--color-white);
}

/* Hover: every button fills with the button blue. The blue button is already
   that colour, so it turns Deep Blue, or white where the background is dark. */
.button-outline:hover,
.button-white:hover,
.button-ghost:hover {
    border-color: var(--color-button-blue);
    background: var(--color-button-blue);
    color: var(--color-white);
}

.button-primary:hover {
    border-color: var(--color-deep-blue);
    background: var(--color-deep-blue);
}

:is(.theme-dark, .bg-deep-blue, .call-to-action) .button-primary:hover {
    border-color: var(--color-white);
    background: var(--color-white);
    color: var(--color-deep-blue);
}

.button-small {
    min-height: 42px;
    padding: 11px 20px;
    font-size: 16px;
}

/* A row of buttons */
.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

/* A Buttons element in a section sits a little further below what comes before it.
   Straight under the section's heading, or in a column, it is already spaced. */
.section > .container > .buttons {
    margin-top: 40px;
}

.section > .container > .section-head + .buttons,
.column > .buttons {
    margin-top: 0;
}

.section-centred > .container > .buttons {
    justify-content: center;
}

/* Accessibility
   ========================================================================== */

.skip-link {
    position: absolute;
    top: 0;
    left: -999px;
    z-index: 200;
    padding: 12px;
    background: var(--color-white);
}

.skip-link:focus {
    left: 12px;
}

/* Hidden on screen, read out by screen readers */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

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

    .button {
        transition: none;
    }
}

/* Colour helpers
   ========================================================================== */

/* Backgrounds, chosen per section in the editor */
.bg-white { background: var(--color-white); }
.bg-grey { background: var(--color-grey); }
.bg-magnolia { background: var(--color-magnolia); }
.bg-lavender { background: var(--color-lavender-pale); }
.bg-salmon { background: var(--color-salmon-pale); }
.bg-pistachio { background: var(--color-pistachio-pale); }
.bg-pink { background: var(--color-pink-pale); }
.bg-deep-blue { background: var(--color-deep-blue); color: var(--color-white); }

/* Accents: a strong colour, its pale tint, and the colour a two-tone icon's
   accent takes when the icon sits on that pale tint. Used by cards, steps,
   icon lists and mockups. */
.accent-blue { --accent: var(--color-funding-blue); --accent-pale: var(--color-magnolia); --accent-icon: var(--color-sky); }
.accent-deep-blue { --accent: var(--color-deep-blue); --accent-pale: var(--color-grey); --accent-icon: var(--color-funding-blue); }
.accent-sky { --accent: var(--color-sky); --accent-pale: var(--color-magnolia); --accent-icon: var(--color-sky); }
.accent-salmon { --accent: var(--color-salmon); --accent-pale: var(--color-salmon-pale); --accent-icon: var(--color-salmon); }
.accent-pistachio { --accent: var(--color-pistachio); --accent-pale: var(--color-pistachio-pale); --accent-icon: var(--color-pistachio); }
.accent-lavender { --accent: var(--color-lavender); --accent-pale: var(--color-lavender-pale); --accent-icon: var(--color-lavender); }
.accent-pink { --accent: var(--color-pink); --accent-pale: var(--color-pink-pale); --accent-icon: var(--color-pink); }

/* Deep Blue's pale tint is the grey of a "Deep Blue (lighter)" section, so on one of those it turns white */
.bg-grey .accent-deep-blue { --accent-pale: var(--color-white); }

/* Two-tone icons change their accent colour to suit what is behind them:
   sky blue on magnolia, the accent's own colour on a pale accent tint,
   and Funding Blue on white. The nearest surface decides. */
.bg-magnolia,
.page-header,
.testimonial {
    --icon-accent: var(--color-sky);
}

.icon-orb,
.icon-list-cards .icon-list-icon,
.card-change-after,
.icon-list-rows .icon-list-icon,
.icon-list-chips .icon-list-icon,
.cards-tinted .card-icon,
.dashboard-stage,
.mockup-dot,
.payment-option-icon {
    --icon-accent: var(--accent-icon);
}

.card,
.icon-list-cards .icon-list-item,
.mockup-card,
.mockup-chip,
.card-dark .card-icon,
.page-header.theme-dark {
    --icon-accent: var(--color-funding-blue);
}

/* The brand mark icon is Funding Blue, and white on a dark surface */
.bg-deep-blue,
.box-deep-blue,
.card-dark,
.call-to-action,
.page-header.theme-dark {
    --brand-mark: var(--color-white);
}

.bg-deep-blue .box:not(.box-deep-blue) {
    --brand-mark: var(--color-funding-blue);
}

/* An icon sized and coloured to match the text around it */
.icon-inline {
    width: 1em;
    height: 1em;
    color: inherit;
    vertical-align: -.14em;
    --icon-accent: currentColor;
}

.text-link {
    color: var(--color-funding-blue);
    font-weight: 600;
    white-space: nowrap;
}

.text-link:hover {
    color: var(--color-deep-blue);
}

/* Linked panels lift slightly on hover */
a.card,
a.testimonial,
a.icon-list-item,
a.search-result {
    transition: transform .18s, box-shadow .18s;
}

a.card:hover,
a.testimonial:hover,
a.icon-list-item:hover,
a.search-result:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(14, 27, 100, .1);
}

/* Reveal on scroll: js/main.js adds "reveal" to a block, then "in-view" when
   it scrolls into view. Without JavaScript nothing is hidden. */
.reveal {
    opacity: 0;
    transform: translateY(18px);
}

.reveal.in-view {
    opacity: 1;
    transform: none;
    transition: opacity .6s ease var(--reveal-delay, 0s), transform .6s ease var(--reveal-delay, 0s);
}

/* Content fades up as the page loads */
.fade-up {
    animation: fade-up .7s ease both;
}

.fade-up-delay {
    animation-delay: .15s;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .fade-up {
        animation: none;
    }

    a.card,
    a.testimonial,
    a.icon-list-item {
        transition: none;
    }

    a.card:hover,
    a.testimonial:hover,
    a.icon-list-item:hover {
        transform: none;
    }
}
