:root {
    --studio-navy: #0b1223;
    --studio-navy-deep: #070d1b;
    --studio-orange: #ff853c;
    --studio-orange-hover: #e8742e;
    --studio-blue: #3b7fff;
    --studio-bg: #070d1b;
    --studio-text: #c7d2e5;
    --studio-ink: #f8fbff;
    --studio-border: rgba(255, 255, 255, 0.14);
    --studio-header-offset: 88px;
    --studio-staging-banner-offset: 30px;
}

body {
    background:
        radial-gradient(1100px 700px at 85% -10%, rgba(59, 127, 255, 0.15), transparent 62%),
        radial-gradient(900px 600px at -10% 0%, rgba(255, 133, 60, 0.09), transparent 62%),
        var(--studio-bg);
    color: var(--studio-text);
    font-family: 'Poppins', system-ui, sans-serif;
}

main {
    background: transparent;
    color: var(--studio-text);
}

body:not(.home-studio) main {
    padding-top: var(--studio-header-offset);
}

#staging-banner+.site-header.studio-header {
    top: var(--studio-staging-banner-offset);
}

#staging-banner+.site-header.studio-header+main {
    padding-top: calc(var(--studio-header-offset) + var(--studio-staging-banner-offset));
}

main h1,
main h2,
main h3,
main h4,
main h5,
main h6 {
    color: var(--studio-ink);
}

main p,
main li,
main td,
main th,
main label,
main small {
    color: var(--studio-text);
}

main a {
    color: #9ec5ff;
}

main a:hover {
    color: #c7ddff;
}

.section-alt {
    background: rgba(255, 255, 255, 0.02);
}

.card {
    background: rgba(17, 27, 50, 0.78);
    border-color: rgba(255, 255, 255, 0.14);
}

table,
th,
td {
    border-color: rgba(255, 255, 255, 0.14);
}

th {
    background: rgba(255, 255, 255, 0.05);
}

.callout,
.alert,
.note-box,
.info-box {
    background: rgba(255, 255, 255, 0.05);
}

.site-header.studio-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    padding: 1rem 0;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background 0.2s ease, padding 0.2s ease, border-color 0.2s ease;
}

.site-header.studio-header.scrolled {
    background: rgba(7, 13, 27, 0.92);
    backdrop-filter: blur(16px);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    padding: 0.75rem 0;
}

/* Three-zone header: logo (auto) | flexible centered nav | utilities (auto).
   The center zone absorbs free space and keeps the compact pill centered; the
   logo and the Download/lang/Login cluster never shrink. */
.studio-nav-inner {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1.25rem;
    position: relative;
    max-width: 1340px;
    padding: 0 2rem;
}

.studio-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    flex: 0 0 auto;
}

.studio-nav-center {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.studio-brand .logo {
    border-radius: 6px;
}

.site-header.studio-header .studio-nav-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 0.15rem;
    margin: 0;
    padding: 0.32rem 0.42rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    backdrop-filter: blur(8px);
}

/* One readable size for both languages — French is NOT shrunk; instead it folds
   into the burger earlier (see the language-aware breakpoints below). */
