/* =========================================================================
   Apasaja Flipbook Studio — Premium Design System
   Single source of truth for shared component styling.
   Palette kept on the original emerald / teal / studio-navy family,
   elevated with design tokens, layered shadows and refined interactions.
   ========================================================================= */

:root {
    /* Brand */
    --brand-primary: #10A37F;
    --brand-primary-strong: #0E8B72;
    --brand-primary-deep: #08745F;
    --brand-cyan: #16B8D8;
    --brand-gold: #D6A84C;
    --brand-gradient: linear-gradient(135deg, #10A37F 0%, #16B8D8 100%);
    --brand-gradient-soft: linear-gradient(135deg, #0AA37F 0%, #0E8B72 100%);

    /* Studio neutrals */
    --studio-950: #07111F;
    --studio-900: #0B1626;
    --studio-800: #142238;
    --studio-700: #1B2D47;
    --studio-500: #43607F;
    --studio-300: #A8B6C8;
    --studio-100: #EEF3F8;
    --studio-50: #F8FBFE;

    /* Surfaces & lines */
    --surface: #F6F9FC;
    --surface-card: #FFFFFF;
    --border: #E3EBF3;
    --border-strong: #D2DEEA;
    --text: #07111F;
    --text-muted: #5A6F88;

    /* Radii */
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 18px;
    --r-xl: 24px;
    --r-pill: 999px;

    /* Layered shadows — soft, premium depth */
    --shadow-xs: 0 1px 2px rgba(7, 17, 31, 0.05);
    --shadow-sm: 0 1px 3px rgba(7, 17, 31, 0.06), 0 1px 2px rgba(7, 17, 31, 0.04);
    --shadow-md: 0 6px 16px -6px rgba(7, 17, 31, 0.10), 0 2px 6px -2px rgba(7, 17, 31, 0.06);
    --shadow-lg: 0 16px 40px -12px rgba(7, 17, 31, 0.16), 0 6px 16px -8px rgba(7, 17, 31, 0.08);
    --shadow-xl: 0 30px 70px -20px rgba(7, 17, 31, 0.24), 0 10px 30px -12px rgba(7, 17, 31, 0.10);
    --shadow-primary: 0 14px 30px -10px rgba(16, 163, 127, 0.45);
    --shadow-primary-sm: 0 8px 18px -8px rgba(16, 163, 127, 0.42);

    --ring: 0 0 0 4px rgba(16, 163, 127, 0.16);
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.font-display {
    font-family: "Plus Jakarta Sans", Manrope, Inter, ui-sans-serif, system-ui, sans-serif;
    letter-spacing: -0.022em;
}

::selection {
    background: rgba(16, 163, 127, 0.18);
    color: var(--studio-950);
}

/* =========================================================================
   Brand mark
   ========================================================================= */
.brand-mark {
    display: inline-flex;
    width: 2.4rem;
    height: 2.4rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.72rem;
    background: var(--brand-gradient);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-primary-sm), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.brand-mark-dark {
    box-shadow: 0 14px 36px rgba(22, 184, 216, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn-primary,
.btn-secondary,
.btn-ghost {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: var(--r-sm);
    padding: 0.7rem 1.15rem;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.005em;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
        background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.btn-primary {
    background-color: var(--brand-primary);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 62%);
    color: #fff;
    border: 1px solid var(--brand-primary-strong);
    box-shadow: var(--shadow-primary-sm), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary:hover {
    background-color: var(--brand-primary-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow-primary), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-primary-sm);
}

.btn-secondary {
    border: 1px solid var(--border-strong);
    background: #fff;
    color: var(--studio-950);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    border-color: var(--studio-300);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-dark-outline {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: var(--r-sm);
    padding: 0.7rem 1.15rem;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: transform 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn-dark-outline:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.32);
    transform: translateY(-1px);
}

.btn-ghost {
    color: var(--studio-500);
    background: transparent;
}

.btn-ghost:hover {
    background: var(--studio-100);
    color: var(--studio-950);
}

.btn-lg {
    min-height: 3.1rem;
    padding: 0.9rem 1.6rem;
    font-size: 0.95rem;
    border-radius: var(--r-md);
}

.icon-button {
    display: inline-flex;
    width: 2.6rem;
    height: 2.6rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: #fff;
    color: var(--studio-500);
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: border-color 0.18s var(--ease), color 0.18s var(--ease),
        background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.icon-button:hover {
    border-color: var(--studio-300);
    color: var(--studio-950);
    box-shadow: var(--shadow-sm);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-ghost:focus-visible,
.icon-button:focus-visible,
a:focus-visible,
button:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

/* =========================================================================
   Cards & panels
   ========================================================================= */
.premium-card {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface-card);
    box-shadow: var(--shadow-md);
    transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease);
}

a.premium-card:hover,
.premium-card.is-interactive:hover,
.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-strong);
}

.premium-panel {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface-card);
    box-shadow: var(--shadow-lg);
}

.metric-card {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: linear-gradient(180deg, #ffffff 0%, var(--studio-50) 100%);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
    transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Decorative depth backgrounds */
.bg-mesh {
    background-color: var(--studio-950);
    background-image:
        radial-gradient(60rem 40rem at 88% -10%, rgba(22, 184, 216, 0.16), transparent 55%),
        radial-gradient(55rem 38rem at 0% 8%, rgba(16, 163, 127, 0.20), transparent 52%);
}

.bg-mesh-light {
    background-color: var(--surface);
    background-image:
        radial-gradient(48rem 30rem at 92% -8%, rgba(22, 184, 216, 0.10), transparent 55%),
        radial-gradient(42rem 28rem at -6% 4%, rgba(16, 163, 127, 0.10), transparent 55%);
}

/* Pills / badges */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: var(--r-pill);
    padding: 0.32rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pill-emerald {
    background: rgba(16, 163, 127, 0.12);
    color: var(--brand-primary-deep);
}

.pill-dark {
    background: rgba(255, 255, 255, 0.10);
    color: #DDF8EF;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

/* =========================================================================
   Forms
   ========================================================================= */
.field-label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--studio-800);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: -0.005em;
}

.field-input,
.field-select,
.field-textarea {
    width: 100%;
    min-height: 2.85rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    background: #fff;
    padding: 0.7rem 0.85rem;
    color: var(--text);
    font-size: 0.9375rem;
    line-height: 1.4;
    box-shadow: var(--shadow-xs);
    transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.field-input::placeholder,
.field-textarea::placeholder {
    color: var(--studio-300);
}

.field-textarea {
    min-height: 7rem;
    resize: vertical;
}

.field-input:hover,
.field-select:hover,
.field-textarea:hover {
    border-color: var(--studio-300);
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: var(--ring);
    outline: none;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: #fff;
    padding: 0.95rem 1rem;
    box-shadow: var(--shadow-xs);
    transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.toggle-row:hover {
    border-color: var(--border-strong);
}

.toggle-row input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--brand-primary);
    flex: 0 0 auto;
    cursor: pointer;
}

/* Selectable swatches & effect cards */
.effect-option input,
.swatch-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.effect-option span,
.swatch-label {
    display: flex;
    cursor: pointer;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    background: #fff;
    box-shadow: var(--shadow-xs);
    transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease), transform 0.16s var(--ease);
}

.effect-option span {
    min-height: 5.5rem;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
    padding: 1rem;
}

.effect-option span:hover,
.swatch-label:hover {
    border-color: var(--studio-300);
    transform: translateY(-1px);
}

.effect-option input:checked + span,
.swatch-input:checked + .swatch-label {
    border-color: var(--brand-primary);
    box-shadow: var(--ring);
    transform: translateY(-1px);
}

.effect-option input:focus-visible + span,
.swatch-input:focus-visible + .swatch-label {
    box-shadow: var(--ring);
}

/* =========================================================================
   Dashboard sidebar
   ========================================================================= */
.studio-sidebar {
    font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, sans-serif;
    background:
        radial-gradient(circle at 18% 2%, rgba(16, 163, 127, 0.20), transparent 30%),
        radial-gradient(circle at 90% 100%, rgba(22, 184, 216, 0.10), transparent 35%),
        linear-gradient(180deg, #0c2023 0%, #081421 44%, #07111f 100%);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}

.sidebar-logo-mark {
    display: inline-flex;
    height: 2.6rem;
    width: 2.6rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 0.78rem;
    background: linear-gradient(135deg, #18b08b, #42c7d3);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: 0 16px 34px rgba(16, 163, 127, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.sidebar-brand-title {
    display: block;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.015em;
}

.sidebar-brand-subtitle {
    display: block;
    margin-top: 3px;
    color: #95a6b8;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.18em;
}

.sidebar-new-button {
    display: flex;
    min-height: 2.85rem;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    border-radius: var(--r-sm);
    background: linear-gradient(135deg, #0aa37f, #07846c);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 14px 30px rgba(8, 116, 95, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.sidebar-new-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgba(8, 116, 95, 0.40), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.studio-nav-link {
    position: relative;
    display: flex;
    min-height: 2.7rem;
    align-items: center;
    gap: 0.75rem;
    border-radius: var(--r-sm);
    padding: 0.6rem 0.9rem;
    color: #c5d0dc;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.studio-nav-link svg {
    stroke-width: 1.75;
}

.studio-nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.studio-nav-link-active {
    background: rgba(255, 255, 255, 0.11) !important;
    color: #fff !important;
}

.studio-nav-link-active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: var(--r-pill);
    background: var(--brand-primary);
    box-shadow: 0 0 12px rgba(16, 163, 127, 0.7);
}

.sidebar-section-label {
    margin: 1.35rem 0.9rem 0.5rem;
    color: #6f8195;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.sidebar-plan-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.85rem;
}

.sidebar-meter {
    height: 5px;
    overflow: hidden;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.16);
}

.sidebar-meter span {
    display: block;
    height: 100%;
    border-radius: var(--r-pill);
    background: linear-gradient(90deg, #10a37f, #16b8d8);
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem 1rem 1.15rem;
}

.sidebar-avatar {
    display: flex;
    height: 2.25rem;
    width: 2.25rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-pill);
    background: var(--brand-gradient);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
}

.auth-proof {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--r-sm);
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(4px);
}

/* =========================================================================
   Homepage redesign — dark nav, footer, hero, API code tabs
   ========================================================================= */
.nav-icon-dark {
    display: inline-flex;
    width: 2.6rem;
    height: 2.6rem;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, 0.06);
    color: var(--studio-300);
    cursor: pointer;
    transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background 0.18s var(--ease);
}
.nav-icon-dark:hover {
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
    background: rgba(255, 255, 255, 0.10);
}

/* Footer column template (kept in CSS so it needs no Tailwind rebuild) */
@media (min-width: 640px) {
    .site-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .site-footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr 1.4fr; }
}

.footer-social {
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--r-sm);
    color: var(--studio-300);
    transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background 0.18s var(--ease), transform 0.18s var(--ease);
}
.footer-social:hover {
    border-color: rgba(16, 163, 127, 0.5);
    color: #fff;
    background: rgba(16, 163, 127, 0.16);
    transform: translateY(-1px);
}

