/* Variables */
:root {
    --bg: #f4f7f9;
    --card-bg: #ffffff;
    --text-main: #1a1c20;
    --text-muted: #64748b;
    --accent: #4361ee;
    --border: #e2e8f0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --border: #334155;
    --shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background 0.3s ease, border 0.3s ease, color 0.3s ease;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.6;
}

.wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* Header & Toggle */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
}

.logo { font-weight: 700; font-size: 1.5rem; letter-spacing: -1px; }
.logo span { color: var(--accent); }

#theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    font-size: 1.2rem;
}

.intro h1 { font-size: 2.2rem; margin-bottom: 10px; }
.intro p { color: var(--text-muted); font-size: 1.1rem; }

/* Grid / Card Layout (Desktop) */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.tool-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.tool-card:not(.disabled):hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.icon-box {
    width: 56px;
    height: 56px;
    background: var(--bg);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    border: 1px solid var(--border);
}

.tool-info h3 { font-size: 1.25rem; margin-bottom: 8px; }

/* Desktop Line Clamp (2 lines) */
.tool-info p {
    font-size: 0.95rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile Compact View (List Style) */
@media (max-width: 650px) {
    .wrapper { padding: 30px 15px; }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .tool-card {
        flex-direction: row; /* Icon and text on same line */
        padding: 16px;
        gap: 16px;
        border-radius: 14px;
        align-items: center;
    }

    .icon-box {
        min-width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    .tool-info h3 { font-size: 1.05rem; margin-bottom: 2px; }

    /* Mobile Line Clamp (1 line to stay compact) */
    .tool-info p {
        font-size: 0.85rem;
        -webkit-line-clamp: 1;
    }

    .intro h1 { font-size: 1.6rem; }
    .intro p { font-size: 0.95rem; }
}

.disabled { opacity: 0.6; cursor: default; }