@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   SOGHRI TOOLS — Premium Engineering Workspace Design System
   Sleek Steel Tech Blue / Subtle Amber / Crisp Grid Geometry
   ============================================================ */

:root {
    /* Primary Brand Colors - Premium Tech Blue & Azure */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #60a5fa;
    --primary-alpha: rgba(37, 99, 235, 0.12);
    --primary-alpha-sm: rgba(37, 99, 235, 0.06);

    /* Secondary / Accent - Warm Amber */
    --accent: #d97706;
    --accent-hover: #b45309;
    --accent-alpha: rgba(217, 119, 6, 0.12);

    /* Semantic Colors */
    --success: #10b981;
    --success-alpha: rgba(16, 185, 129, 0.12);
    --danger: #ef4444;
    --danger-alpha: rgba(239, 68, 68, 0.12);
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Typography */
    --font-primary: 'IBM Plex Sans Arabic', sans-serif;
    --font-secondary: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Radius - Crisp & Technical */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --max-width: 1250px;
    --header-height: 64px;

    /* ── Backwards-compat aliases ── */
    --border-radius: var(--radius);
    --border-radius-sm: var(--radius-sm);
    --card-shadow: var(--shadow);
    --input-bg: var(--bg-input);
}

/* ── Dark Theme (Default) ───────────────────────────────── */
[data-theme="dark"] {
    --bg-base: #070a13;       /* Deeper Slate Navy */
    --bg-primary: #0d111d;    /* Charcoal Slate */
    --bg-secondary: #171d2f;  /* Steel border/divider backgrounds */
    --bg-tertiary: #202941;
    --bg-card: #0d111d;       /* Sleek cards grid background */
    --bg-input: #070a13;
    --bg-hover: #151b2d;

    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-placeholder: #4b5563;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --border-accent: var(--primary);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.12);
    --shadow-glow: none; /* No AI glowing shadows */

    --card-border: 1px solid var(--border-color);
    --nav-bg: rgba(13, 17, 29, 0.9);
    --footer-bg: #05070e;
    --code-bg: #070a13;

    --overlay: rgba(0, 0, 0, 0.7);
}

/* ── Light Theme ─────────────────────────────────────────── */
[data-theme="light"] {
    --bg-base: #f8fafc;
    --bg-primary: #ffffff;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --bg-hover: #f1f5f9;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-placeholder: #94a3b8;

    --border-color: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(15, 23, 42, 0.15);
    --border-accent: var(--primary);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 16px rgba(15, 23, 42, 0.06), 0 0 1px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.1), 0 0 1px rgba(15, 23, 42, 0.06);
    --shadow-glow: none;

    --card-border: 1px solid var(--border-color);
    --nav-bg: rgba(255, 255, 255, 0.9);
    --footer-bg: #f8fafc;
    --code-bg: #f1f5f9;

    --overlay: rgba(15, 23, 42, 0.3);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease, color 0.3s ease;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

/* Technical blueprint lines grid */
body::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to left, var(--border-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--border-color) 1px, transparent 1px);
    background-size: 100px 100px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.25;
}

body::after {
    display: none; /* No generic radial glow blobs */
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

button, input, select, textarea {
    font-family: var(--font-primary);
    outline: none;
    border: none;
}

img { max-width: 100%; display: block; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
header {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--header-height);
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: var(--transition);
}

.logo span { color: var(--text-primary); }
.logo em {
    color: var(--primary-light);
    font-style: normal;
    font-weight: 500;
}

.nav-links {
    list-style: none;
    display: none; /* hidden on mobile by default */
    flex-direction: column;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid transparent;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-links a.active {
    color: var(--primary-light);
    background: var(--primary-alpha);
    border-color: rgba(37, 99, 235, 0.15);
    font-weight: 600;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.theme-toggle-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
    font-size: 0.95rem;
}

.theme-toggle-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.mobile-menu-btn {
    display: flex;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-xs);
}

/* Sidebar and Dashboard navigation classes */
.nav-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.85rem 0.5rem 0.35rem;
    list-style: none;
    user-select: none;
}

