/* ═══════════════════════════════════════════════ */
/*  ONYX AI — LANDING PAGE STYLES                 */
/*  Extends onyx-styles.css; adds landing-only    */
/* ═══════════════════════════════════════════════ */

/* Override overflow-x: hidden from onyx-styles.css so position: sticky works.
   `clip` hides overflow without creating a scroll container. */
html, body.ai-page { overflow-x: clip; overflow-y: visible; }

/* The portfolio stylesheet adds padding-bottom: 70px on mobile for its bottom nav.
   The AI page has no bottom nav, so we reset that here. */
@media (max-width: 768px) {
    body.ai-page { padding-bottom: 0; }
}

/* ═══ PAGE SHELL ═══ */
.ai-page {
    background: var(--onyx-black);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: clip;
}

/* Neural network canvas — ported from onyx-ai-web.html */
#aiNetworkCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* Subtle grid overlay — inspired by onyx.app, warmed for our palette */
.ai-grid-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(201,165,78,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201,165,78,0.035) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.8) 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.8) 0%, transparent 70%);
}

/* Warm amber glow behind hero */
.ai-hero-glow {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    height: 80vh;
    background: radial-gradient(ellipse at center, rgba(201,165,78,0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ═══ NAV — minimal top strip (brand + launch link) ═══ */
.ai-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 2rem 1.1rem 5rem; /* leave left room for the rail */
    padding-top: max(1.1rem, env(safe-area-inset-top));
    padding-right: max(2rem, env(safe-area-inset-right));
    background: transparent;
    border-bottom: 1px solid transparent;
    z-index: 100;
    transition: background 0.35s ease, border-color 0.35s ease, padding 0.35s ease, backdrop-filter 0.35s ease;
}
.ai-nav.scrolled {
    background: var(--glass-overlay);
    border-bottom-color: var(--gold-dim);
    backdrop-filter: blur(14px) saturate(1.3);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}
.ai-nav-logo {
    display: flex; align-items: center; gap: 0.7rem;
    text-decoration: none; color: var(--text-primary);
    transition: transform 0.3s var(--ease-out-expo);
}
.ai-nav-logo:hover { transform: translateX(2px); }
.ai-nav-logo-text {
    font-family: var(--font-display);
    font-size: 1.25rem; font-weight: 500;
    letter-spacing: 3px; text-transform: uppercase;
    color: var(--text-primary);
}
.ai-nav-logo-text .accent { color: var(--gold); font-style: italic; }

.ai-nav-links {
    display: flex; align-items: center; gap: 1.75rem;
    list-style: none;
    padding: 0; margin: 0;
}
.ai-nav-mobile-only { display: none; } /* hidden on desktop; shown when mobile overlay opens */

.ai-nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 2px;
    text-transform: lowercase;
    transition: color 0.3s ease;
    position: relative;
}
.ai-nav-links a:hover { color: var(--gold-bright); }

.ai-nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-primary) !important;
    font-family: var(--font-mono);
    font-size: 0.75rem !important;
    letter-spacing: 2.5px !important;
    text-transform: lowercase;
    padding: 0.5rem 0 0.5rem 0.75rem;
    border-left: 1px solid rgba(201,165,92,0.25);
    transition: color 0.3s ease, border-color 0.3s ease, gap 0.3s var(--ease-out-expo);
}
.ai-nav-cta:hover {
    color: var(--gold-bright) !important;
    border-left-color: var(--gold);
    gap: 0.6rem;
}

/* Compact home button — shown when the left rail is hidden (<=900px) */
.ai-nav-home {
    display: none;
    width: 40px; height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border: 1px solid rgba(201,165,92,0.18);
    border-radius: 10px;
    background: rgba(15,14,12,0.4);
    text-decoration: none;
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    margin-right: 0.5rem;
}
.ai-nav-home i { font-size: 0.95rem; }
.ai-nav-home:hover,
.ai-nav-home:focus-visible {
    color: var(--gold);
    background: rgba(201,165,92,0.08);
    border-color: rgba(201,165,92,0.35);
    transform: translateY(-1px);
}

/* Mobile nav toggle — 44×44 hit area (iOS HIG), 22px visual bars centered */
.ai-nav-toggle {
    display: none;
    background: transparent;
    border: none;
    width: 44px; height: 44px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
    margin: -6px; /* keep layout visually tight despite larger hit box */
}
.ai-nav-toggle span {
    width: 22px; height: 1.5px;
    background: var(--gold);
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.ai-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.ai-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ai-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ═══ LEFT RAIL — fixed vertical utility column ═══ */
.ai-rail {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.1rem 0 1.5rem;
    gap: 0.35rem;
    z-index: 102;
    background: linear-gradient(180deg, transparent 0%, rgba(15,14,12,0.35) 20%, rgba(15,14,12,0.35) 80%, transparent 100%);
    border-right: 1px solid rgba(201,165,92,0.06);
}
.ai-rail::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1px;
    height: 40%;
    background: linear-gradient(180deg, transparent, rgba(201,165,92,0.1), transparent);
    pointer-events: none;
}
.ai-rail-spacer { flex: 1; }
.ai-rail-btn {
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: all 0.3s var(--ease-out-expo);
    position: relative;
    flex-shrink: 0;
}
.ai-rail-btn svg { width: 16px; height: 16px; }
.ai-rail-btn i { font-size: 0.95rem; }
.ai-rail-btn:hover {
    color: var(--gold);
    background: rgba(201,165,92,0.06);
    border-color: rgba(201,165,92,0.2);
    transform: translateX(2px);
}
.ai-rail-tip {
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 1.5px;
    text-transform: lowercase;
    color: var(--text-primary);
    background: rgba(15,14,12,0.92);
    border: 1px solid rgba(201,165,92,0.18);
    padding: 0.3rem 0.55rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 103;
}
.ai-rail-btn:hover .ai-rail-tip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

