/* Aurelia Premium — Style v3.0 "Liquid Glass" */
:root {
    /* Surface tiers — deep indigo tones with clear separation */
    --bg: #0a0a0f;                    /* surface */
    --bg-lowest: #07070c;             /* surface-container-lowest */
    --bg-low: #14141f;                /* surface-container-low */
    --bg-card: #1a1a28;               /* surface-container */
    --bg-high: #242436;               /* surface-container-high */
    --bg-elevated: #2e2e44;           /* surface-container-highest */
    --bg-bright: #3a3a52;             /* surface-bright */

    /* RGB-only versions of the above for use inside rgba() opacity literals.
       Use as: rgba(var(--bg-lowest-rgb), 0.7)
       (CSS variables can't carry alpha, so we expose the channels.) */
    --bg-lowest-rgb: 7, 7, 12;
    --bg-low-rgb: 20, 20, 31;
    --bg-card-rgb: 26, 26, 40;

    /* Glass borders */
    --border: rgba(210,187,255,0.06);
    --border-strong: rgba(210,187,255,0.14);

    /* Typography colors */
    --text: #e5e2e3;                  /* on-surface */
    --text-dim: #ccc3d8;              /* on-surface-variant */
    --text-muted: #a89bb4;            /* outline — bumped for WCAG AA 4.5:1 on --bg */

    /* Primary — electric violet (replaces gold as brand accent) */
    --accent: #d2bbff;                /* primary */
    --accent-2: #7c3aed;              /* primary-container — gradient end */
    --accent-deep: #5a00c6;           /* deeper violet for tints */
    --accent-hover: #e9deff;
    --accent-glow: rgba(124,58,237,0.35);
    --on-accent: #25005a;             /* on-primary-fixed — dark violet for button text */

    /* Secondary — soft periwinkle (quiet highlights) */
    --secondary: #c3c0ff;

    /* Tertiary — premium gold (RESERVED for Pro/Premium moments only) */
    --gold: #e9c400;                  /* tertiary */
    --gold-glow: rgba(233,196,0,0.25);

    /* Status */
    --green: #34d399;
    --red: #ff6b6b;                   /* error — vibrant red */

    /* Font families */
    --font-heading: 'DM Sans', 'Inter', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.3);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 30px rgba(124,58,237,0.2);

    /* Z-index scale */
    --z-nav: 1000;
    --z-modal: 9000;
    --z-toast: 9999;

    /* Radii — no hard boxes */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* Typography scale */
    --font-xs: 11px;
    --font-sm: 13px;
    --font-base: 14px;
    --font-md: 15px;
    --font-lg: 18px;
    --font-xl: 24px;
    --font-2xl: 32px;
    --leading-tight: 1.2;
    --leading-normal: 1.6;
    --leading-relaxed: 1.8;

    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;

    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 0.15s;
    --duration-base: 0.25s;
    --duration-slow: 0.4s;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    background-image:
        radial-gradient(ellipse 900px 600px at 30% -5%, rgba(124,58,237,0.1), transparent 60%),
        radial-gradient(ellipse 600px 400px at 70% 100%, rgba(88,28,235,0.05), transparent 60%);
    background-attachment: fixed;
}
h1, h2, h3 { font-family: 'DM Sans', 'Inter', sans-serif; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }

/* ── Navigation — floating glass panel ── */
.ap-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: rgba(10,10,15,0.75); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); box-shadow: 0 1px 0 rgba(210,187,255,0.06), 0 4px 30px rgba(0,0,0,0.3); border-bottom: 1px solid rgba(210,187,255,0.06); }
.ap-nav-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; height: 68px; }
.ap-logo { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 17px; letter-spacing: -0.018em; line-height: 1; }
.ap-logo-icon { width: 38px; height: 42px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: none; box-shadow: none; }
.ap-logo-icon-sm { width: 26px; height: 28px; }
.ap-logo-mark { width: 100%; height: 100%; display: block; overflow: visible; transition: transform 0.4s var(--ease), filter 0.4s var(--ease); filter: drop-shadow(0 4px 18px rgba(124,58,237,0.35)); }
.ap-logo:hover .ap-logo-mark { transform: translateY(-1px) rotate(-2deg); filter: drop-shadow(0 6px 26px rgba(124,58,237,0.55)); }
.ap-logo-text { white-space: nowrap; }
.ap-logo-accent { background: linear-gradient(135deg, var(--accent), var(--secondary) 50%, var(--accent)); background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 700; }
.ap-nav-links { display: flex; align-items: center; gap: 28px; }
.ap-nav-links a { color: var(--text-dim); font-size: 14px; font-weight: 500; transition: color 0.15s; }
.ap-nav-links a:hover, .ap-nav-links a.active { color: var(--text); }
.ap-nav-btn { padding: 9px 20px; border-radius: var(--radius-full); font-weight: 600; font-size: 13px; transition: all 0.2s var(--ease); }
.ap-nav-btn:not(.ap-nav-btn-outline) { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); }
.ap-nav-btn:not(.ap-nav-btn-outline):hover { box-shadow: 0 0 24px var(--accent-glow); transform: translateY(-1px); color: var(--on-accent); }
.ap-nav-btn-outline { background: rgba(53,52,54,0.5); backdrop-filter: blur(10px); color: var(--text-dim); }
.ap-nav-btn-outline:hover { color: var(--text); background: rgba(53,52,54,0.8); }
.ap-nav-mobile { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.ap-nav-mobile span { display: block; width: 20px; height: 2px; background: var(--text-dim); margin: 4px 0; transition: 0.2s; border-radius: 2px; }

/* ── Main ── */
.ap-main { padding-top: 68px; min-height: 100vh; }

/* ── Hero ── */
.ap-hero { text-align: center; padding: 100px 24px 80px; max-width: 820px; margin: 0 auto; position: relative; }
.ap-hero::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 720px; height: 480px; background: radial-gradient(ellipse, var(--accent-glow), transparent 70%); pointer-events: none; opacity: 0.5; filter: blur(40px); }
.ap-hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; background: rgba(53,52,54,0.5); backdrop-filter: blur(10px); border-radius: var(--radius-full); font-size: 11px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent); margin-bottom: 28px; }
.ap-hero h1 { font-size: clamp(2.4rem, 5.5vw, 3.8rem); font-weight: 900; line-height: 1.02; margin-bottom: 22px; letter-spacing: -0.035em; }
.ap-hero h1 span { background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 50%, var(--accent) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.ap-hero-sub { font-size: 1.125rem; color: var(--text-dim); max-width: 560px; margin: 0 auto 38px; line-height: 1.7; font-weight: 300; }
.ap-hero-cta { display: inline-flex; align-items: center; gap: 10px; padding: 15px 34px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); font-size: 15px; font-weight: 700; border-radius: var(--radius-full); border: none; cursor: pointer; transition: all 0.25s var(--ease); text-decoration: none; box-shadow: 0 12px 40px var(--accent-glow); }
.ap-hero-cta:hover { transform: translateY(-2px); box-shadow: 0 20px 60px var(--accent-glow); color: var(--on-accent); }
.ap-hero-cta svg { width: 18px; height: 18px; }

