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

:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.1);
    --emerald: #10b981;
    --emerald-light: #d1fae5;
    --amber: #f59e0b;
    --amber-light: #fef3c7;
    --rose: #f43f5e;
    --rose-light: #ffe4e6;
    --cyan: #06b6d4;
    --cyan-light: #cffafe;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.noise {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ─── NAV ─── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    background: rgba(246, 247, 249, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s var(--ease-out);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.nav-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
}

/* ─── HERO ─── */
.hero {
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 0;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
}

.hero-badge i {
    font-size: 0.7rem;
    color: #6366f1;
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.035em;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.gradient-text {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 40%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 440px;
    margin: 0 auto;
    font-weight: 400;
}

/* ─── HOME LAYOUT ─── */
.home-layout {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 48px;
    min-height: calc(100vh - 64px);
    padding: 80px 32px 40px;
}

.home-left {
    flex: 0 0 320px;
}

.home-right {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 900px) {
    .home-layout {
        flex-direction: column;
        gap: 40px;
        min-height: auto;
        padding: 100px 24px 60px;
        text-align: center;
    }
    .home-left { flex: none; }
    .home-right { grid-template-columns: 1fr; max-width: 400px; }
}

@media (max-width: 600px) {
    .home-layout { padding: 80px 20px 48px; }
    .home-right { grid-template-columns: 1fr; }
}

/* ─── TOOL CARDS ─── */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px 20px 16px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: all 0.4s var(--ease-out);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.tool-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.card-glow {
    position: absolute;
    top: -60px;
    right: -60px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.5s var(--ease-out);
    pointer-events: none;
}

.tool-card:hover .card-glow {
    opacity: 1;
}

.tool-card[data-color="emerald"] .card-glow {
    background: radial-gradient(circle, rgba(16,185,129,0.12) 0%, transparent 70%);
}

.tool-card[data-color="amber"] .card-glow {
    background: radial-gradient(circle, rgba(245,158,11,0.12) 0%, transparent 70%);
}

.tool-card[data-color="cyan"] .card-glow {
    background: radial-gradient(circle, rgba(6,182,212,0.12) 0%, transparent 70%);
}

.tool-card[data-color="rose"] .card-glow {
    background: radial-gradient(circle, rgba(244,63,94,0.12) 0%, transparent 70%);
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 14px;
    transition: transform 0.4s var(--ease-spring);
}

.tool-card:hover .card-icon {
    transform: scale(1.08);
}

.tool-card[data-color="emerald"] .card-icon {
    background: var(--emerald-light);
    color: var(--emerald);
}

.tool-card[data-color="amber"] .card-icon {
    background: var(--amber-light);
    color: var(--amber);
}

.tool-card[data-color="cyan"] .card-icon {
    background: var(--cyan-light);
    color: var(--cyan);
}

.tool-card[data-color="rose"] .card-icon {
    background: var(--rose-light);
    color: var(--rose);
}

.card-body {
    flex: 1;
    margin-bottom: 14px;
}

.card-title {
    font-size: 1rem;
    font-weight: 650;
    letter-spacing: -0.015em;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.card-desc {
    font-size: 0.82rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.card-action {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-tertiary);
    transition: all 0.3s var(--ease-out);
}

.card-action i {
    font-size: 0.75rem;
    transition: transform 0.3s var(--ease-out);
}

.tool-card:hover .card-action {
    color: var(--text-primary);
}

.tool-card:hover .card-action i {
    transform: translateX(4px);
}

.tool-card[data-color="cyan"]:hover .card-action {
    color: var(--cyan);
}

.tool-card[data-color="emerald"]:hover .card-action {
    color: var(--emerald);
}

.tool-card[data-color="amber"]:hover .card-action {
    color: var(--amber);
}

.tool-card[data-color="rose"]:hover .card-action {
    color: var(--rose);
}

/* ─── FOOTER ─── */
.footer {
    padding: 32px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
}

.footer-text {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    font-weight: 400;
    margin-bottom: 6px;
}

.footer-icp {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-icp:hover {
    color: var(--text-secondary);
}

/* ─── ANIMATIONS ─── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.7s var(--ease-out) both;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
    .nav { padding: 0 24px; }
    .tool-card { padding: 28px 24px 24px; }
}

@media (max-width: 600px) {
    .nav { padding: 0 20px; }
    .tool-card { padding: 24px 20px 20px; }
}

/* ─── DARK MODE ─── */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f0f13;
        --surface: #1a1a22;
        --text-primary: #e8e8ed;
        --text-secondary: #8b8b9e;
        --text-tertiary: #5c5c72;
        --border: rgba(255, 255, 255, 0.06);
        --border-hover: rgba(255, 255, 255, 0.1);
        --emerald-light: rgba(16, 185, 129, 0.12);
        --amber-light: rgba(245, 158, 11, 0.12);
        --rose-light: rgba(244, 63, 94, 0.12);
        --cyan-light: rgba(6, 182, 212, 0.12);
    }

    .nav {
        background: rgba(15, 15, 19, 0.8);
    }

    .noise {
        opacity: 0.015;
    }

    .tool-card:hover {
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    }
}