.sidebar-search-container {
    list-style: none;
    margin: 0.15rem 0.25rem 0.5rem;
    position: relative;
}

.sidebar-search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-xs);
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    font-family: var(--font-primary);
    transition: var(--transition-fast);
}

.sidebar-search-input:focus {
    border-color: var(--primary);
    background: var(--bg-primary);
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.nav-links a:hover .nav-icon {
    color: var(--text-primary);
}

.nav-links a.active .nav-icon {
    color: var(--primary-light);
}

.tool-num-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
    margin-right: auto; /* Push to far left in RTL */
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.nav-links a.active .tool-num-badge {
    color: var(--primary-light);
    background: var(--bg-base);
    border-color: rgba(37, 99, 235, 0.25);
}

.legal-links-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.75rem 0.5rem;
    list-style: none;
}

.legal-nav-item a {
    font-size: 0.78rem !important;
    color: var(--text-muted) !important;
}

.legal-nav-item a:hover {
    color: var(--text-secondary) !important;
}

/* ============================================================
   LAYOUT & DESKTOP SIDEBAR GRID (Width >= 992px)
   ============================================================ */
@media (min-width: 992px) {
    body {
        display: grid;
        grid-template-columns: 280px 1fr;
        grid-template-rows: auto;
        grid-template-areas: 
            "sidebar main"
            "sidebar footer";
        min-height: 100vh;
    }

    header {
        grid-area: sidebar;
        position: sticky;
        top: 0;
        height: 100vh;
        width: 280px;
        background-color: var(--bg-primary);
        border-left: 1px solid var(--border-color);
        border-bottom: none;
        overflow-y: auto;
        z-index: 100;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .nav-container {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        height: 100%;
        padding: 1.75rem 1.25rem;
        gap: 1.25rem;
    }

    .logo {
        justify-content: flex-start;
        padding-bottom: 1.25rem;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    .logo-icon {
        width: 34px;
        height: 34px;
    }

    .nav-links {
        display: flex; /* Always visible on desktop */
        flex-direction: column;
        gap: 0.2rem;
        width: 100%;
        margin-bottom: auto;
    }

    .nav-links a.active {
        background: var(--primary-alpha);
        color: var(--primary-light);
        border-right: 3px solid var(--primary);
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        padding-right: 0.95rem; /* slight offset shift to show focus shift */
        font-weight: 600;
    }

    .nav-actions {
        border-top: 1px solid var(--border-color);
        padding-top: 1.25rem;
        width: 100%;
        justify-content: space-between;
        margin-top: 1.5rem;
    }

    .mobile-menu-btn {
        display: none;
    }

    main {
        grid-area: main;
        max-width: none;
        width: 100%;
        margin: 0;
        padding: 3.5rem 3.5rem 3rem;
    }

    footer {
        grid-area: footer;
        margin: 0;
        width: 100%;
        border-top: 1px solid var(--border-color);
        background: var(--footer-bg);
    }
}

/* Fallback for general layouts */
main {
    flex: 1;
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.25rem 3.5rem;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
    text-align: center;
    padding: 3rem 1rem 2.5rem;
    max-width: 760px;
    margin: 0 auto;
    position: relative;
}

@media (min-width: 992px) {
    .hero {
        text-align: right;
        margin: 0;
        padding: 3rem 0.5rem 2.5rem 0;
    }
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-alpha);
    color: var(--primary-light);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(37, 99, 235, 0.2);
    margin-bottom: 1.5rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-eyebrow .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 1.1rem;
}

.hero h1 .highlight {
    color: var(--primary-light);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 2px;
}

.hero p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 2rem;
    font-weight: 400;
}

/* Search Box - Technical Console Style */
.search-wrapper {
    position: relative;
    max-width: 520px;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .search-wrapper {
        margin-right: 0; /* Align right on desktop */
    }
}

.search-wrapper svg {
    position: absolute;
    top: 50%;
    right: 1.15rem;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-wrapper::after {
    content: '⌘K';
    position: absolute;
    left: 1.15rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius);
    padding: 0.85rem 3.15rem 0.85rem 3.5rem; /* Additional padding on left for the shortcut badge */
    font-size: 0.925rem;
    font-family: var(--font-primary);
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.search-input::placeholder { color: var(--text-placeholder); }
.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
    background: var(--bg-primary);
}