/* ── Features Grid ── */
.ap-features { max-width: 960px; margin: 0 auto 80px; padding: 0 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.ap-feature { background: var(--bg-low); border-radius: var(--radius-lg); padding: 32px 26px; text-align: center; transition: all 0.3s var(--ease); }
.ap-feature:hover { background: var(--bg-card); transform: translateY(-3px); }
.ap-feature-icon { font-size: 28px; margin-bottom: 14px; filter: drop-shadow(0 0 12px var(--accent-glow)); }
.ap-feature h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.01em; }
.ap-feature p { font-size: 13px; color: var(--text-dim); line-height: 1.55; }

/* ── Section ── */
.ap-section { max-width: 820px; margin: 0 auto; padding: 60px 24px; }
.ap-section-title { font-size: 32px; font-weight: 900; margin-bottom: 10px; letter-spacing: -0.03em; }
.ap-section-sub { color: var(--text-dim); margin-bottom: 36px; font-size: 15px; font-weight: 300; }

/* ── Pricing Card ── */
.ap-pricing-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 40px 34px; text-align: center; max-width: 440px; margin: 0 auto 40px; position: relative; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,0.4); }
.ap-pricing-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent)); }
.ap-pricing-card::after { content: ''; position: absolute; top: -50%; right: -30%; width: 300px; height: 300px; background: radial-gradient(circle, var(--accent-glow), transparent 60%); pointer-events: none; opacity: 0.4; filter: blur(40px); }
.ap-pricing-badge { display: inline-block; padding: 5px 15px; background: rgba(210,187,255,0.1); border-radius: var(--radius-full); font-size: 11px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; position: relative; }
.ap-pricing-price { font-size: 52px; font-weight: 900; margin-bottom: 4px; letter-spacing: -0.03em; position: relative; }
.ap-pricing-price span { font-size: 18px; color: var(--text-dim); font-weight: 500; }
.ap-pricing-note { font-size: 13px; color: var(--text-dim); margin-bottom: 26px; position: relative; }
.ap-pricing-features { text-align: left; margin-bottom: 28px; position: relative; }
.ap-pricing-features li { list-style: none; padding: 9px 0; font-size: 14px; color: var(--text-dim); display: flex; align-items: center; gap: 10px; }
.ap-pricing-features li::before { content: ''; width: 18px; height: 18px; background: rgba(52,211,153,0.12); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ap-pricing-cta { display: block; width: 100%; padding: 15px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); font-size: 15px; font-weight: 700; border: none; border-radius: var(--radius-full); cursor: pointer; transition: all 0.25s var(--ease); text-decoration: none; text-align: center; position: relative; box-shadow: 0 10px 30px var(--accent-glow); }
.ap-pricing-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 44px var(--accent-glow); color: var(--on-accent); }

