/* PrepLoom — marketing & shell (home, features, about, revision) */
/* Enhanced with animations and premium visual effects */

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

:root {
    --pl-bg: #07080c;
    --pl-bg-elevated: #0e1018;
    --pl-surface: rgba(18, 20, 30, 0.72);
    --pl-border: rgba(255, 255, 255, 0.08);
    --pl-border-strong: rgba(255, 255, 255, 0.14);
    --pl-text: #f4f4f7;
    --pl-muted: rgba(244, 244, 247, 0.62);
    --pl-faint: rgba(244, 244, 247, 0.38);
    --pl-accent: #6c63ff;
    --pl-accent-soft: rgba(108, 99, 255, 0.18);
    --pl-accent-glow: rgba(108, 99, 255, 0.35);
    --pl-accent-light: #a78bfa;
    --pl-teal: #2dd4bf;
    --pl-teal-soft: rgba(45, 212, 191, 0.15);
    --pl-radius: 16px;
    --pl-radius-sm: 10px;
    --pl-max: 1120px;
    --pl-nav-h: 72px;
}

html { scroll-behavior: smooth; }

body.site {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--pl-bg);
    color: var(--pl-text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

[data-theme-icon] {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

[data-theme-icon] svg {
    width: 100%;
    height: 100%;
    display: block;
    stroke: currentColor;
}

/* ── Animated ambient background ─────────────────────────────── */
body.site::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(108, 99, 255, 0.22), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(45, 212, 191, 0.08), transparent),
        radial-gradient(ellipse 50% 30% at 0% 30%, rgba(108, 99, 255, 0.06), transparent);
    z-index: 0;
    animation: bgShift 30s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0% {
        background-position: 0% 0%;
        opacity: 1;
    }
    50% {
        background-position: 100% 100%;
        opacity: 0.85;
    }
    100% {
        background-position: 0% 0%;
        opacity: 1;
    }
}

/* Floating orbs */
body.site::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle 300px at 15% 60%, rgba(108,99,255,0.07), transparent),
        radial-gradient(circle 250px at 85% 80%, rgba(45,212,191,0.05), transparent);
    z-index: 0;
    animation: orbDrift 20s ease-in-out infinite alternate;
}

@keyframes orbDrift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, -30px); }
}

.site-wrap {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: none;
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-wrap.is-revealing {
    animation: contentReveal 1.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes contentReveal {
    0% { opacity: 0; transform: scale(0.96) translateY(10px); filter: blur(4px); }
    100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

/* ... existing scrollbar styles ... */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(108,99,255,0.3);
    border-radius: 99px;
    transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover { background: rgba(108,99,255,0.5); }

/* ── Nav ─────────────────────────────────────────────────────────────── */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--pl-nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    max-width: calc(var(--pl-max) + 3rem);
    margin: 0 auto;
    width: 100%;
    border-bottom: 1px solid var(--pl-border);
    background: rgba(7, 8, 12, 0.8);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    transition: background 0.3s ease;
}

.site-nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.5rem;
    right: 1.5rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(108,99,255,0.3), transparent);
    pointer-events: none;
}

.site-nav__brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--pl-text);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.04em;
    transition: opacity 0.2s ease;
}

.site-nav__brand:hover { opacity: 0.9; }

.site-nav__mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--pl-accent) 0%, #8b84ff 50%, var(--pl-teal) 100%);
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 900;
    color: #fff;
    box-shadow: 0 4px 20px var(--pl-accent-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.site-nav__brand:hover .site-nav__mark {
    transform: rotate(-5deg) scale(1.05);
    box-shadow: 0 6px 28px var(--pl-accent-glow);
}

.site-nav__links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

@media (max-width: 768px) {
    .site-nav {
        flex-wrap: wrap;
        height: auto;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        gap: 0.75rem;
    }
    .site-nav__links {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    .site-nav__auth {
        margin-left: auto;
    }
}

.site-nav__link {
    padding: 0.5rem 0.85rem;
    border-radius: var(--pl-radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--pl-muted);
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
    position: relative;
}

.site-nav__link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 1.5px;
    background: var(--pl-accent);
    border-radius: 99px;
    transition: transform 0.2s ease;
}

.site-nav__link:hover {
    color: var(--pl-text);
    background: rgba(255, 255, 255, 0.04);
}

.site-nav__link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.site-nav__link--active {
    color: var(--pl-text);
    background: rgba(255, 255, 255, 0.06);
}

.site-nav__link--active::after {
    transform: translateX(-50%) scaleX(1);
    background: var(--pl-accent);
}

.site-nav__link--cta {
    background: var(--pl-accent);
    color: #fff !important;
    font-weight: 600;
    margin-left: 0.35rem;
    box-shadow: 0 2px 16px var(--pl-accent-glow);
    position: relative;
    overflow: hidden;
}

.site-nav__link--cta::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: rgba(255,255,255,0.15);
    transform: skewX(-20deg);
    transition: left 0.4s ease;
}

