:root {
    --bg-color: #f0f4f8;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --input-bg: #ffffff;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --focus-border: #64748b;
    --focus-ring: rgba(100, 116, 139, 0.4);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --transition: all 0.2s ease;
}

[data-theme="dark"] {
    --bg-color: #31353a;
    --card-bg: #26292d;
    --text-main: #f8fafc;
    --text-muted: #9ba1a6;
    --border-color: #4a5057;
    --input-bg: #1e2124;
    --primary: #60a5fa;
    --primary-hover: #93c5fd;
    --focus-border: #9ba1a6;
    --focus-ring: rgba(155, 161, 166, 0.4);
    --shadow-md: 0 8px 12px -3px rgb(0 0 0 / 0.3);
}

* {
    box-sizing: border-box;
    font-family: 'JetBrains Mono', monospace;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    padding: 2rem 1.5rem;
    margin: 0;
    transition: var(--transition);
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    color: var(--primary);
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.theme-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-label {
    font-size: 0.9rem;
    font-weight: 500;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.theme-switch {
    position: relative;
    width: 50px;
    height: 28px;
    background-color: var(--border-color);
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
}

.theme-switch:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

#darkModeToggle:checked + .theme-switch {
    background-color: var(--primary);
}

#darkModeToggle:checked + .theme-switch .toggle-thumb {
    transform: translateX(22px);
}

.intro-section {
    margin-bottom: 3rem;
    text-align: center;
}

.intro-section h2 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
}

.intro-section p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.grid-system {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
    margin-bottom: 4rem;
}

@media (min-width: 640px) {
    .grid-system {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 960px) {
    .grid-system {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .grid-system {
        grid-template-columns: repeat(4, 1fr);
    }
}

.tool-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-icon {
    width: 48px;
    height: 48px;
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.tool-info h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.tool-domain {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    display: block;
    margin-bottom: 0.75rem;
}

.tool-desc {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.footer {
    margin-top: auto;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .footer {
        grid-template-columns: 2fr 1fr;
    }
}

.footer-block h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-main);
}

.footer-block p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 1rem 0;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.contact-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.copyright {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--border-color);
}