﻿/** * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 * 
 * Appearance Report V2 - Premium Editorial Edition
 * A narrative-driven, cinematic experience for genetic appearance insights.
 * Design: Warm, human-centric, accessible. Performance: Core Web Vitals optimized.
 */

/* ========================================
   Design Tokens - Warm Cinematic Palette
   ======================================== */
:root {
    /* Primary warm neutrals */
    --ap-cream: #FAF8F5;
    --ap-warm-white: #FFFCF8;
    --ap-sand: #F5F0E8;
    --ap-stone: #E8E2D9;
    --ap-clay: #D4CBC0;
    
    /* Accent colors - muted, human */
    --ap-terracotta: #C4A484;
    --ap-sage: #8B9A7D;
    --ap-dusty-rose: #C9A9A6;
    --ap-slate: #6B7280;
    --ap-charcoal: #374151;
    --ap-ink: #1F2937;
    
    /* DNA Genics brand integration */
    --ap-teal: #237465;
    --ap-teal-soft: rgba(35, 116, 101, 0.08);
    --ap-teal-muted: rgba(35, 116, 101, 0.6);
    --ap-lime: #C2D053;
    --ap-lime-soft: rgba(194, 208, 83, 0.15);
    
    /* Typography */
    --ap-font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --ap-font-body: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ap-font-accent: 'Lora', Georgia, serif;
    
    /* Spacing scale */
    --ap-space-xs: 0.5rem;
    --ap-space-sm: 1rem;
    --ap-space-md: 1.5rem;
    --ap-space-lg: 2.5rem;
    --ap-space-xl: 4rem;
    --ap-space-2xl: 6rem;
    --ap-space-3xl: 8rem;
    
    /* Borders & Shadows */
    --ap-radius-sm: 8px;
    --ap-radius-md: 12px;
    --ap-radius-lg: 20px;
    --ap-radius-xl: 32px;
    --ap-shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.04);
    --ap-shadow-medium: 0 8px 40px rgba(0, 0, 0, 0.06);
    --ap-shadow-warm: 0 12px 48px rgba(196, 164, 132, 0.12);
    
    /* Transitions */
    --ap-transition-gentle: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --ap-transition-smooth: 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ========================================
   Base & Typography
   ======================================== */
.ap-main {
    background: var(--ap-cream);
    color: var(--ap-charcoal);
    font-family: var(--ap-font-body);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.ap-main h1,
.ap-main h2,
.ap-main h3 {
    font-family: var(--ap-font-display);
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--ap-ink);
}

.ap-main h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.15;
}

.ap-main h2 {
    font-size: clamp(1.875rem, 4vw, 2.75rem);
    line-height: 1.2;
}

.ap-main h3 {
    font-size: clamp(1.375rem, 2.5vw, 1.75rem);
    line-height: 1.3;
}

/* Accessibility - Skip Link */
.ap-skip-link {
    position: absolute;
    top: -100px;
    left: var(--ap-space-sm);
    background: var(--ap-teal);
    color: white;
    padding: var(--ap-space-xs) var(--ap-space-sm);
    border-radius: var(--ap-radius-sm);
    z-index: 1000;
    text-decoration: none;
    font-weight: 600;
    transition: top 0.2s ease;
}

.ap-skip-link:focus {
    top: var(--ap-space-sm);
}

/* ========================================
   Scroll Progress Indicator
   ======================================== */
.ap-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--ap-teal) 0%, var(--ap-lime) 100%);
    z-index: 1001;
    transition: width 0.1s ease;
}

/* ========================================
   Hero Section
   ======================================== */
.ap-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: calc(80px + var(--ap-space-xl)) var(--ap-space-md) var(--ap-space-xl);
}

.ap-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(180deg, rgba(250, 248, 245, 0.75) 0%, rgba(245, 240, 232, 0.8) 50%, rgba(232, 226, 217, 0.75) 100%),
                url('/img/reports/traits/appearance/appearance-hero.webp') center/cover no-repeat;
    background-attachment: fixed;
}

@media (max-width: 991px) {
    .ap-hero-bg {
        background-attachment: scroll;
    }
}