@media (max-width: 900px) {
    .ai-rail { display: none; }
    .ai-nav { padding-left: 1.5rem; }
    .ai-nav-home { display: inline-flex; margin-left: auto; }
    .ai-nav-portfolio-link { display: none; }
}

/* ═══ HERO ═══ */
.ai-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 1.5rem 6rem;
    position: relative;
    z-index: 1;
}
/* Chat-as-hero variant */
.ai-hero-chat {
    min-height: 100vh;
    padding: 7rem 1.25rem 3rem;
}
.ai-hero-inner {
    max-width: 960px;
    width: 100%;
    text-align: center;
    position: relative;
}
.ai-hero-chat .ai-hero-inner {
    max-width: 920px;
}
.ai-visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Hero footer row — secondary CTA + scroll cue */
.ai-hero-footer {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0 0.5rem;
    max-width: 880px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    animation: previewFadeUp 0.8s var(--ease-out-expo) 1.5s forwards;
}
.ai-hero-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 0.5rem 0.75rem;
    border-radius: 100px;
    transition: all 0.3s ease;
}
.ai-hero-secondary:hover { color: var(--gold); background: rgba(201,165,92,0.06); }

.ai-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 1rem;
    background: rgba(12,10,8,0.6);
    border: 1px solid rgba(201,165,78,0.2);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-bottom: 2.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
}
.ai-status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--text-tertiary);
    transition: all 0.4s ease;
    animation: statusPulse 2s ease-in-out infinite;
}
.ai-status-pill.online .ai-status-dot {
    background: var(--color-online);
    box-shadow: 0 0 10px var(--color-online-glow);
}
.ai-status-pill.offline .ai-status-dot {
    background: var(--color-offline);
    box-shadow: 0 0 8px var(--color-offline-glow);
}
.ai-status-pill.online { border-color: var(--color-online-border); color: rgba(242,239,232,0.85); }
.ai-status-pill.offline { border-color: var(--color-offline-border); }

/* Floating variant — sits above the preview, small & diagnostic */
.ai-status-pill-float {
    position: absolute;
    top: -0.25rem;
    right: 0;
    margin-bottom: 0;
    padding: 0.3rem 0.7rem;
    font-size: 0.62rem;
    letter-spacing: 1.5px;
    text-transform: lowercase;
    z-index: 2;
    animation: previewFadeUp 0.8s var(--ease-out-expo) 0.1s forwards;
    opacity: 0;
}
.ai-status-pill-float .ai-status-dot { width: 6px; height: 6px; }
@media (max-width: 768px) {
    .ai-status-pill-float { position: relative; top: auto; right: auto; margin: 0 auto 1rem; display: inline-flex; }
}
@keyframes statusPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.ai-headline {
    font-family: var(--font-display);
    font-size: clamp(2.75rem, 8vw, 5.5rem);
    font-weight: 400;
    line-height: 1.02;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 1.75rem;
}
.ai-headline .em {
    font-style: italic;
    color: var(--gold);
    font-weight: 300;
}
.ai-subhead {
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 620px;
    margin: 0 auto 3rem;
}

.ai-cta-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 4rem;
}
.ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 1.75rem;
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: all 0.3s var(--ease-out-expo);
    cursor: pointer;
    border: 1px solid transparent;
}
.ai-btn-primary {
    background: var(--gold);
    color: var(--onyx-black);
    box-shadow: 0 6px 24px rgba(201,165,78,0.2);
}
.ai-btn-primary:hover {
    background: var(--gold-bright);
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(232,197,90,0.35);
}
.ai-btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: rgba(201,165,78,0.3);
}
.ai-btn-secondary:hover {
    border-color: var(--gold);
    color: var(--gold-bright);
    background: rgba(201,165,78,0.05);
    transform: translateY(-2px);
}

/* Preview card — the hero itself */
.ai-preview {
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    background: var(--glass-surface);
    border: 1px solid rgba(201,165,78,0.15);
    border-radius: 16px;
    padding: 1rem;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-lg), var(--glow-gold-sm);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}
.ai-preview-hero {
    max-width: 820px;
    width: 100%;
    padding: 1rem 1.25rem 1.25rem;
    border-radius: 20px;
    box-shadow:
        var(--shadow-xl),
        var(--glow-gold-md),
        inset 0 1px 0 rgba(255,255,255,0.02);
}
.ai-preview-hero::before { border-radius: 20px; }
.ai-preview::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(201,165,78,0.3), transparent 40%, transparent 60%, rgba(201,165,78,0.15));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.ai-preview-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.6rem 0.8rem;
    border-bottom: 1px solid rgba(201,165,78,0.1);
    margin-bottom: 1rem;
}
.ai-preview-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: rgba(201,165,78,0.25);
}
.ai-preview-dot:first-child { background: rgba(217,119,87,0.5); }
.ai-preview-dot:nth-child(2) { background: rgba(232,197,90,0.5); }
.ai-preview-dot:nth-child(3) { background: rgba(110,231,160,0.5); }
.ai-preview-label {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-tertiary);
    letter-spacing: 1px;
}
/* ─── New-chat screen replica ─── */
.ai-preview-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
    padding: 1.25rem 0.5rem 0.5rem;
    position: relative;
}
.ai-preview-welcome::before {
    content: '';
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(201,165,92,0.1) 0%, rgba(201,165,92,0.04) 35%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}
.ai-preview-welcome > * { position: relative; z-index: 1; }

