/* Space Grotesk (SIL Open Font License, see fonts/OFL.txt), a variable font covering 400–700 */
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('fonts/space-grotesk-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('fonts/space-grotesk-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --hue is set per domain by theme.js; 245 is the original indigo */
:root {
    --hue: 245;
}

html {
    background: hsl(var(--hue) 55% 10%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(135deg, hsl(var(--hue) 55% 10%), hsl(var(--hue) 40% 28%), hsl(calc(var(--hue) - 5) 27% 19%));
    color: #ffffff;
    /* Let touch drags reach the particles instead of being taken over as page pans */
    touch-action: pinch-zoom;
    /* Clicking for shockwaves shouldn't select the title */
    -webkit-user-select: none;
    user-select: none;
}

#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    height: 100dvh;
    text-align: center;
    padding: 20px;
}

h1 {
    max-width: 100%;
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(2rem, 8vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
    background: linear-gradient(135deg, hsl(calc(var(--hue) - 16) 76% 66%) 0%, hsl(calc(var(--hue) + 25) 40% 55%) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
}

/* script.js splits the title into letters that move on their own. Moving letters lose a shared
   background-clip gradient, so each letter carries the slice of the gradient under it instead,
   lined up through --letter-x/y and the title's size (set by script.js). */
h1.split {
    background: none;
    /* Live light, driven by script.js: --flow slides a highlight band through the gradient,
       --spot-* place a soft light under the cursor (title coordinates) */
    --flow: 0px;
    --spot-x: 0px;
    --spot-y: 0px;
    --spot-radius: 140px;
    --spot-strength: 0;
}

.letter {
    display: inline-block;
    /* Room for descenders inside the clipped background, without changing the line height */
    padding: 0.12em 0 0.18em;
    margin: -0.12em 0 -0.18em;
    /* Two layers, both lined up to the whole title: the cursor's light on top, and a gradient
       three titles wide (base colors with a bright band in the middle) that --flow slides along */
    background-image:
        radial-gradient(circle var(--spot-radius) at var(--spot-x) var(--spot-y), hsl(calc(var(--hue) - 16) 85% 88% / var(--spot-strength)), transparent),
        linear-gradient(110deg,
            hsl(calc(var(--hue) - 16) 76% 66%) 0%,
            hsl(calc(var(--hue) + 25) 40% 55%) 30%,
            hsl(calc(var(--hue) - 10) 85% 82%) 50%,
            hsl(calc(var(--hue) + 25) 40% 55%) 70%,
            hsl(calc(var(--hue) - 16) 76% 66%) 100%);
    background-size:
        var(--title-width) var(--title-height),
        calc(var(--title-width) * 3) var(--title-height);
    background-position:
        calc(-1 * var(--letter-x)) calc(-1 * var(--letter-y)),
        calc(-1 * var(--letter-x) - var(--flow)) calc(-1 * var(--letter-y));
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    will-change: transform;
}

/* The extension (.ro, .com) reads as a quieter suffix to the name, like in a logo */
.letter.tld {
    font-weight: 400;
    opacity: 0.55;
}

/* Custom cursor: a glowing dot with a trailing ring, positioned by script.js.
   Only for mouse users with motion enabled; everyone else keeps the system cursor. */
.cursor-dot,
.cursor-ring {
    display: none;
}

@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
    body {
        cursor: none;
    }

    .cursor-dot,
    .cursor-ring {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 3;
        border-radius: 50%;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
        will-change: transform;
    }

    body.has-cursor .cursor-dot,
    body.has-cursor .cursor-ring {
        opacity: 1;
    }
}

.cursor-dot {
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    background: hsl(calc(var(--hue) - 16) 76% 80%);
    box-shadow: 0 0 12px 3px hsl(calc(var(--hue) - 16) 76% 66% / 0.7);
}

.cursor-ring {
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 1.5px solid hsl(calc(var(--hue) - 16) 76% 66% / 0.6);
}

@media (max-width: 768px) {
    .content {
        padding: 40px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    h1 {
        animation: none;
    }
}