.ap-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, 
        rgba(255, 252, 248, 0.25) 0%, 
        rgba(245, 240, 232, 0.2) 50%,
        rgba(232, 226, 217, 0.3) 100%);
    pointer-events: none;
}

.ap-hero-pattern {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 60% at 20% 40%, rgba(196, 164, 132, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 80% at 80% 60%, rgba(139, 154, 125, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.ap-hero-pattern::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    right: -200px;
    top: 50%;
    transform: translateY(-50%);
    background: radial-gradient(circle, rgba(35, 116, 101, 0.04) 0%, transparent 70%);
    border-radius: 50%;
    animation: ap-float 20s ease-in-out infinite;
}

@keyframes ap-float {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-48%) scale(1.05); }
}

.ap-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.ap-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--ap-space-xs);
    background: var(--ap-teal-soft);
    border: 1px solid rgba(35, 116, 101, 0.15);
    color: var(--ap-teal);
    padding: var(--ap-space-xs) var(--ap-space-md);
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: var(--ap-space-lg);
}

.ap-hero-title {
    margin-bottom: var(--ap-space-md);
}

.ap-title-line {
    display: block;
    color: var(--ap-ink);
}

.ap-title-accent {
    display: block;
    color: var(--ap-teal);
    font-style: italic;
}

.ap-hero-subtitle {
    font-family: var(--ap-font-accent);
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    color: var(--ap-slate);
    max-width: 700px;
    margin: 0 auto var(--ap-space-xl);
    line-height: 1.8;
}

.ap-hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--ap-space-lg);
    margin-bottom: var(--ap-space-xl);
    flex-wrap: wrap;
}

.ap-stat-item {
    text-align: center;
}

.ap-stat-number {
    display: block;
    font-family: var(--ap-font-display);
    font-size: 2rem;
    font-weight: 500;
    color: var(--ap-teal);
}

.ap-stat-label {
    font-size: 0.875rem;
    color: var(--ap-slate);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ap-stat-divider {
    width: 1px;
    height: 40px;
    background: var(--ap-clay);
}

.ap-trust-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--ap-space-md);
}

.ap-trust-item {
    display: flex;
    align-items: center;
    gap: var(--ap-space-xs);
    font-size: 0.875rem;
    color: var(--ap-slate);
}

.ap-trust-item i {
    color: var(--ap-teal);
}

.ap-scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--ap-space-xs);
    color: var(--ap-slate);
    font-size: 0.8rem;
    text-decoration: none;
    animation: ap-bounce 2s ease-in-out infinite;
}

.ap-scroll-indicator:hover {
    color: var(--ap-teal);
    text-decoration: none;
}

@keyframes ap-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* ========================================
   Animation Utilities
   ======================================== */
.ap-animate-fade-in {
    opacity: 0;
    animation: ap-fade-in 0.8s ease-out forwards;
}

.ap-animate-fade-in-up {
    opacity: 0;
    animation: ap-fade-in-up 0.8s ease-out forwards;
}

.ap-delay-1 { animation-delay: 0.2s; }
.ap-delay-2 { animation-delay: 0.4s; }
.ap-delay-3 { animation-delay: 0.6s; }

@keyframes ap-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ap-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ap-animate-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.ap-animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Section Layout
   ======================================== */
.ap-section {
    padding: var(--ap-space-3xl) var(--ap-space-md);
    position: relative;
}

.ap-section--cream {
    background: var(--ap-cream);
}

.ap-section--warm-white {
    background: var(--ap-warm-white);
}

.ap-section--sand {
    background: var(--ap-sand);
}

.ap-section--teal-soft {
    background: linear-gradient(180deg, var(--ap-cream) 0%, rgba(35, 116, 101, 0.04) 50%, var(--ap-cream) 100%);
}

.ap-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 var(--ap-space-sm);
}

.ap-container--narrow {
    max-width: 800px;
}

.ap-container--wide {
    max-width: 1320px;
}

/* ========================================
   Chapter Headers
   ======================================== */
.ap-chapter-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto var(--ap-space-xl);
}

