/* ============================================
   PDF42 Homepage - Minimal & Elegant
   Compact design with reduced padding
   ============================================ */

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5f5f5;
    --accent-primary: #2563eb;
    --accent-hover: #1d4ed8;
    --text-primary: #0a0a0a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border-light: #e5e5e5;
    --border-medium: #d4d4d4;
    --shadow-sm: rgba(0, 0, 0, 0.04);
    --shadow-md: rgba(0, 0, 0, 0.08);
    --shadow-lg: rgba(0, 0, 0, 0.12);
    --font-primary: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Instrument Serif', serif;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    color: var(--text-primary);
    background: linear-gradient(to bottom, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.25rem;
    font-family: var(--font-serif);
}

.logo__icon {
    font-size: 1.5rem;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav__link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.nav__link:hover {
    color: var(--accent-primary);
}

/* Hero Section - Ultra Compact */
.hero {
    padding: 3rem 0 3.25rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: auto;
}

.hero .container {
    width: fit-content;
    max-height: 300px;
    overflow: hidden;
    padding: 0 0.75rem;
}

.hero__title {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    letter-spacing: -0.02em;
    line-height: 1.15;
    animation: none;
}

.hero__subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 0.4rem;
    text-align:center;
    line-height: 1.6;
    animation: none;
}

/* Category Tabs - Compact */
.category-tabs {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
    max-width: 700px;
    margin: 0 auto;
}

.tab {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.6rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.tab:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.tab.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.tab__icon {
    width: 16px;
    height: 16px;
}

.tab__icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* Tools Section - Start Immediately */
.tools-section {
    padding: 0.5rem 0 1rem;
    background: transparent;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(140px, 1fr));
    gap: 0.6rem;
    max-width: 100%;
    margin: 0 auto;
}

/* Tool Card - Minimal & Compact */
.tool-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 0.75rem 0.6rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

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

.tool-card:active {
    transform: translateY(-1px);
}

.tool-card__icon {
    width: 30px;
    height: 30px;
    margin: 0 auto 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-card__icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent-primary);
    transition: transform var(--transition-base);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.tool-card__title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.tool-card__desc {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    line-height: 1.3;
    margin: 0;
}

/* Hidden state for filtering */
.tool-card.hidden {
    display: none;
}

/* Footer */
.footer {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-light);
    padding: 1rem 0;
    text-align: center;
}

.footer__text {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
}

.footer__security {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Responsive Design */

/* Tablet */
@media (max-width: 1200px) {
    .tools-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.65rem;
    }
}

@media (max-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .hero {
        padding: 2rem 0 1.5rem;
    }

    .category-tabs {
        gap: 0.5rem;
    }

    .tab {
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }

    .tab__text {
        display: none;
    }

    .tab__icon {
        width: 18px;
        height: 18px;
    }

    .tool-card {
        padding: 1rem 0.75rem;
    }

    .tool-card__icon {
        width: 36px;
        height: 36px;
        margin-bottom: 0.625rem;
    }

    .tool-card__icon svg {
        width: 20px;
        height: 20px;
    }

    .tool-card__title {
        font-size: 0.875rem;
    }

    .tool-card__desc {
        font-size: 0.75rem;
    }

    .tools-section {
        padding: 2rem 0 3rem;
    }
}

/* Short screens: tighten vertical rhythm so all tools fit above the fold */
@media (max-height: 850px) and (min-width: 900px) {
    .header__content {
        height: 56px;
    }

    .hero {
        padding: 0.25rem 0 0.4rem;
    }

    .hero__title {
        font-size: 1.2rem;
    }

    .hero__subtitle {
        font-size: 0.78rem;
        margin-bottom: 0.3rem;
    }

    .tools-section {
        padding: 0.4rem 0 0.75rem;
    }

    .tool-card {
        padding: 0.65rem 0.55rem;
    }

    .tool-card__desc {
        font-size: 0.68rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .tool-card__desc {
        display: none;
    }
}

/* Animation for tool cards on load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card {
    animation: fadeInUp 0.3s ease-out backwards;
}

.tool-card:nth-child(1) {
    animation-delay: 0.03s;
}

.tool-card:nth-child(2) {
    animation-delay: 0.06s;
}

.tool-card:nth-child(3) {
    animation-delay: 0.09s;
}

.tool-card:nth-child(4) {
    animation-delay: 0.12s;
}
