/* ==========================================================
   russofrancesco.com
   File: style.css
   Description: Complete single-page visual system
   Author: Francesco Russo
========================================================== */

/* ==========================================================
   RESET
========================================================== */

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

html {
    min-height: 100%;
    background: #080a0d;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100%;
    overflow-x: hidden;
}

/* ==========================================================
   DESIGN TOKENS
========================================================== */

:root {
    --background: #080a0d;
    --background-elevated: rgba(255, 255, 255, 0.045);

    --text-primary: #f5f7fa;
    --text-secondary: #9299a5;
    --text-tertiary: #626975;
    --accent-primary: #91B8FF;

    --border: rgba(255, 255, 255, 0.09);
    --border-hover: rgba(255, 255, 255, 0.19);

    --icon: #8d949f;
    --icon-hover: #ffffff;

    --glow-primary: rgba(81, 103, 255, 0.13);
    --glow-secondary: rgba(112, 76, 255, 0.08);

    --page-width: 1440px;
    --page-padding-desktop: 64px;
    --page-padding-tablet: 40px;
    --page-padding-mobile: 24px;

    --header-height: 96px;
    --footer-height: 72px;

    --transition-fast: 180ms ease;
    --transition-standard: 320ms cubic-bezier(0.22, 1, 0.36, 1);

    --font-family:
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Display",
        "SF Pro Text",
        "Helvetica Neue",
        Arial,
        sans-serif;
}

/* ==========================================================
   BASE
========================================================== */

body {
    position: relative;

    color: var(--text-primary);
    background:
        radial-gradient(
            circle at 78% 18%,
            rgba(72, 87, 184, 0.07),
            transparent 28%
        ),
        linear-gradient(
            145deg,
            #080a0d 0%,
            #090b0f 48%,
            #07090c 100%
        );

    font-family: var(--font-family);
    font-weight: 400;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

::selection {
    color: #080a0d;
    background: #f5f7fa;
}

/* ==========================================================
   AMBIENT BACKGROUND
========================================================== */

.page-glow {
    position: fixed;
    z-index: 0;

    width: 44rem;
    height: 44rem;

    border-radius: 50%;

    pointer-events: none;

    filter: blur(110px);
    opacity: 0.75;
}

.page-glow--top {
    top: -29rem;
    right: -14rem;

    background: var(--glow-primary);
}

.page-glow--bottom {
    bottom: -35rem;
    left: -22rem;

    background: var(--glow-secondary);
}

/* Subtle texture generated entirely through CSS */

body::before {
    position: fixed;
    z-index: 1;
    inset: 0;

    content: "";

    pointer-events: none;

    opacity: 0.025;

    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.14) 0,
            rgba(255, 255, 255, 0.14) 1px,
            transparent 1px,
            transparent 3px
        );

    mix-blend-mode: soft-light;
}

/* ==========================================================
   PAGE STRUCTURE
========================================================== */

.site-shell {
    position: relative;
    z-index: 2;

    display: grid;
    grid-template-rows:
        var(--header-height)
        minmax(0, 1fr)
        var(--footer-height);

    width: min(100%, var(--page-width));
    min-height: 100vh;
    min-height: 100svh;

    margin: 0 auto;
    padding-inline:
        max(
            var(--page-padding-desktop),
            env(safe-area-inset-left)
        );
}

/* ==========================================================
   HEADER
========================================================== */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border);

    opacity: 0;

    animation:
        reveal-header 700ms
        cubic-bezier(0.22, 1, 0.36, 1)
        80ms forwards;
}

.brand {
    position: relative;

    color: var(--text-primary);

    font-size: 0.98rem;
    font-weight: 560;
    letter-spacing: -0.018em;
    line-height: 1;

    text-decoration: none;

    transition:
        color var(--transition-fast),
        opacity var(--transition-fast);
}

.brand::after {
    position: absolute;

    right: 0;
    bottom: -7px;
    left: 0;

    height: 1px;

    content: "";

    background: currentColor;

    transform: scaleX(0);
    transform-origin: right;

    transition: transform var(--transition-standard);
}

.brand:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.social-navigation {
    display: flex;
    align-items: center;

    padding: 5px;

    border: 1px solid var(--border);
    border-radius: 999px;

    background: var(--background-elevated);

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.025);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.social-link {
    display: grid;
    place-items: center;

    width: 36px;
    height: 36px;

    border-radius: 50%;

    color: var(--icon);

    text-decoration: none;

    transition:
        color var(--transition-fast),
        background-color var(--transition-fast),
        transform var(--transition-standard);
}

