/* ==========================================================================
   CSS Variables & Theme Setup (Light Blue & White)
   ========================================================================== */
   :root {
    /* Colors */
    --clr-bg: #F0F9FF; /* Sky 50 */
    --clr-surface: rgba(255, 255, 255, 0.7);
    --clr-surface-hover: rgba(255, 255, 255, 0.9);
    --clr-primary: #0284C7; /* Sky 600 */
    --clr-primary-light: #38BDF8; /* Sky 400 */
    --clr-text-main: #0F172A; /* Slate 900 */
    --clr-text-muted: #475569; /* Slate 600 */
    --clr-border: rgba(14, 165, 233, 0.2);

    /* Typography */
    --font-main: 'Inter', sans-serif;
    
    /* Layout & Effects */
    --border-radius: 16px;
    --shadow-soft: 0 10px 40px -10px rgba(2, 132, 199, 0.1);
    --shadow-hover: 0 20px 40px -10px rgba(2, 132, 199, 0.2);
    --glass-blur: blur(12px);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--clr-bg);
    color: var(--clr-text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   Dynamic Background
   ========================================================================== */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        linear-gradient(to right, rgba(2, 132, 199, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(2, 132, 199, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    animation: float 10s ease-in-out infinite alternate;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, #E0F2FE, #BAE6FD);
}

.orb-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, #F0F9FF, #7DD3FC);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

/* ==========================================================================
   Typography & Utilities
   ========================================================================== */
h1, h2, h3 {
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.text-gradient {
    background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-primary {
    background: var(--clr-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px 0 rgba(2, 132, 199, 0.39);
}

.btn-primary:hover {
    background: var(--clr-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.125rem;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--clr-border);
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow-soft);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--clr-primary);
}

.logo i {
    color: var(--clr-primary-light);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-links a {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--clr-text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 50px;
    position: relative;
    white-space: nowrap;
}

.nav-links a i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: var(--transition);
}

/* Icon gets primary color on hover */
.nav-links a:hover i {
    color: var(--clr-primary);
    transform: scale(1.2);
}

/* Pill background on hover */
.nav-links a:hover {
    color: var(--clr-primary);
    background: rgba(2, 132, 199, 0.08);
}

/* Active / current page indicator */
.nav-links a.active {
    color: var(--clr-primary);
    background: rgba(2, 132, 199, 0.12);
    font-weight: 700;
}

/* Blog link gets a distinct accent */
.nav-links a:last-child {
    color: #0369a1;
    border: 1.5px solid rgba(2, 132, 199, 0.25);
}
.nav-links a:last-child:hover {
    background: var(--clr-primary);
    color: white;
    border-color: var(--clr-primary);
}
.nav-links a:last-child:hover i {
    color: white;
}

.mobile-menu-btn {
    display: none;
    cursor: pointer;
    color: var(--clr-primary);
}

.mobile-menu-btn i {
    width: 28px;
    height: 28px;
}

/* Tool UI Utility Classes */
.tool-grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.tool-flex-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.tool-flex-wrap > * {
    flex: 1;
    min-width: 140px;
}

.tool-panel {
    background: rgba(255,255,255,0.5);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--clr-border);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    padding-top: 180px;
    padding-bottom: 100px;
    text-align: center;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero h1 {
    font-size: clamp(3rem, 6vw, 5rem);
    margin-bottom: 24px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.hero p {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    color: var(--clr-text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
}

.tool-hero {
    min-height: 40vh;
    padding-top: 140px;
    padding-bottom: 40px;
}
.tool-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

/* ==========================================================================
   Tools Section
   ========================================================================== */
.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.section-header p {
    color: var(--clr-text-muted);
    font-size: 1.125rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
}

.tool-card {
    background: var(--clr-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--clr-border);
    border-radius: var(--border-radius);
    padding: 32px;
    transition: var(--transition);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.tool-card:hover {
    background: var(--clr-surface-hover);
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(2, 132, 199, 0.4);
}

.tool-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--clr-bg), #fff);
    border: 1px solid var(--clr-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--clr-primary);
    transition: var(--transition);
}

.tool-card:hover .tool-icon-wrapper {
    background: var(--clr-primary);
    color: white;
}

.tool-card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--clr-text-main);
}

.tool-card p {
    color: var(--clr-text-muted);
    font-size: 0.95rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    padding: 40px 0;
    text-align: center;
    color: var(--clr-text-muted);
    border-top: 1px solid var(--clr-border);
    margin-top: 80px;
}

/* ==========================================================================
   Scrolling Animations
   ========================================================================== */
.scroll-anim {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: opacity, transform;
}

.fade-in-up {
    transform: translateY(40px);
}

.fade-in-down {
    transform: translateY(-40px);
}

.scroll-anim.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* Responsive Adjustments */
@media (max-width: 992px) {
    .hero h1 { font-size: 3.5rem; }
    .hero { padding-top: 140px; padding-bottom: 60px; min-height: 60vh; }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: var(--glass-blur);
        border-bottom: 1px solid var(--clr-border);
        box-shadow: var(--shadow-soft);
        padding: 24px;
        gap: 20px;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links a {
        font-size: 1.125rem;
        width: 100%;
    }
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1rem; padding: 0 16px; }
    .section { padding: 40px 0; }
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .tool-card { padding: 24px; }
    .btn-large { padding: 12px 24px; font-size: 1rem; }
    
    /* Specific overrides for tool internal pages if needed */
    .tool-container {
        padding: 24px 16px;
        margin: 20px auto;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 2rem; }
    .nav-content { height: 60px; }
    .hero { padding-top: 100px; }
    .section-header h2 { font-size: 2rem; }
}