.site-nav__link--cta:hover { background: #7c74ff; transform: translateY(-1px); }
.site-nav__link--cta:hover::before { left: 120%; }
.site-nav__link--cta::after { display: none; }

.site-nav__auth {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-user-menu {
    position: relative;
    display: inline-block;
}

.nav-user-email {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--pl-text);
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.nav-user-email:hover,
.nav-user-email[aria-expanded="true"] {
    border-color: rgba(108,99,255,0.3);
    background: rgba(108,99,255,0.12);
    transform: translateY(-1px);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    min-width: 190px;
    padding: 0.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(9,12,20,0.96);
    box-shadow: 0 24px 48px rgba(0,0,0,0.35);
    backdrop-filter: blur(18px);
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 130;
}

.user-dropdown-menu.show {
    display: flex;
}

.user-dropdown-menu__link,
.user-dropdown-menu__button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 0.85rem;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--pl-text);
    font: inherit;
    font-size: 0.86rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.user-dropdown-menu__link:hover,
.user-dropdown-menu__button:hover {
    background: rgba(108,99,255,0.12);
}

.user-dropdown-menu__button {
    color: #f87171;
}

.btn-nav-outline {
    padding: 0.45rem 1rem;
    border-radius: var(--pl-radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--pl-border-strong);
    background: transparent;
    color: var(--pl-text);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.btn-nav-outline:hover {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-1px);
}

.btn-nav-primary {
    padding: 0.45rem 1rem;
    border-radius: var(--pl-radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    background: var(--pl-accent);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 14px var(--pl-accent-glow);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn-nav-primary:hover {
    background: #7c74ff;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--pl-accent-glow);
}

/* ── Main content ───────────────────────────────────────────── */
.site-main {
    flex: 1;
    width: 100%;
    max-width: var(--pl-max);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 3rem 0 4rem;
}

.hero__eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--pl-teal);
    margin-bottom: 1rem;
    animation: fadeDown 0.6s ease both;
}

.hero__title {
    font-family: 'Fraunces', 'Georgia', serif;
    font-size: clamp(2.25rem, 5vw, 3.35rem);
    font-weight: 650;
    letter-spacing: -0.03em;
    line-height: 1.12;
    max-width: 18ch;
    margin: 0 auto 1.25rem;
    background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.82) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeUp 0.7s ease 0.1s both;
}

.hero__lead {
    font-size: 1.08rem;
    color: var(--pl-muted);
    max-width: 42ch;
    margin: 0 auto 2rem;
    animation: fadeUp 0.7s ease 0.2s both;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    animation: fadeUp 0.7s ease 0.3s both;
}

/* ── Entrance animations utility ─────────────────────────────── */
[data-animate] {
    opacity: 0;
    visibility: hidden;
    animation-fill-mode: both;
    animation-duration: 0.7s;
    animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
}

[data-animate].visible {
    visibility: visible;
}

