/* ==========================
   RESET
========================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, sans-serif;
    background: #f8fafc;
    color: #0f172a;
    line-height: 1.6;
}

/* ==========================
   VARIABLES
========================== */

:root {

    --bg: #f8fafc;

    --card: #ffffff;

    --primary: #4f46e5;
    --primary-hover: #4338ca;

    --primary-soft: #eef2ff;

    --text: #0f172a;
    --muted: #64748b;

    --border: #e2e8f0;

    --shadow:
        0 10px 30px rgba(15, 23, 42, 0.08);

    --radius: 18px;

    --max-width: 1400px;
}

/* ==========================
   GLOBAL
========================== */

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

img {
    max-width: 100%;
}

button {
    cursor: pointer;
    font-family: inherit;
}

/* ==========================
   HEADER
========================== */

header {

    max-width: var(--max-width);

    margin: auto;

    padding: 20px 30px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-weight: 700;
    font-size: 1.1rem;
}

.logo-badge {

    background: var(--primary-soft);

    color: var(--primary);

    padding: 4px 10px;

    border-radius: 999px;

    font-size: .8rem;
}

nav {
    display: flex;
    gap: 25px;
}

nav a {
    color: var(--muted);
}

nav a:hover {
    color: var(--primary);
}

/* ==========================
   HERO
========================== */

.hero {

    max-width: var(--max-width);

    margin: auto;

    padding: 80px 30px;

    display: grid;

    grid-template-columns:
        1fr
        1fr;

    gap: 50px;

    align-items: center;
}

.hero h1 {

    font-size: 4rem;

    line-height: 1.1;

    margin-bottom: 25px;
}

.hero p {

    color: var(--muted);

    font-size: 1.1rem;

    max-width: 600px;
}

.hero input {

    width: 100%;

    max-width: 450px;

    margin-top: 30px;

    padding: 16px 20px;

    border-radius: 14px;

    border: 1px solid var(--border);

    font-size: 1rem;
}

/* ==========================
   ILLUSTRATION
========================== */

.tool-preview {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 15px;
}

.tool-preview div {

    background: white;

    border-radius: 16px;

    padding: 30px 20px;

    text-align: center;

    box-shadow: var(--shadow);

    font-weight: 600;
}

/* ==========================
   FILTERS
========================== */

.filters {

    max-width: var(--max-width);

    margin: auto;

    padding: 0 30px 30px;

    display: flex;

    flex-wrap: wrap;

    gap: 12px;
}

.filters button {

    border: 1px solid var(--border);

    background: white;

    border-radius: 999px;

    padding: 10px 18px;
}

.filters button:hover {

    background: var(--primary-soft);

    color: var(--primary);
}

/* ==========================
   TOOLS GRID
========================== */

.tools-grid {

    max-width: var(--max-width);

    margin: auto;

    padding: 20px 30px 80px;

    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(320px, 1fr));

    gap: 25px;
}

/* ==========================
   CARD
========================== */

.tool-card {

    background: var(--card);

    border-radius: var(--radius);

    padding: 25px;

    box-shadow: var(--shadow);

    transition:
        transform .2s ease,
        box-shadow .2s ease;

    position: relative;
}

.tool-card:hover {

    transform: translateY(-5px);

    box-shadow:
        0 15px 40px rgba(15,23,42,.12);
}

.tool-icon {

    width: 64px;
    height: 64px;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 2rem;

    background: var(--primary-soft);

    border-radius: 16px;

    margin-bottom: 20px;
}

.tool-card h3 {

    margin: 0 0 10px;
}

.tool-card p {

    color: var(--muted);

    min-height: 70px;
}

.tool-card a {

    color: var(--primary);

    font-weight: 600;
}

.tool-card a:hover {
    text-decoration: underline;
}

/* ==========================
   BADGE
========================== */

.badge {

    position: absolute;

    top: 20px;
    right: 20px;

    background: #fef3c7;

    color: #92400e;

    padding: 6px 12px;

    border-radius: 999px;

    font-size: .75rem;

    font-weight: 600;
}

/* ==========================
   VALUES
========================== */

.values {

    max-width: var(--max-width);

    margin: auto;

    padding: 80px 30px;

    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(250px, 1fr));

    gap: 25px;
}

