/* 1. THEME VARIABLES */
:root {
    --bg-primary: #fcfcfc;       /* Clean off-white */
    --bg-secondary: #ffffff;     /* Pure white for cards */
    --bg-accent: #f0f4f8;        /* Soft gray-blue for sections */
    --text-main: #1a1c1e;        /* Deep charcoal for readability */
    --text-muted: #5f6368;       /* Muted gray */
    --accent: #007bff;           /* Professional Blue */
    --accent-hover: #0056b3;
    --border-color: #e0e4e8;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
}

/* 2. GLOBAL STYLES */
body {
    background: var(--bg-primary);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 3. NAVIGATION */
.nav { 
    background: var(--bg-secondary); 
    padding: 15px 20px; 
    border-bottom: 1px solid var(--border-color); 
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.nav a { 
    color: var(--accent); 
    text-decoration: none; 
    margin: 0 15px; 
    font-weight: bold; 
    transition: 0.3s;
}

.nav a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* 4. LAYOUT & CONTAINERS */
.container { 
    max-width: 1000px; 
    margin: auto; 
    padding: 40px 20px; 
}

/* COMBINED HERO BANNER */
.hero {
    position: relative;
    padding: 120px 20px;
    text-align: center;
    color: white; /* Contrast against the new blue artwork */
    
    /* Using a relative path: Up one folder from /css to /static, then into /images */
    background-image: url('../images/hero_banner_background.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    border-bottom: 1px solid var(--border-color);
    overflow: hidden; /* Keeps the overlay from spilling out */
}

/* THE OVERLAY: Ensures your white text is readable against the busy background 
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5));
    z-index: 1; 
}*/

/* ENSURE TEXT SITS ABOVE OVERLAY */
.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 20px;
}

/* STYLIZED VISION BOX */
.vision-box {
    position: relative;
    max-width: 800px;
    margin: 60px auto;
    padding: 50px 40px;
    background: rgba(255, 255, 255, 0.7); /* Translucent white */
    backdrop-filter: blur(10px);         /* Glass blur effect */
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.vision-quote {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-main);
    font-family: 'Georgia', serif; /* Serif adds authority to quotes */
    font-style: italic;
    margin: 0;
}

/* Decorative Quotation Marks */
.vision-box::before {
    content: "“";
    position: absolute;
    top: -20px;
    left: 20px;
    font-size: 8rem;
    color: var(--accent);
    opacity: 0.15;
    font-family: serif;
}

.vision-box::after {
    content: "”";
    position: absolute;
    bottom: -60px;
    right: 20px;
    font-size: 8rem;
    color: var(--accent);
    opacity: 0.15;
    font-family: serif;
}

/* 5. COMPONENTS (Cards & Vault) */

/* STORYBOARD ENHANCEMENTS */
.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 50px;
    position: relative;
}

.story-card {
    background: var(--bg-secondary);
    padding: 30px 20px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.story-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 15px 30px rgba(0,0,0,0.05);
}

.story-number {
    background: var(--accent);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 15px;
}

.story-card img {
    width: 100%;
    max-width: 180px;
    height: auto;
    margin-bottom: 20px;
}

/* --- VAULT: INTELLIGENCE CARDS (For Tools.html) --- */

.tool-grid {
    display: grid;
    /* Reduced min-width to 250px to guarantee no overlap on smaller screens */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    perspective: 1500px;
    padding: 50px 0; /* Extra padding for the 'grow' effect */
    width: 100%;
}

.tool-card-container {
    height: 420px; /* Tall enough to fit all content */
    width: 100%;
    position: relative;
    margin: 0;
}

.tool-card {
    width: 100%; 
    height: 100%;
    position: relative;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

/* Flip Logic */
.tool-card-container.is-flipped .tool-card {
    transform: rotateY(180deg) scale(1.25); /* Card grows by 15% */
    z-index: 500; /* Ensures it sits on top of neighboring cards */
}

.card-face {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    padding: 25px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-sizing: border-box; /* THIS PREVENTS OVERLAP */
    box-shadow: var(--shadow-sm);
}

.card-back {
    transform: rotateY(180deg);
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2); /* Stronger shadow when enlarged */
    border: 2px solid var(--accent); /* Highlights the active detail view */
}

/* 1: Absolute Close Button */
.close-flip {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    z-index: 10;
    transition: color 0.2s;
}

.close-flip:hover { color: var(--accent); }

/* 2: Consistent Title Styling */
.back-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* 4: Uniform Specs Grid */
.specs-master-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start; /* Ensures all columns start at the top */
    text-align: left;
}