[data-animate].visible[data-animate="up"] { animation-name: fadeUp; }
[data-animate].visible[data-animate="down"] { animation-name: fadeDown; }
[data-animate].visible[data-animate="fade"] { animation-name: fadeIn; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Delay utilities */
[data-delay="50"] { animation-delay: 50ms; }
[data-delay="100"] { animation-delay: 100ms; }
[data-delay="150"] { animation-delay: 150ms; }
[data-delay="200"] { animation-delay: 200ms; }
[data-delay="250"] { animation-delay: 250ms; }
[data-delay="300"] { animation-delay: 300ms; }
[data-delay="400"] { animation-delay: 400ms; }
[data-delay="500"] { animation-delay: 500ms; }

/* ── Global Hero Particles ───────────────────────────────────── */
.hero-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* ── Premium UI Components ───────────────────────────────────── */
.telemetry-card {
    position: absolute;
    min-width: 188px;
    padding: 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(9, 14, 24, 0.82);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(20px);
    z-index: 2;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.telemetry-card:hover {
    border-color: rgba(108, 99, 255, 0.22);
}

.telemetry-card strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.7rem;
}

.telemetry-card__label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--pl-teal);
    margin-bottom: 0.4rem;
}

.telemetry-card__meta {
    color: rgba(244, 244, 247, 0.68);
    font-size: 0.78rem;
    line-height: 1.6;
}

.telemetry-card__bars {
    display: grid;
    gap: 0.6rem;
}

.telemetry-card__bar {
    display: grid;
    gap: 0.3rem;
}

.telemetry-card__bar-label {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.72rem;
    color: rgba(244, 244, 247, 0.64);
}

.telemetry-card__bar-track {
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.telemetry-card__bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6c63ff, #2dd4bf);
}

.telemetry-card__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.telemetry-card__stat {
    padding: 0.7rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.telemetry-card__stat strong {
    margin-bottom: 0.2rem;
    font-size: 1.05rem;
}

.telemetry-card__stat span {
    color: rgba(244, 244, 247, 0.62);
    font-size: 0.72rem;
}

/* Light theme support for telemetry */
html.theme-light .telemetry-card {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 50px rgba(30, 41, 59, 0.08);
}

html.theme-light .telemetry-card strong { color: var(--pl-text); }
html.theme-light .telemetry-card__meta,
html.theme-light .telemetry-card__bar-label,
html.theme-light .telemetry-card__stat span { color: rgba(31, 41, 55, 0.72); }
html.theme-light .telemetry-card__bar-track { background: rgba(0, 0, 0, 0.06); }
html.theme-light .telemetry-card__stat { background: rgba(0, 0, 0, 0.03); border-color: rgba(0, 0, 0, 0.03); }

/* ── Intro Loader ──────────────────────────────────────────────
   Styles moved to layout.css (Global Layout Component)
   ──────────────────────────────────────────────────────────── */

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-hero-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.6rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    background: var(--pl-accent);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 32px var(--pl-accent-glow);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    position: relative;
    overflow: hidden;
}

.btn-hero-primary::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: rgba(255,255,255,0.15);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 44px rgba(108, 99, 255, 0.48);
    background: #7c74ff;
}

.btn-hero-primary:hover::before { left: 120%; }

.btn-hero-secondary {
    display: inline-flex;
    padding: 0.85rem 1.5rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--pl-border-strong);
    background: var(--pl-surface);
    color: var(--pl-text);
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.btn-hero-secondary:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

/* ── Feature grid ─────────────────────────────────────────── */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 2rem;
}

@media (max-width: 900px) {
    .grid-3 { grid-template-columns: 1fr; }
}

.card-pl {
    padding: 1.5rem;
    border-radius: var(--pl-radius);
    border: 1px solid var(--pl-border);
    background: var(--pl-surface);
    backdrop-filter: blur(8px);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.card-pl::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(108,99,255,0.35), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-pl:hover {
    border-color: rgba(108, 99, 255, 0.28);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(108,99,255,0.1);
}

.card-pl:hover::before { opacity: 1; }

.card-pl__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--pl-accent-soft);
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    transition: transform 0.2s ease;
}

.card-pl:hover .card-pl__icon { transform: scale(1.1) rotate(-3deg); }

.card-pl h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.card-pl p {
    font-size: 0.9rem;
    color: var(--pl-muted);
    line-height: 1.55;
}

/* ── Section titles ──────────────────────────────────────── */
.section-head {
    margin-top: 3.5rem;
    margin-bottom: 1.25rem;
}

.section-head h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.65rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.section-head p {
    color: var(--pl-muted);
    font-size: 0.95rem;
    margin-top: 0.4rem;
    max-width: 52ch;
}