/* ── Tier Table ── */
.ap-tier-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 32px; background: var(--bg-low); border-radius: var(--radius); overflow: hidden; }
.ap-tier-table th, .ap-tier-table td { padding: 14px 18px; text-align: left; font-size: 14px; }
.ap-tier-table thead th { background: var(--bg-card); color: var(--text-dim); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.ap-tier-table tbody tr + tr td { box-shadow: inset 0 1px 0 rgba(74,68,85,0.08); }
.ap-tier-table td:last-child { text-align: right; font-weight: 700; color: var(--accent); }
.ap-tier-highlight { background: rgba(210,187,255,0.05); }

/* ── Legal ── */
.ap-legal { max-width: 740px; margin: 0 auto; padding: 60px 24px 80px; }
.ap-legal h1 { font-size: 32px; font-weight: 900; margin-bottom: 8px; letter-spacing: -0.03em; }
.ap-legal .ap-legal-updated { font-size: 13px; color: var(--text-muted); margin-bottom: 36px; }
.ap-legal h2 { font-size: 18px; font-weight: 700; margin: 32px 0 12px; color: var(--text); letter-spacing: -0.01em; }
.ap-legal h3 { font-size: 15px; font-weight: 600; margin: 20px 0 8px; }
.ap-legal p, .ap-legal li { font-size: 14px; color: var(--text-dim); line-height: 1.8; margin-bottom: 12px; }
.ap-legal ul, .ap-legal ol { padding-left: 20px; margin-bottom: 16px; }
.ap-legal strong { color: var(--text); }
.ap-legal a { color: var(--accent); }
.ap-legal table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 16px 0; background: var(--bg-low); border-radius: var(--radius-sm); overflow: hidden; }
.ap-legal table th, .ap-legal table td { padding: 11px 14px; font-size: 13px; }
.ap-legal table th { background: var(--bg-card); color: var(--text-dim); font-weight: 600; text-align: left; }
.ap-legal table tbody tr + tr td { box-shadow: inset 0 1px 0 rgba(74,68,85,0.08); }

/* ── Card ── */
.ap-card { background: rgba(16,16,28,0.5); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: var(--radius-lg); padding: 34px; margin-bottom: 24px; transition: all 0.3s var(--ease); border: 1px solid rgba(210,187,255,0.06); box-shadow: 0 4px 24px rgba(0,0,0,0.2); }
.ap-card:hover { background: rgba(21,21,32,0.7); border-color: rgba(210,187,255,0.14); box-shadow: 0 8px 40px rgba(124,58,237,0.1), 0 0 0 1px rgba(210,187,255,0.1); transform: translateY(-2px); }
.ap-card h3 { font-size: 18px; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.01em; }

/* ── Form ── */
.ap-form-group { margin-bottom: 20px; }
.ap-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 8px; }
.ap-input, .ap-textarea { width: 100%; background: var(--bg-elevated); border: none; border-radius: var(--radius-sm); padding: 13px 16px; color: var(--text); font-family: inherit; font-size: 14px; transition: all 0.2s var(--ease); outline: none; box-shadow: inset 0 0 0 1px transparent; }
.ap-input:focus, .ap-textarea:focus { background: var(--bg-high); box-shadow: inset 0 0 0 1px rgba(210,187,255,0.4), 0 0 0 4px rgba(124,58,237,0.08); }
.ap-textarea { resize: vertical; min-height: 110px; }
.ap-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 26px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); font-size: 14px; font-weight: 700; border: none; border-radius: var(--radius-full); cursor: pointer; transition: all 0.25s var(--ease); box-shadow: 0 8px 24px var(--accent-glow); }
.ap-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 36px var(--accent-glow); }

/* ── FAQ ── */
.ap-faq { margin-top: 40px; }
.ap-faq-item { padding: 2px 0; }
.ap-faq-item + .ap-faq-item { box-shadow: inset 0 1px 0 rgba(74,68,85,0.08); }
.ap-faq-q { width: 100%; background: none; border: none; color: var(--text); font-size: 15px; font-weight: 600; padding: 18px 0; text-align: left; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-family: inherit; transition: color 0.2s; letter-spacing: -0.01em; }
.ap-faq-q:hover { color: var(--accent); }
.ap-faq-arrow { font-size: 18px; color: var(--text-dim); transition: transform 0.3s var(--ease); }
.ap-faq-item.open .ap-faq-arrow { transform: rotate(90deg); color: var(--accent); }
/* FAQ open/close now handled by grid-template-rows technique below (Phase 6) */
.ap-faq-a p { font-size: 14px; color: var(--text-dim); padding: 0 0 18px; line-height: 1.75; }

/* ── Footer ── */
.ap-footer { padding: 56px 24px 28px; margin-top: 80px; background: rgba(10,10,15,0.9); backdrop-filter: blur(16px); border-top: 1px solid rgba(210,187,255,0.06); position: relative; }
.ap-footer::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 60%; max-width: 600px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-2), transparent); }
.ap-footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.ap-footer-brand { display: flex; flex-direction: column; gap: 10px; max-width: 280px; }
.ap-footer-brand strong { font-size: 15px; letter-spacing: -0.01em; }
.ap-footer-sub { font-size: 12px; color: var(--text-muted); line-height: 1.7; }
.ap-footer-sub a { color: var(--text-dim); }
.ap-footer-links { display: flex; gap: 56px; flex-wrap: wrap; }
.ap-footer-col { display: flex; flex-direction: column; gap: 10px; }
.ap-footer-col-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; color: var(--accent); margin-bottom: 6px; }
.ap-footer-col a { font-size: 13px; color: var(--text-muted); transition: color 0.2s; }
.ap-footer-col a:hover { color: var(--text); }
.ap-footer-bottom { max-width: 1200px; margin: 36px auto 0; padding-top: 22px; display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); flex-wrap: wrap; gap: 8px; letter-spacing: 0.05em; text-transform: uppercase; box-shadow: inset 0 1px 0 rgba(74,68,85,0.08); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .ap-nav-links { display: none; }
    .ap-nav-mobile { display: block; }
    .ap-hero { padding: 80px 20px 60px; }
    .ap-hero h1 { font-size: 2.1rem; }
    .ap-features { grid-template-columns: 1fr; }
    .ap-footer-inner { flex-direction: column; }
    .ap-footer-links { flex-direction: column; gap: 28px; }
    .ap-tier-table { font-size: 12px; }
    .ap-tier-table th, .ap-tier-table td { padding: 10px 12px; }
    #toolGrid { grid-template-columns: 1fr !important; }
}