.ai-preview-gem-container {
    position: relative;
    width: 120px; height: 120px;
    opacity: 0;
    animation: previewFadeUp 0.8s var(--ease-out-expo) 0.2s forwards;
}
.ai-preview-gem {
    width: 64px; height: 64px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(201,165,92,0.4);
    animation: previewGemFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(201,165,92,0.25));
    overflow: hidden;
}
.ai-preview-gem::before {
    content: '';
    position: absolute;
    inset: 2px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: conic-gradient(from 0deg at 50% 50%, #38352f 0deg, #38352f 52deg, #2a2824 68deg, #2a2824 112deg, #1e1c18 128deg, #1e1c18 172deg, #131210 188deg, #131210 232deg, #1a1816 248deg, #1a1816 292deg, #302d28 308deg, #302d28 352deg, #38352f 360deg);
}
.ai-preview-gem::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: calc(100% - 4px); height: calc(50% - 2px);
    background: linear-gradient(180deg, rgba(201,165,92,0.08) 0%, transparent 100%);
    clip-path: polygon(50% 0%, 100% 50%, 0% 50%);
}
.ai-preview-gem-ring {
    position: absolute;
    top: 50%; left: 50%;
    width: 88px; height: 88px;
    border: 1px solid rgba(201,165,92,0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: previewRingPulse 4s ease-in-out infinite;
}
.ai-preview-gem-ring:nth-child(2) {
    width: 110px; height: 110px;
    border-color: rgba(201,165,92,0.08);
    animation-delay: 0.6s;
}
.ai-preview-gem-particle {
    position: absolute;
    width: 3px; height: 3px;
    background: var(--gold);
    border-radius: 50%;
    top: 50%; left: 50%;
    filter: blur(0.5px);
}
.ai-preview-gem-particle:nth-child(4) { animation: previewOrbit1 5s linear infinite; }
.ai-preview-gem-particle:nth-child(5) { animation: previewOrbit2 7s linear infinite; width: 2px; height: 2px; opacity: 0.5; }
.ai-preview-gem-particle:nth-child(6) { animation: previewOrbit3 9s linear infinite; width: 2px; height: 2px; opacity: 0.7; }

.ai-preview-welcome-title {
    font-family: var(--font-display);
    font-size: clamp(1.85rem, 8vw, 3.4rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.5px;
    margin: 0;
    color: var(--text-primary);
    opacity: 0;
    animation: previewFadeUp 0.8s var(--ease-out-expo) 0.5s forwards;
}
.ai-preview-welcome-title em {
    font-style: italic;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 40%, var(--gold-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.ai-preview-welcome-sub {
    color: var(--text-tertiary);
    font-size: 0.78rem;
    max-width: min(380px, 100%);
    line-height: 1.7;
    letter-spacing: 0.3px;
    font-style: italic;
    margin: 0;
    opacity: 0;
    animation: previewFadeUp 0.8s var(--ease-out-expo) 0.7s forwards;
}

.ai-preview-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    max-width: 560px;
    width: 100%;
    align-self: stretch;
    margin: 1rem auto 0;
    opacity: 0;
    animation: previewFadeUp 0.8s var(--ease-out-expo) 0.9s forwards;
}
.ai-preview-card {
    background: rgba(10,9,8,0.75);
    border: 1px solid rgba(201,165,92,0.08);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    transition: all 0.4s var(--ease-out-expo);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    position: relative;
    overflow: hidden;
}
.ai-preview-card:hover {
    border-color: rgba(201,165,92,0.3);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 14px 36px rgba(0,0,0,0.22), 0 0 24px rgba(201,165,92,0.06);
}
.ai-preview-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ai-preview-card-icon {
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(201,165,92,0.12), rgba(201,165,92,0.06));
    border: 1px solid rgba(201,165,92,0.15);
    border-radius: 9px;
    flex-shrink: 0;
    transition: all 0.35s ease;
}
.ai-preview-card:hover .ai-preview-card-icon {
    background: linear-gradient(135deg, rgba(201,165,92,0.25), rgba(201,165,92,0.12));
    border-color: rgba(201,165,92,0.4);
    box-shadow: 0 0 16px rgba(201,165,92,0.15);
    transform: scale(1.08);
}
.ai-preview-card-icon svg { width: 15px; height: 15px; color: var(--gold); }
.ai-preview-card-title {
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}
.ai-preview-card-prompt {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.ai-preview-caps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1rem;
    opacity: 0;
    animation: previewFadeUp 0.8s var(--ease-out-expo) 1.1s forwards;
}
.ai-preview-cap {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
    padding: 0.3rem 0.6rem;
    border: 1px solid rgba(201,165,92,0.18);
    border-radius: 20px;
    background: rgba(201,165,92,0.04);
    transition: all 0.25s ease;
}
.ai-preview-cap:hover {
    color: var(--gold);
    border-color: var(--gold-muted);
    background: rgba(201,165,92,0.06);
}
.ai-preview-cap svg { width: 11px; height: 11px; color: inherit; }

/* ─── Input bar — 1:1 replica of real .input-bar ─── */
.ai-preview-input-bar {
    display: block;
    margin-top: 1.25rem;
    background: var(--glass-input);
    border: 1px solid rgba(201,165,78,0.06);
    border-radius: 24px;
    padding: 4px;
    backdrop-filter: blur(32px) saturate(1.4);
    -webkit-backdrop-filter: blur(32px) saturate(1.4);
    box-shadow: var(--shadow-sm), 0 0 0 1px var(--gold-glow);
    text-decoration: none;
    transition: border-color var(--t-smooth), box-shadow var(--t-smooth), transform 0.35s var(--ease-out-expo);
    opacity: 0;
    animation: previewFadeUp 0.8s var(--ease-out-expo) 1.3s forwards;
    position: relative;
}
.ai-preview-input-bar:hover {
    border-color: rgba(201,165,78,0.18);
    box-shadow: var(--shadow-md), 0 0 0 1px var(--gold-dim);
    transform: translateY(-1px);
}
.ai-preview-input-wrapper { width: 100%; }
.ai-preview-input-row {
    display: flex;
    gap: 0.2rem;
    align-items: center;
    padding: 6px 10px;
}

.ai-preview-btn-tool {
    width: 36px; height: 36px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
    padding: 0;
}
.ai-preview-btn-tool svg { width: 17px; height: 17px; }
.ai-preview-btn-tool:hover { color: var(--gold); background: rgba(201,165,92,0.08); }

.ai-preview-input-divider {
    width: 1px; height: 20px;
    background: linear-gradient(180deg, transparent, var(--onyx-border), transparent);
    flex-shrink: 0;
    margin: 0 0.2rem;
    opacity: 0.6;
}

.ai-preview-input-field {
    flex: 1;
    padding: 0.55rem 0.5rem;
    color: var(--text-tertiary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 300;
    letter-spacing: 0.2px;
    line-height: 1.6;
    min-height: 40px;
    display: flex;
    align-items: center;
    text-align: left;
    position: relative;
}
.ai-preview-input-field .ai-preview-input-placeholder { color: var(--text-tertiary); font-weight: 300; }

/* Send button — circular gem replica of .btn-send */
.ai-preview-btn-send {
    width: 40px; height: 40px;
    border: 1.5px solid rgba(218,186,107,0.5);
    color: var(--onyx-black);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
    flex-shrink: 0;
    border-radius: 50%;
    align-self: flex-end;
    margin-bottom: 2px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 30%, #f0d778, var(--gold) 55%, #b89440);
    box-shadow:
        0 2px 8px rgba(120,90,20,0.2),
        0 1px 3px rgba(0,0,0,0.2),
        inset 0 1px 1px rgba(255,255,255,0.12),
        inset 0 -2px 4px rgba(0,0,0,0.15);
    padding: 0;
}
.ai-preview-btn-send svg { width: 22px; height: 22px; position: relative; z-index: 1; }
/* Specular highlight */
.ai-preview-btn-send::before {
    content: '';
    position: absolute;
    top: 4px; left: 6px;
    width: 18px; height: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.05) 60%, transparent 100%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}
/* Shimmer sweep */
.ai-preview-btn-send::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.2) 46%, rgba(255,255,255,0.06) 54%, transparent 70%);
    background-size: 300% 100%;
    background-position: 100% 0;
    z-index: 3;
    pointer-events: none;
    animation: gemShimmer 5s ease-in-out infinite;
}
@keyframes gemShimmer {
    0%, 80% { background-position: 100% 0; }
    95%, 100% { background-position: -100% 0; }
}

