/* Material tones at the hue of Lurgan's `#3551A0`, as `lbcrm-api`'s `themeFor` derives them */
:root {
    --paper: #fbf8fd;
    --ink: #1d1f29;
    --pencil: #4e5262;
    --hall: #f4f3fa;
    --rule: #cacbd8;
    --product: #3551a0;
    --product-container: #dbe1ff;
    --on-product-container: #001a55;
    --product-light: #b4c5ff;
    --accent: #f8f991;
    --inverse: #242734;
    --on-inverse: #d5d3db;

    /* The app frame's shades, from lbcrm-web's index.css */
    --frame: rgb(233 236 245);
    --frame-high: rgb(222 226 239);
    --indicator: rgb(214 221 246);
    --on-indicator: rgb(22 32 74);

    --measure: 38rem;
    --radius: 0.625rem;

    color-scheme: light;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "Public Sans", system-ui, sans-serif;
    font-size: 1.125rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

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

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.15;
    text-wrap: balance;
}

h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.015em;
}

h3 {
    font-size: 1.25rem;
    font-weight: 650;
}

p {
    margin: 0;
}

.wrap {
    width: min(100% - 3rem, 72rem);
    margin-inline: auto;
}

.sprite {
    display: none;
}

.skip {
    position: absolute;
    left: 1rem;
    top: -3rem;
    background: var(--ink);
    color: var(--paper);
    padding: 0.5rem 1rem;
    z-index: 10;
}

.skip:focus {
    top: 1rem;
}

/**
 * What script.js moves in starts hidden, so it doesn't show and then jump. The class comes off
 * once motion has loaded, or after a moment if it never does.
 */
@media (prefers-reduced-motion: no-preference) {
    .motion-pending [data-words],
    .motion-pending [data-enter],
    .motion-pending [data-reveal] {
        opacity: 0;
    }
}

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--rule);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 4rem;
}

.wordmark {
    font-weight: 800;
    font-size: 1.375rem;
    letter-spacing: -0.02em;
    text-decoration: none;
    color: var(--product);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.wordmark__mark {
    width: 1.75rem;
    height: 1.75rem;
}

.site-nav {
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.9375rem;
}

.site-nav a {
    text-decoration: none;
    color: var(--pencil);
}

.site-nav a:hover {
    color: var(--ink);
    text-decoration: underline;
}

@media (max-width: 52rem) {
    .site-nav {
        display: none;
    }
}

/* Hero */

/* A tonal panel, with the phone standing on the accent's disc */
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: center;
    margin-top: 1rem;
    padding: clamp(2rem, 5vw, 4rem);
    border-radius: 2.5rem;
    background: linear-gradient(160deg, var(--product-container), var(--hall) 70%);
}

.hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    right: clamp(-6rem, -4vw, -2rem);
    bottom: -8rem;
    width: 30rem;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--accent);
}

.hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    right: 22rem;
    top: -5rem;
    width: 12rem;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--product-light);
    opacity: 0.45;
}

.hero h1 {
    font-size: clamp(2.5rem, 5.2vw, 4.25rem);
    font-weight: 780;
    letter-spacing: -0.03em;
    line-height: 1.02;
    max-width: 14ch;
}

/* Each word is split out by script.js so it can rise on its own */
.word {
    display: inline-block;
}

.lede {
    margin-top: 1.5rem;
    max-width: var(--measure);
    color: var(--pencil);
}

.lede + .lede {
    margin-top: 1rem;
}

.hero__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

/* Material's filled and tonal buttons, with the state layer as a mix */
.button {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    background: var(--product);
    color: #fff;
    font-weight: 650;
    text-decoration: none;
    border-radius: 999px;
    transition:
        background-color 150ms,
        box-shadow 150ms;
}

.button:hover {
    background: color-mix(in srgb, var(--product), #fff 8%);
    box-shadow: 0 1px 3px rgb(22 32 74 / 0.25);
}

.button--tonal {
    background: color-mix(in srgb, var(--product-container), var(--product) 12%);
    color: var(--on-product-container);
}

.button--tonal:hover {
    background: color-mix(in srgb, var(--product-container), var(--product) 20%);
}

.button--on-primary {
    background: #fff;
    color: var(--product);
}

.button--on-primary:hover {
    background: var(--product-container);
}

.hero__demo {
    margin: 0;
    display: grid;
    justify-items: center;
    gap: 1rem;
}

.hero__drift {
    width: min(100%, 22rem);
}

.hero__caption {
    display: flex;
    gap: 1rem;
    align-items: baseline;
    font-size: 0.9375rem;
    color: var(--pencil);
    font-variant-numeric: tabular-nums;
}

.hero__count {
    display: inline-block;
}

.replay {
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--pencil);
    background: none;
    border: 0;
    padding: 0.25rem 0.5rem;
    text-decoration: underline;
    text-underline-offset: 0.18em;
    cursor: pointer;
}