.ap-chapter-number {
    display: inline-block;
    font-family: var(--ap-font-body);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ap-teal);
    margin-bottom: var(--ap-space-sm);
    padding: var(--ap-space-xs) var(--ap-space-md);
    background: var(--ap-teal-soft);
    border-radius: 100px;
}

.ap-section-title {
    margin-bottom: var(--ap-space-sm);
}

.ap-section-subtitle {
    font-family: var(--ap-font-accent);
    font-size: 1.125rem;
    color: var(--ap-slate);
    margin: 0;
}

/* ========================================
   Profile Summary Grid
   ======================================== */
.ap-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--ap-space-md);
    margin-bottom: var(--ap-space-xl);
}

.ap-profile-card {
    display: flex;
    align-items: center;
    gap: var(--ap-space-md);
    padding: var(--ap-space-md);
    background: white;
    border-radius: var(--ap-radius-md);
    box-shadow: var(--ap-shadow-soft);
    cursor: pointer;
    transition: all var(--ap-transition-gentle);
    border: 2px solid transparent;
}

.ap-profile-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ap-shadow-warm);
    border-color: var(--ap-teal-soft);
}

.ap-profile-icon {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ap-teal-soft) 0%, var(--ap-lime-soft) 100%);
    border-radius: var(--ap-radius-md);
}

.ap-profile-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.ap-profile-icon i {
    font-size: 1.5rem;
    color: var(--ap-teal);
}

.ap-profile-info {
    flex: 1;
    min-width: 0;
}

.ap-profile-title {
    font-family: var(--ap-font-body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ap-charcoal);
    margin: 0 0 0.25rem;
}

.ap-profile-result {
    font-family: var(--ap-font-display);
    font-size: 1.25rem;
    color: var(--ap-teal);
    margin: 0 0 0.5rem;
}

.ap-profile-bar {
    height: 6px;
    background: var(--ap-stone);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.ap-profile-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ap-teal) 0%, var(--ap-lime) 100%);
    border-radius: 3px;
    transition: width 0.8s ease-out;
}

.ap-profile-percentage {
    font-size: 0.75rem;
    color: var(--ap-slate);
}

/* ========================================
   Category Overview Cards
   ======================================== */
.ap-category-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--ap-space-md);
    margin-bottom: var(--ap-space-xl);
}

.ap-category-card {
    background: white;
    border-radius: var(--ap-radius-md);
    padding: var(--ap-space-lg);
    text-align: center;
    box-shadow: var(--ap-shadow-soft);
    cursor: pointer;
    transition: all var(--ap-transition-gentle);
    border: 2px solid transparent;
}

.ap-category-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--ap-shadow-warm);
    border-color: var(--ap-teal);
}

.ap-category-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--ap-space-md);
    background: linear-gradient(135deg, var(--ap-teal-soft) 0%, var(--ap-lime-soft) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--ap-transition-gentle);
}

.ap-category-card:hover .ap-category-icon {
    background: linear-gradient(135deg, var(--ap-teal) 0%, #2a8a78 100%);
}

.ap-category-icon i {
    font-size: 1.75rem;
    color: var(--ap-teal);
    transition: color var(--ap-transition-gentle);
}

.ap-category-card:hover .ap-category-icon i {
    color: white;
}

.ap-category-card h4 {
    font-family: var(--ap-font-display);
    font-size: 1.25rem;
    color: var(--ap-ink);
    margin: 0 0 0.25rem;
}

.ap-category-card p {
    font-size: 0.875rem;
    color: var(--ap-slate);
    margin: 0 0 var(--ap-space-sm);
}

.ap-category-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ap-teal);
}

/* ========================================
   Insight Callout
   ======================================== */
.ap-insight-callout {
    display: flex;
    align-items: flex-start;
    gap: var(--ap-space-sm);
    padding: var(--ap-space-md);
    background: linear-gradient(135deg, var(--ap-teal-soft) 0%, var(--ap-lime-soft) 100%);
    border-radius: var(--ap-radius-md);
    border-left: 4px solid var(--ap-teal);
}

.ap-insight-callout i {
    color: var(--ap-teal);
    font-size: 1.25rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.ap-insight-callout p {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--ap-charcoal);
}

/* ========================================
   Category Tabs
   ======================================== */