.ai-preview-input-bar:hover .ai-preview-btn-send { transform: scale(1.05); }

/* ═══ PREVIEW BANNER — clearly signal this is a preview ═══ */
.ai-preview-banner {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.65rem;
    border: 1px solid rgba(201,165,92,0.3);
    background: linear-gradient(135deg, rgba(201,165,92,0.14), rgba(201,165,92,0.06));
    border-radius: 100px;
    color: var(--gold-bright);
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 1.5px;
    text-transform: lowercase;
    box-shadow: 0 0 12px rgba(201,165,92,0.15);
    animation: previewBannerPulse 3s ease-in-out infinite;
}
.ai-preview-banner-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--gold-bright);
    box-shadow: 0 0 8px rgba(232,197,90,0.7);
    animation: previewDotBlink 1.5s ease-in-out infinite;
}
@keyframes previewBannerPulse {
    0%, 100% { box-shadow: 0 0 12px rgba(201,165,92,0.15); border-color: rgba(201,165,92,0.3); }
    50% { box-shadow: 0 0 20px rgba(201,165,92,0.3); border-color: rgba(201,165,92,0.5); }
}
@keyframes previewDotBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ═══ SIDEBAR + SHELL ═══ 1:1 with real .sidebar */
.ai-preview-shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0;
    transition: grid-template-columns 0.4s var(--ease-out-expo);
    min-height: 560px;
}
.ai-preview.sidebar-collapsed .ai-preview-shell {
    grid-template-columns: 48px 1fr;
}

.ai-preview-sidebar {
    position: relative;
    background: rgba(38,34,25,0.55);
    background-image:
        linear-gradient(180deg, rgba(201,165,92,0.06) 0%, transparent 22%),
        linear-gradient(90deg, rgba(201,165,92,0.03), transparent 60%);
    border-right: 1px solid rgba(201,165,92,0.12);
    border-radius: 12px 0 0 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow:
        inset -1px 0 0 rgba(201,165,92,0.04),
        1px 0 0 rgba(0,0,0,0.3);
}
.ai-preview.sidebar-collapsed .ai-preview-sidebar {
    background: rgba(38,34,25,0.7);
    background-image:
        linear-gradient(180deg, rgba(201,165,92,0.1) 0%, rgba(201,165,92,0.02) 35%, transparent 60%),
        linear-gradient(90deg, rgba(201,165,92,0.05), transparent 70%);
    border-right-color: rgba(201,165,92,0.18);
}

/* Collapsed-state strip (.sidebar-collapsed-strip replica) */
.ai-preview-strip {
    position: absolute;
    inset: 0 auto 0 0;
    width: 48px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0;
    gap: 0.35rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease 0.1s;
    background: linear-gradient(180deg, rgba(201,165,92,0.03) 0%, transparent 30%);
    z-index: 3;
}
.ai-preview.sidebar-collapsed .ai-preview-strip {
    opacity: 1;
    pointer-events: auto;
}
.ai-preview-strip-btn {
    width: 34px; height: 34px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    padding: 0;
}
.ai-preview-strip-btn svg { width: 16px; height: 16px; }
.ai-preview-strip-btn:hover {
    color: var(--gold);
    border-color: rgba(201,165,92,0.2);
    background: rgba(201,165,92,0.08);
}
.ai-preview-strip-divider {
    width: 20px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201,165,92,0.35), transparent);
    margin: 0.15rem 0;
}
.ai-preview-strip-btn-end { margin-top: auto; }

