/* ==========================================================================
   Quasar Dev: tokens, fonts, reset and base typography
   ========================================================================== */

@font-face {
    font-family: "Inter";
    src: url("/fonts/inter-var.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Space Grotesk";
    src: url("/fonts/space-grotesk-var.woff2") format("woff2");
    font-weight: 300 700;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("/fonts/jetbrains-mono-var.woff2") format("woff2");
    font-weight: 100 800;
    font-display: swap;
}

/* Colours are taken from the Quasar Dev icon: deep indigo space, a cyan jet, a violet nebula
   and an amber accretion disc. */
:root {
    color-scheme: dark;

    --bg: #07061a;
    --bg-2: #0c0a24;
    --bg-3: #120f30;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-2: rgba(255, 255, 255, 0.06);
    --surface-3: rgba(255, 255, 255, 0.09);
    --surface-solid: #110e2c;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);

    --text: #eeecf8;
    --text-muted: #aaa6c6;
    --text-faint: #8a85ad;

    --cyan: #3fb8ff;
    --cyan-soft: #9ff3ff;
    --violet: #b14bff;
    --indigo: #5b2bd6;
    --amber: #ffb547;
    --pink: #ff4f8b;
    --green: #5cf2c4;

    --accent: var(--cyan);
    --accent-2: var(--violet);
    --gradient: linear-gradient(120deg, var(--cyan-soft) 0%, var(--cyan) 30%, var(--violet) 70%, var(--pink) 100%);
    --gradient-accent: linear-gradient(120deg, var(--accent), var(--accent-2));

    --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Space Grotesk", var(--font-sans);
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --radius-xl: 30px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.75), 0 8px 24px -8px rgba(0, 0, 0, 0.5);

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

    --header-h: 72px;
    --gutter: clamp(16px, 4vw, 32px);
    --max-w: 1200px;
    --narrow-w: 780px;
}

@property --angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

/* --- Reset ---------------------------------------------------------------- */

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 24px);
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.65;
    font-feature-settings: "cv11", "ss01", "ss03";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img, picture, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
figure { margin: 0; }
dialog { padding: 0; border: 0; color: inherit; }
code, kbd, pre, samp { font-family: var(--font-mono); font-size: 0.92em; }
::selection { background: color-mix(in srgb, var(--violet) 55%, transparent); color: #fff; }

:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
    border-radius: 6px;
}

/* --- Utilities ------------------------------------------------------------ */

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

.skip-link {
    position: fixed;
    top: 12px; left: 12px;
    z-index: 1000;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--text);
    color: var(--bg);
    font-weight: 600;
    transform: translateY(-200%);
    transition: transform 0.2s var(--ease-out);
}
.skip-link:focus { transform: none; }

.gradient-text {
    background: var(--gradient);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradient-pan 8s linear infinite;
}

@keyframes gradient-pan {
    to { background-position: 200% center; }
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--cyan-soft);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.pulse-dot {
    position: relative;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 12px var(--green);
}
.pulse-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--green);
    animation: pulse 2.4s var(--ease-out) infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(3.2); opacity: 0; }
}

.icon {
    width: 1.15em;
    height: 1.15em;
    flex: none;
    display: inline-block;
    vertical-align: -0.2em;
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6em;
    padding: 2px 6px;
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.4;
}

/* --- Scroll reveal ---------------------------------------------------------
   Elements start hidden only when scripting is on. A fallback animation shows them
   after a few seconds in case the script never runs; main.js cancels it on start. */

@media (scripting: enabled) {
    [data-reveal]:not(.is-visible) {
        opacity: 0;
        transform: translate3d(0, 22px, 0);
        animation: reveal-fallback 0.6s 3s forwards;
    }
    .reveal-ready [data-reveal]:not(.is-visible) { animation: none; }
}

[data-reveal] {
    transition:
        opacity 0.8s var(--ease-out),
        transform 0.9s var(--ease-out);
    transition-delay: calc(min(var(--i, 0), 8) * 80ms);
}

@keyframes reveal-fallback {
    to { opacity: 1; transform: none; }
}

/* --- Page transitions (cross-document View Transitions) ------------------- */

@view-transition { navigation: auto; }

::view-transition-old(root) { animation: vt-out 0.25s var(--ease-in-out) both; }
::view-transition-new(root) { animation: vt-in 0.35s var(--ease-out) both; }

@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* --- Reduced motion ------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        transition-delay: 0s !important;
    }
    [data-reveal]:not(.is-visible) { opacity: 1 !important; transform: none !important; }
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