.footer-input {
    width: 100%;
    min-height: 2.75rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.6rem 0.85rem;
    color: #fff;
    font-size: 0.875rem;
    transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.footer-input::placeholder { color: var(--studio-300); }
.footer-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: var(--ring);
}

/* Trust / brand logo row */
.trust-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(168, 182, 200, 0.85);
    font-family: "Plus Jakarta Sans", Inter, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: color 0.18s var(--ease);
}
.trust-logo:hover { color: #fff; }

/* Hero stat */
.hero-stat-icon {
    display: inline-flex;
    height: 2.5rem;
    width: 2.5rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-md);
    background: rgba(16, 163, 127, 0.16);
    color: #5fe9c6;
    border: 1px solid rgba(16, 163, 127, 0.28);
}

/* Dark glass card (featured / api panels) */
.glass-card {
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--r-lg);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.glass-soft {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.05);
}

/* Homepage reference adaptation */
.home-hero {
    position: relative;
    isolation: isolate;
}

.home-hero > .mx-auto {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

@media (min-width: 1024px) {
    .home-hero h1 {
        max-width: 36rem;
        font-size: clamp(3.25rem, 4.15vw, 4rem);
        line-height: 0.98;
    }

    .home-hero-copy p {
        margin-top: 1.1rem;
        line-height: 1.58;
    }

    .home-hero-copy .mt-8,
    .home-hero-copy .mt-10,
    .home-hero-copy .mt-11 {
        margin-top: 1.55rem;
    }

    .home-preview-canvas {
        min-height: 290px;
    }
}

.home-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 auto;
    width: min(32vw, 420px);
    height: 78%;
    background-image: radial-gradient(circle, rgba(22, 184, 216, 0.16) 1px, transparent 1.5px);
    background-size: 15px 15px;
    mask-image: linear-gradient(90deg, transparent, #000 34%, #000);
    opacity: 0.65;
    z-index: -1;
}

.home-studio-frame {
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
    padding: 0.75rem;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.home-studio-window {
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(180deg, #111d2d 0%, #07111f 100%);
    padding: 0.9rem;
}

.home-studio-topbar,
.home-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--studio-300);
    font-size: 0.72rem;
    font-weight: 800;
}

.home-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: var(--r-pill);
    background: rgba(16, 163, 127, 0.18);
    padding: 0.3rem 0.55rem;
    color: #d9fff4;
}