/* Expanded sidebar content */
.ai-preview-sidebar-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    opacity: 1;
    transition: opacity 0.2s ease;
}
.ai-preview.sidebar-collapsed .ai-preview-sidebar-main {
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

/* Sidebar header — New Chat + New Folder row, then search */
.ai-preview-sidebar-header {
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
    position: relative;
}
.ai-preview-sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0.5rem; right: 0.5rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--onyx-border), rgba(201,165,92,0.1), var(--onyx-border), transparent);
}
.ai-preview-sidebar-header-row {
    display: flex;
    gap: 0.35rem;
}
.ai-preview-new-chat {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    background: linear-gradient(135deg, rgba(201,165,92,0.1), rgba(201,165,92,0.04));
    border: 1px solid rgba(201,165,92,0.15);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.ai-preview-new-chat::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(201,165,92,0.08), transparent);
    transition: left 0.5s ease;
}
.ai-preview-new-chat:hover::after { left: 150%; }
.ai-preview-new-chat svg { width: 15px; height: 15px; color: var(--gold); opacity: 0.7; transition: opacity 0.2s; }
.ai-preview-new-chat:hover {
    background: linear-gradient(135deg, rgba(201,165,92,0.2), rgba(201,165,92,0.1));
    border-color: rgba(201,165,92,0.3);
    color: var(--gold);
    box-shadow: 0 2px 12px rgba(201,165,92,0.1);
}
.ai-preview-new-chat:hover svg { opacity: 1; }

.ai-preview-new-folder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    background: var(--onyx-surface);
    border: 1px solid var(--onyx-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
}
.ai-preview-new-folder svg { width: 16px; height: 16px; color: var(--text-tertiary); transition: color 0.2s; }
.ai-preview-new-folder:hover { border-color: rgba(201,165,92,0.3); background: rgba(201,165,92,0.06); }
.ai-preview-new-folder:hover svg { color: var(--gold); }

.ai-preview-sidebar-search {
    position: relative;
}
.ai-preview-sidebar-search input {
    width: 100%;
    background: var(--onyx-surface);
    border: 1px solid var(--onyx-border);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.78rem;
    padding: 0.4rem 0.65rem 0.4rem 1.8rem;
    border-radius: 8px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}
.ai-preview-sidebar-search input::placeholder { color: var(--text-tertiary); }
.ai-preview-sidebar-search svg {
    position: absolute;
    left: 0.55rem; top: 50%;
    transform: translateY(-50%);
    width: 13px; height: 13px;
    color: var(--text-tertiary);
    pointer-events: none;
}

/* Conversation list — items with title + preview subline */
.ai-preview-sidebar-list {
    flex: 1;
    overflow: hidden;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.ai-preview-sidebar-item {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.55rem 0.6rem;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    min-height: 36px;
    border-left: 2px solid transparent;
    border-radius: 0 10px 10px 0;
}
.ai-preview-sidebar-item:hover {
    background: rgba(201,165,92,0.08);
    border-color: rgba(201,165,92,0.12);
    border-left-color: rgba(201,165,92,0.4);
}
.ai-preview-sidebar-item.active {
    background: rgba(201,165,92,0.08);
    border-color: rgba(201,165,92,0.12);
    border-left-color: var(--gold);
    box-shadow: inset 0 0 16px rgba(201,165,92,0.04), 0 1px 4px rgba(0,0,0,0.04);
}
.ai-preview-sidebar-item-content {
    flex: 1;
    min-width: 0;
}
.ai-preview-sidebar-item-text {
    font-size: 0.78rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    display: block;
    transition: color 0.2s ease;
}
.ai-preview-sidebar-item:hover .ai-preview-sidebar-item-text { color: var(--gold); }
.ai-preview-sidebar-item.active .ai-preview-sidebar-item-text { color: var(--text-primary); font-weight: 500; }
.ai-preview-sidebar-item-preview {
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.65;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin-top: 0.2rem;
    display: block;
}

/* Personas section */
.ai-preview-sidebar-personas {
    padding: 0.5rem;
    flex-shrink: 0;
    position: relative;
}
.ai-preview-sidebar-personas::before {
    content: '';
    position: absolute;
    top: 0; left: 0.5rem; right: 0.5rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--onyx-border), rgba(201,165,92,0.1), var(--onyx-border), transparent);
}
.ai-preview-sidebar-personas label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.5rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold-muted);
    margin-bottom: 0.3rem;
    padding: 0 0.15rem;
}
.ai-preview-persona-select {
    width: 100%;
    background: var(--onyx-surface);
    border: 1px solid var(--onyx-border);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.ai-preview-persona-select:hover { border-color: rgba(201,165,92,0.2); }
.ai-preview-persona-select svg { width: 11px; height: 11px; color: var(--text-tertiary); flex-shrink: 0; }

/* Footer — chat count + action buttons */
.ai-preview-sidebar-footer {
    padding: 0.45rem 0.55rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative;
}
.ai-preview-sidebar-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0.5rem; right: 0.5rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--onyx-border), rgba(201,165,92,0.1), var(--onyx-border), transparent);
}
.ai-preview-sidebar-footer-text {
    font-family: var(--font-mono);
    font-size: 0.48rem;
    letter-spacing: 0.8px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    opacity: 0.7;
}
.ai-preview-sidebar-footer-actions {
    display: flex;
    gap: 0.15rem;
    align-items: center;
}
.ai-preview-sidebar-footer-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    width: 28px; height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.25s ease;
    padding: 0;
}
.ai-preview-sidebar-footer-btn svg { width: 13px; height: 13px; }
.ai-preview-sidebar-footer-btn:hover {
    color: var(--gold);
    border-color: var(--onyx-border);
    background: var(--gold-dim);
}