.ap-tabs {
    background: white;
    border-radius: var(--ap-radius-lg);
    box-shadow: var(--ap-shadow-soft);
    overflow: hidden;
}

.ap-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    background: var(--ap-cream);
    border-bottom: 2px solid var(--ap-stone);
    padding: var(--ap-space-xs);
    gap: var(--ap-space-xs);
}

.ap-tab-btn {
    flex: 1;
    min-width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--ap-space-xs);
    padding: var(--ap-space-sm) var(--ap-space-md);
    background: transparent;
    border: none;
    border-radius: var(--ap-radius-sm);
    font-family: var(--ap-font-body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ap-slate);
    cursor: pointer;
    transition: all var(--ap-transition-gentle);
}

.ap-tab-btn:hover {
    background: white;
    color: var(--ap-teal);
}

.ap-tab-btn.active {
    background: var(--ap-teal);
    color: white;
}

.ap-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ap-tab-btn.active .ap-tab-count {
    background: rgba(255, 255, 255, 0.3);
}

.ap-tab-content {
    display: none;
    padding: var(--ap-space-lg);
    animation: ap-tab-fade 0.4s ease-out;
}

.ap-tab-content.active {
    display: block;
}

@keyframes ap-tab-fade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ap-tab-header {
    margin-bottom: var(--ap-space-lg);
    padding-bottom: var(--ap-space-md);
    border-bottom: 1px solid var(--ap-stone);
}

.ap-tab-header h3 {
    font-size: 1.375rem;
    margin: 0 0 0.5rem;
    color: var(--ap-ink);
}

.ap-tab-header p {
    font-size: 0.9375rem;
    color: var(--ap-slate);
    margin: 0;
}

.ap-traits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: var(--ap-space-lg);
}

.ap-trait-wrapper {
    scroll-margin-top: 100px;
    min-width: 0; /* Allow grid items to shrink below content's intrinsic width */
}

/* ========================================
   Understanding Section
   ======================================== */
.ap-understanding-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--ap-space-lg);
    margin-bottom: var(--ap-space-xl);
}

.ap-understanding-card {
    background: white;
    border-radius: var(--ap-radius-md);
    padding: var(--ap-space-lg);
    box-shadow: var(--ap-shadow-soft);
}

.ap-understanding-icon {
    width: 56px;
    height: 56px;
    background: var(--ap-teal-soft);
    border-radius: var(--ap-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--ap-space-md);
}

.ap-understanding-icon i {
    font-size: 1.5rem;
    color: var(--ap-teal);
}

.ap-understanding-card h3 {
    font-size: 1.25rem;
    margin: 0 0 var(--ap-space-sm);
}

.ap-understanding-card p {
    font-size: 0.9375rem;
    color: var(--ap-slate);
    margin: 0;
    line-height: 1.65;
}

.ap-understanding-note {
    display: flex;
    align-items: center;
    gap: var(--ap-space-xs);
    margin-top: var(--ap-space-md);
    padding: var(--ap-space-sm);
    background: var(--ap-teal-soft);
    border-radius: var(--ap-radius-sm);
    font-size: 0.875rem;
    color: var(--ap-teal);
}

/* Confidence Legend */
.ap-confidence-legend {
    margin-top: var(--ap-space-sm);
}

.ap-confidence-item {
    display: flex;
    align-items: center;
    gap: var(--ap-space-sm);
    padding: var(--ap-space-xs) 0;
    font-size: 0.875rem;
    color: var(--ap-slate);
}

.ap-conf-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.ap-conf-high {
    background: #d4edda;
    color: #155724;
}

.ap-conf-moderate {
    background: #fff3cd;
    color: #856404;
}

.ap-conf-low {
    background: #f8d7da;
    color: #721c24;
}

/* Influence Visual */
.ap-influence-visual {
    margin-top: var(--ap-space-md);
}

.ap-influence-bar {
    height: 8px;
    background: #d4edda;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--ap-space-xs);
}

.ap-influence-genetic {
    height: 100%;
    background: linear-gradient(90deg, var(--ap-teal) 0%, #2a8a78 100%);
}

.ap-influence-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--ap-slate);
}