.site-header.studio-header .studio-nav-pill a {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.46rem 0.7rem;
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

/* French labels are longer, so the FR pill uses a slightly denser (but still
   fully readable, ~12.5px) size + tighter spacing so all 7 items stay on one
   row. It still folds into the burger earlier than English (breakpoints below). */
html[lang="fr"] .site-header.studio-header .studio-nav-pill {
    gap: 0.06rem;
}

html[lang="fr"] .site-header.studio-header .studio-nav-pill a {
    font-size: 0.78rem;
    padding: 0.44rem 0.56rem;
}

.site-header.studio-header .studio-nav-pill a:hover,
.site-header.studio-header .studio-nav-pill a.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.studio-nav-right {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Primary Download CTA — solid BranchPy orange (not the legacy gradient .btn-orange) */
.studio-nav-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: var(--brand-orange, #ff853c);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0.62rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 14px rgba(255, 133, 60, 0.22);
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.studio-nav-cta:hover {
    background: var(--brand-orange-hover, #e8742e);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(255, 133, 60, 0.28);
}

.studio-nav-cta:focus-visible {
    outline: 2px solid #ffb784;
    outline-offset: 2px;
}

.studio-lang {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    font-weight: 600;
}

.studio-lang strong {
    color: #fff;
}

.studio-lang a {
    color: rgba(255, 255, 255, 0.62);
}

.studio-lang a:hover {
    color: #fff;
}

/* Login/account button — identical size to the Download CTA (same padding,
   font, line-height, border box) so the two header buttons always match. */
#navAuthLink.btn-dark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0.62rem 1.2rem;
    border-radius: 10px;
    white-space: nowrap;
}

#navAuthLink.btn-dark:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.studio-burger {
    display: none;
    background: none;
    border: 0;
    padding: 0.25rem;
    margin-left: 0;
}

.studio-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

.site-header.studio-header .studio-nav-mobile {
    display: none;
    flex-direction: column;
    gap: 0;
    background: var(--studio-navy-deep);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.8rem 1rem;
    /* Neutralize the legacy `.site-header nav` mobile rules (style.css) that
       otherwise collapse this drawer to max-height:0 / opacity:0 because it
       only clears them on the old `.show` class, not the studio `.open` class. */
    max-height: none;
    overflow: visible;
    opacity: 1;
    margin-top: 0;
    border-radius: 0;
}

.site-header.studio-header .studio-nav-mobile.open {
    display: flex;
    max-height: none;
    opacity: 1;
}

/* Override the legacy purple hover background that leaks onto drawer links */
.site-header.studio-header .studio-nav-mobile a:hover,
.site-header.studio-header .studio-nav-mobile a.active {
    background: rgba(255, 255, 255, 0.04);
    padding-left: 0.5rem;
    border-left: 0;
}

.site-header.studio-header .studio-nav-mobile a {
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.92rem;
    font-weight: 500;
    padding: 0.72rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-header.studio-header .studio-nav-mobile a:hover {
    color: #fff;
}

.studio-login-link {
    color: var(--studio-orange) !important;
    font-weight: 600 !important;
}

.user-menu {
    position: relative;
}

.user-avatar {
    border: 2px solid rgba(255, 255, 255, 0.26);
}

.user-dropdown {
    right: 0;
}

.home-studio .section {
    opacity: 1;
    transform: none;
    animation: none;
}

.home-studio-hero {
    position: relative;
    overflow: hidden;
    min-height: 0;
    background: var(--studio-navy-deep);
    padding: 8.75rem 0 3.5rem;
}

.home-studio-hero-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 0%, black 30%, transparent 100%);
}

.home-studio-hero-glow-a {
    position: absolute;
    top: -26%;
    left: 50%;
    width: 980px;
    height: 680px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse, rgba(59, 127, 255, 0.18) 0%, transparent 68%);
    pointer-events: none;
}

.home-studio-hero-glow-b {
    position: absolute;
    top: 30%;
    right: -10%;
    width: 520px;
    height: 520px;
    background: radial-gradient(ellipse, rgba(255, 133, 60, 0.09) 0%, transparent 70%);
    pointer-events: none;
}

.home-studio-hero-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.home-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.36rem 0.9rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.8rem;
    font-weight: 600;
}

.home-hero-pill {
    border-radius: 999px;
    background: rgba(59, 127, 255, 0.18);
    border: 1px solid rgba(59, 127, 255, 0.3);
    color: #8fc0ff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
}

.home-studio-hero h1 {
    color: #fff;
    margin: 0 auto 1.15rem;
    max-width: 840px;
    line-height: 1.1;
    font-size: clamp(2.3rem, 5.2vw, 3.9rem);
}

.home-studio-hero p {
    margin-left: auto;
    margin-right: auto;
}

.home-hero-sub {
    max-width: 650px;
    color: rgba(255, 255, 255, 0.64);
    font-size: 1.05rem;
}

.home-hero-subtle {
    margin-top: 0.4rem;
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.44);
}

.home-hero-actions {
    margin-top: 1.35rem;
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.home-hero-actions .btn {
    border-radius: 10px;
    font-weight: 600;
}

.home-hero-actions .btn-orange {
    background: var(--studio-orange);
    color: #fff;
    box-shadow: 0 8px 26px rgba(255, 133, 60, 0.28);
}

.home-hero-actions .btn-orange:hover {
    background: var(--studio-orange-hover);
    color: #fff;
}

.home-hero-actions .btn-ghost {
    color: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.home-hero-actions .btn-ghost:hover {
    border-color: rgba(255, 255, 255, 0.38);
    color: #fff;
}

.home-hero-screen {
    margin: 2rem auto 0;
    max-width: 1040px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.38);
}

.home-hero-screen img {
    width: 100%;
    height: auto;
}

.home-hero-detect {
    margin: 1.4rem auto 0;
    max-width: 760px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    padding: 1.1rem 1.2rem;
}

.home-hero-detect h3 {
    color: #fff;
    margin-bottom: 0.6rem;
    font-size: 1rem;
}

.home-hero-detect .list li {
    color: rgba(255, 255, 255, 0.82);
}

.studio-footer {
    margin-top: 5rem;
    padding: 4rem 0 1.5rem;
    background: var(--studio-navy);
    color: #94a3b8;
}

.studio-footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 2.2rem;
}

