:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #6366f1;
    --accent: #e11d48;
    --dark: #0f172a;
    --gray: #64748b;
    --light-gray: #f8fafc;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.25);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 10px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.08);
    --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 4px 10px -5px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 40px -15px rgb(0 0 0 / 0.2);
    --radius-md: 16px;
    --radius-lg: 28px;
    --radius-full: 9999px;
    --transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Glassmorphism & Mesh Utilities */
.glass-effect {
    background: var(--glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
}

.orb-bg {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
}

@keyframes floatOrb {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 40px) scale(0.9);
    }
}

/* Lenis Recommended CSS */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    line-height: 1.7;
    background: var(--light-gray);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Header & Navigation - Floating Pill */
header {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 600px;
    max-width: 95%;
    z-index: 10000;
    transition: var(--transition);
}

@media (max-width: 768px) {
    header {
        min-width: unset;
        width: 95%;
        top: 1rem;
    }
}

nav {
    padding: 0.8rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

header.scrolled nav {
    padding: 0.6rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-xl);
}

.logo {
    font-size: 1.4rem;
    font-weight: 950;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: var(--transition);
    flex-shrink: 0;
}

.logo::before {
    content: '⚡';
    -webkit-text-fill-color: initial;
    font-size: 1.2rem;
}

.logo:hover {
    transform: scale(1.05) rotate(-2deg);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
    white-space: nowrap;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Mobile Menu Button */
.menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    /* Perfectly circular */
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    z-index: 10001;
}

.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--light-gray);
}

.menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--primary);
    border-radius: 4px;
    transition: var(--transition);
}

.menu-btn.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-btn.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.menu-btn.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Navigation Overlay */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: var(--white);
    z-index: 9999;
    padding: 80px 2rem;
    transition: 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0);
    display: none;
    /* Hidden by default on desktop */
}

.mobile-nav.active {
    right: 0;
    display: block;
}

.mobile-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mobile-nav a {
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--light-gray);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.mobile-nav a:hover {
    background: var(--primary);
    color: white;
    transform: translateX(10px);
}

/* Responsive Grid */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Utilities */
.mt-nav {
    margin-top: 100px;
}

.py-section {
    padding: 80px 0;
}

@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }

    .menu-btn {
        display: flex;
    }

    header {
        width: 90%;
        min-width: 300px;
    }
}

@media (min-width: 1025px) {
    .nav-links {
        display: flex !important;
    }

    .menu-btn,
    .mobile-nav {
        display: none !important;
    }
}

@media (max-width: 768px) {
    nav {
        padding: 1rem 1.5rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 1.5rem;
    }
}

/* ── Tool Pages: Back to Home Button (Circular) ── */
.back-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 44px;
    height: 44px;
    background: white;
    color: var(--primary);
    border: 2px solid rgba(99, 102, 241, 0.25);
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .back-home {
        width: 38px;
        height: 38px;
    }

    .back-home svg {
        width: 16px;
        height: 16px;
    }
}

.back-home:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.1) translateX(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.back-home svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.back-home:hover svg {
    transform: translateX(-2px);
}

/* ── Premium Tool Design System ── */
:root {
    --p: #8B5CF6;
    --p2: #7C3AED;
    --pk: #EC4899;
    --glass-p: rgba(255, 255, 255, 0.7);
}

@keyframes bgShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.premium-bg {
    background: linear-gradient(135deg, #faf5ff 0%, #fdf2f8 35%, #f0f9ff 65%, #f5f3ff 100%);
    background-size: 400% 400%;
    animation: bgShift 12s ease infinite;
}

.tool-header {
    padding: 180px 2rem 80px;
    /* Increased padding to avoid pill overlap */
    text-align: center;
    position: relative;
}

.tool-header::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(139, 92, 246, 0.1);
    color: var(--p);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 100px;
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.tool-header h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1.2rem;
    background: linear-gradient(135deg, var(--p) 0%, var(--pk) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-header p {
    font-size: 1.15rem;
    color: var(--gray);
    max-width: 560px;
    margin: 0 auto;
}

.tool-interface {
    max-width: 800px;
    margin: 0 auto 5rem;
    padding: 0 1.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 1.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calculator-card {
    background: var(--glass-p);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: 28px;
    box-shadow: 0 25px 60px rgba(139, 92, 246, 0.12), 0 8px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.85);
}

/* ── Content Sections ── */
.content-section {
    max-width: 860px;
    margin: 6rem auto;
    padding: 0 1.5rem;
}

.section-tag {
    display: inline-block;
    background: rgba(139, 92, 246, 0.08);
    color: var(--p);
    border-radius: 100px;
    padding: 0.3rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin: 2rem 0;
}

.feature-item {
    background: var(--glass-p);
    backdrop-filter: blur(12px);
    padding: 1.4rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.faq-item {
    background: var(--glass-p);
    backdrop-filter: blur(12px);
    padding: 1.8rem;
    margin-bottom: 0.8rem;
    border-radius: 18px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

/* ── Mobile Nav: Close (X) Button ── */
.mobile-nav-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--light-gray);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--dark);
    transition: var(--transition);
    z-index: 10002;
}

@media (min-width: 1025px) {
    .mobile-nav {
        display: none !important;
        right: -100% !important;
    }
}

@media (max-width: 1024px) {
    .mobile-nav {
        display: none;
    }

    .mobile-nav.active {
        display: block;
        right: 0;
    }
}

/* ── Premium Tool Elements ── */
.calculate-btn {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--p) 0%, var(--pk) 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.3);
    margin-top: 0.5rem;
    letter-spacing: 0.02em;
    font-family: 'Poppins', sans-serif;
    position: relative;
    overflow: hidden;
}

.calculate-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--pk) 0%, var(--p) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.calculate-btn:hover::before {
    opacity: 1;
}

.calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 40px rgba(139, 92, 246, 0.4);
}

.calculate-btn span {
    position: relative;
    z-index: 1;
}

.results {
    display: none;
    margin-top: 2rem;
    animation: popIn 0.5s ease;
}

.results.show {
    display: block;
}

.result-main {
    background: linear-gradient(135deg, var(--p) 0%, var(--pk) 100%);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-align: center;
    color: white;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.result-main::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 50%;
}

.result-label {
    font-size: 0.85rem;
    font-weight: 700;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    padding: 1.2rem 1rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.stat-card .number {
    font-size: 1.7rem;
    font-weight: 900;
    font-family: 'Poppins', sans-serif;
    line-height: 1;
    margin-bottom: 0.3rem;
}

/* ── Related Tools ── */
.related-tools {
    max-width: 1000px;
    margin: 4rem auto 6rem;
    padding: 0 1.5rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
}

.tool-card-premium {
    background: var(--glass-p);
    backdrop-filter: blur(12px);
    padding: 1.8rem 1.5rem;
    border-radius: 22px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.9);
    text-decoration: none;
    color: inherit;
    display: block;
}

.tool-card-premium:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

@media (max-width: 640px) {
    .calculator-card {
        padding: 1.8rem 1.2rem;
    }
}