/* Fonts (self-hosted, OFL licences in assets/fonts). Variable weights; the latin-ext subset
   holds the Polish letters (ą, ę, ł, ś, ż…) and is only downloaded when such a letter is on the page. */

@font-face {
    font-family: "Geist";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/geist-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Geist";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/geist-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: "Inter";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("../fonts/inter-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("../fonts/inter-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;
}

:root {
    --color-background: #09060f;
    --color-text: #f1eaf9;
    --color-text-muted: #a99bbd;
    --color-accent-warm: #ffd49a;
    --color-surface-hover: rgba(255, 255, 255, 0.06);
    --font-heading: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
    color-scheme: dark;
}

body {
    margin: 0;
    background: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
}

/* Header */

.site-header {
    position: absolute;
    inset: 0 0 auto;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px clamp(16px, 4vw, 40px);
}

.site-header__brand {
    font-family: var(--font-heading);
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.01em;
}

.language-switcher {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.language-switcher a {
    display: block;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    letter-spacing: 0.06em;
    text-decoration: none;
    text-transform: uppercase;
}

.language-switcher a:hover,
.language-switcher a[aria-current="page"] {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

/* On the home page the header waits for the hero intro (class set by hero-animation.js). */
.js .page-home .site-header {
    opacity: 0;
    transition: opacity 1.2s ease;
}

.js .page-home.is-hero-revealed .site-header {
    opacity: 1;
}

/* Hero */

.hero {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 50%, transparent 45%, rgba(0, 0, 0, 0.65) 100%),
        var(--color-background);
}

/* Ambient light around the icon, switched on by the flash (.is-lit). Kept dim so the lines stay the brightest thing. */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 45% 40% at 50% 42%, rgba(110, 40, 190, 0.22), transparent 70%),
        radial-gradient(ellipse 22% 20% at 50% 42%, rgba(255, 120, 20, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 2.5s ease;
    pointer-events: none;
}

.hero.is-lit::before {
    opacity: 1;
}

.hero__canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hero__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 96px 16px;
    text-align: center;
}

.hero__icon {
    position: relative;
    width: clamp(120px, 24vw, 210px);
    aspect-ratio: 1;
    overflow: hidden;
    /* The source icon is a full-bleed square; corners are rounded here (iOS-like ratio). */
    border-radius: 22.5%;
    /* Thin rim only; the glow around the icon is drawn on the canvas (hero-animation.js). */
    box-shadow: 0 0 0 1px rgba(255, 220, 130, 0.55);
    will-change: transform, opacity;
}

.hero__icon img {
    width: 100%;
}

/* Warm inner rim, as if the glow behind the icon bleeds over its edges. */
.hero__icon::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    box-shadow:
        inset 0 0 0 1px rgba(255, 236, 180, 0.6),
        inset 0 0 14px 2px rgba(255, 170, 60, 0.55);
    pointer-events: none;
}

.hero__icon::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%);
    transform: translateX(-110%);
    pointer-events: none;
}