@media (max-width: 52rem) {
    .hero {
        grid-template-columns: 1fr;
        border-radius: 1.75rem;
    }

    .hero::after {
        display: none;
    }

    .wrap.hero {
        width: calc(100% - 1rem);
    }
}

/* Phone frames, shared by the demo and the phone screenshots */

.phone,
.feature__shot--phone {
    border: 0.625rem solid var(--ink);
    border-radius: 2.5rem;
    background: #fff;
    overflow: hidden;
    box-shadow:
        0 2rem 3.5rem -2rem rgb(28 36 51 / 0.45),
        0 0.5rem 1rem -0.5rem rgb(28 36 51 / 0.2);
}

.phone__screen {
    container-type: inline-size;
    aspect-ratio: 390 / 800;
}

/**
 * The check-in demo: lbcrm-web's check-in screen, redrawn at its own sizes. `--u` is one CSS
 * pixel of the 390-wide phone the screenshots were taken on, so every size below reads as the
 * Tailwind class it came from.
 */

.app {
    --u: calc(100cqw / 390);
    --content: #1f2937;

    position: relative;
    height: 100%;
    overflow: hidden;
    background: #f2f2f2;
    color: var(--content);
    font-family: "Fira Sans", sans-serif;
    font-size: calc(16 * var(--u));
    line-height: 1.5;
    -webkit-font-smoothing: auto;
}

.i {
    width: calc(24 * var(--u));
    height: calc(24 * var(--u));
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app__bar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: calc(16 * var(--u));
    height: calc(64 * var(--u));
    padding-inline: calc(20 * var(--u));
    background: var(--frame);
}

.app__titles {
    flex-grow: 1;
    min-width: 0;
}

.app__title {
    font-size: calc(20 * var(--u));
    font-weight: 800;
    line-height: 1.2;
}

.app__subtitle {
    font-size: calc(14 * var(--u));
    line-height: 1.3;
    color: rgb(31 41 55 / 0.7);
}

.app__scroll {
    padding-bottom: calc(120 * var(--u));
}

.app__search {
    padding: calc(16 * var(--u)) calc(16 * var(--u)) 0;
}

.app__label {
    font-size: calc(14 * var(--u));
    font-weight: 700;
    margin-bottom: calc(8 * var(--u));
}

.app__input {
    height: calc(48 * var(--u));
    padding-inline: calc(16 * var(--u));
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid rgb(31 41 55 / 0.2);
    border-radius: calc(8 * var(--u));
    color: #9ca3af;
}

.app__letter {
    margin-top: calc(10 * var(--u));
    padding-inline: calc(16 * var(--u));
    font-weight: 700;
}

.app__list {
    list-style: none;
    margin: 0;
    padding: 0 calc(8 * var(--u));
}

/* `ActivatableListItem` */
.row {
    margin-block: calc(8 * var(--u));
    background: #fff;
    border: 1px solid transparent;
    border-radius: calc(16 * var(--u));
    transition:
        background-color 300ms,
        border-color 300ms;
}

.row.is-in {
    background: #dcfce7;
    border-color: #86efac;
}

.row.is-open {
    background: #fff;
    border-color: transparent;
}

.row__head {
    display: flex;
    align-items: stretch;
    border-radius: calc(16 * var(--u));
    transition: background-color 300ms;
}

.row.is-in.is-open .row__head {
    background: #dcfce7;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.row__chevron {
    display: grid;
    place-items: center;
    width: calc(40 * var(--u));
    flex-shrink: 0;
}

.row__chevron .i {
    width: calc(20 * var(--u));
    height: calc(20 * var(--u));
}

.row__main {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: calc(12 * var(--u));
    padding: calc(8 * var(--u)) calc(12 * var(--u)) calc(8 * var(--u)) 0;
}

/* `PersonAvatar` at `xs`, daisyUI's squircle mask */
.avatar {
    display: grid;
    place-items: center;
    width: calc(40 * var(--u));
    height: calc(40 * var(--u));
    flex-shrink: 0;
    background: var(--bg);
    color: #fff;
    mask: url("data:image/svg+xml,%3csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M100 0C20 0 0 20 0 100s20 100 100 100 100-20 100-100S180 0 100 0Z'/%3e%3c/svg%3e")
        center / contain no-repeat;
}

.avatar--dark {
    color: #2a323c;
}

.row__who {
    flex-grow: 1;
    min-width: 0;
    display: grid;
    gap: calc(2 * var(--u));
}