.ap-influence-labels i {
    margin-right: 4px;
}

/* Limitations Section */
.ap-limitations {
    background: white;
    border-radius: var(--ap-radius-lg);
    padding: var(--ap-space-lg);
    box-shadow: var(--ap-shadow-soft);
    border-left: 4px solid var(--ap-terracotta);
    margin-bottom: var(--ap-space-xl);
}

.ap-limitations-header {
    display: flex;
    align-items: center;
    gap: var(--ap-space-sm);
    margin-bottom: var(--ap-space-md);
}

.ap-limitations-header i {
    font-size: 1.5rem;
    color: var(--ap-terracotta);
}

.ap-limitations-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.ap-limitations-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--ap-space-md);
}

.ap-limitation-item {
    padding: var(--ap-space-sm);
    background: var(--ap-cream);
    border-radius: var(--ap-radius-sm);
}

.ap-limitation-item h4 {
    font-family: var(--ap-font-body);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--ap-charcoal);
}

.ap-limitation-item p {
    font-size: 0.875rem;
    color: var(--ap-slate);
    margin: 0;
    line-height: 1.6;
}

/* Quote Block */
.ap-quote-block {
    text-align: center;
    padding: var(--ap-space-lg);
}

.ap-quote-block blockquote {
    font-family: var(--ap-font-display);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-style: italic;
    color: var(--ap-teal);
    margin: 0;
    padding: var(--ap-space-md);
    border-top: 2px solid var(--ap-terracotta);
    border-bottom: 2px solid var(--ap-terracotta);
}

/* ========================================
   AI Assistant Section
   ======================================== */
.ap-ai-container {
    background: linear-gradient(180deg, var(--ap-warm-white) 0%, var(--ap-cream) 100%);
    border: 1px solid var(--ap-stone);
    border-radius: var(--ap-radius-lg);
    padding: var(--ap-space-xl);
    box-shadow: var(--ap-shadow-soft);
    max-width: 800px;
    margin: 0 auto;
}

.ap-ai-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--ap-space-sm);
    margin-bottom: var(--ap-space-md);
}

.ap-ai-title {
    display: flex;
    align-items: center;
    gap: var(--ap-space-sm);
}

.ap-ai-title i {
    font-size: 1.5rem;
    color: var(--ap-teal);
}

.ap-ai-title h4 {
    font-family: var(--ap-font-display);
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--ap-ink);
}

.ap-ai-title small {
    font-weight: 400;
    color: var(--ap-slate);
}

.ap-ai-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ap-badge-success {
    background: #d4edda;
    color: #155724;
}

.ap-badge-warning {
    background: #fff3cd;
    color: #856404;
}

.ap-ai-info {
    display: flex;
    align-items: flex-start;
    gap: var(--ap-space-sm);
    padding: var(--ap-space-sm);
    background: rgba(196, 164, 132, 0.08);
    border-left: 3px solid var(--ap-terracotta);
    border-radius: var(--ap-radius-sm);
    margin-bottom: var(--ap-space-lg);
}

.ap-ai-info i {
    color: var(--ap-teal);
    margin-top: 2px;
}

.ap-ai-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--ap-slate);
}

.ap-suggested-prompts {
    margin-bottom: var(--ap-space-lg);
}

.ap-prompts-label {
    font-size: 0.875rem;
    color: var(--ap-slate);
    margin-bottom: var(--ap-space-sm);
}

.ap-prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--ap-space-sm);
}

.ap-prompt-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--ap-space-xs);
    padding: 1rem 1.25rem;
    background: var(--ap-warm-white);
    border: 1px solid var(--ap-clay);
    border-radius: var(--ap-radius-sm);
    box-shadow: var(--ap-shadow-soft);
    font-family: var(--ap-font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ap-ink);
    cursor: pointer;
    transition: all var(--ap-transition-gentle);
}

.ap-prompt-btn:hover {
    background: var(--ap-cream);
    color: var(--ap-teal);
    border-color: var(--ap-teal);
    box-shadow: var(--ap-shadow-medium);
    transform: translateY(-2px);
}

.ap-prompt-btn i {
    font-size: 1.25rem;
    color: var(--ap-teal);
    margin-bottom: 0.25rem;
}