.social-link svg {
    width: 17px;
    height: 17px;

    overflow: visible;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.social-link .icon-fill {
    fill: currentColor;
    stroke: none;
}

.social-link:hover {
    color: var(--icon-hover);
    background: rgba(255, 255, 255, 0.075);

    transform: translateY(-1px);
}

.social-link:active {
    transform: translateY(0) scale(0.96);
}

.social-link:focus-visible,
.brand:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.72);
    outline-offset: 4px;
}

.navigation-divider {
    width: 1px;
    height: 16px;

    background: var(--border);
}

/* ==========================================================
   HERO
========================================================== */

.hero {
    display: flex;
    align-items: center;
    padding-block: 80px;
}

.hero-content {
    max-width: 1050px;
}

.hero-line {
    color: var(--text-secondary);

    font-size: clamp(2.8rem, 6vw, 6.75rem);
    font-weight: 560;
    letter-spacing: -0.058em;
    line-height: 0.99;

    opacity: 0;
    transform: translateY(26px);

    animation:
        reveal-line 900ms
        cubic-bezier(0.22, 1, 0.36, 1)
        forwards;
}

.hero-line--primary {
    color: var(--accent-primary);
    animation-delay: 220ms;
}

.hero-secondary {
    margin-top: clamp(28px, 4vw, 52px);
}

.hero-secondary .hero-line:first-child {
    animation-delay: 340ms;
}

.hero-secondary .hero-line:last-child {
    animation-delay: 440ms;
}

/* ==========================================================
   FOOTER
========================================================== */

.site-footer {
    display: flex;
    align-items: center;

    border-top: 1px solid var(--border);

    color: var(--text-tertiary);

    font-size: 0.78rem;
    font-weight: 450;
    letter-spacing: 0.01em;

    opacity: 0;

    animation:
        reveal-footer 700ms
        cubic-bezier(0.22, 1, 0.36, 1)
        600ms forwards;
}

/* ==========================================================
   ANIMATIONS
========================================================== */

@keyframes reveal-header {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

@keyframes reveal-line {
    from {
        opacity: 0;
        transform: translateY(26px);
        filter: blur(7px);
    }

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

@keyframes reveal-footer {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 1024px) {
    .site-shell {
        padding-inline:
            max(
                var(--page-padding-tablet),
                env(safe-area-inset-left)
            );
    }

    .hero-line {
        font-size: clamp(3.3rem, 8vw, 5.5rem);
    }
}

/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 640px) {

    :root {
        --header-height: 82px;
        --footer-height: 64px;
    }

    .site-shell {
        padding-inline:
            max(
                var(--page-padding-mobile),
                env(safe-area-inset-left)
            );
    }

    .site-header {
        gap: 20px;
    }

    .brand {
        font-size: 0.9rem;
    }

    .social-navigation {
        padding: 3px;
    }

    .social-link {
        width: 32px;
        height: 32px;
    }

    .social-link svg {
        width: 15px;
        height: 15px;
    }

    .navigation-divider {
        height: 14px;
    }

    .hero {
        align-items: center;
        padding-block: 56px;
    }

    .hero-line {
        font-size: clamp(2.6rem, 13vw, 4.2rem);
        letter-spacing: -0.055em;
        line-height: 1.02;
    }

    .hero-secondary {
        margin-top: 30px;
    }

    .site-footer {
        font-size: 0.72rem;
    }

    .page-glow {
        width: 28rem;
        height: 28rem;
        filter: blur(85px);
    }
}

/* ==========================================================
   VERY SMALL SCREENS
========================================================== */

@media (max-width: 390px) {

    .site-shell {
        padding-inline: 18px;
    }

    .brand {
        max-width: 96px;
        line-height: 1.08;
    }

    .social-link {
        width: 30px;
        height: 30px;
    }

    .hero-line {
        font-size: clamp(2.35rem, 12.5vw, 3.15rem);
    }
}

/* ==========================================================
   REDUCED MOTION
========================================================== */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .site-header,
    .hero-line,
    .site-footer {
        opacity: 1;
        transform: none;
        filter: none;
    }
}