/* ═══ CHAT APP HEADER inside main column (1:1 with real .header) ═══ */
.ai-preview-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.ai-preview-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: rgba(15, 14, 12, 0.55);
    backdrop-filter: blur(40px) saturate(1.5);
    -webkit-backdrop-filter: blur(40px) saturate(1.5);
    border-bottom: 1px solid var(--gold-dim);
    flex-shrink: 0;
}
.ai-preview-chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ai-preview-chat-toggle {
    width: 32px; height: 32px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    padding: 0;
}
.ai-preview-chat-toggle svg { width: 17px; height: 17px; }
.ai-preview-chat-toggle:hover { color: var(--gold); background: rgba(201,165,92,0.06); }

.ai-preview-chat-logo {
    width: 24px; height: 24px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(201,165,92,0.3));
    position: relative;
    background: rgba(201,165,92,0.4);
    overflow: hidden;
    animation: previewLogoIdle 6s ease-in-out infinite;
}
.ai-preview-chat-logo::before {
    content: '';
    position: absolute;
    inset: 1.5px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: conic-gradient(from 0deg at 50% 50%, #38352f 0deg, #38352f 52deg, #2a2824 68deg, #2a2824 112deg, #1e1c18 128deg, #1e1c18 172deg, #131210 188deg, #131210 232deg, #1a1816 248deg, #1a1816 292deg, #302d28 308deg, #302d28 352deg, #38352f 360deg);
}
.ai-preview-chat-logo::after {
    content: '';
    position: absolute;
    top: 1.5px; left: 1.5px;
    width: calc(100% - 3px); height: calc(50% - 1.5px);
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    clip-path: polygon(50% 0%, 100% 50%, 0% 50%);
}
@keyframes previewLogoIdle {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(201,165,92,0.25)); }
    50% { filter: drop-shadow(0 0 10px rgba(201,165,92,0.4)); }
}

.ai-preview-chat-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-primary);
}
.ai-preview-chat-title em {
    font-style: italic;
    font-weight: 700;
    font-size: 1.15em;
    margin-left: -0.25em;
    background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 40%, var(--gold-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-preview-chat-status { display: flex; align-items: center; }
.ai-preview-chat-status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--color-active);
    box-shadow: 0 0 6px var(--color-active-glow);
    animation: statusPulse 3s ease-in-out infinite;
}

.ai-preview-chat-header-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.ai-preview-model-picker {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(201,165,92,0.03);
    border: 1px solid rgba(201,165,92,0.08);
    padding: 0.3rem 0.55rem 0.3rem 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 20px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}
.ai-preview-model-picker:hover {
    background: rgba(201,165,92,0.07);
    border-color: rgba(201,165,92,0.18);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.06), 0 0 8px rgba(201,165,92,0.06);
}
.ai-preview-model-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--color-active);
    box-shadow: 0 0 6px var(--color-active-glow);
    flex-shrink: 0;
}
.ai-preview-model-name {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.ai-preview-model-arrow {
    color: var(--text-tertiary);
    font-size: 0.55rem;
    line-height: 1;
}

/* Main content area (welcome + input inside main column) */
.ai-preview-main .ai-preview-welcome {
    padding: 1.25rem 0.5rem 0.5rem;
    gap: 0.85rem;
    width: 100%;
    box-sizing: border-box;
}
.ai-preview-main .ai-preview-input-bar {
    margin: 0.5rem 0.5rem 0.5rem;
    /* calc ensures the bar never overflows its column regardless of box-model */
    width: calc(100% - 1rem);
    box-sizing: border-box;
}

/* NOTE: This block was previously @media (max-width: 720px) — bumped to 768px to
   unify with the main mobile breakpoint. The higher-specificity selector below is
   intentional: .ai-preview.sidebar-collapsed .ai-preview-shell has specificity 0,2,0
   which beats the plain .ai-preview-shell rule at 0,1,0, so we must match it here. */
@media (max-width: 768px) {
    .ai-preview-shell,
    .ai-preview.sidebar-collapsed .ai-preview-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .ai-preview-sidebar { display: none; }
    /* Sidebar is hidden on mobile, so the header toggle has nothing to toggle
       — and its click handler preventDefault()s the link, making it a dead tap. */
    .ai-preview-chat-toggle { display: none; }
    .ai-preview-banner { font-size: 0.5rem; padding: 0.2rem 0.5rem; }
    .ai-preview-chat-header { padding: 0.55rem 0.75rem; }
    .ai-preview-chat-title { font-size: 0.9rem; letter-spacing: 2px; }
    .ai-preview-model-name { font-size: 0.58rem; max-width: 80px; overflow: hidden; text-overflow: ellipsis; }
}

@keyframes previewFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes previewGemFloat {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); }
    50% { transform: translate(-50%, -50%) translateY(-6px); }
}
@keyframes previewRingPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.3; }
}
@keyframes previewOrbit1 {
    0% { transform: translate(-50%, -50%) rotate(0deg) translateX(46px) rotate(0deg); opacity: 0.8; }
    50% { opacity: 0.2; }
    100% { transform: translate(-50%, -50%) rotate(360deg) translateX(46px) rotate(-360deg); opacity: 0.8; }
}
@keyframes previewOrbit2 {
    0% { transform: translate(-50%, -50%) rotate(120deg) translateX(38px) rotate(-120deg); opacity: 0.5; }
    50% { opacity: 0.1; }
    100% { transform: translate(-50%, -50%) rotate(480deg) translateX(38px) rotate(-480deg); opacity: 0.5; }
}
@keyframes previewOrbit3 {
    0% { transform: translate(-50%, -50%) rotate(240deg) translateX(50px) rotate(-240deg); opacity: 0.6; }
    50% { opacity: 0.15; }
    100% { transform: translate(-50%, -50%) rotate(600deg) translateX(50px) rotate(-600deg); opacity: 0.6; }
}
@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ═══ SECTION SHARED ═══ */
.ai-section {
    padding: 6rem 1.5rem;
    position: relative;
    z-index: 1;
}
.ai-section-inner { max-width: 1100px; margin: 0 auto; }
.ai-section-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--gold-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 1rem;
}
.ai-section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 400;
    line-height: 1.15;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
}
.ai-section-title .em { color: var(--gold); font-style: italic; font-weight: 300; }
.ai-section-sub {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 620px;
    margin: 0 auto 4rem;
    line-height: 1.6;
}