/* ============================================================
   TOOLS GRID
   ============================================================ */
.section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1rem;
    counter-reset: tool-counter;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    counter-increment: tool-counter;
}

.tool-card::before {
    display: none; /* Removed the generic AI template gradient bar */
}

.tool-card::after {
    content: "[" counter(tool-counter, decimal-leading-zero) "]";
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    transition: var(--transition-fast);
}

[dir="ltr"] .tool-card::after {
    left: auto;
    right: 1.5rem;
}

.tool-card:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
    box-shadow: var(--shadow);
}

.tool-card:hover::after {
    color: var(--primary-light);
    border-color: rgba(37, 99, 235, 0.25);
    background: var(--bg-base);
}

.tool-icon-wrapper {
    width: 42px;
    height: 42px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.tool-card:hover .tool-icon-wrapper {
    background: var(--primary-alpha);
    color: var(--primary-light);
    border-color: rgba(37, 99, 235, 0.25);
}

.tool-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
}

.tool-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.65;
    flex: 1;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 700;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.btn-link:hover {
    color: var(--primary-light);
    gap: 0.6rem;
}

/* ============================================================
   TOOL PAGE CONTAINERS
   ============================================================ */
.tool-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2.25rem 2.25rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

/* Mock macOS window controls on top-left */
.tool-container::before {
    content: '';
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    width: 40px;
    height: 8px;
    background: radial-gradient(circle, #ff5f56 3px, transparent 4px) 0 0,
                radial-gradient(circle, #ffbd2e 3px, transparent 4px) 14px 0,
                radial-gradient(circle, #27c93f 3px, transparent 4px) 28px 0;
    background-repeat: no-repeat;
    background-size: 8px 8px;
    opacity: 0.8;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid var(--border-color);
}

.tool-header-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.tool-header svg { color: var(--primary-light); }

.tool-header-text h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.tool-header-text p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.825rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-secondary); }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.form-control {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.925rem;
    font-family: var(--font-primary);
    width: 100%;
    transition: var(--transition-fast);
}

.form-control::placeholder { color: var(--text-placeholder); }
.form-control:focus {
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

textarea.form-control {
    resize: vertical;
    min-height: 140px;
    line-height: 1.6;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238fa3be' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    padding-left: 2.5rem;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.72rem 1.4rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
    white-space: nowrap;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.08);
    opacity: 0;
    transition: var(--transition-fast);
}

.btn:hover::after { opacity: 1; }
.btn:hover {
    box-shadow: 0 6px 20px rgba(13,148,136,0.35);
    transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
}

.btn-accent:hover { box-shadow: 0 6px 20px rgba(245,158,11,0.35); }

.btn-danger {
    background: var(--danger-alpha);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(244,63,94,0.35);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
}

.btn-lg {
    padding: 0.9rem 1.75rem;
    font-size: 1rem;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

/* ============================================================
   RESULT / CODE BOX
   ============================================================ */
.result-box {
    position: relative;
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    overflow: hidden;
}

.result-box pre,
.result-box code {
    white-space: pre-wrap;
    word-break: break-all;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.copy-btn {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    z-index: 2;
}

[dir="ltr"] .copy-btn { left: auto; right: 0.75rem; }

.copy-btn:hover {
    background: var(--primary);
    border-color: transparent;
    color: #fff;
}

/* ============================================================
   STAT / METRIC CARDS
   ============================================================ */
.word-count-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.stat-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem 0.75rem;
    text-align: center;
    transition: var(--transition-fast);
}

.stat-item:hover {
    border-color: var(--primary);
    background: var(--primary-alpha-sm);
}

.stat-val {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-mono);
    line-height: 1;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ============================================================
   STRENGTH METER
   ============================================================ */
.strength-meter {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.4s ease, background-color 0.4s ease;
}

.strength-text {
    font-size: 0.82rem;
    font-weight: 700;
    margin-top: 0.35rem;
    display: block;
}

/* ============================================================
   QR PREVIEW
   ============================================================ */
.qr-preview-container {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 1rem auto;
    max-width: 240px;
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   POMODORO SPECIFIC
   ============================================================ */
.pomodoro-timer-container {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 2.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: inset 0 0 30px rgba(99, 102, 241, 0.05), var(--shadow);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}

.pomodoro-timer-container svg {
    position: absolute;
    top: -1px;
    left: -1px;
    transform: rotate(-90deg);
}

.pomodoro-display {
    font-size: 3.8rem;
    font-weight: 800;
    font-family: var(--font-mono);
    letter-spacing: 2px;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    margin: 0;
    text-align: center;
    line-height: 1;
    z-index: 5;
}

.pomodoro-modes {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.pomodoro-mode-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    font-family: var(--font-primary);
    transition: var(--transition-fast);
}

.pomodoro-mode-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.pomodoro-mode-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(13,148,136,0.35);
}

/* ============================================================
   INFO / SEO SECTION
   ============================================================ */
.tool-info-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.tool-info-section h3 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.tool-info-section p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 0.925rem;
    line-height: 1.8;
}

.tool-info-section ul,
.tool-info-section ol {
    padding-right: 1.5rem;
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

[dir="ltr"] .tool-info-section ul,
[dir="ltr"] .tool-info-section ol {
    padding-right: 0;
    padding-left: 1.5rem;
}

.tool-info-section li {
    margin-bottom: 0.5rem;
    font-size: 0.925rem;
    line-height: 1.7;
}

/* FAQ Cards - Modern Accordion Style */
.faq-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.faq-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition-fast);
}