/* ============================================================
   MODERN HOMEPAGE — v2 redesign (Lumina edition)
   ============================================================ */

/* Scroll reveal */
[data-anim] { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
[data-anim].is-visible { opacity: 1; transform: translateY(0); }

/* ── Modern hero ── */
.ap-hero-modern { position: relative; min-height: calc(100vh - 68px); padding: 60px 24px 80px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ap-hero-content { max-width: 1240px; width: 100%; display: grid; grid-template-columns: 1.1fr 1fr; gap: 72px; align-items: center; position: relative; z-index: 2; }
.ap-hero-col { min-width: 0; }

/* Animated ambient light blobs */
.ap-hero-blob { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.4; pointer-events: none; z-index: 0; }
.ap-hero-blob-1 { width: 680px; height: 680px; background: radial-gradient(circle, var(--accent-2), transparent 65%); top: -160px; left: -160px; animation: blob-drift 22s ease-in-out infinite; opacity: 0.5; }
.ap-hero-blob-2 { width: 560px; height: 560px; background: radial-gradient(circle, var(--secondary), transparent 65%); bottom: -120px; right: -100px; animation: blob-drift 28s ease-in-out infinite reverse; opacity: 0.35; }
.ap-hero-blob-3 { width: 500px; height: 500px; background: radial-gradient(circle, var(--accent-deep), transparent 65%); top: 25%; right: 15%; animation: blob-drift 32s ease-in-out infinite; opacity: 0.4; }
@keyframes blob-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.08); }
    66% { transform: translate(-30px, 40px) scale(0.95); }
}

/* Hero text column */
.ap-hero-badge-modern { display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px; background: rgba(53,52,54,0.5); backdrop-filter: blur(14px); border-radius: var(--radius-full); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 30px; }
.ap-hero-dot { width: 8px; height: 8px; background: var(--green); border-radius: 50%; animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0.6); }
    50% { box-shadow: 0 0 0 8px rgba(52,211,153,0); }
}

.ap-hero-title { font-size: clamp(2.6rem, 6vw, 4.8rem); font-weight: 900; line-height: 0.98; letter-spacing: -0.04em; margin-bottom: 30px; }
.ap-hero-gradient-text { background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 45%, var(--accent) 100%); background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; animation: gradient-shift 6s linear infinite; }
@keyframes gradient-shift {
    to { background-position: 200% center; }
}

.ap-hero-sub-modern { font-size: 1.175rem; color: var(--text-dim); max-width: 540px; line-height: 1.7; margin-bottom: 42px; font-weight: 300; }

.ap-hero-actions { display: flex; gap: 14px; margin-bottom: 52px; flex-wrap: wrap; }

.ap-cta-primary { display: inline-flex; align-items: center; gap: 10px; padding: 18px 38px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); font-size: 16px; font-weight: 700; border-radius: var(--radius-full); border: none; cursor: pointer; transition: all 0.3s var(--ease); text-decoration: none; position: relative; overflow: hidden; box-shadow: 0 14px 44px var(--accent-glow), 0 0 0 1px rgba(210,187,255,0.2); }
.ap-cta-primary::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent); transition: left 0.6s; }
.ap-cta-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 60px var(--accent-glow); color: var(--on-accent); }
.ap-cta-primary:hover::before { left: 100%; }
.ap-cta-primary svg { transition: transform 0.2s; }
.ap-cta-primary:hover svg { transform: translateX(4px); }

.ap-cta-secondary { display: inline-flex; align-items: center; padding: 16px 26px; background: rgba(53,52,54,0.5); backdrop-filter: blur(14px); color: var(--text); font-size: 14px; font-weight: 600; border-radius: var(--radius-full); border: none; cursor: pointer; transition: all 0.25s var(--ease); text-decoration: none; }
.ap-cta-secondary:hover { background: rgba(53,52,54,0.85); color: var(--accent); box-shadow: 0 0 0 1px rgba(210,187,255,0.25); }

