:root {
    --grad: linear-gradient(135deg, #a69df4 0%, #5050b5 100%);
    --bg: #0f0d1c;
    --bg-deep: #08070f;
    --bg-lift: #1c1930;
    --text: #ffffff;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg-deep);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Film grain over the whole page, including the hero video. */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0.055;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- Hero ---------- */
.hero {
    position: sticky;
    top: 0;
    height: 100svh;
    min-height: 34rem;
    display: grid;
    place-items: center;
    overflow: hidden;
    z-index: 0;
    will-change: opacity;
}
.hero__bg {
    position: absolute;
    inset: -2%;
    transform-origin: center;
    will-change: transform;
}
.hero__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}
.hero__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(180deg, rgba(15, 13, 28, 0.55) 0%, rgba(15, 13, 28, 0.35) 45%, rgba(15, 13, 28, 0.95) 100%),
        linear-gradient(135deg, rgba(166, 157, 244, 0.28) 0%, rgba(80, 80, 181, 0.42) 100%);
    pointer-events: none;
}
.hero__inner {
    position: relative;
    text-align: center;
    padding: 0 1.5rem;
    will-change: transform, opacity;
}
.hero__title {
    margin: 0;
    font-size: clamp(5rem, 22vw, 15rem);
    font-weight: 900;
    line-height: 0.85;
    letter-spacing: -0.055em;
    color: var(--text);
}
.hero__subtitle {
    margin: clamp(1.25rem, 3vw, 2rem) 0 0;
    font-size: clamp(0.95rem, 2.6vw, 1.4rem);
    font-weight: 500;
    letter-spacing: 0.42em;
    text-indent: 0.42em;
    text-transform: uppercase;
    color: var(--text);
}
.hero__scroll {
    position: absolute;
    left: 50%;
    bottom: clamp(1.75rem, 5vh, 3rem);
    transform: translateX(-50%);
    display: grid;
    justify-items: center;
    gap: 0.6rem;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text);
}
.icon {
    width: 1.25rem;
    height: 1.15rem;
    flex: none;
    object-fit: contain;
}
.icon--chevron { width: 0.9rem; height: 0.9rem; }
.icon--pill { width: 0.85rem; height: 0.85rem; }
.hero__scroll .icon { animation: bob 2.2s ease-in-out infinite; }
@keyframes bob {
    0%, 100% { transform: translateY(0); opacity: .6; }
    50% { transform: translateY(6px); opacity: 1; }
}

/* ---------- Content ---------- */
.content {
    position: relative;
    z-index: 1;
    background-color: var(--bg);
    background-image: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}
.content::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 5rem;
    background: linear-gradient(to top, rgb(15, 13, 28) 0%, rgba(15, 13, 28, 0) 100%);
    pointer-events: none;
}
.wrap {
    max-width: 64rem;
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 5vw, 3rem);
}
.section {
    display: grid;
    grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
    gap: clamp(1.5rem, 5vw, 3.5rem);
    padding: clamp(3rem, 6vw, 4.75rem) 0;
}
.section + .section { border-top: 1px solid rgba(255, 255, 255, 0.06); }

.section__label {
    margin: 0.6rem 0 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--text);
}
.section__title {
    margin: 0 0 1.5rem;
    font-size: clamp(1.9rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.1;
}

.lede {
    max-width: 46rem;
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.75;
    color: var(--text);
}

@media (max-width: 52rem) {
    .section { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .section__label { margin: 0 0 1.25rem; }
}

/* ---------- Project ---------- */
.project__title {
    margin: 0 0 1.25rem;
    font-size: clamp(1.5rem, 3.5vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.025em;
}
.project__title a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
.lede b { color: var(--text); font-weight: 600; }
.stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 1.75rem 0 0;
    padding: 0;
    list-style: none;
}
.stack li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.42rem 0.9rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text);
    background: var(--bg-lift);
}

/* ---------- Connections ---------- */
.links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.3rem;
}
.link {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    font-size: clamp(1.05rem, 2.4vw, 1.3rem);
    font-weight: 600;
    letter-spacing: -0.015em;
}
.link .icon { width: 1.4rem; }
.link:hover .link__handle { text-decoration: underline; text-underline-offset: 0.35em; }

/* ---------- Contact ---------- */
.contact .lede { margin: 0 0 2.25rem; }
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.95rem 2rem;
    border-radius: 99px;
    font-weight: 600;
    color: var(--text);
    background: var(--grad);
    transition: transform .25s ease, filter .25s ease;
}
.btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.08);
}

/* ---------- Footer ---------- */
.footer {
    padding: 2.5rem 0 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text);
}

/* ---------- Reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .7s cubic-bezier(.22, 1, .36, 1), transform .7s cubic-bezier(.22, 1, .36, 1);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}