.row__name {
    line-height: 1.25;
}

.row__name b {
    font-weight: 800;
}

.row__flags {
    display: flex;
    flex-wrap: wrap;
    column-gap: calc(10 * var(--u));
    font-size: calc(12 * var(--u));
    font-weight: 700;
    line-height: 1.35;
}

.flag {
    display: inline-flex;
    align-items: center;
    gap: calc(4 * var(--u));
}

.flag .i {
    width: calc(14 * var(--u));
    height: calc(14 * var(--u));
}

.flag--amber {
    color: #92400e;
}

.flag--red {
    color: #b91c1c;
}

.flag--green {
    color: #166534;
}

/* `CheckInTick` */
.tick {
    display: grid;
    justify-items: center;
    gap: calc(2 * var(--u));
    min-width: calc(52 * var(--u));
}

.tick__circle {
    position: relative;
    display: grid;
    place-items: center;
    width: calc(44 * var(--u));
    height: calc(44 * var(--u));
    border-radius: 50%;
    box-shadow: inset 0 0 0 calc(2 * var(--u)) rgb(31 41 55 / 0.4);
    color: #fff;
}

.tick__circle .i {
    stroke-width: 3;
    visibility: hidden;
}

.row.is-in .tick__circle {
    background: #16a34a;
    box-shadow: none;
}

.row.is-in .tick__circle .i {
    visibility: visible;
}

/* The request is out: daisyUI's spinner, while the ring goes pale */
.row.is-busy .tick__circle {
    box-shadow: inset 0 0 0 calc(2 * var(--u)) #e5e6e6;
}

.row.is-busy .tick__circle::after {
    content: "";
    width: calc(24 * var(--u));
    height: calc(24 * var(--u));
    border-radius: 50%;
    border: calc(2.5 * var(--u)) solid var(--product);
    border-right-color: transparent;
    animation: spin 700ms linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(1turn);
    }
}

.tick__time {
    min-height: calc(16 * var(--u));
    font-size: calc(11.2 * var(--u));
    font-weight: 700;
    line-height: calc(16 * var(--u));
    color: #15803d;
}

/* What a row opens to: `PersonCheckInDetails` */
.row__details {
    height: 0;
    overflow: hidden;
}

.row__details-inner {
    display: grid;
    gap: calc(10 * var(--u));
    padding: calc(12 * var(--u)) calc(12 * var(--u)) calc(14 * var(--u));
}

.alert {
    display: flex;
    gap: calc(16 * var(--u));
    padding: calc(16 * var(--u));
    border-radius: calc(16 * var(--u));
    background: #ffedd5;
    color: #7c2d12;
}

.alert .i {
    width: calc(16 * var(--u));
    height: calc(16 * var(--u));
}

.alert__heading {
    font-weight: 700;
    line-height: 1.25;
}

.alert__body {
    margin-top: calc(4 * var(--u));
    font-size: calc(14 * var(--u));
    line-height: 1.4;
}

.tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(6 * var(--u));
}

.tile {
    display: grid;
    align-content: start;
    gap: calc(2 * var(--u));
    padding: calc(10 * var(--u));
    border-radius: calc(16 * var(--u));
    background: #e5e6e6;
}

.tile--success {
    background: #dcfce7;
    color: #052e16;
}

.tile__label {
    display: flex;
    align-items: center;
    gap: calc(4 * var(--u));
    font-size: calc(12 * var(--u));
    font-weight: 700;
    color: rgb(31 41 55 / 0.7);
}

.tile--success .tile__label {
    color: #166534;
}

.tile__label .i {
    width: calc(14 * var(--u));
    height: calc(14 * var(--u));
}

.tile__value {
    font-weight: 800;
    line-height: 1.25;
}

.tile__detail {
    font-size: calc(12 * var(--u));
    line-height: 1.35;
    opacity: 0.8;
}

/* `FloatingNavBar` */
.app__nav {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: calc(20 * var(--u));
    translate: -50% 0;
    display: flex;
    gap: calc(4 * var(--u));
    padding: calc(6 * var(--u)) calc(8 * var(--u));
    border-radius: calc(32 * var(--u));
    background: var(--frame-high);
    box-shadow:
        0 1px 3px rgb(0 0 0 / 0.12),
        0 6px 16px rgb(24 32 58 / 0.16);
}

.app__nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(4 * var(--u));
    width: calc(64 * var(--u));
    padding: calc(6 * var(--u)) 0 calc(4 * var(--u));
    font-size: calc(12 * var(--u));
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    color: rgb(31 41 55 / 0.7);
}