.ap-prompt-btn:hover i {
    color: var(--ap-teal);
}

.ap-ai-main-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--ap-space-sm);
    width: 100%;
    padding: var(--ap-space-md);
    background: linear-gradient(135deg, var(--ap-teal) 0%, #2a8a78 100%);
    border: none;
    border-radius: var(--ap-radius-lg);
    font-family: var(--ap-font-body);
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--ap-transition-gentle);
    box-shadow: 0 4px 16px rgba(35, 116, 101, 0.25);
}

.ap-ai-main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(35, 116, 101, 0.3);
}

.ap-ai-main-btn img {
    width: 24px;
    height: 24px;
}

.ap-sample-output {
    background: var(--ap-warm-white);
    border-left: 4px solid var(--ap-terracotta);
    border-radius: var(--ap-radius-md);
    padding: var(--ap-space-lg);
}

.ap-sample-output h6 {
    font-family: var(--ap-font-body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ap-ink);
    margin: 0 0 var(--ap-space-sm);
}

.ap-sample-content {
    padding: var(--ap-space-md);
    background: var(--ap-cream);
    border-radius: var(--ap-radius-sm);
    border: 1px solid var(--ap-stone);
    margin-bottom: var(--ap-space-md);
}

.ap-sample-content p {
    margin: 0;
    line-height: 1.6;
}

.ap-unlock-cta {
    text-align: center;
}

.ap-ai-results {
    margin-top: var(--ap-space-lg);
}

/* ========================================
   Science Section
   ======================================== */
.ap-science-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--ap-space-xl);
    align-items: start;
}

@media (min-width: 992px) {
    .ap-science-content {
        grid-template-columns: 1fr 1fr;
    }
}

.ap-science-text h3 {
    font-size: 1.25rem;
    margin: var(--ap-space-lg) 0 var(--ap-space-sm);
}

.ap-science-text h3:first-child {
    margin-top: 0;
}

.ap-science-text p {
    color: var(--ap-slate);
    line-height: 1.7;
}

.ap-methodology {
    background: white;
    border-radius: var(--ap-radius-md);
    padding: var(--ap-space-lg);
    box-shadow: var(--ap-shadow-soft);
    margin-top: var(--ap-space-lg);
}

.ap-methodology h4 {
    font-family: var(--ap-font-body);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 var(--ap-space-md);
    color: var(--ap-ink);
}

.ap-method-steps {
    display: grid;
    gap: var(--ap-space-sm);
}

.ap-method-step {
    display: flex;
    align-items: center;
    gap: var(--ap-space-sm);
    padding: var(--ap-space-sm);
    background: var(--ap-cream);
    border-radius: var(--ap-radius-sm);
}

.ap-step-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ap-teal);
    color: white;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.ap-method-step p {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--ap-charcoal);
}

.ap-science-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--ap-space-md);
}

@media (min-width: 768px) {
    .ap-science-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.ap-science-card {
    background: white;
    border-radius: var(--ap-radius-md);
    padding: var(--ap-space-lg);
    text-align: center;
    box-shadow: var(--ap-shadow-soft);
    border-top: 3px solid var(--ap-teal);
}

.ap-science-number {
    font-family: var(--ap-font-display);
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--ap-teal);
    margin-bottom: var(--ap-space-xs);
}

.ap-science-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ap-charcoal);
    margin-bottom: var(--ap-space-xs);
}

.ap-science-desc {
    font-size: 0.875rem;
    color: var(--ap-slate);
    margin: 0;
}

.ap-trust-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--ap-space-lg);
    margin-top: var(--ap-space-xl);
    padding-top: var(--ap-space-lg);
    border-top: 1px solid var(--ap-stone);
}

.ap-trust-badge {
    display: flex;
    align-items: center;
    gap: var(--ap-space-xs);
    color: var(--ap-slate);
    font-size: 0.875rem;
}

.ap-trust-badge i {
    color: var(--ap-teal);
}

.ap-sources-link {
    text-align: center;
    margin-top: var(--ap-space-lg);
}

/* ========================================
   FAQ Section
   ======================================== */
