/*
 * Design tokens lifted from the Vuewer site (resources/css/app.css and
 * docs/03-design-system.md), written as plain CSS so this page needs no build
 * step.
 */

@font-face {
    font-family: 'Geist';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/geist-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Geist';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/geist-500.woff2') format('woff2');
}

@font-face {
    font-family: 'Geist';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/geist-600.woff2') format('woff2');
}

:root {
    --font-sans: 'Geist', ui-sans-serif, system-ui, sans-serif;

    --color-base: oklch(0.145 0.006 300);
    --color-surface-2: oklch(0.245 0.009 300);
    --color-surface-3: oklch(0.31 0.011 300);

    --color-ink: oklch(0.955 0.004 320);
    --color-ink-muted: oklch(0.77 0.009 300);
    --color-ink-subtle: oklch(0.6 0.013 300);

    --color-accent: oklch(0.87 0.23 128);
    --color-accent-dim: oklch(0.62 0.16 128);
    --color-accent-wash: oklch(0.25 0.06 128);
    --color-accent-glow: oklch(0.87 0.23 128 / 0.18);

    --radius-sm: 0.25rem;
    --radius: 0.375rem;

    --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-entrance: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-entrance: 800ms;
}

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

html {
    background-color: var(--color-base);
    color-scheme: dark;
    -webkit-font-smoothing: antialiased;
}

body {
    position: relative;
    overflow-x: clip;
    background-color: var(--color-base);
    color: var(--color-ink-muted);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.65;
    letter-spacing: -0.005em;
}

a {
    color: inherit;
    text-decoration: none;
}

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

::selection {
    background-color: var(--color-ink);
    color: var(--color-base);
}

/* Layout --------------------------------------------------------------- */

.page {
    position: relative;
    z-index: 10;
    display: flex;
    min-height: 100svh;
    flex-direction: column;
    padding-inline: 1.5rem;
}

@media (min-width: 48rem) {
    .page {
        padding-inline: 2.5rem;
    }
}

.header,
.footer {
    display: flex;
    min-height: 5.5rem;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.logo {
    display: inline-flex;
    color: var(--color-ink);
}

.logo svg {
    height: 1.5rem;
    width: auto;
}

.main {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-block: 3rem;
    text-align: center;
    container-type: inline-size;
}

.footer {
    font-size: 0.8125rem;
    color: var(--color-ink-subtle);
}

.footer a {
    transition: color 150ms var(--ease-standard);
}

.footer a:hover {
    color: var(--color-ink);
}

/* Content --------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.1875rem 0.625rem;
    border: 1px solid color-mix(in oklch, var(--color-accent-dim) 50%, transparent);
    border-radius: var(--radius-sm);
    background-color: var(--color-accent-wash);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-accent);
}

.pulse-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background-color: var(--color-accent);
}

/*
 * Shrinks a long domain to fit instead of breaking it mid-word, at roughly
 * 0.56em per character; --chars is set by the script.
 */
.domain {
    max-width: 100%;
    margin-top: 1.5rem;
    font-size: max(1.5rem, min(clamp(2.5rem, 5vw, 3.75rem), 100cqi / (var(--chars, 18) * 0.56)));
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
    text-wrap: balance;
    color: #fff;
}

.lede {
    max-width: 25rem;
    margin-top: 1.25rem;
    font-size: 1.0625rem;
    line-height: 1.6;
    text-wrap: balance;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2.25rem;
}

.button {
    display: inline-flex;
    height: 3rem;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding-inline: 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 600;
    white-space: nowrap;
    transition:
        filter 150ms var(--ease-standard),
        box-shadow 150ms var(--ease-standard),
        background-color 150ms var(--ease-standard),
        border-color 150ms var(--ease-standard);
}

.button--primary {
    background-color: var(--color-accent);
    color: var(--color-base);
}

.button--primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 24px var(--color-accent-glow);
}

.button--secondary {
    border-color: var(--color-surface-3);
    color: var(--color-ink);
}

.button--secondary:hover {
    background-color: var(--color-surface-2);
    border-color: var(--color-ink-subtle);
}

.arrow {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 150ms var(--ease-standard);
}

.button:hover .arrow {
    transform: translateX(0.125rem);
}

@media (max-width: 29.99rem) {
    .actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }
}

/* Backdrop -------------------------------------------------------------- */

.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/*
 * The three Vuewer colours as one soft glow along the bottom edge. Cyan sits
 * between lime and violet, which turn grey where they meet.
 */
.aurora {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.aurora span {
    position: absolute;
    bottom: -38vmax;
    left: calc(50% + var(--x) - 45vmax);
    width: 90vmax;
    height: 60vmax;
    border-radius: 50%;
    background: radial-gradient(closest-side, color-mix(in oklab, var(--glow) 22%, transparent), color-mix(in oklab, var(--glow) 7%, transparent) 55%, transparent);
}

.aurora span:nth-child(1) {
    --x: -34vmax;
    --glow: var(--color-accent);
}

.aurora span:nth-child(2) {
    --x: 0vmax;
    --glow: oklch(0.75 0.14 231);
}

.aurora span:nth-child(3) {
    --x: 34vmax;
    --glow: oklch(0.65 0.22 300);
}

/* Motion ---------------------------------------------------------------- */

/*
 * Entrances only apply once the inline script in the head has added
 * `.js-motion`, which it never does under reduced motion. Without it
 * everything is simply visible.
 */
.js-motion [data-reveal] {
    animation: reveal var(--duration-entrance) var(--ease-entrance) var(--reveal-delay, 0ms) both;
}

.js-motion [data-reveal='fade'] {
    animation-name: reveal-fade;
}

@media (prefers-reduced-motion: no-preference) {
    .aurora span {
        will-change: transform;
        animation: drift 24s ease-in-out infinite alternate;
    }

    .aurora span:nth-child(2) {
        animation-duration: 30s;
        animation-direction: alternate-reverse;
    }

    .aurora span:nth-child(3) {
        animation-duration: 36s;
    }

    .pulse-dot {
        animation: pulse-dot 2.4s var(--ease-standard) infinite;
    }
}

@keyframes reveal {
    from {
        opacity: 0;
        translate: 0 1rem;
    }
}

@keyframes reveal-fade {
    from {
        opacity: 0;
    }
}

@keyframes drift {
    from {
        transform: translate(-3%, 2%);
    }
    to {
        transform: translate(3%, -4%);
    }
}

@keyframes pulse-dot {
    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 var(--color-accent-glow);
    }
    50% {
        opacity: 0.55;
        box-shadow: 0 0 0 5px transparent;
    }
}
