/* ============================================================
   RESET & BASE
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #f9fafb;
    --bg-card: #ffffff;
    --bg-card-hover: #f3f4f6;
    --text: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #e0e7ff;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-hover: 0 10px 30px -10px rgba(99, 102, 241, 0.25);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --header-bg: rgba(255,255,255,0.9);
    --footer-bg: #f3f4f6;
    --max-width: 1200px;
}

html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ============================================================
   HEADER
   ============================================================ */
header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem 1.5rem;
}
.logo { font-weight: 700; font-size: 1.5rem; letter-spacing: -0.5px; }
.logo span { color: var(--primary); }
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.8rem;
    flex-wrap: wrap;
}
.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.2s;
}
.nav-links a:hover::after { width: 100%; }
.nav-links a:hover { color: var(--primary); }
.dropdown { position: relative; }
.dropdown-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.2rem 0;
}
.dropdown-trigger:hover { color: var(--primary); }
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0;
    min-width: 170px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.dropdown:hover .dropdown-menu,
.dropdown.active .dropdown-menu { display: block; }
.dropdown-menu a {
    display: block;
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 400;
}
.dropdown-menu a::after { display: none; }
.dropdown-menu a:hover { background: var(--bg-card-hover); color: var(--primary); }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}
.footer-grid h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.8rem; }
.footer-grid ul { list-style: none; }
.footer-grid ul li { margin-bottom: 0.4rem; }
.footer-grid ul li a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}
.footer-grid ul li a:hover { color: var(--primary); }
.footer-bottom {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

/* ============================================================
   HERO
   ============================================================ */
.hero { padding: 4rem 0 3.5rem; }
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}
.hero-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 1rem;
    border-radius: 50px;
    margin-bottom: 1rem;
    border: 1px solid var(--primary);
}
.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -1.5px;
}
.gradient-text {
    background: linear-gradient(135deg, var(--primary), #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-desc {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin: 1.2rem 0 1.8rem;
    max-width: 480px;
    line-height: 1.7;
}
.hero-search {
    display: flex;
    max-width: 460px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 60px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 1.8rem;
}
.hero-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}
.hero-search input {
    flex: 1;
    border: none;
    padding: 0.85rem 1.4rem;
    background: transparent;
    font-size: 1rem;
    outline: none;
    color: var(--text);
}
.hero-search input::placeholder { color: var(--text-muted); }
.hero-search button {
    background: var(--primary);
    border: none;
    padding: 0 1.8rem;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 1.2rem;
}
.hero-search button:hover { background: var(--primary-hover); }
.hero-visual { display: flex; justify-content: center; align-items: center; }
.hero-illustration {
    display: flex;
    gap: 1.8rem;
    font-size: 3.8rem;
    background: var(--bg-card);
    padding: 2.2rem 2.8rem;
    border-radius: 40px;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.10);
    border: 1px solid var(--border);
}
.hero-icon {
    animation: float 3s ease-in-out infinite;
}
.hero-icon:nth-child(2) { animation-delay: 0.5s; }
.hero-icon:nth-child(3) { animation-delay: 1s; }
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    padding: 0.7rem 1.8rem;
    border-radius: 60px;
    border: none;
    cursor: pointer;
    transition: all 0.25s;
    font-size: 1rem;
    font-family: inherit;
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px var(--primary);
}
.btn-large { padding: 0.9rem 2.8rem; font-size: 1.05rem; }
.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 4rem 0; }
.section-alt {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.5px; }
.section-sub { color: var(--text-secondary); margin-top: 0.3rem; font-size: 1.05rem; }
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1.5rem;
}
.filter-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0.4rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-family: inherit;
}
.filter-btn:hover { border-color: var(--primary); color: var(--text); }
.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.filter-btn.active:hover { background: var(--primary-hover); }

/* ============================================================
   CARDS
   ============================================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.8rem;
}
.tool-card, .article-card, .category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    position: relative;
}
.tool-card:hover, .article-card:hover, .category-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}
.tool-card .tool-icon { font-size: 2.2rem; margin-bottom: 0.5rem; display: block; }
.tool-card h3, .article-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.3rem; }
.tool-card p, .article-card p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tool-tag {
    display: inline-block;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.1rem 0.7rem;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}
.tool-card .tool-link {
    display: inline-block;
    margin-top: 0.6rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
    transition: color 0.2s;
}
.tool-card .tool-link:hover { color: var(--primary-hover); }
.article-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}
.tool-card .featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.7rem;
    border-radius: 50px;
    letter-spacing: 0.04em;
}

/* ============================================================
   CATEGORY CARDS
   ============================================================ */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 700px;
    margin: 0 auto;
}
.category-card { text-align: center; padding: 2rem 1.5rem; cursor: pointer; }
.category-card .category-icon { font-size: 2.8rem; display: block; margin-bottom: 0.5rem; }
.category-card h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.2rem; }
.category-card p { color: var(--text-secondary); font-size: 0.9rem; }
.category-card .category-arrow {
    display: inline-block;
    margin-top: 0.6rem;
    font-size: 1.2rem;
    opacity: 0.5;
    transition: all 0.3s;
}
.category-card:hover .category-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* ============================================================
   PAGE TITLE & ARTICLE DETAIL
   ============================================================ */
.page-title { padding: 2rem 0 1rem; }
.page-title h1 { font-size: 2.2rem; font-weight: 700; }
.page-title p { color: var(--text-secondary); }
.article-detail { padding: 2rem 0; }
.article-detail .content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 2rem; }
    .hero-desc { margin: 1.2rem auto; }
    .hero-search { max-width: 100%; margin: 0 auto 1.8rem; }
    .hero-illustration { font-size: 2.8rem; padding: 1.8rem 2.2rem; }
}
@media (max-width: 768px) {
    .header-inner { flex-direction: column; align-items: stretch; gap: 0.6rem; }
    .nav-links { gap: 1rem; justify-content: center; flex-wrap: wrap; }
    .dropdown-menu {
        position: static;
        border: none;
        box-shadow: none;
        padding-left: 1rem;
        background: transparent;
    }
    .dropdown:hover .dropdown-menu { display: none; }
    .dropdown.active .dropdown-menu { display: block; }
    .card-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
    .filter-tabs { gap: 0.4rem; }
    .filter-btn { font-size: 0.75rem; padding: 0.3rem 0.8rem; }
    .section { padding: 2.5rem 0; }
    .section-header h2 { font-size: 1.8rem; }
    .hero { padding: 2.5rem 0 2rem; }
    .hero h1 { font-size: 2rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}
@media (max-width: 480px) {
    .card-grid { grid-template-columns: 1fr; }
    .container { padding: 0 1rem; }
    .hero h1 { font-size: 1.7rem; }
    .hero-illustration { font-size: 2.2rem; padding: 1.2rem 1.5rem; gap: 1rem; }
    .hero-search input { padding: 0.65rem 1rem; font-size: 0.9rem; }
    .hero-search button { padding: 0 1.2rem; }
    .btn-large { padding: 0.7rem 1.8rem; font-size: 0.95rem; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .nav-links { gap: 0.7rem; }
    .nav-links a { font-size: 0.85rem; }
}