.ap-faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.ap-faq-item {
    background: white;
    border-radius: var(--ap-radius-md);
    margin-bottom: var(--ap-space-sm);
    box-shadow: var(--ap-shadow-soft);
    overflow: hidden;
}

.ap-faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--ap-space-md) var(--ap-space-lg);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--ap-font-body);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--ap-charcoal);
    text-align: left;
    transition: background var(--ap-transition-gentle);
}

.ap-faq-question:hover {
    background: var(--ap-cream);
}

.ap-faq-question i {
    color: var(--ap-teal);
    transition: transform var(--ap-transition-gentle);
    flex-shrink: 0;
}

.ap-faq-item.active .ap-faq-question i {
    transform: rotate(180deg);
}

.ap-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--ap-transition-gentle);
}

.ap-faq-item.active .ap-faq-answer {
    max-height: 500px;
}

.ap-faq-answer p {
    padding: 0 var(--ap-space-lg) var(--ap-space-md);
    color: var(--ap-slate);
    line-height: 1.7;
    margin: 0;
}

/* ========================================
   Footer Note
   ======================================== */
.ap-footer-note {
    display: flex;
    align-items: flex-start;
    gap: var(--ap-space-sm);
    padding: var(--ap-space-md);
    background: white;
    border-radius: var(--ap-radius-md);
    box-shadow: var(--ap-shadow-soft);
    border-left: 4px solid var(--ap-teal);
}

.ap-footer-note i {
    color: var(--ap-teal);
    margin-top: 2px;
    flex-shrink: 0;
}

.ap-footer-note span {
    font-size: 0.9375rem;
    color: var(--ap-slate);
    line-height: 1.6;
}

/* ========================================
   Page Navigation Dots
   ======================================== */
.ap-page-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: none;
}

@media (min-width: 1200px) {
    .ap-page-nav {
        display: block;
    }
}

.ap-nav-dot {
    display: block;
    width: 10px;
    height: 10px;
    background: var(--ap-clay);
    border-radius: 50%;
    margin: 14px 0;
    transition: all var(--ap-transition-gentle);
    position: relative;
}

.ap-nav-dot:hover,
.ap-nav-dot.active {
    background: var(--ap-teal);
    transform: scale(1.4);
}

.ap-nav-dot::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--ap-ink);
    color: white;
    padding: 4px 10px;
    border-radius: var(--ap-radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.ap-nav-dot:hover::after {
    opacity: 1;
}

/* ========================================
   Back to Top Button
   ======================================== */
.ap-back-to-top {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--ap-teal);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--ap-transition-gentle);
    z-index: 99;
    box-shadow: 0 4px 16px rgba(35, 116, 101, 0.3);
}

.ap-back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.ap-back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(35, 116, 101, 0.4);
}

/* ========================================
   Sticky CTA Bar
   ======================================== */
.ap-sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--ap-stone);
    padding: var(--ap-space-sm) var(--ap-space-md);
    z-index: 98;
    transform: translateY(100%);
    transition: transform var(--ap-transition-gentle);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.ap-sticky-cta.visible {
    transform: translateY(0);
}

.ap-sticky-content {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ap-space-md);
}

.ap-sticky-info h4 {
    font-family: var(--ap-font-display);
    font-size: 1.125rem;
    margin: 0;
    color: var(--ap-ink);
}

.ap-sticky-info p {
    font-size: 0.875rem;
    color: var(--ap-slate);
    margin: 0;
}

.ap-sticky-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--ap-space-xs);
    padding: var(--ap-space-sm) var(--ap-space-lg);
    background: var(--ap-teal);
    color: white;
    border-radius: 100px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--ap-transition-gentle);
    white-space: nowrap;
}

.ap-sticky-btn:hover {
    background: #1a5a4e;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

/* ========================================
   Buttons
   ======================================== */
.ap-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--ap-space-xs);
    background: var(--ap-teal);
    color: white;
    padding: var(--ap-space-sm) var(--ap-space-lg);
    border-radius: 100px;
    font-family: var(--ap-font-body);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--ap-transition-gentle);
    box-shadow: 0 4px 16px rgba(35, 116, 101, 0.25);
}

