/* [Core Theme System] */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Montserrat:wght@700;800;900&display=swap');

:root {
    --primary-grad: linear-gradient(135deg, #B71C1C 0%, #D32F2F 100%);
    --primary-solid: #C62828;
    --accent-color: #FFC107;
    --dark-surface: #1a1a1a;
    --light-bg: #F3F4F6;
    --white: #ffffff;
    --text-main: #374151;
    --text-muted: #6B7280;
    
    --font-display: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }

body {
    background-color: #e5e7eb;
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    padding-bottom: 2rem;
}

.app-shell {
    background-color: var(--white);
    margin: 0 auto;
    max-width: 500px;
    min-height: 100vh;
    position: relative;
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
}

/* [Header / Hero] */
.header-wrapper {
    background: var(--primary-grad);
    color: var(--white);
    padding: 2.5rem 1.5rem 3rem;
    text-align: center;
    border-bottom: 4px solid var(--accent-color);
    position: relative;
    overflow: hidden;
}

.header-wrapper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml,<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="rgba(255,255,255,0.05)"/></svg>');
    opacity: 0.3;
}

.badge-identity {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    padding: 0.25rem 1rem;
    border-radius: 9999px;
    display: inline-block;
    margin-bottom: 1rem;
    border: 1px solid rgba(255,255,255,0.2);
}

.main-headline {
    font-family: var(--font-display);
    font-size: 1.85rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sub-headline {
    font-size: 1rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* [Data Matrix] */
.meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: rgba(0,0,0,0.2);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.1);
}

.meta-item {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.8);
}

.meta-item strong {
    display: block;
    color: var(--accent-color);
    font-size: 0.8rem;
    font-weight: 800;
    margin-bottom: 2px;
}

/* [Visuals] */
.hero-visual {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 2px solid rgba(255,255,255,0.2);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}
.hero-visual:hover { transform: translateY(-2px); }

/* [Interaction Module] */
.interaction-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: left;
    position: relative;
    z-index: 10;
    margin-top: -10px;
}

.field-label {
    color: var(--primary-solid);
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.query-field {
    flex: 1;
    min-width: 0; /* Allow shrinking below default content size */
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-surface);
    transition: all 0.2s;
    font-family: var(--font-body);
}

.query-field:focus {
    outline: none;
    border-color: var(--primary-solid);
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
}

.query-field.input-error {
    border-color: #ef4444;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

.action-trigger {
    background: #10B981; /* Emerald 500 */
    background: linear-gradient(to bottom, #10B981, #059669);
    color: white;
    border: none;
    padding: 0 1.5rem;
    font-weight: 800;
    font-family: var(--font-display);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.4);
    transition: all 0.2s;
}

.action-trigger:active {
    transform: scale(0.98);
    box-shadow: none;
}

.pulse-anim { animation: pulse 2s infinite; }

/* [Content Segments] */
.content-segment {
    padding: 2.5rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.content-segment.is-dark {
    background-color: var(--dark-surface);
    color: var(--white);
}

.segment-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.segment-title::after {
    content: '';
    display: block;
    width: 3rem;
    height: 4px;
    background: var(--accent-color);
    margin-top: 0.5rem;
    border-radius: 2px;
}

/* [Process Nodes] */
.process-node {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    background: #ffffff;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-solid);
    transition: transform 0.2s;
}
.process-node:hover { transform: translateX(5px); }

.node-index {
    font-size: 1.5rem;
    font-weight: 900;
    color: rgba(198, 40, 40, 0.2);
    margin-right: 1rem;
    font-family: var(--font-display);
    line-height: 1;
}

.node-body h4 {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: var(--dark-surface);
}

.node-body p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* [Case Studies] */
.case-unit {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.case-unit::before {
    content: "VERIFIED";
    position: absolute;
    top: 12px; right: -30px;
    background: var(--accent-color);
    color: var(--dark-surface);
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 30px;
    transform: rotate(45deg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.unit-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    border-bottom: 1px dashed rgba(255,255,255,0.2);
    padding-bottom: 0.5rem;
}

.stock-id { font-weight: 800; font-size: 1.1rem; color: var(--white); font-family: var(--font-display); }
.perf-gain { color: #10B981; font-weight: 800; }

.unit-metric {
    font-size: 0.8rem;
    color: #9CA3AF;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

/* [Accordion] */
.accordion-item {
    border-bottom: 1px solid #e5e7eb;
}

.accordion-trigger {
    padding: 1rem 0;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    padding-right: 1.5rem;
    font-size: 0.95rem;
    color: var(--dark-surface);
    transition: color 0.2s;
}

.accordion-trigger::after {
    content: '+';
    position: absolute;
    right: 0;
    font-weight: 800;
    color: var(--primary-solid);
}

.accordion-content {
    display: none;
    padding-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.accordion-item.expanded .accordion-content { display: block; }
.accordion-item.expanded .accordion-trigger { color: var(--primary-solid); }
.accordion-item.expanded .accordion-trigger::after { content: '-'; }

/* [Footer] */
.site-footer {
    background: #f9fafb;
    padding: 2rem 1.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid #e5e7eb;
}

.legal-links a {
    color: var(--text-main);
    text-decoration: none;
    margin-right: 1rem;
    font-weight: 600;
    transition: color 0.2s;
}
.legal-links a:hover { color: var(--primary-solid); }

.risk-notice {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: var(--radius-md);
    color: #9CA3AF;
}

/* [Animations] */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* [Floating WA] */
.wa-float {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    width: 3.5rem; height: 3.5rem;
    background: #25D366;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    border: 2px solid white;
    transition: transform 0.2s;
}
.wa-float:hover { transform: scale(1.1); }

/* [Mobile Optimization] */
@media (max-width: 380px) {
    .interaction-card {
        padding: 1rem;
    }
    
    .action-trigger {
        padding: 0 1rem;
        font-size: 0.85rem;
    }
    
    .query-field {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .main-headline {
        font-size: 1.5rem;
    }
}