.spec-column h4 {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 12px 0; /* Uniform margin for alignment */
    padding-bottom: 5px;
    border-bottom: 1px solid #f0f0f0;
}

.spec-column p {
    margin: 0 0 10px 0;
    display: flex;
    flex-direction: column;
}

.spec-column label {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.spec-column span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
}

.front-description {
    font-size: 0.8rem;
    color: #444;
    margin: 10px 0;
    line-height: 1.4;
}

.eco-tag { background: #e8f5e9; color: #2e7d32; }

/* Tool Header & Positioning */
.tool-logo-box {
    position: absolute;
    top: 20px; right: 20px;
    width: 40px; height: 40px;
    background: var(--bg-accent);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color);
}

.tool-name { 
    font-size: 1.25rem; 
    font-weight: bold; 
    margin: 5px 0 10px 0; 
    padding-right: 50px; 
    color: var(--accent);
}

.tagline-container { height: 45px; overflow: hidden; margin-bottom: 10px; }
.tagline { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }

/* Metrics Fix */
.metrics-bar {
    display: flex; 
    justify-content: space-between;
    margin-top: auto; 
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.metric-item { display: flex; flex-direction: column; }
.metric-item small { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; }
.metric-item span { font-weight: bold; font-size: 0.8rem; }

/* Flip Link Styling */
.flip-link-wrapper { text-align: right; margin-top: 10px; }
.flip-link { font-size: 0.8rem; color: var(--accent); text-decoration: none; font-weight: bold; cursor: pointer; }

/* Pillar Badges */
.badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}
.badge-offline { background: #28a745; color: white; }

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: #ccc;
}

/* Filter Pills */
.ui-controls-wrapper {
    max-width: 800px;
    margin: 0 auto 50px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center; /* Centers the tray and the search bar */
}

.filter-container {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.filter-pill-group {
    display: flex;
    gap: 8px;
    background: #f1f3f5; /* The "Tray" background */
    padding: 6px;
    border-radius: 14px;
    border: 1px solid #e9ecef;
    justify-content: center;
}

.pill { 
    padding: 8px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: 0.2s;
    color: #555;
    background: transparent;
}

.pill.active { 
    background: #ffffff;
    color: var(--accent);
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.search-bar-container { 
    width: 100%; 
    max-width: 380px; 
}

#searchInput {
    width: 100%;
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #fff;
    font-size: 0.95rem;
    text-align: center; /* Centers the placeholder text */
    outline: none;
}

#searchInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* 6. CHAT INTERFACE (Using AI) */
.chat-container { 
    flex: 1; 
    overflow-y: auto; 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    max-width: 800px; 
    margin: auto; 
    width: 100%; 
}

.message { padding: 12px 18px; border-radius: 12px; max-width: 80%; }
.user { align-self: flex-end; background: var(--accent); color: white; }
.bot { align-self: flex-start; background: var(--bg-accent); border: 1px solid var(--border-color); }

.input-area { background: var(--bg-secondary); padding: 20px; border-top: 1px solid var(--border-color); }
input, select { 
    padding: 12px; 
    border-radius: 6px; 
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-main);
}

/* 7. REFINED FOOTER SECTION */
footer {
    background-color: #f1f3f5;    /* Slightly darker than page bg for distinction */
    border-top: 1px solid var(--border-color);
    padding: 60px 20px 30px 20px;
    margin-top: auto;             /* Pins to bottom */
    width: 100%;                  /* Ensures full-width background */
    box-sizing: border-box;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;               /* Centers the content block */
    display: flex;
    flex-wrap: wrap;              /* Responsive wrapping */
    justify-content: space-around; /* Spreads sections evenly */
    text-align: center;           /* Centers all text inside */
    gap: 40px;
}

