:root {
    --bg: #0d1117;
    --card-bg: #161b22;
    --border: #30363d;
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
}

/* This line makes everything transition smoothly */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.3s; 
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ANIMATED BACKGROUND SETUP */
body {
    background-color: #0f172a; /* Deep fallback color */
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;

    /* THE UPGRADE: A layered background */
    background-image: 
        /* Layer 1: The Technical Grid */
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), 
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        /* Layer 2: The Glowing Orbs (Blue/Purple AI vibe) */
        radial-gradient(circle at 50% 50%, rgba(88, 166, 255, 0.1), transparent 50%),
        radial-gradient(circle at 0% 0%, rgba(121, 192, 255, 0.15), transparent 50%);

    /* Sizing the layers */
    background-size: 
        30px 30px, /* Grid square size */
        30px 30px, 
        100% 100%, 
        100% 100%;

    background-attachment: fixed; /* Keeps background still while scrolling */
    animation: bgPulse 10s ease-in-out infinite alternate;
}

/* Subtle breathing animation for the background */
@keyframes bgPulse {
    0% { background-position: 0 0, 0 0, 50% 50%, 0% 0%; }
    100% { background-position: 0 0, 0 0, 50% 55%, 2% 2%; } /* Moves the glow slightly */
}

.container { max-width: 1000px; margin: 0 auto; padding: 20px; }

/* Hero Section */
.hero { padding: 60px 0; border-bottom: 1px solid var(--border); margin-bottom: 40px; }
.hero h1 {
    font-size: 2.8rem;
    background: linear-gradient(120deg, #ffffff, #58a6ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 0px 20px rgba(88, 166, 255, 0.3); /* Subtle glow */
}
.hero p { color: var(--text-muted); font-size: 1.2rem; }

.secondary-info strong {
    color: #fff; /* Make bolded location stand out against the muted text */
}

/* NEW X BUTTON STYLE */
.x-button {
    display: inline-block;
    padding: 10px 25px;
    margin-top: 25px;
    background-color: var(--accent); /* Blue */
    color: var(--bg); /* Dark text on blue */
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    font-size: 1rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(88, 166, 255, 0.3); /* Subtle glow */
}

.x-button:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px); /* Lift effect on hover */
    box-shadow: 0 6px 20px rgba(88, 166, 255, 0.5); /* Stronger glow */
}

/* Grid Layout */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

/* Cards */
.card {
    /* Make the card slightly see-through */
    background: rgba(22, 27, 34, 0.7); 

    /* The "Frosted Glass" blur effect */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* For Safari support */

    border: 1px solid rgba(255, 255, 255, 0.1);
    /* ADD THIS LINE: */
    text-decoration: none; 

    /* Optional: Ensure text color doesn't look like a standard blue link */
    color: inherit;
    /* ... keep your existing flex/padding styles ... */
}
.card:hover {  
            transform: scale(1.02); /* Instead of translate, let's scale slightly */
            border-color: var(--accent); 
            background-color: #1a222e; /* Slightly lighten background on hover */
}
.card-content { padding: 20px; }
.card h2 { margin: 10px 0; font-size: 1.4rem; color: #fff; }
.card p { color: var(--text-muted); font-size: 0.95rem; }
.tag { font-size: 0.75rem; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; font-weight: bold; }
.card-footer { padding: 15px 20px; border-top: 1px solid var(--border); font-size: 0.9rem; color: var(--accent); font-weight: 600; }

/* Tool Detail Page */
.top-nav { border-bottom: 1px solid var(--border); padding: 15px 0; margin-bottom: 30px; background: var(--bg); }
.back-link { color: var(--text-muted); text-decoration: none; font-weight: 500; }
.back-link:hover { color: var(--accent); }

.tool-header { margin-bottom: 20px; }
.badge { background: var(--border); color: var(--text-main); padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; margin-right: 8px; }

.embed-wrapper {
    width: 100%;
    height: 600px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
    background: #000;
}
iframe { width: 100%; height: 100%; border: none; }

.content-section { background: var(--card-bg); padding: 30px; border-radius: 8px; border: 1px solid var(--border); }
.content-section h3 { margin-bottom: 15px; color: #fff; }

/* Demo Control Bar */
.demo-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Safety: Allows wrapping on mobile */
    gap: 15px;       /* Adds space between the text and button */

    margin-bottom: 20px; /* More breathing room below the bar */
    background: var(--card-bg);
    padding: 12px 20px; /* Slightly more container padding */
    border: 1px solid var(--border);
    border-radius: 8px; /* Softer corners */
}

/* The "Open New Tab" Button */
.launch-button {
    font-size: 0.9rem; /* Slightly larger text */
    color: #38bdf8; 
    border: 1px solid #38bdf8;

    text-decoration: none;
    font-weight: 600;

    /* THE PADDING FIX: Makes the button chunky and clickable */
    padding: 8px 16px; 

    border-radius: 6px;
    transition: all 0.2s;
    display: inline-block; /* Ensures padding is respected */
}

/* ... keep your :visited and :hover states same as before ... */
.launch-button:visited {
    color: #d2a8ff;
    border-color: #d2a8ff;
}

.launch-button:hover {
    background: #38bdf8;
    color: #0d1117;
    border-color: #38bdf8;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
    transform: translateY(-1px); /* Subtle lift effect */
}

/* NEW: Action Header Layout */
.action-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* Aligns button with the bottom of the tags */
    flex-wrap: wrap;       /* Crucial for Mobile: Allows button to wrap if screen is tight */
    gap: 20px;             /* Space between title and button */
    margin-bottom: 20px;
}

.tool-header {
    flex: 1;               /* Allows title to take up available space */
    min-width: 280px;      /* Ensures title doesn't get too squished before wrapping */
}

/* Ensure the button looks solid on the dark background */
.launch-button.header-btn {
    background: transparent; /* Clean look */
    /* It inherits the Blue/Purple colors from your existing .launch-button styles */
    white-space: nowrap;     /* Prevents button text from breaking into two lines */
}