.home-live-badge span {
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 50%;
    background: var(--brand-primary);
}

.home-studio-grid {
    display: grid;
    grid-template-columns: minmax(112px, 0.72fr) minmax(230px, 1.55fr) minmax(142px, 0.86fr);
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.home-studio-menu,
.home-inspector {
    border-radius: 10px;
    padding: 0.8rem;
}

.home-studio-menu {
    background: rgba(255, 255, 255, 0.045);
}

.home-studio-menu span {
    display: block;
    border-radius: 7px;
    padding: 0.62rem 0.7rem;
    color: var(--studio-300);
    font-size: 0.72rem;
    font-weight: 800;
}

.home-studio-menu span + span {
    margin-top: 0.25rem;
}

.home-studio-menu span.is-active {
    color: #fff;
    background: linear-gradient(135deg, #10a37f, #0b826d);
}

.home-preview-canvas {
    position: relative;
    display: flex;
    min-height: 330px;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    overflow: hidden;
    border-radius: 10px;
    background:
        radial-gradient(circle at 50% 20%, rgba(22, 184, 216, 0.16), transparent 36%),
        linear-gradient(135deg, #10243b, #081522 78%);
    padding: 1.35rem 0.9rem;
}

.home-preview-arrow {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    color: #c7d5e6;
}

.home-preview-arrow svg {
    width: 1rem;
    height: 1rem;
}

.hero-cover-image {
    width: min(58%, 230px);
    min-width: 170px;
    border-radius: 7px;
    box-shadow: 0 28px 55px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(7, 17, 31, 0.08);
}

.home-inspector {
    background: #fff;
    color: var(--studio-950);
}

.home-inspector p {
    margin: 0 0 0.65rem;
    color: var(--brand-primary-strong);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.home-inspector button {
    display: flex;
    width: 100%;
    min-height: 2.55rem;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #edf2f7;
    border-radius: 7px;
    background: #fff;
    padding: 0.55rem 0.68rem;
    color: var(--studio-800);
    font-size: 0.72rem;
    font-weight: 800;
}

.home-inspector button + button {
    margin-top: 0.45rem;
}

.home-inspector button span:last-child {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #dce6f0;
}

.home-inspector button span:last-child.is-on {
    background: var(--brand-primary);
}

.home-toolbar {
    margin-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.75rem 0.2rem 0.1rem;
}

.home-toolbar > div {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.toolbar-icon,
.toolbar-pill {
    display: inline-flex;
    min-width: 1.82rem;
    height: 1.82rem;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.06);
    color: #d5e1ee;
}

.toolbar-pill {
    width: auto;
    padding: 0 0.65rem;
}

.toolbar-icon svg {
    width: 0.9rem;
    height: 0.9rem;
}

.feature-card-compact {
    min-height: 10.6rem;
}

.feature-icon,
.check-dot {
    display: inline-flex;
    width: 2.55rem;
    height: 2.55rem;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(16, 163, 127, 0.12);
    color: var(--brand-primary-strong);
}

.check-dot {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
}

.feature-card-compact .feature-icon {
    margin-bottom: 1rem;
}

.home-showcase-wrap {
    background:
        linear-gradient(180deg, var(--studio-50) 0 50%, #fff 50% 100%);
    padding: 0 0 3.8rem;
}

.home-showcase-panel {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background:
        radial-gradient(42rem 24rem at 88% 8%, rgba(22, 184, 216, 0.12), transparent 52%),
        linear-gradient(180deg, #061321 0%, #07111f 100%);
    padding: 1.55rem;
    box-shadow: 0 26px 70px rgba(7, 17, 31, 0.24);
}

.home-publication-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
}

.home-publication-card {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: #fff;
    color: var(--studio-950);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

.home-publication-cover {
    position: relative;
    display: flex;
    aspect-ratio: 0.78;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f1f5f9;
    padding: 0.55rem;
    text-decoration: none;
}

.home-publication-cover img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 6px;
    object-fit: contain;
    box-shadow: 0 12px 24px rgba(7, 17, 31, 0.2);
}

.home-publication-cover .sample-publication-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-publication-cover > span,
.home-publication-cover > small {
    position: absolute;
    bottom: 0.45rem;
    z-index: 2;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.18rem 0.35rem;
    color: var(--studio-800);
    font-size: 0.55rem;
    font-weight: 900;
}

.home-publication-cover > span {
    left: 0.45rem;
}

.home-publication-cover > small {
    right: 0.45rem;
}

.home-publication-body {
    padding: 0.7rem 0.7rem 0.8rem;
}

.home-publication-body h3 {
    margin: 0;
    overflow: hidden;
    color: var(--studio-950);
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-publication-body p {
    display: -webkit-box;
    min-height: 2.15rem;
    margin: 0.35rem 0 0.65rem;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--studio-500);
    font-size: 0.68rem;
    line-height: 1.55;
}

.home-publication-body div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
}

.home-publication-body a {
    display: inline-flex;
    min-height: 1.9rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-strong);
    border-radius: 7px;
    color: var(--studio-700);
    font-size: 0.62rem;
    font-weight: 900;
    text-decoration: none;
}

.home-publication-body a:hover {
    border-color: rgba(16, 163, 127, 0.45);
    color: var(--brand-primary-strong);
}

.sample-cover {
    position: relative;
    overflow: hidden;
    aspect-ratio: 0.72;
    width: min(100%, 220px);
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 28px 55px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(7, 17, 31, 0.08);
}

.hero-cover {
    width: min(58%, 230px);
    min-width: 170px;
}

.compact-cover {
    width: 100%;
    height: 100%;
}

.cover-kicker,
.cover-title {
    position: absolute;
    z-index: 2;
    left: 11%;
    color: #264033;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 0.95;
}

.cover-kicker {
    top: 9%;
    font-size: clamp(1rem, 2.2vw, 1.9rem);
}

.cover-title {
    top: 20%;
    font-size: clamp(1.05rem, 2.35vw, 2rem);
}

.cover-person {
    position: absolute;
    right: 8%;
    bottom: 0;
    width: 48%;
    height: 68%;
    border-radius: 45% 45% 0 0;
    background:
        radial-gradient(circle at 50% 18%, #eccab5 0 16%, transparent 17%),
        linear-gradient(150deg, transparent 0 26%, #c2d0bd 27% 68%, #8fa68f 69% 100%);
}

.cover-controls {
    position: absolute;
    right: 0.7rem;
    bottom: 0.7rem;
    z-index: 3;
    display: flex;
    gap: 0.25rem;
}

.cover-controls span {
    width: 1.35rem;
    height: 1.05rem;
    border-radius: 4px;
    background: rgba(7, 17, 31, 0.48);
}

.sample-cover-lookbook {
    background:
        radial-gradient(circle at 28% 72%, rgba(244, 169, 154, 0.55), transparent 18%),
        radial-gradient(circle at 14% 68%, rgba(16, 163, 127, 0.24), transparent 14%),
        linear-gradient(135deg, #fff8ed, #ecfff7 56%, #ffe7da);
}

.sample-cover-report {
    background:
        linear-gradient(132deg, transparent 0 46%, #123c66 47% 73%, #6bb8e7 74%),
        linear-gradient(180deg, #fff, #f4f8ff);
}

.sample-cover-report .cover-title,
.sample-cover-report .cover-kicker {
    color: #174071;
    font-family: "Plus Jakarta Sans", Inter, sans-serif;
    font-weight: 900;
}

.sample-cover-travel {
    background:
        radial-gradient(circle at 76% 64%, #163a4d 0 12%, transparent 13%),
        linear-gradient(160deg, #f6e7cd 0 44%, #b8d7e4 45% 74%, #20455b 75%);
}

.sample-cover-catalogue {
    background:
        linear-gradient(160deg, #ffffff 0 58%, #e7eaee 58%),
        radial-gradient(circle at 70% 70%, #20252a 0 18%, transparent 19%);
}

.sample-cover-portfolio {
    background:
        radial-gradient(circle at 82% 72%, #f1f3f5 0 20%, transparent 21%),
        linear-gradient(135deg, #050505, #262626 70%);
}

.sample-cover-portfolio .cover-title,
.sample-cover-portfolio .cover-kicker {
    color: #fff;
    font-family: "Plus Jakarta Sans", Inter, sans-serif;
    font-weight: 900;
}

.sample-cover-deck {
    background:
        linear-gradient(152deg, transparent 0 58%, rgba(254, 230, 86, 0.82) 59%),
        radial-gradient(circle at 76% 78%, rgba(16, 163, 127, 0.9), transparent 25%),
        linear-gradient(180deg, #083f45, #061321);
}

.sample-cover-deck .cover-title,
.sample-cover-deck .cover-kicker {
    color: #e8fff8;
    font-family: "Plus Jakarta Sans", Inter, sans-serif;
    font-weight: 900;
}

.home-security {
    padding-top: 1rem;
}

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

.scan-report {
    grid-row: span 2;
    padding: 1.6rem;
}

.scan-clean {
    border-radius: var(--r-pill);
    background: rgba(16, 163, 127, 0.13);
    padding: 0.32rem 0.7rem;
    color: var(--brand-primary-deep);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.scan-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--studio-50);
    padding: 0.75rem 0.9rem;
}

.scan-row span {
    color: var(--studio-700);
    font-size: 0.8rem;
    font-weight: 900;
}

.scan-row strong {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--brand-primary-strong);
    font-size: 0.72rem;
}

@media (max-width: 1100px) {
    .home-publication-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

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

    .home-studio-menu {
        display: flex;
        overflow-x: auto;
        gap: 0.35rem;
    }

    .home-studio-menu span {
        white-space: nowrap;
    }

    .home-inspector {
        display: none;
    }
}

@media (max-width: 720px) {
    .home-hero > .mx-auto {
        padding-top: 3.4rem;
        padding-bottom: 3.4rem;
    }

    .home-publication-row,
    .security-grid {
        grid-template-columns: 1fr;
    }

    .home-showcase-panel {
        padding: 1rem;
    }

    .home-preview-canvas {
        min-height: 280px;
    }
}

/* Security stat tiles (light) */
.stat-tile {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface-card);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.35rem;
    transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Width helper (max-w-5xl isn't in the compiled Tailwind build) */
.mw-wide { max-width: 64rem; }

/* Prose content for static marketing / legal pages */
.prose-page { color: var(--studio-500); line-height: 1.75; font-size: 1rem; }
.prose-page > :first-child { margin-top: 0; }
.prose-page h2 {
    font-family: "Plus Jakarta Sans", Manrope, Inter, sans-serif;
    color: var(--studio-950);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 2.25rem 0 0.65rem;
}
.prose-page h3 {
    font-family: "Plus Jakarta Sans", Manrope, Inter, sans-serif;
    color: var(--studio-950);
    font-size: 1.08rem;
    font-weight: 800;
    margin: 1.6rem 0 0.4rem;
}
.prose-page p { margin: 0 0 1rem; }
.prose-page ul { list-style: disc; padding-left: 1.3rem; margin: 0 0 1.15rem; }
.prose-page ol { list-style: decimal; padding-left: 1.3rem; margin: 0 0 1.15rem; }
.prose-page li { margin-bottom: 0.4rem; }
.prose-page a { color: var(--brand-primary-strong); font-weight: 600; }
.prose-page a:hover { text-decoration: underline; }
.prose-page strong { color: var(--studio-800); font-weight: 700; }
.prose-page hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose-page code {
    background: var(--studio-100);
    border-radius: 6px;
    padding: 0.12rem 0.4rem;
    font-size: 0.86em;
    color: var(--studio-700);
}

/* ---- API code tabs (CSS-only, CSP-safe, no JS) ---- */
.code-tabs { position: relative; }
.code-tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.code-tab-bar {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    padding: 0.35rem 0.5rem 0;
}
.code-tab-bar label {
    cursor: pointer;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 0.55rem 0.95rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--studio-300);
    transition: color 0.16s var(--ease), background 0.16s var(--ease);
}
.code-tab-bar label:hover { color: #fff; }
.code-panel { display: none; margin: 0; padding: 1.15rem 1.25rem; overflow: auto; }
.code-panel code { display: block; white-space: pre; }
.code-panel .ln { display: inline-block; width: 1.5rem; color: rgba(168, 182, 200, 0.5); user-select: none; }
#apitab-curl:checked ~ .code-tab-bar label[for="apitab-curl"],
#apitab-js:checked ~ .code-tab-bar label[for="apitab-js"],
#apitab-py:checked ~ .code-tab-bar label[for="apitab-py"],
#apitab-php:checked ~ .code-tab-bar label[for="apitab-php"] {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}
#apitab-curl:checked ~ .code-panels .panel-curl,
#apitab-js:checked ~ .code-panels .panel-js,
#apitab-py:checked ~ .code-panels .panel-py,
#apitab-php:checked ~ .code-panels .panel-php { display: block; }

/* =========================================================================
   Flipbook viewer pages
   ========================================================================= */
.page {
    background: #fff;
    box-shadow: inset 0 0 28px rgba(7, 17, 31, 0.05);
    overflow: hidden;
}

.page img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.stf__wrapper {
    box-shadow: 0 36px 90px -24px rgba(7, 17, 31, 0.55) !important;
}

.stf__item {
    box-shadow: inset 0 0 22px rgba(7, 17, 31, 0.08);
}

/* =========================================================================
   Utilities
   ========================================================================= */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

aside::-webkit-scrollbar,
.studio-scroll::-webkit-scrollbar {
    width: 7px;
}

aside::-webkit-scrollbar-thumb,
.studio-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(67, 96, 127, 0.35);
    border-radius: var(--r-pill);
}

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

.animate-fade-in {
    animation: fadeIn 0.5s var(--ease);
}

@media (max-width: 768px) {
    #viewerContainer {
        min-height: 430px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .animate-fade-in {
        animation: none;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* Admin settings accordions (collapsible <details> sections) */
.admin-accordion > .admin-acc-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    list-style: none;
}
.admin-accordion > .admin-acc-summary::-webkit-details-marker {
    display: none;
}
.admin-accordion > .admin-acc-summary::after {
    content: "";
    width: 0.6rem;
    height: 0.6rem;
    flex: 0 0 auto;
    margin-left: 0.5rem;
    border-right: 2px solid var(--studio-400, #94a3b8);
    border-bottom: 2px solid var(--studio-400, #94a3b8);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}
.admin-accordion[open] > .admin-acc-summary::after {
    transform: rotate(-135deg);
}
.admin-accordion[open] > .admin-acc-summary {
    margin-bottom: 0.25rem;
}
.admin-accordion > .admin-acc-summary:focus-visible {
    outline: 2px solid var(--brand-500, #10b981);
    outline-offset: 4px;
    border-radius: 0.5rem;
}