/* Hero stats */
.ap-hero-stats { display: flex; gap: 48px; padding-top: 30px; box-shadow: inset 0 1px 0 rgba(74,68,85,0.15); }
.ap-stat { display: flex; flex-direction: column; }
.ap-stat-value { font-size: 28px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; background: linear-gradient(135deg, #fff, var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; letter-spacing: -0.02em; }
.ap-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.12em; margin-top: 4px; font-weight: 600; }

/* ── Demo card (right column) — glassmorphism floating element ── */
.ap-hero-demo { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ap-demo-card { width: 100%; max-width: 500px; background: rgba(16,16,28,0.6); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 40px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(210,187,255,0.1), 0 0 120px rgba(124,58,237,0.15); animation: demo-float 6s ease-in-out infinite; border: 1px solid rgba(210,187,255,0.08); }
@keyframes demo-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(-0.3deg); }
}
.ap-demo-bar { display: flex; align-items: center; gap: 6px; padding: 13px 16px; background: rgba(14,14,15,0.6); }
.ap-demo-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.ap-demo-filename { margin-left: auto; font-size: 11px; color: var(--text-muted); font-family: 'SF Mono', Menlo, monospace; letter-spacing: 0.02em; }
.ap-demo-canvas { background: var(--bg-lowest); position: relative; aspect-ratio: 420/260; overflow: hidden; }
.ap-demo-svg { width: 100%; height: 100%; display: block; }
.ap-demo-scan { filter: drop-shadow(0 0 10px var(--accent)); }
.ap-demo-text-layer { transform-origin: 120px 110px; }
.ap-demo-bird { stroke-dasharray: 40; stroke-dashoffset: 0; opacity: 0.7; }
.ap-demo-detect-box { filter: drop-shadow(0 0 8px rgba(210,187,255,0.7)); }
.ap-demo-status-dot { animation: pulse-status 1.8s ease-in-out infinite; }
@keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.ap-demo-footer { padding: 13px 18px 16px; background: rgba(14,14,15,0.5); }
.ap-demo-progress { height: 4px; background: rgba(255,255,255,0.08); border-radius: var(--radius-full); overflow: hidden; margin-bottom: 10px; }
.ap-demo-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--secondary), var(--accent)); background-size: 200% 100%; width: 0; transition: width 0.12s linear; box-shadow: 0 0 12px rgba(210,187,255,0.6); animation: shimmer 2s linear infinite; }
@keyframes shimmer {
    to { background-position: 200% 0; }
}
.ap-demo-footer-text { display: flex; justify-content: space-between; font-size: 11px; }
.ap-demo-label { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.ap-demo-timer { color: var(--text-dim); font-family: 'SF Mono', Menlo, monospace; font-variant-numeric: tabular-nums; }
.ap-demo-caption { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.15em; cursor: pointer; transition: color 0.2s; font-weight: 600; }
.ap-demo-caption:hover { color: var(--accent); }

/* Scroll hint */
.ap-hero-scroll-hint { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 2; color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.2em; opacity: 0.6; animation: fade-pulse 3s ease-in-out infinite; font-weight: 600; }
@keyframes fade-pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.8; } }
.ap-scroll-mouse { width: 22px; height: 34px; box-shadow: inset 0 0 0 2px currentColor; border-radius: 12px; display: flex; justify-content: center; padding-top: 6px; }
.ap-scroll-wheel { width: 3px; height: 6px; background: currentColor; border-radius: 2px; animation: scroll-wheel 2s ease-in-out infinite; }
@keyframes scroll-wheel {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(10px); opacity: 0; }
}

/* ── Section divider ── */
.ap-section-divider { width: 100%; max-width: 200px; height: 1px; margin: 0 auto; background: linear-gradient(90deg, transparent, var(--accent-2), var(--accent), var(--accent-2), transparent); opacity: 0.5; }

/* ── Section titles (big) ── */
.ap-section-title-big { font-size: clamp(2rem, 4vw, 3rem); font-weight: 900; letter-spacing: -0.035em; text-align: center; margin-bottom: 12px; line-height: 1.05; background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.ap-section-sub-big { font-size: 1.05rem; color: var(--text-dim); text-align: center; margin-bottom: 60px; max-width: 620px; margin-left: auto; margin-right: auto; font-weight: 300; }

/* ── How it works — tonal layering, no hard borders ── */
.ap-how { max-width: 1200px; margin: 0 auto; padding: 100px 24px; }
.ap-how-steps { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 24px; align-items: center; }
.ap-how-step { background: rgba(16,16,28,0.5); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: var(--radius-lg); padding: 36px 30px; text-align: center; transition: all 0.4s var(--ease); position: relative; overflow: hidden; border: 1px solid rgba(210,187,255,0.06); box-shadow: 0 4px 24px rgba(0,0,0,0.2); }
.ap-how-step::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at top, rgba(124,58,237,0.15), transparent 60%); opacity: 0; transition: opacity 0.4s; }
.ap-how-step:hover { background: var(--bg-card); transform: translateY(-5px); box-shadow: 0 24px 48px rgba(0,0,0,0.35), 0 0 80px rgba(124,58,237,0.1); border-color: rgba(210,187,255,0.15); }
.ap-how-step:hover::before { opacity: 1; }
.ap-how-num { position: absolute; top: 18px; right: 22px; font-size: 44px; font-weight: 900; color: rgba(210,187,255,0.12); letter-spacing: -0.04em; }
.ap-how-icon { width: 60px; height: 60px; margin: 0 auto 20px; color: var(--accent); background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(210,187,255,0.06)); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; position: relative; box-shadow: 0 0 40px rgba(124,58,237,0.15); }
.ap-how-icon svg { width: 28px; height: 28px; }
.ap-how-step h3 { font-size: 20px; font-weight: 800; margin-bottom: 10px; letter-spacing: -0.02em; position: relative; }
.ap-how-step p { font-size: 13px; color: var(--text-dim); line-height: 1.65; position: relative; }
.ap-how-arrow { color: var(--text-muted); }
.ap-how-arrow svg { width: 48px; height: 16px; }
.ap-how-arrow-dash { animation: dash-flow 3s linear infinite; stroke-dashoffset: 0; }
@keyframes dash-flow {
    to { stroke-dashoffset: -24; }
}