.hero__icon.is-shining::after {
    animation: hero-icon-shine 1.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes hero-icon-shine {
    to {
        transform: translateX(110%);
    }
}

.hero__title {
    margin: 2.5rem 0 0;
    /* Gradient fill is on the letters (see .hero__title .animated-text__part). */
    color: transparent;
    font-size: clamp(2.75rem, 9vw, 4.5rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.hero__tagline {
    max-width: 28ch;
    text-wrap: balance;
    margin: 1rem 0 0;
    color: var(--color-text-muted);
    font-size: clamp(1.125rem, 2.6vw, 1.5rem);
    line-height: 1.4;
    /* Dark halo in the background colour keeps the text readable over glowing lines. */
    text-shadow:
        0 0 2px var(--color-background),
        0 0 8px var(--color-background),
        0 0 18px var(--color-background);
}

.hero__status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 2rem 0 0;
    padding: 7px 16px;
    border: 1px solid rgba(255, 184, 80, 0.35);
    border-radius: 999px;
    /* Opaque dark base under the tint, so lines behind the pill do not show through. */
    background:
        linear-gradient(rgba(255, 160, 40, 0.08), rgba(255, 160, 40, 0.08)),
        var(--color-background);
    color: var(--color-accent-warm);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Small glowing dot, like a node of the network. */
.hero__status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffc46b;
    box-shadow: 0 0 8px 2px rgba(255, 150, 30, 0.7);
    animation: hero-status-pulse 2.4s ease-in-out infinite;
}

@keyframes hero-status-pulse {
    50% {
        opacity: 0.45;
        box-shadow: 0 0 4px 1px rgba(255, 150, 30, 0.4);
    }
}

/* Initial state is hidden only when JS runs, so content stays visible without it. */
.js .hero__icon {
    opacity: 0;
}

.js .hero__icon.is-ready {
    opacity: 1;
}

.js .hero__reveal {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(10px);
    transition:
        opacity 1.1s ease,
        transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1),
        filter 1.1s ease;
}

.js .hero__reveal.is-visible {
    opacity: 1;
    transform: none;
    filter: blur(0);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Split text (animated_letters / animated_words): the parts animate, not the whole block. */
.js .hero__reveal--parts {
    opacity: 1;
    transform: none;
    filter: none;
}

/* Transforms do not apply to inline boxes. */
.animated-text__part {
    display: inline-block;
}

/* The gradient sits on each letter: background-clip: text on the parent breaks once children are transformed. */
.hero__title .animated-text__part {
    background: linear-gradient(180deg, #ffffff 0%, #e2d4f5 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.js .hero__reveal--parts .animated-text__part {
    opacity: 0;
}

.js .hero__title .animated-text__part {
    transform: translateY(0.45em) scale(0.92);
    filter: blur(12px);
    transition:
        opacity 0.9s ease,
        transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1),
        filter 0.9s ease;
    transition-delay: calc(var(--index) * 70ms);
}

/* Warm glint running across the letters once they have landed. Starts after the slowest letter's entry ends. */
.js .hero__title.is-visible .animated-text__part {
    opacity: 1;
    transform: none;
    filter: blur(0);
    animation: hero-letter-glint 1s ease-in-out calc(1400ms + var(--index) * 65ms);
}

@keyframes hero-letter-glint {
    0%,
    100% {
        filter: brightness(1) drop-shadow(0 0 0 rgba(255, 170, 60, 0));
    }

    40% {
        filter: brightness(1.5) drop-shadow(0 0 10px rgba(255, 170, 60, 0.75));
    }
}

.js .hero__tagline .animated-text__part {
    transform: translateY(0.3em);
    filter: blur(8px);
    transition:
        opacity 0.8s ease,
        transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1),
        filter 0.8s ease;
    transition-delay: calc(var(--index) * 90ms);
}

.js .hero__tagline.is-visible .animated-text__part {
    opacity: 1;
    transform: none;
    filter: blur(0);
}

/* Pill: pops in, its dot ignites like a network node and sends out one ring of light. */
.hero__status {
    position: relative;
}

.js .hero__status {
    transform: translateY(16px) scale(0.94);
}

.hero__status::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
}

.js .hero__status.is-visible::after {
    animation: hero-status-ring 1.2s ease-out 0.45s both;
}

@keyframes hero-status-ring {
    from {
        box-shadow: 0 0 0 0 rgba(255, 184, 80, 0.55);
    }

    to {
        box-shadow: 0 0 0 16px rgba(255, 184, 80, 0);
    }
}

.js .hero__status::before {
    animation: none;
    opacity: 0.15;
}

.js .hero__status.is-visible::before {
    animation:
        hero-status-ignite 0.8s ease-out 0.3s both,
        hero-status-pulse 2.4s ease-in-out 1.1s infinite;
}

@keyframes hero-status-ignite {
    from {
        opacity: 0.15;
        transform: scale(0.4);
        box-shadow: 0 0 0 0 rgba(255, 150, 30, 0);
    }

    50% {
        opacity: 1;
        transform: scale(1.8);
        box-shadow: 0 0 14px 5px rgba(255, 170, 50, 0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 8px 2px rgba(255, 150, 30, 0.7);
    }
}

@media (prefers-reduced-motion: reduce) {
    .js .hero__reveal,
    .js .hero__reveal--parts .animated-text__part,
    .js .page-home .site-header {
        transition: none;
    }

    .js .hero__title.is-visible .animated-text__part,
    .js .hero__status.is-visible::after {
        animation: none;
    }

    .js .hero__status.is-visible::before {
        animation: none;
        opacity: 1;
    }

    .hero::before {
        transition: none;
    }

    .hero__icon.is-shining::after,
    .hero__status::before {
        animation: none;
    }
}

/* Generic pages */

.page-message {
    display: grid;
    place-content: center;
    min-height: 70vh;
    padding: 96px 16px;
    text-align: center;
}

.page-message p {
    color: var(--color-text-muted);
}

/* Footer */

.site-footer {
    padding: 32px 16px;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    text-align: center;
}

.site-footer p {
    margin: 0;
}

.site-footer .site-footer__links {
    margin-top: 8px;
}

.site-footer a {
    text-decoration-color: rgba(169, 155, 189, 0.4);
    text-underline-offset: 3px;
}

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