/*!
 * ICI loading screen, v1.0: Archie's loading screen for every ICI tool, with the tool's own icon and name.
 * Source: icihomes/ici-kit templates/splash (README there). The original is Archie's runtime/web/src/splash.css.
 *
 * Copy this file whole and byte for byte into each tool, beside ici-splash.js; never edit a copy. Change it here,
 * bump the version above, and re-copy it into every tool.
 *
 * The navy and gold of the main website's header, a faint blueprint grid, the tool's pixel icon on a badge, the
 * "ICI Homes" eyebrow, the tool's name and a status line. It is the same in light and dark (it shows before the tool
 * knows the person's theme). Load it in <head>, ahead of the tool's own styles, so it paints first. No inline styles
 * are needed, so a strict CSP is fine. Fonts are the tool's own (ici-look.css: Jost and Cormorant Garamond, with
 * their @font-face rules in the tool); without them it falls back to system faces.
 */

.ici-splash {
    --ici-splash-ink: #0b1b33;
    --ici-splash-navy: #1c3a63;
    --ici-splash-gold: #dbc392;
    --ici-splash-gold-deep: #c3a265;
    --ici-splash-text: #f1ede3;
    --ici-splash-muted: #b9b3a6;
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    margin: 0;
    padding: 24px 16px;
    overflow: auto;
    color-scheme: dark;
    color: var(--ici-splash-text);
    font-family: var(--ici-font, Jost, "Helvetica Neue", Arial, system-ui, sans-serif);
    font-size: 14px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    text-align: center;
    background:
        radial-gradient(ellipse 70% 55% at 50% 42%, rgb(28 58 99 / 0.85), transparent 70%), var(--ici-splash-ink);
    transition: opacity 320ms ease;
}
.ici-splash *,
.ici-splash *::before,
.ici-splash *::after {
    box-sizing: border-box;
}

/* Shown once per browser tab (ici-splash.js with data-once): later pages of the visit go straight to the tool. */
.ici-splash-skip .ici-splash:not(.ici-splash--stay) {
    display: none;
}

/* The blueprint: gold hairlines every 32px, fading out toward the edges. */
.ici-splash::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgb(219 195 146 / 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgb(219 195 146 / 0.07) 1px, transparent 1px);
    background-size: 32px 32px;
    background-position: center center;
    mask-image: radial-gradient(ellipse 60% 55% at 50% 45%, #000 20%, transparent 75%);
}

.ici-splash-stack {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 340px;
    transition: transform 320ms ease;
}

.ici-splash-badge {
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    border-radius: 22px;
    background: linear-gradient(160deg, #24497a, var(--ici-splash-navy) 55%, #142c4d);
    box-shadow:
        inset 0 0 0 1px rgb(219 195 146 / 0.35),
        0 18px 40px -18px rgb(0 0 0 / 0.7),
        0 0 0 8px rgb(219 195 146 / 0.04);
}

/* The tool's 14 by 14 pixel icon (its favicon.svg) at four screen pixels to the icon pixel. */
.ici-splash-icon {
    display: block;
    width: 56px;
    height: 56px;
    image-rendering: pixelated;
    user-select: none;
    -webkit-user-drag: none;
}

.ici-splash-eyebrow {
    margin: 28px 0 0;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    /* The tracking pads the right edge; pull it back so the word sits centred. */
    margin-right: -0.32em;
    color: var(--ici-splash-gold);
}

.ici-splash-wordmark {
    margin: 6px 0 0;
    font-family: var(--ici-font-display, "Cormorant Garamond", Georgia, "Times New Roman", serif);
    font-size: 52px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    text-wrap: balance;
    color: var(--ici-splash-text);
}
/* A long name ("Infrastructure") still fits a phone. */
.ici-splash-wordmark--long {
    font-size: 42px;
}

/* A gold diamond between two hairlines, as on the main website. */
.ici-splash-ornament {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    color: var(--ici-splash-gold-deep);
}
.ici-splash-ornament::before,
.ici-splash-ornament::after {
    content: "";
    width: 44px;
    height: 1px;
    background: currentColor;
    opacity: 0.6;
}
.ici-splash-ornament > span {
    width: 6px;
    height: 6px;
    background: currentColor;
    transform: rotate(45deg);
}

.ici-splash-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    /* Room for the signed-out and error versions too, so the mark above never moves between them. */
    min-height: 132px;
    margin-top: 22px;
}

.ici-splash .ici-splash-status {
    margin: 0;
    min-height: 20px;
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--ici-splash-muted);
}

/* A slim gold line that sweeps while the tool loads. */
.ici-splash-progress {
    position: relative;
    width: 148px;
    height: 2px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 2px;
    background: rgb(219 195 146 / 0.16);
}
.ici-splash-progress > span {
    position: absolute;
    inset: 0 auto 0 0;
    width: 40%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, var(--ici-splash-gold), transparent);
    animation: ici-splash-sweep 1.5s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