/* ── Modern features grid ── */
.ap-features-modern { max-width: 1200px; margin: 0 auto; padding: 80px 24px; }
.ap-features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 22px; }
.ap-feature-card { background: rgba(16,16,28,0.5); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: var(--radius-lg); padding: 32px 28px; transition: all 0.4s var(--ease); position: relative; overflow: hidden; cursor: pointer; border: 1px solid rgba(210,187,255,0.06); box-shadow: 0 4px 24px rgba(0,0,0,0.2); }
.ap-feature-card::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, rgba(210,187,255,0.15), transparent 50%, rgba(124,58,237,0.15)); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity 0.4s; pointer-events: none; }
.ap-feature-card::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0; transition: opacity 0.4s; }
.ap-feature-card:hover { background: var(--bg-card); transform: translateY(-6px); box-shadow: 0 24px 48px rgba(0,0,0,0.35), 0 0 60px rgba(124,58,237,0.08); border-color: rgba(210,187,255,0.12); }
.ap-feature-card:hover::before { opacity: 1; }
.ap-feature-card:hover::after { opacity: 1; }
.ap-feature-card-icon { width: 52px; height: 52px; color: var(--accent); background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(210,187,255,0.05)); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; transition: all 0.4s var(--ease); box-shadow: 0 0 30px rgba(124,58,237,0.12); }
.ap-feature-card-icon svg { width: 24px; height: 24px; }
.ap-feature-card:hover .ap-feature-card-icon { transform: rotate(-6deg) scale(1.1); box-shadow: 0 0 40px rgba(124,58,237,0.25); }
.ap-feature-card h3 { font-size: 16px; font-weight: 800; margin-bottom: 10px; letter-spacing: -0.01em; }
.ap-feature-card p { font-size: 13px; color: var(--text-dim); line-height: 1.65; }

/* ── Bottom CTA ── */
.ap-cta-section { max-width: 1200px; margin: 60px auto; padding: 0 24px; }
.ap-cta-card { position: relative; background: linear-gradient(135deg, rgba(124,58,237,0.22), rgba(210,187,255,0.06)); border-radius: var(--radius-xl); padding: 64px 44px; text-align: center; overflow: hidden; box-shadow: 0 40px 80px rgba(0,0,0,0.4); border: 1px solid rgba(210,187,255,0.1); }
.ap-cta-card::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(124,58,237,0.18), transparent 60%); animation: cta-shimmer 12s ease-in-out infinite; }
@keyframes cta-shimmer {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}
.ap-cta-content { position: relative; z-index: 1; }
.ap-cta-card h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); font-weight: 900; margin-bottom: 16px; letter-spacing: -0.03em; line-height: 1.1; }
.ap-cta-card p { font-size: 15px; color: var(--text-dim); max-width: 560px; margin: 0 auto 32px; line-height: 1.7; font-weight: 300; }
.ap-cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ── Responsive modern layout ── */
@media (max-width: 900px) {
    .ap-hero-content { grid-template-columns: 1fr; gap: 48px; }
    .ap-hero-text { text-align: center; }
    .ap-hero-sub-modern { margin-left: auto; margin-right: auto; }
    .ap-hero-actions, .ap-hero-stats { justify-content: center; }
    .ap-hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
    .ap-how-steps { grid-template-columns: 1fr; }
    .ap-how-arrow { transform: rotate(90deg); margin: -8px auto; }
}

@media (max-width: 640px) {
    .ap-hero-modern { padding: 40px 20px 60px; }
    .ap-hero-stats { gap: 22px; }
    .ap-stat-value { font-size: 22px; }
    .ap-cta-card { padding: 44px 26px; }
}

/* ============================================================
   PHASE 1 — Accessibility & Global Patterns
   ============================================================ */

/* Focus rings — visible for keyboard nav, hidden for mouse */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* Skip-to-content link */
.ap-skip-link { position: absolute; top: -100%; left: 50%; transform: translateX(-50%); padding: 10px 24px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: var(--font-sm); border-radius: var(--radius-full); z-index: 10000; text-decoration: none; transition: top var(--duration-fast) var(--ease); }
.ap-skip-link:focus { top: 12px; }

/* Page fade-in */
@keyframes ap-page-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.ap-main { animation: ap-page-enter var(--duration-slow) var(--ease) both; }

/* ── Toast notification system ── */
.ap-toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column-reverse; gap: 10px; pointer-events: none; }
.ap-toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: var(--bg-elevated); border-radius: var(--radius-sm); font-size: var(--font-sm); font-weight: 500; color: var(--text); box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px var(--border); transform: translateX(120%); opacity: 0; transition: transform var(--duration-base) var(--ease), opacity var(--duration-base) var(--ease); max-width: 380px; }
.ap-toast.is-visible { transform: translateX(0); opacity: 1; }
.ap-toast-icon { width: 20px; height: 20px; flex-shrink: 0; }
.ap-toast--success { border-left: 3px solid var(--green); }
.ap-toast--success .ap-toast-icon { color: var(--green); }
.ap-toast--error { border-left: 3px solid var(--red); }
.ap-toast--error .ap-toast-icon { color: var(--red); }
.ap-toast--info { border-left: 3px solid var(--accent); }
.ap-toast--info .ap-toast-icon { color: var(--accent); }
@media (max-width: 480px) { .ap-toast-container { left: 12px; right: 12px; bottom: 12px; } .ap-toast { max-width: 100%; } }

