@font-face {
    font-family: "Source Sans 3";
    src: url("/assets/fonts/source-sans-3-400.woff2?v=0f73f35e08cd") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Cormorant Garamond";
    src: url("/assets/fonts/cormorant-garamond-500.woff2?v=8197bf53615d") format("woff2");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

:root {
    /* Deep midnight void */
    --space-dark: #07090f;

    /* Cor Caroli A: A-type star (Intense blue-white) */
    --star-a-color: #d8e8ff;
    --star-a-glow: rgba(216, 232, 255, 0.25);
    --star-a-flare: rgba(216, 232, 255, 0.6);

    /* Cor Caroli B: F-type star (Soft yellow-white) */
    --star-b-color: #fcf4d9;
    --star-b-glow: rgba(252, 244, 217, 0.15);
    --star-b-flare: rgba(252, 244, 217, 0.4);

    /* Typography colors */
    --text-main: #f4f6fa;
    --text-muted: #9ca5b8;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: var(--space-dark);
    color: var(--text-main);
    font-family: "Source Sans 3", "Optima", system-ui, -apple-system, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

.stars {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
}

/* DEPTH LAYER 1: The Farthest Field */
body::before {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    opacity: 0.35;
    background-image:
        radial-gradient(1px 1px at 20px 30px, #ffffff, transparent),
        radial-gradient(1px 1px at 80px 70px, #ffffff, transparent),
        radial-gradient(1.5px 1.5px at 130px 40px, #ffffff, transparent),
        radial-gradient(1px 1px at 190px 100px, #ffffff, transparent);
    background-size: 300px 300px;
    animation: starDrift_Deep 180s linear infinite;
}

/* DEPTH LAYER 2: The Mid-Field */
#stars-mid {
    z-index: 1;
    opacity: 0.55;
    background-image:
        radial-gradient(1.5px 1.5px at 15px 15px, #ffffff, transparent),
        radial-gradient(1.5px 1.5px at 115px 95px, #ffffff, transparent),
        radial-gradient(2px 2px at 225px 55px, #ffffff, transparent),
        radial-gradient(1.5px 1.5px at 285px 175px, #ffffff, transparent);
    background-size: 400px 400px;
    animation: starDrift_Mid 100s linear infinite;
}

/* DEPTH LAYER 3: The Near Field */
#stars-near {
    z-index: 2;
    opacity: 0.75;
    background-image:
        radial-gradient(2px 2px at 50px 100px, #ffffff, transparent),
        radial-gradient(2.5px 2.5px at 150px 250px, #ffffff, transparent),
        radial-gradient(2px 2px at 300px 50px, #ffffff, transparent),
        radial-gradient(3px 3px at 450px 150px, #ffffff, transparent);
    background-size: 500px 500px;
    animation: starDrift_Near 40s linear infinite;
}

.container {
    width: min(100%, 34rem);
    padding: 0 1.5rem;
    box-sizing: border-box;
    text-align: center;
    animation: slowFadeIn 2.5s ease-out;
    position: relative;
    z-index: 5;
}

/* The Spectroscopic Binary Star Motif */
.star-system {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-bottom: 2rem;
    transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: default;
    padding: 10px;
}

/* Hover Effect: Orbital Shift */
.star-system:hover {
    transform: scale(1.1) rotate(15deg);
}

.star-primary {
    width: 5px;
    height: 5px;
    background-color: var(--star-a-color);
    border-radius: 50%;
    box-shadow: 0 0 14px 2px var(--star-a-glow);
    animation: pulse-primary 4s infinite alternate ease-in-out;
    transition: all 0.8s ease;
}

.star-secondary {
    width: 3px;
    height: 3px;
    background-color: var(--star-b-color);
    border-radius: 50%;
    box-shadow: 0 0 8px 1px var(--star-b-glow);
    animation: pulse-secondary 6s infinite alternate ease-in-out;
    transition: all 0.8s ease;
}

/* Hover Effect: Increased Luminosity */
.star-system:hover .star-primary {
    box-shadow: 0 0 24px 6px var(--star-a-flare);
    background-color: #ffffff;
}

.star-system:hover .star-secondary {
    box-shadow: 0 0 16px 4px var(--star-b-flare);
    background-color: #ffffff;
}

h1 {
    font-family: "Cormorant Garamond", "Didot", "Bodoni MT", "Times New Roman", serif;
    font-size: 2.5rem;
    font-weight: 500;
    letter-spacing: 6px;
    margin: 0;
    text-transform: lowercase;
}

.subtitle {
    font-size: 0.72rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 1.2rem;
    margin-bottom: 1rem;
    line-height: 1.45;
    text-wrap: balance;
}

.name-note {
    width: min(27rem, calc(100vw - 3rem));
    margin: 0 auto;
    color: var(--text-muted);
}

.name-note-label {
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-main);
    margin-bottom: 0.95rem;
}

.name-note p {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.9;
    letter-spacing: 0.03em;
    text-transform: none;
    color: rgba(244, 246, 250, 0.86);
    text-wrap: balance;
}

.closing-note {
    margin: 1.9rem auto 0;
    width: min(18rem, calc(100vw - 3rem));
    font-size: 0.78rem;
    line-height: 1.68;
    letter-spacing: 0.06em;
    text-transform: none;
    color: rgba(156, 164, 183, 0.92);
    text-align: center;
    text-wrap: balance;
}

.closing-note::before {
    content: "";
    display: block;
    width: 4.5rem;
    height: 1px;
    margin: 0 auto 0.95rem;
    background: linear-gradient(90deg, transparent, rgba(216, 232, 255, 0.3), transparent);
}

.corner-signature {
    position: fixed;
    right: 28px;
    bottom: 22px;
    z-index: 4;
    font-family: "Cormorant Garamond", "Didot", "Bodoni MT", "Times New Roman", serif;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.14rem;
    color: rgba(216, 232, 255, 0.44);
    text-shadow: 0 0 14px rgba(216, 232, 255, 0.14);
    opacity: 0.92;
    user-select: none;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.4s ease, text-shadow 0.4s ease, opacity 0.4s ease;
}

.corner-signature[data-state="loading"],
.corner-signature[data-state="error"] {
    pointer-events: none;
}

.corner-signature:hover,
.corner-signature:focus-visible {
    color: rgba(244, 246, 250, 0.8);
    text-shadow: 0 0 18px rgba(216, 232, 255, 0.28);
    opacity: 1;
    outline: none;
}

@keyframes slowFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
        filter: blur(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes pulse-primary {
    0% {
        box-shadow: 0 0 10px 1px rgba(216, 232, 255, 0.15);
        transform: scale(0.95);
    }

    100% {
        box-shadow: 0 0 22px 4px rgba(216, 232, 255, 0.4);
        transform: scale(1.05);
    }
}

@keyframes pulse-secondary {
    0% {
        box-shadow: 0 0 6px 1px rgba(252, 244, 217, 0.1);
    }

    100% {
        box-shadow: 0 0 12px 2px rgba(252, 244, 217, 0.25);
    }
}

@keyframes starDrift_Deep {
    from {
        background-position: 0 0;
    }

    to {
        background-position: -300px -300px;
    }
}

@keyframes starDrift_Mid {
    from {
        background-position: 0 0;
    }

    to {
        background-position: -400px -400px;
    }
}

@keyframes starDrift_Near {
    from {
        background-position: 0 0;
    }

    to {
        background-position: -500px -500px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1.1rem;
    }

    h1 {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }

    .subtitle {
        font-size: 0.62rem;
        letter-spacing: 2px;
        max-width: 14rem;
        margin-left: auto;
        margin-right: auto;
        line-height: 1.5;
    }

    .name-note {
        width: 100%;
    }

    .name-note-label {
        font-size: 0.64rem;
        letter-spacing: 2px;
    }

    .name-note p {
        font-size: 0.8rem;
        line-height: 1.85;
    }

    .closing-note {
        margin-top: 1.65rem;
        width: min(15rem, 100%);
        font-size: 0.72rem;
        line-height: 1.72;
        letter-spacing: 0.04em;
    }

    .closing-note::before {
        width: 3.5rem;
        margin-bottom: 0.8rem;
    }

    .corner-signature {
        right: 18px;
        bottom: 18px;
        max-width: 9rem;
        font-size: 0.6rem;
        letter-spacing: 0.1rem;
        line-height: 1.45;
        white-space: normal;
        text-align: right;
    }
}

@media (prefers-reduced-motion: reduce) {
    body::before,
    #stars-mid,
    #stars-near,
    .star-primary,
    .star-secondary {
        animation: none;
    }

    .star-system {
        transition: none;
    }

    .star-system:hover {
        transform: none;
    }
}