.studio-footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.85rem;
}

.studio-footer-tagline {
    color: #94a3b8;
    font-size: 0.9rem;
    max-width: 320px;
}

.studio-footer-col-title {
    color: rgba(255, 255, 255, 0.58);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.72rem;
    font-weight: 700;
    margin: 0 0 0.9rem;
}

.studio-footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.studio-footer-links a {
    color: #94a3b8;
    font-size: 0.9rem;
}

.studio-footer-links a:hover {
    color: var(--studio-orange);
}

.studio-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
    padding-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: #64748b;
}

/* French labels are ~30% longer, so the FR pill folds into the burger at a wider
   breakpoint than English. The empty center zone (flex:1) keeps the Download /
   language / Login cluster pushed right in burger mode — no margin hacks. */
@media (max-width: 1320px) {
    html[lang="fr"] .site-header.studio-header .studio-nav-pill {
        display: none;
    }

    html[lang="fr"] .studio-burger {
        display: inline-flex;
        flex-direction: column;
        gap: 5px;
    }
}

/* English keeps the desktop pill down to ~1200px, then folds into the burger. */
@media (max-width: 1200px) {
    .site-header.studio-header .studio-nav-pill {
        display: none;
    }

    .studio-burger {
        display: inline-flex;
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 980px) {
    .studio-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    body:not(.home-studio) main {
        padding-top: 80px;
    }

    #staging-banner+.site-header.studio-header+main {
        padding-top: calc(80px + var(--studio-staging-banner-offset));
    }

    .site-header.studio-header {
        padding: 0.75rem 0;
    }

    .studio-lang {
        display: none;
    }

    .home-studio-hero {
        padding-top: 7rem;
    }

    .home-hero-sub {
        font-size: 0.98rem;
    }

    .home-hero-actions {
        gap: 0.55rem;
    }

    .home-hero-actions .btn {
        width: 100%;
        max-width: 300px;
    }

    .studio-footer-grid {
        grid-template-columns: 1fr;
    }
}

/* Keep the mobile drawer hidden only when the desktop pill is actually shown,
   which is a much wider breakpoint for FR (≥1441) than for EN (≥1201). */
@media (min-width: 1201px) {

    html:not([lang="fr"]) .site-header.studio-header .studio-nav-mobile,
    html:not([lang="fr"]) .site-header.studio-header .studio-nav-mobile.open {
        display: none !important;
    }
}

@media (min-width: 1321px) {

    html[lang="fr"] .site-header.studio-header .studio-nav-mobile,
    html[lang="fr"] .site-header.studio-header .studio-nav-mobile.open {
        display: none !important;
    }
}

/* ---- mobile header refinements: responsive padding + safe button sizing ---- */
@media (max-width: 768px) {
    .studio-nav-inner { padding: 0 1.5rem; }
}

@media (max-width: 600px) {
    .studio-nav-inner { padding: 0 1.25rem; gap: 0.7rem; }
    .studio-nav-right { gap: 0.5rem; }
    .studio-nav-cta,
    #navAuthLink.btn-dark { padding: 0.55rem 0.85rem; font-size: 0.8rem; }
    /* French labels are longer — shrink a touch more so the cluster stays one row */
    html[lang="fr"] .studio-nav-cta,
    html[lang="fr"] #navAuthLink.btn-dark { padding: 0.52rem 0.62rem; font-size: 0.74rem; }
    html[lang="fr"] .studio-nav-inner { gap: 0.55rem; }
}

@media (max-width: 420px) {
    .studio-nav-inner { padding: 0 0.9rem; gap: 0.5rem; }
    .studio-brand { font-size: 0.92rem; gap: 0.45rem; }
    .studio-nav-right { gap: 0.4rem; }
    .studio-nav-cta,
    #navAuthLink.btn-dark { padding: 0.48rem 0.66rem; font-size: 0.75rem; }
    .studio-burger { padding: 0.25rem 0; }
    html[lang="fr"] .studio-nav-inner { gap: 0.4rem; padding: 0 0.75rem; }
    html[lang="fr"] .studio-brand { font-size: 0.86rem; gap: 0.4rem; }
    html[lang="fr"] .studio-nav-cta,
    html[lang="fr"] #navAuthLink.btn-dark { padding: 0.42rem 0.5rem; font-size: 0.69rem; }
}