/* ── Skeleton shimmer (loading placeholder) ── */
@keyframes ap-shimmer { to { background-position: -200% 0; } }
.ap-skeleton { background: linear-gradient(90deg, var(--bg-low) 25%, var(--bg-card) 50%, var(--bg-low) 75%); background-size: 200% 100%; animation: ap-shimmer 1.5s ease-in-out infinite; border-radius: var(--radius-xs); }

/* ── Scroll-to-top button ── */
.ap-scroll-top { position: fixed; bottom: 28px; right: 28px; z-index: 900; width: 44px; height: 44px; border: none; border-radius: 50%; background: var(--bg-elevated); color: var(--text-dim); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 0 1px var(--border); opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity var(--duration-base) var(--ease), transform var(--duration-base) var(--ease), background var(--duration-fast) var(--ease); }
.ap-scroll-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.ap-scroll-top:hover { background: var(--bg-bright); color: var(--accent); }
.ap-scroll-top svg { width: 20px; height: 20px; }

/* ── Button ripple ── */
.ap-btn, .ap-cta-primary, .ap-pricing-cta { position: relative; overflow: hidden; }
.ap-ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.25); transform: scale(0); animation: ap-ripple-expand 0.5s ease-out forwards; pointer-events: none; }
@keyframes ap-ripple-expand { to { transform: scale(4); opacity: 0; } }

/* ── Link hover animated underline ── */
.ap-legal a, .ap-footer-col a, .ap-faq-a a {
    background-image: linear-gradient(var(--accent), var(--accent));
    background-size: 0% 1px;
    background-position: 0% 100%;
    background-repeat: no-repeat;
    transition: background-size var(--duration-base) var(--ease), color var(--duration-fast);
}
.ap-legal a:hover, .ap-footer-col a:hover, .ap-faq-a a:hover { background-size: 100% 1px; }

/* ============================================================
   PHASE 2 — Navigation polish
   ============================================================ */

/* Active nav underline indicator */
.ap-nav-links a { position: relative; }
.ap-nav-links a.active::after { content: ''; position: absolute; bottom: -4px; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 1px; }

/* Auth state flash prevention */
.ap-nav-auth-anon, .ap-nav-auth-user { visibility: hidden; }
.ap-auth-ready .ap-nav-auth-anon, .ap-auth-ready .ap-nav-auth-user { visibility: visible; }

/* Low-credit pulse dot */
.ap-credit-warn { display: inline-block; width: 6px; height: 6px; background: var(--red); border-radius: 50%; margin-left: 4px; vertical-align: middle; animation: pulse-dot 2s ease-in-out infinite; }

/* ── Mobile menu — CSS-based slide animation ── */
@media (max-width: 768px) {
    .ap-nav-links {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: rgba(var(--bg-lowest-rgb), 0.97);
        backdrop-filter: blur(20px) saturate(140%);
        padding: var(--space-6);
        gap: var(--space-4);
        box-shadow: 0 12px 40px rgba(0,0,0,0.5);
        transform: translateY(-10px);
        opacity: 0;
        pointer-events: none;
        transition: transform var(--duration-base) var(--ease), opacity var(--duration-base) var(--ease);
        z-index: 999;
    }
    .ap-nav-links.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
    .ap-nav-links a { padding: var(--space-3) 0; font-size: var(--font-md); }
    .ap-nav-links a.active::after { bottom: 0; }

    /* Backdrop overlay */
    .ap-nav-backdrop { position: fixed; inset: 0; top: 68px; background: rgba(0,0,0,0.5); z-index: 998; opacity: 0; pointer-events: none; transition: opacity var(--duration-base) var(--ease); }
    .ap-nav-backdrop.is-visible { opacity: 1; pointer-events: auto; }

    /* Hamburger → X animation */
    .ap-nav-mobile span { transition: transform var(--duration-base) var(--ease), opacity var(--duration-fast); }
    .ap-nav-mobile.is-active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .ap-nav-mobile.is-active span:nth-child(2) { opacity: 0; }
    .ap-nav-mobile.is-active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

/* ============================================================
   PHASE 6 — Pricing page classes (moved from inline)
   ============================================================ */

.ap-pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-6); max-width: 960px; margin: 0 auto; }
@media (max-width: 768px) { .ap-pricing-grid { grid-template-columns: 1fr; } }

/* "Popular" badge */
.ap-pricing-popular { position: absolute; top: -1px; right: 24px; padding: 6px 14px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; border-radius: 0 0 var(--radius-xs) var(--radius-xs); z-index: 1; }

/* Feature list with check icons */
.ap-pricing-features li::before { content: ''; width: 18px; height: 18px; background: rgba(52,211,153,0.12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2334d399' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6l3 3 5-5'/%3E%3C/svg%3E") no-repeat center; border-radius: 50%; }

/* Pricing CTA spinner */
.ap-pricing-cta .ap-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(37,0,90,0.3); border-top-color: var(--on-accent); border-radius: 50%; animation: ap-spin 0.6s linear infinite; margin-right: 8px; }
.ap-pricing-cta.is-loading .ap-spinner { display: inline-block; }
@keyframes ap-spin { to { transform: rotate(360deg); } }

/* Mobile tier table scroll */
.ap-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; }
.ap-table-scroll::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 40px; background: linear-gradient(to right, transparent, var(--bg)); pointer-events: none; opacity: 0; transition: opacity var(--duration-fast); }
@media (max-width: 768px) { .ap-table-scroll::after { opacity: 1; } }