/* ── Page hero (inner pages) ─────────────────────────────── */
.page-hero {
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--pl-border);
    margin-bottom: 2rem;
    position: relative;
}

.page-hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 80px;
    height: 1px;
    background: var(--pl-accent);
}

.page-hero h1 {
    font-family: 'Fraunces', serif;
    font-size: clamp(1.85rem, 4vw, 2.4rem);
    font-weight: 650;
    letter-spacing: -0.03em;
    margin-bottom: 0.6rem;
    animation: fadeUp 0.6s ease both;
}

.page-hero p {
    color: var(--pl-muted);
    font-size: 1.02rem;
    max-width: 56ch;
    animation: fadeUp 0.6s ease 0.1s both;
}

.content-block {
    margin-bottom: 2.25rem;
    animation: fadeUp 0.5s ease both;
}

.content-block h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.65rem;
    color: var(--pl-text);
}

.content-block p,
.content-block li {
    color: var(--pl-muted);
    font-size: 0.95rem;
}

.content-block ul {
    margin-left: 1.25rem;
    margin-top: 0.5rem;
}

.content-block li { margin-bottom: 0.35rem; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
    margin-top: auto;
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--pl-border);
    background: rgba(0, 0, 0, 0.25);
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(108,99,255,0.4), transparent);
}

.site-footer__inner {
    max-width: var(--pl-max);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--pl-faint);
}

.site-footer__links {
    display: flex;
    gap: 1.25rem;
}

.site-footer a {
    color: var(--pl-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-footer a:hover { color: var(--pl-accent-light); }

/* ── Modals ─────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-width: 400px;
    border-radius: var(--pl-radius);
    border: 1px solid var(--pl-border-strong);
    background: var(--pl-bg-elevated);
    padding: 1.75rem;
    box-shadow: 0 32px 96px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(108,99,255,0.08);
    transform: scale(0.94) translateY(12px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(108,99,255,0.5), transparent);
}

.modal-overlay.is-open .modal {
    transform: scale(1) translateY(0);
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.modal__header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.modal__close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--pl-radius-sm);
    background: rgba(255, 255, 255, 0.06);
    color: var(--pl-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}

.modal__close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--pl-text);
    transform: rotate(90deg);
}

.modal__note {
    font-size: 0.82rem;
    color: var(--pl-teal);
    background: rgba(45, 212, 191, 0.08);
    border: 1px solid rgba(45, 212, 191, 0.18);
    border-radius: var(--pl-radius-sm);
    padding: 0.65rem 0.85rem;
    margin-bottom: 1.25rem;
    line-height: 1.45;
}

.modal__field {
    margin-bottom: 1rem;
}

.modal__field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--pl-faint);
    margin-bottom: 0.35rem;
}

.modal__field input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: var(--pl-radius-sm);
    border: 1px solid var(--pl-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--pl-text);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.modal__field input:focus {
    border-color: var(--pl-accent);
    box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}

.modal__footer-text {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.82rem;
    color: var(--pl-faint);
}

.modal__footer-text button {
    background: none;
    border: none;
    color: var(--pl-accent);
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    transition: color 0.15s;
}

.modal__footer-text button:hover {
    text-decoration: underline;
    color: var(--pl-accent-light);
}

.hidden {
    display: none !important;
}

.nav-user-email {
    font-size: 0.82rem;
    color: var(--pl-muted);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-error {
    font-size: 0.82rem;
    color: #f87171;
    margin-bottom: 0.75rem;
    line-height: 1.45;
}

.modal-optional {
    font-weight: 400;
    color: var(--pl-faint);
    text-transform: none;
    letter-spacing: normal;
}

.btn-modal-primary {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.35rem;
    border: none;
    border-radius: var(--pl-radius-sm);
    background: var(--pl-accent);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s, transform 0.15s;
    position: relative;
    overflow: hidden;
}

.btn-modal-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), transparent);
}

.btn-modal-primary:hover:not(:disabled) {
    background: #7c74ff;
    transform: translateY(-1px);
}

.btn-modal-primary:disabled {
    opacity: 0.65;
    cursor: wait;
}

/* ── Staggered card animations on the home grid ─────────── */
.grid-3 .card-pl:nth-child(1) { animation: fadeUp 0.5s ease 0.1s both; }
.grid-3 .card-pl:nth-child(2) { animation: fadeUp 0.5s ease 0.2s both; }
.grid-3 .card-pl:nth-child(3) { animation: fadeUp 0.5s ease 0.3s both; }

/* ── Glowing divider ─────────────────────────────────────── */
.glow-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(108,99,255,0.4), rgba(45,212,191,0.3), transparent);
    margin: 3rem 0;
    border: none;
}