.ap-btn-primary:hover {
    background: #1a5a4e;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(35, 116, 101, 0.3);
    color: white;
    text-decoration: none;
}

.ap-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: var(--ap-space-xs);
    background: transparent;
    color: var(--ap-teal);
    padding: var(--ap-space-sm) var(--ap-space-lg);
    border-radius: 100px;
    font-family: var(--ap-font-body);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid var(--ap-teal);
    cursor: pointer;
    transition: all var(--ap-transition-gentle);
}

.ap-btn-secondary:hover {
    background: var(--ap-teal);
    color: white;
    text-decoration: none;
}

/* ========================================
   No Data State
   ======================================== */
.ap-no-data {
    text-align: center;
    padding: var(--ap-space-2xl);
}

.ap-no-data h2 {
    margin-bottom: var(--ap-space-sm);
}

.ap-no-data p {
    color: var(--ap-slate);
    margin-bottom: var(--ap-space-lg);
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
    .ap-section {
        padding: var(--ap-space-2xl) var(--ap-space-sm);
    }
    
    .ap-hero {
        min-height: auto;
        padding: calc(80px + var(--ap-space-lg)) var(--ap-space-sm) var(--ap-space-2xl);
    }
    
    .ap-hero-stats {
        flex-direction: column;
        gap: var(--ap-space-md);
    }
    
    .ap-stat-divider {
        display: none;
    }
    
    .ap-profile-grid {
        grid-template-columns: 1fr;
    }
    
    .ap-category-overview {
        grid-template-columns: 1fr;
    }
    
    .ap-tabs-nav {
        flex-direction: column;
    }
    
    .ap-tab-btn {
        width: 100%;
    }
    
    .ap-traits-grid {
        grid-template-columns: 1fr;
    }
    
    .ap-understanding-grid {
        grid-template-columns: 1fr;
    }
    
    .ap-limitations-content {
        grid-template-columns: 1fr;
    }
    
    .ap-prompts-grid {
        grid-template-columns: 1fr;
    }
    
    .ap-science-grid {
        grid-template-columns: 1fr;
    }
    
    .ap-trust-section {
        flex-direction: column;
        align-items: center;
    }
    
    .ap-sticky-content {
        flex-direction: column;
        text-align: center;
    }
    
    .ap-sticky-info {
        margin-bottom: var(--ap-space-xs);
    }
    
    /* Near full-width trait cards on mobile */
    #traits.ap-section {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    #traits .ap-container--wide {
        padding-left: 0;
        padding-right: 0;
    }
    
    #traits .ap-tabs {
        border-radius: var(--ap-radius-sm);
    }
    
    #traits .ap-tab-content {
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 480px) {
    .ap-faq-question {
        padding: var(--ap-space-sm);
        font-size: 0.9375rem;
    }
    
    .ap-faq-answer p {
        padding: 0 var(--ap-space-sm) var(--ap-space-sm);
    }
}

/* ========================================
   Modal Z-Index Fix
   ======================================== */
/* Ensure modals appear above navbar (navbar z-index: 1030) */
/* Bootstrap modals default to z-index 1050, but we ensure it's explicit */
#traitDetailModal.modal {
    z-index: 1050 !important;
}

#traitDetailModal.modal.show,
#traitDetailModal.modal.in {
    z-index: 1050 !important;
}

/* Modal backdrop should be below modal but above navbar */
.modal-backdrop {
    z-index: 1040 !important;
}

.modal-backdrop.show,
.modal-backdrop.in {
    z-index: 1040 !important;
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .ap-page-nav,
    .ap-back-to-top,
    .ap-sticky-cta,
    .ap-scroll-progress,
    .ap-scroll-indicator,
    .ap-ai-main-btn,
    .ap-prompt-btn,
    .ap-btn-primary,
    .ap-btn-secondary {
        display: none !important;
    }
    
    .ap-hero {
        min-height: auto;
        padding: 2rem;
    }
    
    .ap-section {
        padding: 2rem 1rem;
        break-inside: avoid;
    }
    
    .ap-tabs-nav {
        display: none;
    }
    
    .ap-tab-content {
        display: block !important;
    }
}

