/*
 * Design tokens and effects 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');
}

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

:root {
    --font-sans: 'Geist', ui-sans-serif, system-ui, sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

    --color-base: oklch(0.145 0.006 300);
    --color-surface: oklch(0.196 0.008 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.53 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);

    --color-warning: oklch(0.84 0.16 85);
    --color-info: oklch(0.75 0.14 231);
    --color-violet: oklch(0.65 0.22 300);
    --color-rose: oklch(0.7 0.18 350);

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

    --container-wide: 90rem;

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

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

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

body {
    position: relative;
    display: flex;
    min-height: 100svh;
    flex-direction: column;
    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;
}

h1 {
    color: #fff;
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

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);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

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

.container {
    position: relative;
    width: 100%;
    max-width: var(--container-wide);
    margin-inline: auto;
    padding-inline: 1.5rem;
}

.page {
    position: relative;
    z-index: 10;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.header {
    display: flex;
    height: 4rem;
    align-items: center;
    justify-content: space-between;
}

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

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

.main {
    display: flex;
    flex: 1;
    align-items: center;
}

.hero {
    display: grid;
    gap: 3rem;
    padding-block: 5rem;
}

@media (min-width: 64rem) {
    .hero {
        grid-template-columns: 1.35fr 1fr;
        align-items: center;
        gap: 4rem;
        padding-block: 7rem;
    }
}

.footer {
    border-top: 1px solid color-mix(in oklch, var(--color-surface-3) 60%, transparent);
}

.footer .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    padding-block: 1.5rem;
    font-size: 0.8125rem;
    color: var(--color-ink-subtle);
}

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

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

/* Type ----------------------------------------------------------------- */

.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent-dim);
}

.eyebrow__number {
    color: var(--color-ink-subtle);
}

.display {
    margin-top: 1.5rem;
    font-size: clamp(2.75rem, 6vw, 4.5rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.025em;
    container-type: inline-size;
}

/*
 * Shrinks a long domain to fit the column instead of breaking it mid-word.
 * Roughly 0.55em per character in Geist italic; --chars is set by the script.
 */
.display__domain {
    display: block;
    font-size: max(1.75rem, min(1em, calc(175cqi / var(--chars, 10))));
    overflow-wrap: anywhere;
    color: var(--color-accent);
    font-style: italic;
}

.lede {
    max-width: 28rem;
    font-size: 1.0625rem;
    line-height: 1.6;
}

/* Buttons -------------------------------------------------------------- */

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

.button {
    display: inline-flex;
    height: 3rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding-inline: 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    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__arrow {
    transition: transform 150ms var(--ease-standard);
}

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

.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);
}

/* Status panel ---------------------------------------------------------- */

.panel {
    margin-top: 2.5rem;
    overflow: hidden;
    border: 1px solid var(--color-surface-3);
    border-radius: var(--radius-lg);
    background-color: color-mix(in oklch, var(--color-surface) 80%, transparent);
    backdrop-filter: blur(12px);
}

.panel__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid rgb(255 255 255 / 0.06);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-ink-subtle);
}

.panel__dots {
    display: flex;
    gap: 0.375rem;
}

.panel__dots span {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--color-surface-3);
}

.panel__rows {
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    list-style: none;
}

.panel__row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 0.5rem;
}

.panel__row + .panel__row {
    border-top: 1px solid rgb(255 255 255 / 0.06);
}

.panel__key {
    color: var(--color-ink-subtle);
}

.panel__value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-ink);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.125rem 0.5rem;
    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-family: var(--font-sans);
    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);
}

.gradient-hairline {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--color-accent) 25%,
        var(--color-info) 55%,
        var(--color-violet) 80%,
        transparent 100%
    );
    opacity: 0.4;
}

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

.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    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");
}

.grid-rules {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    mask-image: linear-gradient(180deg, transparent, black 6rem, black calc(100% - 6rem), transparent);
}