.values article {

    background: white;

    padding: 30px;

    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.values h4 {

    margin-top: 0;
}

/* ==========================
   FOOTER
========================== */

footer {

    background: white;

    border-top: 1px solid var(--border);

    padding: 60px 30px;

    display: grid;

    grid-template-columns:
        2fr
        1fr
        1fr
        1fr;

    gap: 30px;
}

footer ul {

    padding: 0;
    margin: 0;

    list-style: none;
}

footer li {

    margin-bottom: 10px;
}

footer a {

    color: var(--muted);
}

footer a:hover {

    color: var(--primary);
}

/* ==========================
   RESPONSIVE
========================== */

@media (max-width: 900px) {

    .hero {

        grid-template-columns: 1fr;
    }

    .hero h1 {

        font-size: 3rem;
    }

    footer {

        grid-template-columns: 1fr;
    }

    nav {
        display: none;
    }
}

/*
=========================================
DARK MODE
=========================================
*/

body.dark {

    background: #0f172a;
    color: #f8fafc;
}

body.dark .tool-card,
body.dark .values article,
body.dark footer,
body.dark .tool-preview div {

    background: #1e293b;
}

body.dark .tool-card p,
body.dark footer a,
body.dark nav a {

    color: #cbd5e1;
}

/*
=========================================
DARK BUTTON
=========================================
*/

.dark-toggle {

    position: fixed;

    bottom: 20px;
    right: 20px;

    width: 55px;
    height: 55px;

    border-radius: 50%;

    border: none;

    background: var(--primary);

    color: white;

    font-size: 1.2rem;

    box-shadow: var(--shadow);

    z-index: 999;
}

/*
=========================================
FAVORITES
=========================================
*/

.favorite-btn {

    position: absolute;

    top: 20px;
    left: 20px;

    border: none;

    background: transparent;

    font-size: 1.2rem;

    cursor: pointer;
}

/*
=========================================
COUNTER
=========================================
*/

.tool-counter {

    margin-left: auto;

    color: var(--muted);

    font-size: .9rem;
}

/*
=========================================
ANIMATION
=========================================
*/

.tool-card {

    opacity: 0;

    transform:
        translateY(20px);

    transition:
        opacity .4s ease,
        transform .4s ease;
}

.tool-card.visible {

    opacity: 1;

    transform:
        translateY(0);
}

/*
=========================================
FILTER ACTIVE
=========================================
*/

.filter-active {

    background: var(--primary) !important;

    color: white !important;
}

/*
=========================================
CATEGORIES
=========================================
*/

.categories {

    max-width: var(--max-width);

    margin: auto;

    padding: 0 30px 40px;

    display: grid;

    grid-template-columns:
        repeat(auto-fit,minmax(250px,1fr));

    gap: 20px;
}

.category-card {

    background: white;

    border-radius: var(--radius);

    padding: 25px;

    box-shadow: var(--shadow);

    cursor: pointer;

    transition: .2s ease;
}

.category-card:hover {

    transform: translateY(-4px);
}

.category-icon {

    font-size: 2rem;

    margin-bottom: 15px;
}

.category-card h3 {

    margin: 0 0 10px;
}

.category-card p {

    margin: 0 0 10px;

    color: var(--muted);
}

.category-card small {

    color: var(--primary);

    font-weight: 600;
}

/*
=========================================
DARK MODE CATEGORY
=========================================
*/

body.dark .category-card {

    background: #1e293b;
}

/*
=========================================
FAVORITES
=========================================
*/

.favorite-btn {

    position: absolute;

    top: 20px;
    left: 20px;

    border: none;

    background: transparent;

    font-size: 1.2rem;

    cursor: pointer;
}

/*
=========================================
COUNTER
=========================================
*/

.tool-counter {

    margin-left: auto;

    display: flex;

    align-items: center;

    color: var(--muted);

    font-size: .9rem;
}

/*
=========================================
FILTER ACTIVE
=========================================
*/

.filter-active {

    background: var(--primary) !important;

    color: white !important;
}

/*
=========================================
DARK BUTTON
=========================================
*/

.dark-toggle {

    position: fixed;

    bottom: 20px;
    right: 20px;

    width: 55px;
    height: 55px;

    border: none;

    border-radius: 50%;

    background: var(--primary);

    color: white;

    font-size: 1.2rem;

    box-shadow: var(--shadow);

    z-index: 1000;
}

/*
=========================================
DARK MODE
=========================================
*/

body.dark {

    background: #0f172a;

    color: #f8fafc;
}

body.dark .tool-card,
body.dark .values article,
body.dark footer,
body.dark .tool-preview div {

    background: #1e293b;
}

body.dark p,
body.dark a,
body.dark small {

    color: #cbd5e1;
}