/* The signed-out and error versions: words and a button in place of the status line. */
.ici-splash .ici-splash-title {
    margin: 0;
    text-wrap: balance;
    font-size: 15px;
    font-weight: 500;
    color: var(--ici-splash-text);
}
.ici-splash .ici-splash-text {
    margin: 6px 0 0;
    text-wrap: balance;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ici-splash-muted);
}
.ici-splash .ici-splash-error {
    margin: 12px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: #f0a8a0;
}
.ici-splash .ici-splash-error:empty {
    display: none;
}
.ici-splash .ici-splash-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    margin-top: 22px;
    padding: 0 24px;
    border: 1px solid var(--ici-splash-gold);
    border-radius: 6px;
    background: var(--ici-splash-gold);
    color: var(--ici-splash-ink);
    font: inherit;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color 150ms ease,
        border-color 150ms ease;
}
.ici-splash .ici-splash-button:hover {
    background: var(--ici-splash-gold-deep);
    border-color: var(--ici-splash-gold-deep);
    color: var(--ici-splash-ink);
}
.ici-splash .ici-splash-button--quiet {
    background: transparent;
    color: var(--ici-splash-gold);
}
.ici-splash .ici-splash-button--quiet:hover {
    background: rgb(219 195 146 / 0.1);
    border-color: var(--ici-splash-gold);
    color: var(--ici-splash-gold);
}
.ici-splash .ici-splash-button + .ici-splash-button {
    margin-top: 10px;
}
.ici-splash .ici-splash-button:focus-visible,
.ici-splash .ici-splash-link:focus-visible,
.ici-splash .ici-splash-input:focus-visible {
    outline: 2px solid var(--ici-splash-gold);
    outline-offset: 3px;
}
.ici-splash .ici-splash-button:disabled {
    opacity: 0.6;
    cursor: default;
}
/* A quiet text link under the button ("Use an API token", "Sign in with a password"). */
.ici-splash .ici-splash-link {
    margin-top: 16px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ici-splash-gold);
    font: inherit;
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.ici-splash .ici-splash-link:hover {
    color: var(--ici-splash-text);
}
/* A field on the splash (an API token, a break-glass login): light text on the navy. */
.ici-splash .ici-splash-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    margin-top: 18px;
    text-align: left;
}
.ici-splash .ici-splash-form .ici-splash-button {
    margin-top: 4px;
}
.ici-splash .ici-splash-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: var(--ici-splash-muted);
}
.ici-splash .ici-splash-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid rgb(219 195 146 / 0.35);
    border-radius: 6px;
    background: rgb(11 27 51 / 0.6);
    color: var(--ici-splash-text);
    font: inherit;
}
.ici-splash .ici-splash-input::placeholder {
    color: rgb(185 179 166 / 0.7);
}
.ici-splash .ici-splash-footnote {
    margin: 18px 0 0;
    font-size: 12px;
    color: rgb(185 179 166 / 0.75);
}

/* The icon hops one icon pixel now and then while you wait, in whole-pixel steps like Archie's moves. */
.ici-splash .ici-splash-icon {
    animation: ici-splash-hop 4.8s steps(1, end) 1.6s infinite;
}

/* The first paint: the badge settles, the icon drops on, then the words follow. */
.ici-splash--intro .ici-splash-badge {
    animation: ici-splash-rise 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.ici-splash--intro .ici-splash-icon {
    animation:
        ici-splash-drop 560ms steps(4, end) 160ms both,
        ici-splash-hop 4.8s steps(1, end) 1.6s infinite;
}
.ici-splash--intro .ici-splash-eyebrow,
.ici-splash--intro .ici-splash-wordmark,
.ici-splash--intro .ici-splash-ornament {
    animation: ici-splash-fade-up 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.ici-splash--intro .ici-splash-eyebrow {
    animation-delay: 140ms;
}
.ici-splash--intro .ici-splash-wordmark {
    animation-delay: 200ms;
}
.ici-splash--intro .ici-splash-ornament {
    animation-delay: 260ms;
}
/* A quick load never flashes the status line. */
.ici-splash--intro .ici-splash-body {
    animation: ici-splash-fade-in 400ms ease 650ms both;
}

/* Leaving: a short fade onto the tool underneath. */
.ici-splash--leaving {
    opacity: 0;
    pointer-events: none;
}
.ici-splash--leaving .ici-splash-stack {
    transform: translateY(-6px) scale(0.985);
}

@keyframes ici-splash-sweep {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(250%);
    }
}
@keyframes ici-splash-rise {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
@keyframes ici-splash-drop {
    from {
        transform: translateY(-16px);
        opacity: 0;
    }
    25% {
        opacity: 1;
    }
    to {
        transform: none;
        opacity: 1;
    }
}
@keyframes ici-splash-fade-up {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
@keyframes ici-splash-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@keyframes ici-splash-hop {
    0%,
    88% {
        transform: none;
    }
    89%,
    93% {
        transform: translateY(-4px);
    }
    94%,
    100% {
        transform: none;
    }
}

@media (max-width: 380px) {
    .ici-splash-wordmark {
        font-size: 44px;
    }
    .ici-splash-wordmark--long {
        font-size: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ici-splash,
    .ici-splash-stack {
        transition: none;
    }
    .ici-splash .ici-splash-icon,
    .ici-splash--intro .ici-splash-badge,
    .ici-splash--intro .ici-splash-icon,
    .ici-splash--intro .ici-splash-eyebrow,
    .ici-splash--intro .ici-splash-wordmark,
    .ici-splash--intro .ici-splash-ornament,
    .ici-splash--intro .ici-splash-body,
    .ici-splash-progress > span {
        animation: none;
    }
    .ici-splash-progress > span {
        left: 30%;
    }
}