.footer-section {
    flex: 1;
    min-width: 250px;             /* Prevents squishing on mobile */
}

.footer-section h4 {
    color: var(--text-main);
    font-size: 0.9rem;
    text-transform: uppercase;    /* Professional header style */
    letter-spacing: 1.5px;
    margin-bottom: 20px;
}

.footer-section p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto;               /* Centers the paragraph text */
}

/* Link Styling */
.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-main);
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    font-size: 0.75rem;
    color: #adb5bd;
    letter-spacing: 1px;
}

/* --- STORY REEL SECTION --- */

/* THE WRAPPER: Breaks out of any parent container to touch the screen edges */
.reel-wrapper {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background: var(--bg-secondary);
    overflow: hidden; /* Keeps arrows from creating horizontal page scroll */
}

/* THE VIEWPORT: The horizontal scroll window */
.reel-viewport {
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
}

.reel-viewport::-webkit-scrollbar { display: none; }

/* THE TRACK: No fixed width here, let the slides define it */
.reel-container {
    display: flex;
    flex-wrap: nowrap;
}

/* THE SLIDE: Forced to be exactly the width of the browser window */
.reel-slide {
    flex: 0 0 100vw; 
    width: 100vw;
    height: 70vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0 80px; /* Room for arrows */
}

/* THE CONTENT: Keeps your bunny and text in the center "safe zone" */
.reel-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    max-width: 1200px; /* This keeps your content from stretching too far on huge monitors */
    width: 100%;
}

.reel-content img {
    max-width: 550px;
    height: auto;
    flex-shrink: 0;
}

.reel-text {
    flex: 1;
}

.reel-text span {
    display: block;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.reel-text h2 {
    font-size: clamp(2.5rem, 5vw, 3.5rem); /* Responsive font size */
    line-height: 1.1;
    margin: 15px 0;
    color: var(--text-main);
}

.reel-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* THE ARROWS: Now pinned to the absolute edges of the BROWSER */
.reel-arrows {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 100;
}

.arrow-btn {
    pointer-events: auto;
    width: 55px;
    height: 55px;
    background: white;
    border: 2px solid var(--accent);
    color: var(--accent);
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.arrow-btn:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.1);
}

/* --- MOBILE RESPONSIVE FIXES --- */
@media (max-width: 992px) {
    .reel-content { gap: 30px; }
    .reel-content img { max-width: 400px; }
}

@media (max-width: 768px) {
    .reel-slide { height: auto; padding: 100px 20px; }
    
    .reel-content {
        flex-direction: column; /* Stacks bunny on top of text */
        text-align: center;
    }

    .reel-content img {
        max-width: 300px;
        transform: none; /* Removes zoom on mobile for better fit */
    }

    .reel-arrows {
        display: none; /* Users prefer swiping on mobile */
    }
}

/* SCROLL REVEAL ANIMATION */
@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Initially hidden state */
.story-card {
    opacity: 0;
}

/* The class we will add via JavaScript */
.story-card.reveal {
    animation: fadeInUp 0.8s ease forwards;
}

/* ABOUT AI SECTION */
.about-ai {
    background-color: var(--bg-main);
}

.section-intro {
    max-width: 800px;
    margin-bottom: 60px;
}

.section-intro span {
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.85rem;
}

/* THE GRID */
.ai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

/* THE CARDS */
.ai-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
}

.ai-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    border-color: var(--accent);
}

.ai-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.ai-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.ai-alias, .ai-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
    margin-bottom: 20px;
    background: #f0f4f8;
    color: var(--text-muted);
}

.ai-card.highlight .ai-tag {
    background: var(--accent);
    color: white;
}

.ai-card p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .section-intro { text-align: center; }
    .ai-grid { grid-template-columns: 1fr; }
}