/* ================================================================
   EXPERIMENTAL DESIGN SYSTEM v2.1
   Safe & Compatible with Existing HTML
   Anti-Template Visuals, Muted Tones, Mobile-First
   ================================================================ */

/* ================================
   CSS SPRING ANIMATIONS
   ================================ */
@keyframes spring-in {
    0% { transform: scale(0.95) translateY(20px); opacity: 0; }
    60% { transform: scale(1.02) translateY(-5px); }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes float-gentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes reveal-up {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes lamp-glow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulse-soft {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); opacity: 0.9; }
}

/* ================================
   12 MUTED ATMOSPHERE THEMES
   ================================ */

/* Theme 1: Dust Rose & Charcoal */
.theme-dust-rose {
    --bg-primary: #1c1a1b;
    --bg-surface: #f5f0f1;
    --bg-muted: #e8dfe0;
    --text-primary: #1c1a1b;
    --text-secondary: #5a4d50;
    --accent-primary: #e8b4b8;
    --accent-secondary: #c48b92;
    --accent-glow: rgba(232, 180, 184, 0.25);
    --border-color: rgba(157, 122, 128, 0.15);
    --gradient-hero: linear-gradient(135deg, #252022 0%, #3a3234 100%);
}

/* Theme 2: Sage Mist & Cream */
.theme-sage-mist {
    --bg-primary: #1e2420;
    --bg-surface: #f4f6f3;
    --bg-muted: #e0e5dc;
    --text-primary: #1e2420;
    --text-secondary: #4a5548;
    --accent-primary: #98a890;
    --accent-secondary: #6b7a65;
    --accent-glow: rgba(152, 168, 144, 0.2);
    --border-color: rgba(107, 122, 101, 0.15);
    --gradient-hero: linear-gradient(135deg, #252d28 0%, #3d453a 100%);
}

/* Theme 3: Slate Ocean & Sand */
.theme-slate-ocean {
    --bg-primary: #1a2027;
    --bg-surface: #f5f6f8;
    --bg-muted: #dfe3e8;
    --text-primary: #1a2027;
    --text-secondary: #485460;
    --accent-primary: #7a9bae;
    --accent-secondary: #5a7a8d;
    --accent-glow: rgba(122, 155, 174, 0.2);
    --border-color: rgba(90, 122, 141, 0.15);
    --gradient-hero: linear-gradient(135deg, #1e2830 0%, #2d3a47 100%);
}

/* Theme 4: Terracotta Dusk */
.theme-terracotta-dusk {
    --bg-primary: #231c18;
    --bg-surface: #f8f5f2;
    --bg-muted: #ebe4dd;
    --text-primary: #231c18;
    --text-secondary: #5a4d44;
    --accent-primary: #c9a088;
    --accent-secondary: #a07860;
    --accent-glow: rgba(201, 160, 136, 0.2);
    --border-color: rgba(160, 120, 96, 0.15);
    --gradient-hero: linear-gradient(135deg, #2a2018 0%, #4a3830 100%);
}

/* Theme 5: Lavender Stone */
.theme-lavender-stone {
    --bg-primary: #1e1a24;
    --bg-surface: #f6f4f8;
    --bg-muted: #e5e0eb;
    --text-primary: #1e1a24;
    --text-secondary: #4d4558;
    --accent-primary: #a898b5;
    --accent-secondary: #7d6d90;
    --accent-glow: rgba(168, 152, 181, 0.2);
    --border-color: rgba(125, 109, 144, 0.15);
    --gradient-hero: linear-gradient(135deg, #252030 0%, #3a3348 100%);
}

/* Theme 6: Olive Twilight */
.theme-olive-twilight {
    --bg-primary: #1f2118;
    --bg-surface: #f5f6f2;
    --bg-muted: #e2e5d8;
    --text-primary: #1f2118;
    --text-secondary: #4a4d40;
    --accent-primary: #9da088;
    --accent-secondary: #757860;
    --accent-glow: rgba(157, 160, 136, 0.2);
    --border-color: rgba(117, 120, 96, 0.15);
    --gradient-hero: linear-gradient(135deg, #252820 0%, #3d4030 100%);
}

/* Theme 7: Copper Patina */
.theme-copper-patina {
    --bg-primary: #1a201e;
    --bg-surface: #f4f7f6;
    --bg-muted: #dde5e2;
    --text-primary: #1a201e;
    --text-secondary: #455550;
    --accent-primary: #5dd4c0;
    --accent-secondary: #3ab09a;
    --accent-glow: rgba(93, 212, 192, 0.25);
    --border-color: rgba(90, 144, 133, 0.15);
    --gradient-hero: linear-gradient(135deg, #1a2520 0%, #243530 100%);
}

/* Theme 8: Midnight Ink & Pearl */
.theme-midnight-ink {
    --bg-primary: #0d0f14;
    --bg-surface: #f8f9fa;
    --bg-muted: #e8eaee;
    --text-primary: #0d0f14;
    --text-secondary: #3a4050;
    --accent-primary: #8a95aa;
    --accent-secondary: #5a6580;
    --accent-glow: rgba(138, 149, 170, 0.2);
    --border-color: rgba(90, 101, 128, 0.15);
    --gradient-hero: linear-gradient(135deg, #12151c 0%, #1e2430 100%);
}

/* Theme 9: Desert Bone */
.theme-desert-bone {
    --bg-primary: #25201a;
    --bg-surface: #faf8f4;
    --bg-muted: #ece6dc;
    --text-primary: #25201a;
    --text-secondary: #5a5345;
    --accent-primary: #c8b8a0;
    --accent-secondary: #a09078;
    --accent-glow: rgba(200, 184, 160, 0.2);
    --border-color: rgba(160, 144, 120, 0.15);
    --gradient-hero: linear-gradient(135deg, #2a2518 0%, #4a4030 100%);
}

/* Theme 10: Forest Shadow */
.theme-forest-shadow {
    --bg-primary: #141a16;
    --bg-surface: #f3f6f4;
    --bg-muted: #dbe3dd;
    --text-primary: #141a16;
    --text-secondary: #3a4a3e;
    --accent-primary: #6a9a7a;
    --accent-secondary: #4a7a5a;
    --accent-glow: rgba(106, 154, 122, 0.2);
    --border-color: rgba(74, 122, 90, 0.15);
    --gradient-hero: linear-gradient(135deg, #182018 0%, #254030 100%);
}

/* Theme 11: Ceramic Rust */
.theme-ceramic-rust {
    --bg-primary: #201c1a;
    --bg-surface: #f7f5f4;
    --bg-muted: #e8e2e0;
    --text-primary: #201c1a;
    --text-secondary: #504a48;
    --accent-primary: #b89080;
    --accent-secondary: #987060;
    --accent-glow: rgba(184, 144, 128, 0.2);
    --border-color: rgba(152, 112, 96, 0.15);
    --gradient-hero: linear-gradient(135deg, #282220 0%, #403530 100%);
}

/* Theme 12: Arctic Fog */
.theme-arctic-fog {
    --bg-primary: #181c20;
    --bg-surface: #f8fafb;
    --bg-muted: #e5eaee;
    --text-primary: #181c20;
    --text-secondary: #455055;
    --accent-primary: #8aaab8;
    --accent-secondary: #6a8a98;
    --accent-glow: rgba(138, 170, 184, 0.2);
    --border-color: rgba(106, 138, 152, 0.15);
    --gradient-hero: linear-gradient(135deg, #1c2228 0%, #2a3540 100%);
}

/* ================================
   THEME APPLICATION (Safe Override)
   ================================ */
[class*="theme-"] {
    background: var(--bg-surface, #fff);
    color: var(--text-primary, #1a1a1a);
}

[class*="theme-"] .site-header,
[class*="theme-"] header {
    background: var(--bg-surface, #fff);
    border-bottom: 1px solid var(--border-color, #e5e5e5);
}

[class*="theme-"] .site-footer,
[class*="theme-"] footer {
    background: var(--bg-primary, #1a1a1a);
}

[class*="theme-"] .site-footer *,
[class*="theme-"] footer * {
    color: var(--bg-muted, #ddd) !important;
}

/* TL;DR Box Styling - DARK backgrounds for contrast */
[class*="theme-"] .tldr-box {
    background: var(--bg-primary, #1a1a1a);
    background-image: var(--gradient-hero, linear-gradient(135deg, #1a1a1a, #2a2a2a));
    border: none;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    padding: 48px 32px;
    text-align: center;
}

[class*="theme-"] .tldr-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 50% 0%, var(--accent-glow, rgba(255,255,255,0.15)) 0%, transparent 60%);
    pointer-events: none;
}

[class*="theme-"] .tldr-box,
[class*="theme-"] .tldr-box * {
    color: #ffffff !important;
}

[class*="theme-"] .tldr-label {
    color: var(--accent-primary, #aaa) !important;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    display: block;
}

/* Hero Answer - BIG & BOLD */
[class*="theme-"] .tldr-answer,
[class*="theme-"] .tldr-box h1 {
    font-size: clamp(1.5rem, 4vw, 2.25rem) !important;
    font-weight: 800 !important;
    line-height: 1.3 !important;
    margin-bottom: 16px !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Big Number Highlight */
[class*="theme-"] .tldr-box .big-number,
[class*="theme-"] .tldr-box .hero-number {
    font-size: clamp(3rem, 8vw, 5rem) !important;
    font-weight: 900 !important;
    color: var(--accent-primary, #fff) !important;
    text-shadow: 0 4px 20px rgba(0,0,0,0.4);
    line-height: 1.1;
    margin-bottom: 8px;
    display: block;
}

[class*="theme-"] .tldr-box .big-number-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 24px;
    display: block;
}

/* Hero subtext */
[class*="theme-"] .tldr-box .hero-subtext,
[class*="theme-"] .tldr-box .tldr-explanation,
[class*="theme-"] .tldr-box p {
    font-size: 1.05rem !important;
    line-height: 1.6 !important;
    opacity: 0.85;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

/* Lead Answer - PRIMARY emphasis */
[class*="theme-"] .tldr-box .lead-answer,
[class*="theme-"] .tldr-box p:first-of-type {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    opacity: 1;
    margin-bottom: 16px;
}

/* Stat Pills in Hero */
[class*="theme-"] .tldr-box .stat-pills {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Quick Answer Box (alternate structure) */
[class*="theme-"] .quick-answer,
[class*="theme-"] [class*="answer-box"],
[class*="theme-"] [class*="hero-card"] {
    background: var(--bg-primary, #1a1a1a) !important;
    color: #ffffff !important;
    padding: 32px;
    border-radius: 16px;
}

[class*="theme-"] .quick-answer *,
[class*="theme-"] [class*="answer-box"] *,
[class*="theme-"] [class*="hero-card"] * {
    color: #ffffff !important;
}

/* Override hero-minimal to maintain dark background */
[class*="theme-"] .tldr-box.hero-minimal,
[class*="theme-"] .hero-minimal.tldr-box {
    background: var(--bg-primary, #1a1a1a) !important;
    background-image: var(--gradient-hero) !important;
    color: #ffffff !important;
}

[class*="theme-"] .tldr-box.hero-minimal *,
[class*="theme-"] .hero-minimal.tldr-box * {
    color: #ffffff !important;
}

[class*="theme-"] .tldr-box.hero-minimal .tldr-label {
    color: var(--accent-primary, #aaa) !important;
}

/* Lead answer highlight */
[class*="theme-"] .lead-answer {
    color: #ffffff !important;
    font-weight: 700;
}

/* Strong text = KEY NUMBERS - make them POP */
[class*="theme-"] .tldr-box strong {
    color: var(--accent-primary, #5dd4c0) !important;
    font-weight: 800;
    font-size: 1.15em;
}

/* Big Number Grid (Roth IRA style) */
[class*="theme-"] .big-number-grid {
    display: flex;
    gap: 32px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 24px 0;
}

[class*="theme-"] .big-number-item {
    text-align: center;
}

[class*="theme-"] .tldr-box .big-number,
[class*="theme-"] .big-number-item .big-number {
    font-size: clamp(2.5rem, 7vw, 4rem) !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    line-height: 1.1;
    display: block;
}

[class*="theme-"] .tldr-box .big-number-label,
[class*="theme-"] .big-number-item .big-number-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7) !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

/* TL;DR Title */
[class*="theme-"] .tldr-box .tldr-title,
[class*="theme-"] .tldr-box h2 {
    font-size: 0.8rem !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-primary, rgba(255,255,255,0.8)) !important;
    margin-bottom: 20px !important;
    font-weight: 600;
}

/* Info Value in Cards */
[class*="theme-"] .info-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-secondary, #456);
    margin: 8px 0;
}

/* Term Value (Medicare style) */
[class*="theme-"] .term-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent-secondary, #456);
    margin: 8px 0;
}

/* Term Card */
[class*="theme-"] .term-card,
[class*="theme-"] .terms-grid .term-card {
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-color, #e5e5e5);
    border-left: 4px solid var(--accent-primary, #666);
    padding: 20px;
    border-radius: 8px;
}

/* Terms Grid */
[class*="theme-"] .terms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

/* Deductible Note */
[class*="theme-"] .deductible-note {
    background: rgba(255,255,255,0.1);
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    font-weight: 600;
}

/* Pills */
[class*="theme-"] .pill {
    background: rgba(255,255,255,0.15);
    color: var(--bg-surface, #fff) !important;
    backdrop-filter: blur(4px);
}

[class*="theme-"] .pill.accent,
[class*="theme-"] .pill.highlight {
    background: var(--accent-secondary, #666);
}

/* Content Sections */
[class*="theme-"] .content-section h2 {
    color: var(--text-primary, #1a1a1a);
    border-bottom-color: var(--border-color, #e5e5e5);
}

[class*="theme-"] .info-card {
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-color, #e5e5e5);
    border-left: 4px solid var(--accent-primary, #666);
}

[class*="theme-"] .callout-box {
    background: var(--bg-muted, #f5f5f5);
    border-left-color: var(--accent-primary, #666);
}

[class*="theme-"] .comparison-table th {
    background: var(--bg-primary, #1a1a1a);
    color: var(--bg-surface, #fff);
}

[class*="theme-"] a {
    color: var(--accent-secondary, #456);
}

[class*="theme-"] a:hover {
    color: var(--accent-primary, #567);
}

[class*="theme-"] .cta-button {
    background: var(--accent-secondary, #456);
    color: var(--bg-surface, #fff) !important;
}

/* ================================
   12 ANTI-TEMPLATE LAYOUTS
   Safe, Non-Breaking Enhancements
   ================================ */

/* Layout 1: Lamp - Centered with glow effect */
.layout-lamp .tldr-box {
    text-align: center;
    padding: 60px 32px;
    margin-bottom: 48px;
    border-radius: 24px;
}

.layout-lamp .tldr-box::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 100px;
    background: linear-gradient(180deg, var(--accent-glow, rgba(255,255,255,0.1)) 0%, transparent 100%);
    filter: blur(30px);
    pointer-events: none;
}

.layout-lamp .tldr-answer {
    font-size: clamp(1.75rem, 4vw, 2.5rem) !important;
}

.layout-lamp .content-section {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    animation: reveal-up 0.6s ease-out both;
}

.layout-lamp .content-section:nth-child(1) { animation-delay: 0.1s; }
.layout-lamp .content-section:nth-child(2) { animation-delay: 0.2s; }
.layout-lamp .content-section:nth-child(3) { animation-delay: 0.3s; }
.layout-lamp .content-section:nth-child(4) { animation-delay: 0.4s; }

/* Layout 2: Bento Chaos - Card-style sections */
.layout-bento-chaos .content-section {
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.layout-bento-chaos .content-section:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.layout-bento-chaos .content-section h2 {
    border-bottom: none;
    padding-bottom: 0;
}

.layout-bento-chaos .tldr-box {
    border-radius: 20px;
}

@media (min-width: 768px) {
    .layout-bento-chaos .container,
    .layout-bento-chaos .content-container {
        max-width: 1000px;
    }
}

/* Layout 3: Vertical Story - Centered narrative */
.layout-vertical-story .tldr-box {
    border-radius: 20px;
    margin-bottom: 60px;
    animation: spring-in 0.6s ease-out;
}

.layout-vertical-story .content-section {
    position: relative;
    padding-left: 24px;
    border-left: 2px solid var(--border-color, #e5e5e5);
    margin-left: 12px;
    animation: reveal-up 0.5s ease-out both;
}

.layout-vertical-story .content-section::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 8px;
    width: 12px;
    height: 12px;
    background: var(--accent-primary, #666);
    border-radius: 50%;
    border: 3px solid var(--bg-surface, #fff);
}

.layout-vertical-story .content-section:nth-child(2) { animation-delay: 0.1s; }
.layout-vertical-story .content-section:nth-child(3) { animation-delay: 0.2s; }
.layout-vertical-story .content-section:nth-child(4) { animation-delay: 0.3s; }

@media (max-width: 768px) {
    .layout-vertical-story .content-section {
        padding-left: 20px;
        margin-left: 8px;
    }
}

/* Layout 4: Float Space - Subtle floating effect */
.layout-float-space .tldr-box {
    border-radius: 24px;
    animation: float-gentle 6s ease-in-out infinite;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.layout-float-space .content-section {
    background: var(--bg-surface, #fff);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color, #e5e5e5);
    transition: all 0.3s ease;
}

.layout-float-space .content-section:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .layout-float-space .tldr-box {
        animation: none;
    }
}

/* Layout 5: Scattered - Slight rotation variation */
.layout-scattered .tldr-box {
    border-radius: 20px;
    transform: rotate(-0.5deg);
}

.layout-scattered .content-section {
    transition: transform 0.3s ease;
}

.layout-scattered .content-section:nth-child(odd) {
    transform: rotate(0.3deg);
}

.layout-scattered .content-section:nth-child(even) {
    transform: rotate(-0.3deg);
}

.layout-scattered .content-section:hover {
    transform: rotate(0deg) scale(1.01);
}

@media (max-width: 768px) {
    .layout-scattered .tldr-box,
    .layout-scattered .content-section {
        transform: none !important;
    }
}

/* Layout 6: Diagonal - Angled accent */
.layout-diagonal .tldr-box {
    border-radius: 0 0 0 40px;
    padding: 48px 32px;
}

.layout-diagonal .content-section {
    position: relative;
    padding-left: 20px;
}

.layout-diagonal .content-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--accent-primary, #666) 0%, var(--accent-secondary, #888) 100%);
    border-radius: 2px;
}

/* Layout 7: Overlap - Overlapping card effect */
.layout-overlap .tldr-box {
    border-radius: 20px;
    margin-bottom: 60px;
    position: relative;
    z-index: 10;
}

.layout-overlap .content-section {
    background: var(--bg-surface, #fff);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: -12px;
    border: 1px solid var(--border-color, #e5e5e5);
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.layout-overlap .content-section:nth-child(2) { z-index: 6; }
.layout-overlap .content-section:nth-child(3) { z-index: 5; margin-left: 12px; }
.layout-overlap .content-section:nth-child(4) { z-index: 4; margin-left: 24px; }
.layout-overlap .content-section:nth-child(5) { z-index: 3; margin-left: 12px; }
.layout-overlap .content-section:nth-child(6) { z-index: 2; }

.layout-overlap .content-section:hover {
    z-index: 20;
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

@media (max-width: 768px) {
    .layout-overlap .content-section {
        margin-left: 0 !important;
        margin-bottom: 16px;
    }
}

/* Layout 8: Split Screen - Alternating backgrounds */
.layout-split-screen .content-section:nth-child(odd) {
    background: var(--bg-surface, #fff);
    padding: 32px 24px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.layout-split-screen .content-section:nth-child(even) {
    background: var(--bg-muted, #f5f5f5);
    padding: 32px 24px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.layout-split-screen .tldr-box {
    border-radius: 20px;
}

/* Layout 9: Circular - Rounded elements */
.layout-circular .tldr-box {
    border-radius: 32px;
    text-align: center;
    padding: 48px 32px;
}

.layout-circular .content-section {
    background: var(--bg-surface, #fff);
    border-radius: 24px;
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color, #e5e5e5);
    transition: transform 0.3s ease;
}

.layout-circular .content-section:hover {
    transform: scale(1.02);
}

/* Layout 10: Staggered - Alternating alignment */
.layout-staggered .tldr-box {
    border-radius: 20px;
}

.layout-staggered .content-section {
    background: var(--bg-surface, #fff);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color, #e5e5e5);
    max-width: 85%;
    transition: all 0.3s ease;
}

.layout-staggered .content-section:nth-child(odd) {
    margin-left: 0;
    margin-right: auto;
    border-radius: 16px 32px 32px 16px;
}

.layout-staggered .content-section:nth-child(even) {
    margin-left: auto;
    margin-right: 0;
    border-radius: 32px 16px 16px 32px;
}

.layout-staggered .content-section:hover {
    max-width: 90%;
}

@media (max-width: 768px) {
    .layout-staggered .content-section {
        max-width: 100% !important;
        border-radius: 16px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Layout 11: Masonry Wild - Column layout */
.layout-masonry-wild .tldr-box {
    border-radius: 20px;
    margin-bottom: 40px;
}

@media (min-width: 768px) {
    .layout-masonry-wild .article-page .container,
    .layout-masonry-wild main .container,
    .layout-masonry-wild .content-container {
        max-width: 1000px;
    }

    .layout-masonry-wild .content-section {
        background: var(--bg-surface, #fff);
        border: 1px solid var(--border-color, #e5e5e5);
        border-radius: 16px;
        padding: 24px;
        margin-bottom: 20px;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .layout-masonry-wild .content-section:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 24px rgba(0,0,0,0.08);
    }
}

/* Layout 12: Kinetic - 3D perspective feel */
.layout-kinetic .tldr-box {
    border-radius: 20px;
    transform: perspective(1000px) rotateX(2deg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.layout-kinetic .content-section {
    transition: transform 0.4s ease;
}

.layout-kinetic .content-section:hover {
    transform: perspective(1000px) rotateX(-1deg) translateY(-4px);
}

@media (max-width: 768px) {
    .layout-kinetic .tldr-box {
        transform: none;
    }
    .layout-kinetic .content-section:hover {
        transform: translateY(-4px);
    }
}

/* ================================
   MICRO-INTERACTIONS
   ================================ */

/* Interactive hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

/* Glow effect */
.hover-glow:hover {
    box-shadow: 0 0 24px var(--accent-glow, rgba(100,100,100,0.2));
}

/* Spring press effect */
.spring-press {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spring-press:active {
    transform: scale(0.96);
}

/* ================================
   MOBILE OPTIMIZATIONS
   ================================ */
@media (max-width: 768px) {
    [class*="layout-"] .tldr-box {
        padding: 32px 20px;
        border-radius: 16px;
        margin-bottom: 32px;
    }

    [class*="layout-"] .content-section {
        padding: 20px 16px;
        margin-bottom: 16px;
    }

    /* Disable complex animations on mobile */
    [class*="layout-"] .content-section,
    [class*="layout-"] .tldr-box {
        animation-duration: 0.3s !important;
    }
}

@media (hover: none) {
    /* Touch device optimizations */
    [class*="layout-"] .content-section:hover,
    [class*="layout-"] .tldr-box:hover {
        transform: none;
    }

    .spring-press:active {
        transform: scale(0.98);
    }
}

/* ================================
   ACCESSIBILITY
   ================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--accent-primary, #666);
    outline-offset: 2px;
}

/* ================================
   ENHANCED TEXT CONTENT STYLING
   Plain text sections made visually interesting
   ================================ */

/* Content section headings */
[class*="theme-"] .content-section h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color, #e5e5e5);
    position: relative;
}

[class*="theme-"] .content-section h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent-primary, #666);
}

[class*="theme-"] .content-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a1a);
    margin-top: 28px;
    margin-bottom: 16px;
    position: relative;
    padding-left: 16px;
}

[class*="theme-"] .content-section h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    background: var(--accent-primary, #666);
    border-radius: 2px;
}

/* Paragraphs */
[class*="theme-"] .content-section p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary, #444);
    margin-bottom: 16px;
}

/* First paragraph emphasis */
[class*="theme-"] .content-section > p:first-of-type {
    font-size: 1.15rem;
    line-height: 1.75;
    color: var(--text-primary, #1a1a1a);
    font-weight: 500;
}

/* Enhanced Lists */
[class*="theme-"] .content-section ul {
    list-style: none;
    padding-left: 0;
    margin: 20px 0;
}

[class*="theme-"] .content-section ul li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
    line-height: 1.7;
}

[class*="theme-"] .content-section ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    background: var(--accent-primary, #666);
    border-radius: 50%;
    opacity: 0.7;
}

[class*="theme-"] .content-section ul li strong {
    color: var(--text-primary, #1a1a1a);
    font-weight: 700;
}

/* Ordered Lists */
[class*="theme-"] .content-section ol {
    list-style: none;
    padding-left: 0;
    margin: 20px 0;
    counter-reset: list-counter;
}

[class*="theme-"] .content-section ol li {
    position: relative;
    padding-left: 40px;
    margin-bottom: 16px;
    line-height: 1.7;
    counter-increment: list-counter;
}

[class*="theme-"] .content-section ol li::before {
    content: counter(list-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: var(--accent-primary, #666);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Block Quotes */
[class*="theme-"] .content-section blockquote,
[class*="theme-"] blockquote {
    background: var(--bg-muted, #f5f5f5);
    border-left: 4px solid var(--accent-primary, #666);
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--text-secondary, #444);
}

[class*="theme-"] .content-section blockquote p {
    margin-bottom: 0;
    font-size: 1.1rem;
}

/* Note boxes */
[class*="theme-"] .content-section .note,
[class*="theme-"] .note {
    background: linear-gradient(135deg, var(--bg-muted, #f5f5f5) 0%, var(--bg-surface, #fff) 100%);
    border: 1px solid var(--border-color, #e5e5e5);
    border-left: 4px solid var(--accent-secondary, #888);
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    font-size: 0.95rem;
}

/* Formula/Code boxes */
[class*="theme-"] .formula-box,
[class*="theme-"] .code-box {
    background: var(--bg-primary, #1a1a1a);
    color: #fff;
    padding: 24px;
    border-radius: 12px;
    margin: 24px 0;
    font-family: 'SF Mono', 'Monaco', monospace;
    overflow-x: auto;
}

[class*="theme-"] .formula-box p,
[class*="theme-"] .code-box p {
    color: #fff;
    margin-bottom: 8px;
}

[class*="theme-"] .formula-box strong {
    color: var(--accent-primary, #5dd4c0);
}

/* Example boxes */
[class*="theme-"] .example-box {
    background: var(--bg-surface, #fff);
    border: 2px dashed var(--border-color, #e5e5e5);
    padding: 28px;
    margin: 24px 0;
    border-radius: 16px;
    position: relative;
}

[class*="theme-"] .example-box::before {
    content: 'Example';
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--bg-surface, #fff);
    padding: 0 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-secondary, #666);
}

[class*="theme-"] .example-box h3 {
    margin-top: 0;
    padding-left: 0;
}

[class*="theme-"] .example-box h3::before {
    display: none;
}

/* Calculation steps */
[class*="theme-"] .calculation {
    background: var(--bg-muted, #f5f5f5);
    padding: 20px 24px;
    border-radius: 12px;
    margin-top: 16px;
}

[class*="theme-"] .calculation p {
    margin-bottom: 8px;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 0.95rem;
}

/* Disclaimer box */
[class*="theme-"] .disclaimer-box {
    background: linear-gradient(135deg, #f8f5f0 0%, #f0ebe5 100%);
    border: 1px solid #e5ddd5;
    padding: 24px;
    margin: 32px 0;
    border-radius: 12px;
}

[class*="theme-"] .disclaimer-box h3 {
    color: #8a7a6a;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0;
    margin-bottom: 12px;
    padding-left: 0;
}

[class*="theme-"] .disclaimer-box h3::before {
    display: none;
}

[class*="theme-"] .disclaimer-box p {
    color: #6a5a4a;
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Sources section */
[class*="theme-"] .sources-section {
    background: var(--bg-muted, #f5f5f5);
    padding: 24px;
    border-radius: 12px;
    margin-top: 32px;
}

[class*="theme-"] .sources-section h2 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    padding-bottom: 8px;
}

[class*="theme-"] .sources-section ul {
    margin: 0;
}

[class*="theme-"] .sources-section ul li {
    padding-left: 20px;
    margin-bottom: 8px;
}

[class*="theme-"] .sources-section ul li::before {
    width: 6px;
    height: 6px;
    top: 10px;
}

[class*="theme-"] .sources-section a {
    color: var(--accent-secondary, #456);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

[class*="theme-"] .sources-section a:hover {
    border-bottom-color: var(--accent-primary, #666);
}

/* FAQ Section */
[class*="theme-"] .faq-section {
    margin-top: 40px;
}

[class*="theme-"] .faq-item {
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[class*="theme-"] .faq-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

[class*="theme-"] .faq-item h3 {
    color: var(--text-primary, #1a1a1a);
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 12px;
    padding-left: 0;
}

[class*="theme-"] .faq-item h3::before {
    display: none;
}

[class*="theme-"] .faq-item p {
    color: var(--text-secondary, #555);
    margin-bottom: 0;
    font-size: 1rem;
}

/* Mistakes list styling */
[class*="theme-"] .mistakes-list {
    margin: 24px 0;
}

[class*="theme-"] .mistake-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 12px;
    margin-bottom: 12px;
    transition: transform 0.2s ease;
}

[class*="theme-"] .mistake-item:hover {
    transform: translateX(4px);
}

[class*="theme-"] .mistake-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--accent-primary, #666);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

[class*="theme-"] .mistake-item strong {
    display: block;
    color: var(--text-primary, #1a1a1a);
    margin-bottom: 4px;
}

[class*="theme-"] .mistake-item p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary, #555);
}

/* State tags grid */
[class*="theme-"] .state-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

[class*="theme-"] .state-tag {
    background: var(--bg-muted, #f5f5f5);
    border: 1px solid var(--border-color, #e5e5e5);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary, #555);
    transition: all 0.2s ease;
}

[class*="theme-"] .state-tag:hover {
    background: var(--accent-primary, #666);
    color: #fff;
    border-color: var(--accent-primary, #666);
}

/* Tables */
[class*="theme-"] .comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

[class*="theme-"] .comparison-table th {
    background: var(--bg-primary, #1a1a1a);
    color: #fff;
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

[class*="theme-"] .comparison-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color, #e5e5e5);
    font-size: 0.95rem;
}

[class*="theme-"] .comparison-table tr:last-child td {
    border-bottom: none;
}

[class*="theme-"] .comparison-table tr:nth-child(even) {
    background: var(--bg-muted, #f9f9f9);
}

[class*="theme-"] .comparison-table .highlight-green {
    color: #2a9d6a;
    font-weight: 700;
}

[class*="theme-"] .comparison-table .highlight-red {
    color: #c54040;
    font-weight: 700;
}

/* Info grid */
[class*="theme-"] .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

[class*="theme-"] .info-card {
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-color, #e5e5e5);
    border-left: 4px solid var(--accent-primary, #666);
    padding: 24px;
    border-radius: 0 12px 12px 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[class*="theme-"] .info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

[class*="theme-"] .info-card h3 {
    margin-top: 0;
    padding-left: 0;
    font-size: 1.1rem;
}

[class*="theme-"] .info-card h3::before {
    display: none;
}

/* ================================
   UTILITY CLASSES
   ================================ */
.text-center { text-align: center; }
.rounded-lg { border-radius: 16px; }
.rounded-xl { border-radius: 24px; }
.shadow-soft { box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.animate-in { animation: reveal-up 0.5s ease-out both; }