.grid-rules .container,
.grid-rules__inner {
    height: 100%;
}

.grid-rules__inner {
    position: relative;
}

.rule,
.beam {
    position: absolute;
    top: 0;
    width: 1px;
}

.rule {
    height: 100%;
    background-color: color-mix(in oklch, var(--color-surface-3) 25%, transparent);
}

.beam {
    height: 8rem;
    opacity: 0;
    background-image: linear-gradient(180deg, transparent, var(--beam-color), transparent);
}

/* The quarter rules would crowd the text on narrow screens. */
@media (max-width: 47.99rem) {
    .is-quarter {
        display: none;
    }
}

/*
 * Spans the viewport rather than a fixed band at the top, because the content
 * is centred vertically: on a tall screen a fixed band leaves the headline
 * below the glow.
 */
.backdrop {
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: max(46rem, 100svh);
    pointer-events: none;
    mask-image: linear-gradient(180deg, black, black calc(100% - 16rem), transparent);
}

.dot-field {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at center, var(--color-surface-3) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(58% 50% at 50% 40%, black, transparent);
    opacity: 0.6;
}

.aurora {
    position: absolute;
    inset: 0;
    overflow: hidden;
    contain: paint;
}

.aurora span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 56vmax;
    height: 56vmax;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.38;
}

.aurora span:nth-child(1) {
    background: radial-gradient(circle, color-mix(in oklch, var(--color-accent) 50%, transparent) 0%, transparent 60%);
}

.aurora span:nth-child(2) {
    background: radial-gradient(circle, color-mix(in oklch, var(--color-info) 40%, transparent) 0%, transparent 60%);
}

.aurora span:nth-child(3) {
    width: 42vmax;
    height: 42vmax;
    background: radial-gradient(circle, oklch(0.62 0.2 300 / 0.35) 0%, transparent 60%);
}

/* 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) both;
    animation-delay: var(--reveal-delay, 0ms);
}

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

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

.js-motion .gradient-hairline {
    background-size: 200% 100%;
    animation: hairline 1400ms var(--ease-entrance) 600ms both;
}

@media (prefers-reduced-motion: no-preference) {
    .aurora span {
        will-change: transform;
    }

    .aurora span:nth-child(1) {
        animation: aurora-a 32s ease-in-out infinite;
    }

    .aurora span:nth-child(2) {
        animation: aurora-b 40s ease-in-out infinite;
    }

    .aurora span:nth-child(3) {
        animation: aurora-c 48s ease-in-out infinite;
    }

    .beam {
        animation: beam 8s var(--ease-standard) infinite both;
    }

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

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

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

@keyframes reveal-blur {
    from {
        opacity: 0;
        translate: 0 0.75rem;
        filter: blur(8px);
    }
}

@keyframes hairline {
    from {
        background-position: 100% 0;
        opacity: 0;
    }
    to {
        background-position: 0 0;
        opacity: 0.4;
    }
}

@keyframes aurora-a {
    0%,
    100% {
        transform: translate(-70%, -75%) scale(1);
    }
    25% {
        transform: translate(-15%, -80%) scale(1.08);
    }
    50% {
        transform: translate(-10%, -15%) scale(1);
    }
    75% {
        transform: translate(-75%, -10%) scale(1.08);
    }
}

@keyframes aurora-b {
    0%,
    100% {
        transform: translate(-10%, -10%) scale(1.08);
    }
    33% {
        transform: translate(-75%, -15%) scale(1);
    }
    66% {
        transform: translate(-70%, -80%) scale(1.08);
    }
}

@keyframes aurora-c {
    0%,
    100% {
        transform: translate(-15%, -80%) scale(1);
    }
    50% {
        transform: translate(-70%, -10%) scale(1.08);
    }
}

@keyframes beam {
    0% {
        opacity: 0;
        translate: 0 -18rem;
    }
    28%,
    72% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        translate: 0 38rem;
    }
}

@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;
    }
}
