:root {
    --tressia-bg: #f8f3ee;
    --tressia-ink: #1f1628;
    --tressia-muted: #62556e;
    --tressia-primary: #7b2ff2;
    --tressia-rose: #e35d9a;
    --tressia-amber: #f0b56f;
    --glass-bg: rgba(255, 255, 255, 0.48);
    --glass-border: rgba(255, 255, 255, 0.7);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
    color: var(--tressia-ink);
    background: var(--tressia-bg);
    min-height: 100vh;
    overflow-x: hidden;
}

.aurora-bg,
.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.aurora-bg {
    z-index: 0;
    background:
        radial-gradient(circle at 12% 20%, rgba(123, 47, 242, 0.2), transparent 38%),
        radial-gradient(circle at 86% 26%, rgba(227, 93, 154, 0.25), transparent 36%),
        radial-gradient(circle at 70% 88%, rgba(240, 181, 111, 0.25), transparent 40%),
        linear-gradient(180deg, #fffaf4 0%, #f8f3ee 40%, #f5efe8 100%);
    filter: saturate(1.1);
}

.grain {
    z-index: 1;
    opacity: 0.08;
    background-image: radial-gradient(circle at center, rgba(31, 22, 40, 0.22) 0.5px, transparent 0.5px);
    background-size: 3px 3px;
}

.hero-section {
    padding-top: clamp(2rem, 6vw, 6rem);
    padding-bottom: clamp(3rem, 9vw, 8rem);
}

.sticky-header {
    position: relative;
    z-index: 1030;
}

.page-main {
    padding-top: 0;
}

.sticky-header.is-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    animation: navIn 0.22s ease-out;
}

.sticky-header .glass-nav {
    background: rgba(255, 255, 255, 0.72);
    transition: background-color 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(127, 98, 168, 0.2);
    color: var(--tressia-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    background: rgba(255, 255, 255, 0.58);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.nav-pill:hover,
.nav-pill.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--tressia-primary), var(--tressia-rose));
}

.sticky-header.is-stuck .glass-nav {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.95);
    box-shadow:
        0 14px 32px rgba(76, 45, 122, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

@keyframes navIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.glass-nav,
.glass-card,
.glass-form {
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    box-shadow:
        0 8px 26px rgba(76, 45, 122, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
}

.glass-form {
    border-radius: 18px;
}

.glass-form .form-control {
    border-radius: 12px;
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.72);
}

.btn-primary {
    --bs-btn-bg: var(--tressia-primary);
    --bs-btn-border-color: var(--tressia-primary);
    --bs-btn-hover-bg: #6b1fe2;
    --bs-btn-hover-border-color: #6b1fe2;
    --bs-btn-active-bg: #5f19ca;
    --bs-btn-active-border-color: #5f19ca;
    box-shadow: 0 10px 24px rgba(123, 47, 242, 0.3);
}

.brand-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(123, 47, 242, 0.24));
}

.device-scene {
    position: relative;
    perspective: 1400px;
    transform-style: preserve-3d;
    min-height: 460px;
}

.phone-stack {
    position: relative;
    width: min(100%, 460px);
    margin-inline: auto;
    transform-style: preserve-3d;
    transition: transform 0.16s ease-out;
}

.phone-card {
    border-radius: 26px;
}

.phone-main {
    position: relative;
    z-index: 3;
    transform: rotateY(-8deg) rotateX(6deg) translateZ(25px);
}

.app-mockup-wrap {
    margin: 0;
    display: grid;
    place-items: center;
}

.app-mockup {
    width: min(100%, 420px);
    height: auto;
    filter: drop-shadow(0 28px 40px rgba(24, 16, 38, 0.22));
}

.phone-back {
    position: absolute;
    inset: 22% -4% -8% 22%;
    z-index: 2;
    transform: rotateY(-18deg) rotateX(10deg) translateZ(-45px);
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.78);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    z-index: 1;
}

.orb-a {
    width: 160px;
    height: 160px;
    top: -10%;
    right: 8%;
    background: radial-gradient(circle at 30% 30%, rgba(123, 47, 242, 0.48), rgba(123, 47, 242, 0));
}

.orb-b {
    width: 220px;
    height: 220px;
    left: -12%;
    bottom: -7%;
    background: radial-gradient(circle at 50% 50%, rgba(227, 93, 154, 0.4), rgba(227, 93, 154, 0));
}

.feature-card {
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow:
        0 24px 42px rgba(82, 46, 135, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.icon-wrap {
    width: 3rem;
    height: 3rem;
    border-radius: 14px;
    display: grid;
    place-content: center;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--tressia-primary), var(--tressia-rose));
}

.timeline-track {
    position: relative;
    display: grid;
    gap: 0.9rem;
}

.timeline-step {
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(127, 98, 168, 0.25);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--tressia-muted);
}

.timeline-step.active {
    color: #fff;
    background: linear-gradient(130deg, var(--tressia-primary), var(--tressia-rose));
    border-color: transparent;
}

.reveal-up {
    opacity: 1;
    transform: none;
}

.js-ready .reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.js-ready .reveal-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.legal-sheet {
    max-width: 980px;
    margin-inline: auto;
}

.legal-content h2 {
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.legal-content p,
.legal-content li {
    color: var(--tressia-muted);
    line-height: 1.72;
}

.legal-content ul {
    padding-left: 1.2rem;
}

.legal-content a {
    color: var(--tressia-primary);
}

@media (min-width: 1200px) {
    .phone-stack {
        width: min(100%, 760px);
        transform-style: preserve-3d;
    }

    .app-mockup {
        width: min(100%, 520px);
    }

    .phone-main {
        transform: rotateY(-10deg) rotateX(6deg) translate3d(-38%, -4%, 42px);
        position: relative;
        z-index: 6;
    }

    .phone-back {
        inset: auto 0 1% 16%;
        width: auto;
        min-height: 250px;
        transform: rotateY(-8deg) rotateX(4deg) translateZ(-10px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 2rem 2rem 2rem clamp(12rem, 20vw, 15rem);
        opacity: 1;
        z-index: 3;
        background: rgba(255, 255, 255, 0.9);
    }
}

@media (min-width: 1400px) {
    .phone-stack {
        width: min(100%, 820px);
    }

    .phone-main {
        transform: rotateY(-10deg) rotateX(6deg) translate3d(-42%, -5%, 44px);
    }

    .phone-back {
        inset: auto 0 0% 22%;
        min-height: 270px;
        padding-left: clamp(13rem, 21vw, 16rem);
    }
}

@media (max-width: 991px) {
    .phone-main,
    .phone-back {
        transform: none;
    }

    .phone-back {
        position: relative;
        inset: auto;
        margin-top: -24px;
    }

    .device-scene {
        min-height: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