/* ── Stats strip (home enhancement) ─────────────────────── */
.stats-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    padding: 2rem 0;
    border-top: 1px solid var(--pl-border);
    border-bottom: 1px solid var(--pl-border);
    margin: 2rem 0;
}

.stat-item {
    text-align: center;
    min-width: 100px;
}

.stat-item__value {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Fraunces', serif;
    background: linear-gradient(135deg, var(--pl-accent), var(--pl-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.stat-item__label {
    font-size: 0.75rem;
    color: var(--pl-muted);
    font-weight: 500;
    margin-top: 0.2rem;
    letter-spacing: 0.03em;
}

/* ── Floating badge animation ────────────────────────────── */
@keyframes floatBadge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ── Hover link glow ─────────────────────────────────────── */
a.glow-link {
    color: var(--pl-accent-light);
    text-decoration: none;
    position: relative;
    transition: color 0.15s;
}

a.glow-link:hover {
    color: #fff;
    text-shadow: 0 0 12px rgba(108,99,255,0.5);
}

/* ═══════════════════════════════════════════════════════════════ */
/* LIGHT THEME                                                    */
/* ═══════════════════════════════════════════════════════════════ */

:root.theme-light {
    --pl-bg: #ffffff;
    --pl-bg-elevated: #f9fafb;
    --pl-surface: rgba(249, 250, 251, 0.9);
    --pl-border: rgba(0, 0, 0, 0.08);
    --pl-border-strong: rgba(0, 0, 0, 0.14);
    --pl-text: #1f2937;
    --pl-muted: rgba(31, 41, 55, 0.62);
    --pl-faint: rgba(31, 41, 55, 0.38);
    --pl-accent: #6c63ff;
    --pl-accent-soft: rgba(108, 99, 255, 0.15);
    --pl-accent-glow: rgba(108, 99, 255, 0.25);
    --pl-accent-light: #a78bfa;
    --pl-teal: #2dd4bf;
    --pl-teal-soft: rgba(45, 212, 191, 0.12);
}

body.site.theme-light {
    background: var(--pl-bg);
    color: var(--pl-text);
}

body.site.theme-light::before {
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(108, 99, 255, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(45, 212, 191, 0.04), transparent),
        radial-gradient(ellipse 50% 30% at 0% 30%, rgba(108, 99, 255, 0.05), transparent);
}

body.site.theme-light::after {
    background:
        radial-gradient(circle 300px at 15% 60%, rgba(108,99,255,0.04), transparent),
        radial-gradient(circle 250px at 85% 80%, rgba(45,212,191,0.02), transparent);
}

.theme-light .site-nav {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: none !important;
}

.theme-light .site-nav__link {
    color: rgba(31, 41, 55, 0.62);
}

.theme-light .site-nav__link:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--pl-text);
}

.theme-light .btn-nav-outline {
    border-color: rgba(0, 0, 0, 0.14);
    background: transparent;
    color: var(--pl-text);
}

.theme-light .btn-nav-outline:hover {
    border-color: rgba(0, 0, 0, 0.28);
    background: rgba(0, 0, 0, 0.04);
}

.theme-light .card-pl {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.7);
}

.theme-light .card-pl:hover {
    border-color: rgba(108, 99, 255, 0.18);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08), 0 0 0 1px rgba(108,99,255,0.08);
}

.theme-light .modal-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.theme-light .modal {
    background: var(--pl-bg-elevated);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 32px 96px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(108,99,255,0.08);
}

.theme-light .modal__close {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(31, 41, 55, 0.62);
}

.theme-light .modal__close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--pl-text);
}