.faq-item[open] {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.faq-item summary {
    padding: 1.25rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    outline: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--primary);
    transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
    content: '−';
    transform: rotate(180deg);
}

.faq-item summary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.faq-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.75;
    padding: 0 1.5rem 1.5rem;
    margin: 0;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

/* ============================================================
   FEATURE STRIPS (Info Section on Homepage)
   ============================================================ */
.features-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 3rem;
    padding: 2rem;
    background: var(--bg-card);
    border: var(--card-border);
    border-radius: var(--radius-lg);
}

.feature-item {
    text-align: center;
    padding: 1.5rem 1rem;
}

.feature-icon {
    width: 52px;
    height: 52px;
    background: var(--primary-alpha);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    margin: 0 auto 1rem;
}

.feature-item h4 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.feature-item p {
    font-size: 0.825rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    padding: 3rem 1.5rem 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2.5rem;
}

.footer-section h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.7;
}

.footer-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-section ul a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.footer-section ul a::before {
    content: '←';
    font-size: 0.75rem;
    color: var(--primary);
    opacity: 0;
    transition: var(--transition-fast);
}

[dir="ltr"] .footer-section ul a::before { content: '→'; }

.footer-section ul a:hover {
    color: var(--primary);
    padding-right: 0.35rem;
}

.footer-section ul a:hover::before { opacity: 1; }

.footer-bottom {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.825rem;
    color: var(--text-muted);
}

.footer-bottom-links {
    display: flex;
    gap: 1.25rem;
}

.footer-bottom-links a:hover { color: var(--primary); }

/* Footer brand */
.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.footer-brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.footer-brand span {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-primary);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-hover);
    padding: 0.75rem 1.4rem;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    opacity: 0;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    max-width: 90vw;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast::before {
    content: '✓';
    width: 20px;
    height: 20px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 900;
    flex-shrink: 0;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============================================================
   LEGAL & CONTACT PAGES
   ============================================================ */
.legal-container {
    max-width: 780px;
    margin: 1.5rem auto;
    background: var(--bg-card);
    border: var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2.75rem;
    box-shadow: var(--shadow-sm);
}

.legal-container h1 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.legal-container h2 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    padding-right: 0.75rem;
    border-right: 3px solid var(--primary);
}

[dir="ltr"] .legal-container h2 {
    padding-right: 0;
    padding-left: 0.75rem;
    border-right: none;
    border-left: 3px solid var(--primary);
}