.app__nav-icon {
    display: grid;
    place-items: center;
    width: calc(56 * var(--u));
    height: calc(32 * var(--u));
    border-radius: 999px;
}

.app__nav-item.is-current {
    font-weight: 800;
    color: var(--content);
}

.app__nav-item.is-current .app__nav-icon {
    background: var(--indicator);
    color: var(--on-indicator);
}

/* Where the demo's finger lands, so a visitor can follow the taps */
.app__touch {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 0;
    width: calc(44 * var(--u));
    height: calc(44 * var(--u));
    margin: calc(-22 * var(--u)) 0 0 calc(-22 * var(--u));
    border-radius: 50%;
    background: rgb(53 81 160 / 0.28);
    box-shadow: 0 0 0 calc(2 * var(--u)) rgb(53 81 160 / 0.35);
    opacity: 0;
    pointer-events: none;
}

/* What it does */

.features {
    padding-block: clamp(3rem, 7vw, 5.5rem);
}

.tabs-track {
    margin-top: 2.25rem;
}

/* The app's floating bar, with its pill moving to the tab picked */
.tabs {
    position: relative;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 0.25rem;
    padding: 0.375rem;
    border-radius: 2rem;
    background: var(--frame-high);
    box-shadow:
        0 1px 3px rgb(0 0 0 / 0.08),
        0 6px 16px rgb(24 32 58 / 0.1);
}

.tabs__pill {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 1.625rem;
    background: var(--indicator);
    box-shadow: 0 1px 2px rgb(22 32 74 / 0.12);
}

.tabs button {
    position: relative;
    padding: 0.75rem 0.5rem;
    border: 0;
    border-radius: 1.625rem;
    background: none;
    color: rgb(31 41 55 / 0.72);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: color 200ms;
}

.tabs button:hover {
    color: var(--ink);
}

.tabs button[aria-selected="true"] {
    color: var(--on-indicator);
}

.feature-panels {
    display: grid;
    margin-top: 1.5rem;
    padding: clamp(1.25rem, 4vw, 3rem);
    border-radius: 2.5rem;
    background: var(--hall);
}

/* As tall as the phone shots, so switching tabs doesn't move the page below */
@media (min-width: 52.01rem) {
    .feature-panels {
        min-height: 51rem;
    }
}

@media (max-width: 52rem) {
    .feature-panels {
        border-radius: 1.75rem;
    }
}

.feature {
    display: grid;
    grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

.feature[hidden] {
    display: none;
}

.feature__text {
    padding-top: 0.5rem;
}

.feature__icon {
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 1.25rem;
    border-radius: 1.125rem;
    background: var(--product-container);
    color: var(--product);
}

.feature__icon svg {
    width: 1.75rem;
    height: 1.75rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.feature__text h3 {
    font-size: 1.5rem;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.feature__text p {
    margin-top: 0.75rem;
    color: var(--pencil);
}

.feature__shot--phone {
    justify-self: center;
    width: min(100%, 20rem);
}

.feature__shot--wide {
    border: 0.5rem solid var(--frame-high);
    border-radius: 1.5rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1.5rem 3rem -1.5rem rgb(22 32 74 / 0.35);
}

/* Too many tabs for the width, so the bar scrolls sideways */
@media (max-width: 64rem) {
    .tabs-track {
        overflow-x: auto;
        margin-inline: -1.5rem;
        padding: 0.25rem 1.5rem 0.75rem;
        scrollbar-width: none;
    }

    .tabs {
        grid-auto-columns: max-content;
        width: max-content;
    }

    .tabs button {
        padding-inline: 1rem;
    }
}

@media (max-width: 52rem) {
    .feature {
        grid-template-columns: 1fr;
    }
}

/* Plain sections */

.prose-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 1rem clamp(2rem, 5vw, 4rem);
    padding-block: clamp(3rem, 7vw, 5rem);
    border-top: 1px solid var(--rule);
}

/* The brand colour's own card, the one place it's used as a surface */
.contact {
    margin-block: clamp(2rem, 5vw, 3.5rem);
    padding: clamp(2rem, 5vw, 4rem);
    border: 0;
    border-radius: 2.5rem;
    background: var(--product);
    color: #fff;
}

.contact p {
    max-width: var(--measure);
    color: rgb(255 255 255 / 0.86);
}

.contact p + p {
    margin-top: 1rem;
}

.contact .contact__action {
    margin-top: 2rem;
}

.contact :focus-visible {
    outline-color: #fff;
}

@media (max-width: 52rem) {
    .prose-section {
        grid-template-columns: 1fr;
    }
}

.site-footer {
    background: var(--inverse);
    color: var(--on-inverse);
    font-size: 0.875rem;
    padding-block: 2rem;
}

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

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