/* ═══ BOTTOM CTA ═══ */
.ai-cta-section {
    padding: 7rem 1.5rem;
    padding-bottom: max(7rem, calc(4rem + env(safe-area-inset-bottom)));
    text-align: center;
    position: relative;
    z-index: 1;
}
.ai-cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(201,165,78,0.06) 0%, transparent 60%);
    pointer-events: none;
}
.ai-cta-inner { position: relative; max-width: 720px; margin: 0 auto; }

/* ═══ FOOTER TWEAKS FOR AI PAGE ═══ */
.ai-page .site-footer { position: relative; z-index: 1; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
    .ai-nav { padding: 0.7rem 1.2rem; gap: 1rem; }
    .ai-nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; margin-top: 0.5rem; flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem; background: rgba(12,10,8,0.95); backdrop-filter: blur(20px); border: 1px solid rgba(201,165,78,0.15); border-radius: 16px; }
    .ai-nav-links.open { display: flex; }
    .ai-nav-mobile-only { display: list-item; }
    .ai-nav-links li { width: 100%; }
    .ai-nav-links a { display: block; padding: 0.85rem 1rem; text-align: center; border-left: none; }
    .ai-nav-cta {
        margin-top: 0.25rem;
        border-top: 1px solid rgba(201,165,92,0.15);
        border-left: none !important;
        padding: 0.85rem 1rem !important;
        justify-content: center;
    }
    .ai-nav-toggle { display: flex; }
    .ai-nav-logo-text { font-size: 1rem; letter-spacing: 2px; }
    .ai-hero { padding: 7rem 1.25rem 4rem; }
    .ai-hero-chat { padding: 5.5rem 1rem 2.5rem; }
    .ai-section { padding: 4.5rem 1.25rem; }
    .ai-cta-section { padding: 5rem 1.25rem; }
    .ai-preview-hero { padding: 0.75rem 0.85rem 0.85rem; border-radius: 16px; width: 100%; box-sizing: border-box; }
    .ai-preview-hero::before { border-radius: 16px; }
    .ai-preview-welcome-title { font-size: 2.4rem; }
    .ai-preview-cards { max-width: 100%; width: 100%; box-sizing: border-box; }
    .ai-preview-card { padding: 0.75rem 0.85rem; }
    /* Chips — full-width wrapping row so they don't overflow on narrow viewports */
    .ai-preview-caps { gap: 0.3rem; width: 100%; box-sizing: border-box; flex-wrap: wrap; }
    /* Input bar — fill the full column width; box-sizing prevents padding overflow */
    .ai-preview-input-bar { width: 100%; box-sizing: border-box; margin-left: 0; margin-right: 0; }
    .ai-preview-input-wrapper { width: 100%; box-sizing: border-box; }
    /* Input bar row — match real mobile behaviour: tighten row, drop divider + secondary tools */
    .ai-preview-input-row { padding: 6px 8px; gap: 0.35rem; }
    .ai-preview-input-divider { display: none; }
    .ai-preview-btn-tool:nth-child(2),
    .ai-preview-btn-tool:nth-last-child(2),
    .ai-preview-btn-tool:nth-last-child(3) { display: none; }
    .ai-cta-row { flex-direction: column; align-items: stretch; max-width: 280px; margin-left: auto; margin-right: auto; margin-bottom: 3rem; }
    .ai-btn { justify-content: center; }
    /* Marquee — speed up so scroll feels right on a narrow viewport */
    .ai-marquee { padding: 1rem 0; }
    .ai-marquee-track { gap: 2rem; animation-duration: 28s; }
    .ai-marquee-item { font-size: 0.68rem; letter-spacing: 1.5px; }
    /* Grid bg — smaller cell so it doesn't look sparse on phones */
    .ai-grid-bg { background-size: 48px 48px; }
    /* Hero footer — center single link, tighten spacing */
    .ai-hero-footer { margin-top: 1.25rem; justify-content: center; }
    /* Tap feedback — :hover doesn't fire on touch */
    .ai-btn-primary:active { transform: translateY(0); box-shadow: 0 4px 16px rgba(201,165,78,0.25); }
    .ai-btn-secondary:active { background: rgba(201,165,78,0.1); }
    .ai-preview-card:active { border-color: rgba(201,165,92,0.3); background: rgba(201,165,92,0.04); }
}