.legal-container p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.925rem;
    line-height: 1.8;
}

.legal-container ul {
    padding-right: 1.5rem;
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.legal-container li {
    margin-bottom: 0.5rem;
    font-size: 0.925rem;
    line-height: 1.7;
}

/* Contact */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition-fast);
}

.contact-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.contact-card-icon {
    width: 42px;
    height: 42px;
    background: var(--primary-alpha);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    flex-shrink: 0;
}

.contact-card-detail h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.contact-card-detail p {
    color: var(--text-secondary);
    font-size: 0.825rem;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

.animate-fade-in {
    animation: fadeIn 0.35s ease forwards;
}

.animate-slide-in {
    animation: slideIn 0.35s ease forwards;
}

/* Stagger children */
.tools-grid .tool-card:nth-child(1) { animation-delay: 0.05s; }
.tools-grid .tool-card:nth-child(2) { animation-delay: 0.1s; }
.tools-grid .tool-card:nth-child(3) { animation-delay: 0.15s; }
.tools-grid .tool-card:nth-child(4) { animation-delay: 0.2s; }
.tools-grid .tool-card:nth-child(5) { animation-delay: 0.25s; }
.tools-grid .tool-card:nth-child(6) { animation-delay: 0.3s; }
.tools-grid .tool-card:nth-child(7) { animation-delay: 0.35s; }
.tools-grid .tool-card:nth-child(8) { animation-delay: 0.4s; }
.tools-grid .tool-card:nth-child(9) { animation-delay: 0.45s; }
.tools-grid .tool-card:nth-child(10) { animation-delay: 0.5s; }

.animate-fade-in .tool-card {
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.about-hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.value-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.value-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    transition: var(--transition-fast);
}

.value-card:hover { border-color: var(--primary); }

.value-card h4 {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.value-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .footer-content .footer-section:first-child {
        grid-column: 1 / -1;
    }

    .features-strip {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 991px) {
    html { font-size: 14px; }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--nav-bg);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border-color);
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 0.25rem;
        align-items: stretch;
        box-shadow: var(--shadow);
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
    }

    .nav-links.active { display: flex; }
    .nav-links a { padding: 0.65rem 1rem; }

    .mobile-menu-btn { display: flex; }

    .hero h1 { font-size: 2.2rem; }

    .hero-eyebrow { font-size: 0.72rem; }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .features-strip {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .legal-container { padding: 1.75rem; }
    .tool-container { padding: 1.5rem; }
    .pomodoro-display { font-size: 4rem; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.75rem; }
    main { padding: 1.5rem 1rem 3rem; }

    .tools-grid { grid-template-columns: 1fr; }

    .word-count-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .btn-group { flex-direction: column; }
    .btn-group .btn { width: 100%; }

    .footer-bottom { flex-direction: column; text-align: center; }
}

/* ============================================================
   BADGES & PILLS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-success {
    background: var(--success-alpha);
    color: var(--success);
    border: 1px solid rgba(16,185,129,0.2);
}

.badge-primary {
    background: var(--primary-alpha);
    color: var(--primary-light);
    border: 1px solid rgba(13,148,136,0.2);
}

/* ============================================================
   CHECKBOXES & RANGE INPUTS
   ============================================================ */
input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
    cursor: pointer;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    accent-color: var(--primary);
    cursor: pointer;
    border-radius: 3px;
}

input[type="color"] {
    width: 52px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    cursor: pointer;
    background: transparent;
}

/* ============================================================
   DIVIDERS & UTILITIES
   ============================================================ */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ============================================================
   CONTRAST CHECKER (Color Palette Tool)
   ============================================================ */
.contrast-preview {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 1rem;
    padding: 1.5rem;
    transition: var(--transition);
}

.wcag-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.wcag-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.wcag-badge {
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-xs);
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.wcag-badge.pass {
    background: var(--success-alpha);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.wcag-badge.fail {
    background: var(--danger-alpha);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ============================================================
   GRID COLUMN UTILITIES
   ============================================================ */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

@media (max-width: 600px) {
    .grid-2 { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .wcag-grid { grid-template-columns: 1fr; }
}