/* ── FAQ smooth animation (grid technique) ── */
.ap-faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--duration-base) var(--ease); }
.ap-faq-a > div { overflow: hidden; }
.ap-faq-item.open .ap-faq-a { grid-template-rows: 1fr; }

/* ============================================================
   PHASE 8 — Legal page enhancements
   ============================================================ */

/* Reading progress bar */
.ap-reading-progress { position: fixed; top: 68px; left: 0; right: 0; height: 3px; z-index: 999; background: transparent; pointer-events: none; }
.ap-reading-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 50ms linear; }

/* Legal TOC sidebar */
.ap-legal-layout { display: grid; grid-template-columns: 1fr; max-width: 960px; margin: 0 auto; padding: 60px 24px 80px; gap: 40px; }
@media (min-width: 900px) {
    .ap-legal-layout { grid-template-columns: 200px 1fr; }
}
.ap-legal-toc { position: sticky; top: 88px; align-self: start; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 100px); overflow-y: auto; }
.ap-legal-toc a { font-size: var(--font-xs); color: var(--text-muted); padding: 6px 12px; border-left: 2px solid transparent; border-radius: 0; transition: color var(--duration-fast), border-color var(--duration-fast); text-decoration: none; line-height: 1.4; display: block; }
.ap-legal-toc a:hover, .ap-legal-toc a.is-active { color: var(--accent); border-left-color: var(--accent); }
@media (max-width: 899px) {
    .ap-legal-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 0; padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; max-height: none; }
    .ap-legal-toc a { border-left: none; border-bottom: 2px solid transparent; padding: 8px 12px; font-size: 12px; }
}

/* ============================================================
   PHASE 7 — Account page classes
   ============================================================ */

/* Credit usage bar */
.ap-credit-bar { height: 8px; background: var(--bg-elevated); border-radius: var(--radius-full); overflow: hidden; margin-top: 8px; }
.ap-credit-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: var(--radius-full); transition: width var(--duration-slow) var(--ease); }

/* Upsell card */
.ap-upsell-card { background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(210,187,255,0.04)); border: 1px solid rgba(210,187,255,0.1); border-radius: var(--radius-lg); padding: var(--space-8); text-align: center; }
.ap-upsell-card h3 { font-size: var(--font-lg); font-weight: 800; margin-bottom: var(--space-2); }
.ap-upsell-card p { font-size: var(--font-sm); color: var(--text-dim); margin-bottom: var(--space-6); line-height: var(--leading-relaxed); }

/* Account skeleton */
.ap-acct-skeleton-row { display: flex; justify-content: space-between; padding: 14px 0; }
.ap-acct-skeleton-label { width: 80px; height: 12px; }
.ap-acct-skeleton-value { width: 160px; height: 14px; }

/* Sign-out confirm modal */
.ap-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 9000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity var(--duration-base) var(--ease); }
.ap-modal-backdrop.is-visible { opacity: 1; pointer-events: auto; }
.ap-modal { background: var(--bg-card); border-radius: var(--radius-lg); padding: var(--space-8); max-width: 380px; width: 90%; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,0.6); transform: scale(0.95); transition: transform var(--duration-base) var(--ease); }
.ap-modal-backdrop.is-visible .ap-modal { transform: scale(1); }
.ap-modal h3 { font-size: var(--font-lg); font-weight: 700; margin-bottom: var(--space-2); }
.ap-modal p { font-size: var(--font-sm); color: var(--text-dim); margin-bottom: var(--space-6); }
.ap-modal-actions { display: flex; gap: var(--space-3); justify-content: center; }
.ap-btn-sm { padding: 10px 20px; font-size: var(--font-sm); font-weight: 600; border: none; border-radius: var(--radius-full); cursor: pointer; transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease); }
.ap-btn-sm--ghost { background: var(--bg-elevated); color: var(--text-dim); }
.ap-btn-sm--ghost:hover { background: var(--bg-bright); color: var(--text); }
.ap-btn-sm--danger { background: rgba(255,180,171,0.15); color: var(--red); }
.ap-btn-sm--danger:hover { background: rgba(255,180,171,0.25); }

/* ============================================================
   PHASE 8 — Accessibility, Performance, Polish
   ============================================================ */

/* Selection */
::selection { background: rgba(124,58,237,0.35); color: #fff; }

/* Headings — consistent font family and weight */
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.15; }
h1 { font-weight: 800; }
h2 { font-weight: 700; }
h3 { font-weight: 700; }

/* Disabled buttons */
.ap-btn:disabled, .ap-cta-primary:disabled, .ap-pricing-cta:disabled {
    opacity: 0.4; cursor: not-allowed; transform: none !important;
    box-shadow: none !important; pointer-events: none;
}

/* Focus visible — keyboard navigation */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }

/* Dark scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-bright); }
html { scrollbar-color: var(--bg-elevated) var(--bg); scrollbar-width: thin; }

/* Reduced motion — disable ALL animations and transitions */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print */
@media print {
    .ap-nav, .ap-footer, .ap-scroll-top, .ap-toast-container,
    .ap-nav-backdrop, .ap-fab { display: none !important; }
    body { background: #fff; color: #000; }
    .ap-main { padding-top: 0; }
    a { color: #000; text-decoration: underline; }
    a::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}