/* ═══ SMALL PHONES — tighten preview card so it fits a 360-400px viewport ═══ */
@media (max-width: 480px) {
    .ai-hero-chat { padding: 5rem 0.75rem 2rem; }
    .ai-hero-inner { padding: 0; }
    .ai-preview-hero { padding: 0.6rem 0.6rem 0.75rem; border-radius: 14px; }
    .ai-preview-hero::before { border-radius: 14px; }
    .ai-preview-header { padding: 0.25rem 0.4rem 0.6rem; margin-bottom: 0.6rem; gap: 0.35rem; }
    .ai-preview-label { display: none; } /* free space for the banner */
    .ai-preview-banner {
        margin-left: auto;
        font-size: 0.48rem;
        letter-spacing: 1px;
        padding: 0.2rem 0.5rem;
        gap: 0.3rem;
    }
    /* Welcome — smaller gem + title so it fits above the fold */
    .ai-preview-welcome { padding: 0.5rem 0.25rem 0.25rem; gap: 0.6rem; }
    .ai-preview-gem-container { width: 88px; height: 88px; }
    .ai-preview-gem { width: 48px; height: 48px; }
    .ai-preview-gem-ring { width: 66px; height: 66px; }
    .ai-preview-gem-ring:nth-child(2) { width: 82px; height: 82px; }
    .ai-preview-welcome::before { width: 240px; height: 240px; }
    .ai-preview-welcome-title { font-size: 1.85rem; }
    .ai-preview-welcome-sub { font-size: 0.7rem; line-height: 1.5; }
    /* Cards — single column fits better than two cramped ones */
    .ai-preview-cards { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; margin-top: 0.75rem; }
    .ai-preview-card { padding: 0.7rem 0.8rem; }
    .ai-preview-card-prompt { font-size: 0.68rem; }
    /* Caps — hide a few to keep this to two tidy rows */
    .ai-preview-caps { gap: 0.3rem; margin-top: 0.75rem; }
    .ai-preview-cap { font-size: 0.55rem; padding: 0.25rem 0.5rem; }
    .ai-preview-cap:nth-child(n+5) { display: none; }
    /* Chat header — drop model picker text on tiniest screens, keep the dot */
    .ai-preview-chat-header { padding: 0.45rem 0.6rem; }
    .ai-preview-chat-title { font-size: 0.8rem; letter-spacing: 1.5px; }
    .ai-preview-chat-title em { font-size: 1.05em; }
    .ai-preview-model-picker { padding: 0.25rem 0.45rem; gap: 0.3rem; }
    .ai-preview-model-name { font-size: 0.55rem; max-width: 56px; }
    /* Input bar — keep core attach, textarea, send */
    .ai-preview-input-field { font-size: 0.85rem; min-height: 36px; padding: 0.45rem 0.35rem; }
    .ai-preview-btn-send { width: 36px; height: 36px; }
    .ai-preview-btn-send svg { width: 18px; height: 18px; }
    /* Section/CTA padding */
    .ai-section { padding: 3.5rem 1rem; }
    .ai-cta-section { padding: 4rem 1rem; }
    .ai-marquee { padding: 0.85rem 0; }
    .ai-marquee-track { gap: 1.5rem; animation-duration: 22s; }
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ─── Reduced motion: disable intro animations, stop background canvas ─── */
@media (prefers-reduced-motion: reduce) {
    .ai-preview-gem-container,
    .ai-preview-welcome-title,
    .ai-preview-welcome-sub,
    .ai-preview-cards,
    .ai-preview-caps,
    .ai-preview-input-bar,
    .ai-hero-footer,
    .ai-status-pill-float,
    .reveal { animation: none !important; opacity: 1 !important; transform: none !important; }
    #aiNetworkCanvas { display: none; }
}

/* ─── Cursor spotlight on cards ─── */
.ai-preview-card {
    --mx: -200px;
    --my: -200px;
}
.ai-preview-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle 280px at var(--mx) var(--my), rgba(232,197,90,0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    border-radius: inherit;
}
.ai-preview-card:hover::after { opacity: 1; }

/* ─── Marquee ticker ─── */
.ai-marquee {
    border-top: 1px solid rgba(201,165,92,0.1);
    border-bottom: 1px solid rgba(201,165,92,0.1);
    overflow: hidden;
    padding: 1.4rem 0;
    position: relative;
    z-index: 1;
    background: rgba(10,9,8,0.4);
    backdrop-filter: blur(8px);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.ai-marquee-track {
    display: flex;
    gap: 3rem;
    width: max-content;
    animation: marqueeScroll 45s linear infinite;
    will-change: transform;
}
.ai-marquee:hover .ai-marquee-track { animation-play-state: paused; }
.ai-marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: lowercase;
    white-space: nowrap;
}
.ai-marquee-item.gold { color: var(--gold); }
.ai-marquee-sep {
    width: 6px; height: 6px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--gold-muted);
    display: inline-block;
    flex-shrink: 0;
}
@keyframes marqueeScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ═══ WHY I BUILT THIS SECTION ═══ */
.ai-why-section {
    padding: 7rem 1.5rem;
    position: relative;
    z-index: 1;
    background: rgba(10,9,8,0.5);
    border-top: 1px solid rgba(201,165,92,0.08);
    border-bottom: 1px solid rgba(201,165,92,0.08);
}
.ai-why-inner {
    max-width: 800px;
    margin: 0 auto;
}
.ai-why-body {
    margin: 2.5rem 0 3.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.ai-why-p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.85;
    max-width: 680px;
}
.ai-why-p em {
    color: var(--text-primary);
    font-style: italic;
}
.ai-why-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: rgba(201,165,92,0.1);
    border: 1px solid rgba(201,165,92,0.1);
}
.ai-why-card {
    background: var(--onyx-deep);
    padding: 1.75rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: background 0.3s ease;
}
.ai-why-card:hover { background: rgba(15,14,12,0.8); }
.ai-why-card-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--gold-muted);
}
.ai-why-card-value {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .ai-why-section { padding: 5rem 1.25rem; }
    .ai-why-grid { grid-template-columns: 1fr; }
    .ai-why-card { padding: 1.5rem; }
    .ai-why-p { font-size: 0.97rem; }
}
@media (max-width: 480px) {
    .ai-why-section { padding: 4rem 1rem; }
    .ai-why-card { padding: 1.25rem; }
}
