/* ============================================================
   PDF Tools hub — shared teal design language
   Tokens mirror the Alok Systems tool pages.
   ============================================================ */

:root {
    color-scheme: light;
    --page: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --brand: #14b8a6;
    --brand-strong: #0d9488;
    --brand-deep: #0f766e;
    --brand-soft: rgba(20, 184, 166, .09);
    --brand-soft-2: rgba(20, 184, 166, .2);
    --danger: #b91c1c;
    --danger-soft: #fef2f2;
    --danger-line: #fecaca;
    --shadow: 0 8px 26px rgba(15, 23, 42, .06);
    --shadow-lift: 0 18px 38px -18px rgba(15, 23, 42, .22);
    --shadow-card: 0 2px 8px rgba(15, 23, 42, .03);
    --btn-grad: linear-gradient(135deg, #0f766e, #14b8a6);
    --radius: 18px;
    --radius-sm: 11px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --nav-h: 64px;
    --max-w: 1180px;
}

[data-theme="dark"] {
    color-scheme: dark;
    --page: #0b1120;
    --surface: #101a2e;
    --surface-soft: #16223a;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --line: #26354a;
    --line-strong: #334155;
    --brand: #2dd4bf;
    --brand-strong: #14b8a6;
    --brand-deep: #2dd4bf;
    --brand-soft: rgba(45, 212, 191, .1);
    --brand-soft-2: rgba(45, 212, 191, .22);
    --danger: #fecaca;
    --danger-soft: #351c27;
    --danger-line: #7f1d1d;
    --shadow: 0 12px 30px rgba(0, 0, 0, .22);
    --shadow-lift: 0 20px 40px -18px rgba(0, 0, 0, .6);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, .2);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 70px);
    -webkit-text-size-adjust: 100%;
}

body {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--page);
    color: var(--text);
    font: 16px/1.6 var(--font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

svg {
    display: block;
    max-width: 100%;
}

:focus-visible {
    outline: 3px solid var(--brand-strong);
    outline-offset: 3px;
}

.main {
    flex: 1;
}

/* ===== APP NAVBAR ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.navbar.scrolled {
    box-shadow: var(--shadow);
}

.navbar-inner {
    width: min(100% - 48px, var(--max-w));
    min-height: var(--nav-h);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

/* ===== SEARCH ===== */
.navbar-search {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 520px;
}

.navbar-search .search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

#searchInput {
    width: 100%;
    height: 42px;
    padding: 0 78px 0 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    color: var(--text);
    font-size: .88rem;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

#searchInput::placeholder {
    color: var(--muted);
    opacity: .85;
}

#searchInput:focus {
    border-color: var(--brand-strong);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.search-kbd {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    padding: 2px 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);
    font-size: .68rem;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity .18s ease;
}

.navbar-search:focus-within .search-kbd {
    opacity: 0;
}

/* Search dropdown */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 200;
    max-height: min(380px, 70vh);
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-lift);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}

.search-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-dropdown-section {
    padding: 8px 10px 4px;
}

.search-dropdown-label {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.search-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--text);
    font-size: .87rem;
    transition: background-color .16s ease;
}

.search-dropdown-item:hover,
.search-dropdown-item.is-active {
    background: var(--surface-soft);
}

.search-dropdown-item-icon {
    width: 32px;
    height: 32px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--btn-grad) !important;
    color: #fff;
}

.search-dropdown-item-text {
    flex: 1;
    min-width: 0;
}

.search-dropdown-item-title {
    font-weight: 600;
    line-height: 1.3;
}

.search-dropdown-item-cat {
    color: var(--muted);
    font-size: .74rem;
}

.search-dropdown-divider {
    height: 1px;
    margin: 4px 10px;
    background: var(--line);
}

/* ===== HERO ===== */
.hero {
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(circle at 50% -18%, var(--brand-soft), transparent 44rem),
        var(--page);
}

.hero-inner {
    width: min(100% - 48px, 780px);
    margin: 0 auto;
    padding: clamp(44px, 7vw, 74px) 0 clamp(34px, 5vw, 50px);
    text-align: center;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--brand-deep);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.045em;
}

.hero > .hero-inner > p:not(.eyebrow) {
    max-width: 640px;
    margin: 14px auto 0;
    color: var(--muted);
    font-size: clamp(.98rem, 1.6vw, 1.08rem);
}

.privacy-note {
    width: fit-content;
    max-width: 100%;
    margin: 20px auto 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--muted);
    font-size: .82rem;
}

.privacy-note svg {
    width: 17px;
    height: 17px;
    flex: none;
    fill: none;
    stroke: var(--brand-deep);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ===== CATEGORY BAR ===== */
.categories-section {
    position: sticky;
    top: var(--nav-h);
    z-index: 90;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.categories-inner {
    width: min(100% - 48px, var(--max-w));
    min-height: 58px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.categories-scroll {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.cat-pill {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 650;
    white-space: nowrap;
    transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}

.cat-pill:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.cat-pill.active {
    background: var(--btn-grad);
    color: #fff;
    box-shadow: 0 10px 20px -14px rgba(20, 184, 166, .9);
}

.cat-pill svg {
    width: 14px;
    height: 14px;
    flex: none;
}

.cat-pill-count {
    font-size: .72rem;
    font-weight: 700;
    opacity: .6;
}

.categories-meta {
    flex: none;
    color: var(--muted);
    font-size: .8rem;
    white-space: nowrap;
}

/* ===== TOOLS ===== */
.tools-inner {
    width: min(100% - 48px, var(--max-w));
    margin: 0 auto;
    padding: 34px 0 64px;
}

.tools-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.tools-header .eyebrow {
    margin-bottom: 3px;
}

.tools-heading {
    margin: 0;
    font-size: clamp(1.25rem, 2.4vw, 1.55rem);
    font-weight: 750;
    letter-spacing: -.03em;
}

.tools-count {
    padding: 3px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 600;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

/* ===== TOOL CARD ===== */
.tool-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-soft-2);
    box-shadow: var(--shadow-lift);
}

.tool-card-inner {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

.tool-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.tool-card-icon-wrap {
    width: 46px;
    height: 46px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--btn-grad) !important;
    color: #fff;
    box-shadow: 0 10px 20px -14px rgba(20, 184, 166, .75);
    transition: transform .18s ease;
}

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

.tool-card-arrow {
    width: 28px;
    height: 28px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-deep);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .18s ease, transform .18s ease;
}

.tool-card:hover .tool-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

.tool-card-arrow svg {
    width: 15px;
    height: 15px;
}

.tool-card-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tool-card-category {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--brand-deep) !important;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tool-card-title {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.015em;
}

.tool-card-desc {
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.55;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tool-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: auto;
}

.tool-tag {
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: .68rem;
    font-weight: 600;
    white-space: nowrap;
}

.popular-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--brand-soft) !important;
    color: var(--brand-deep) !important;
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.tool-card.is-popular {
    border-color: var(--brand-soft-2);
}

.tool-card-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 20px;
    border-top: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: .74rem;
}

.tool-card-footer svg {
    width: 13px;
    height: 13px;
    flex: none;
    opacity: .65;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    padding: 56px 20px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    text-align: center;
}

.empty-state svg {
    margin: 0 auto 14px;
    color: var(--muted);
    opacity: .45;
}

.empty-state-title {
    margin: 0 0 4px;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 700;
}

.empty-state-desc {
    margin: 0 0 18px;
    font-size: .88rem;
}

.empty-state-action {
    padding: 9px 18px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--btn-grad);
    color: #fff;
    font-size: .85rem;
    font-weight: 650;
    transition: transform .16s ease, box-shadow .16s ease;
}

.empty-state-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(20, 184, 166, .22);
}

/* ===== CONTENT SECTIONS ===== */
.content-section {
    margin-top: 24px;
    padding: clamp(20px, 3vw, 28px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.section-heading {
    margin-bottom: 16px;
}

.section-heading .eyebrow {
    margin-bottom: 4px;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    font-weight: 750;
    letter-spacing: -.03em;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.steps-grid li {
    display: flex;
    gap: 11px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--page);
}

.steps-grid li > span {
    flex: none;
    color: var(--brand-deep);
    font-size: .74rem;
    font-weight: 800;
}

.steps-grid h3 {
    margin: 0 0 4px;
    font-size: .9rem;
    font-weight: 700;
}

.steps-grid p,
.faq-section details p {
    margin: 0;
    color: var(--muted);
    font-size: .84rem;
}

.faq-section details {
    border-top: 1px solid var(--line);
}

.faq-section details:last-child {
    border-bottom: 1px solid var(--line);
}

.faq-section summary {
    padding: 14px 2px;
    cursor: pointer;
    font-size: .92rem;
    font-weight: 700;
}

.faq-section summary::marker {
    color: var(--brand-deep);
}

.faq-section summary:hover {
    color: var(--brand-deep);
}

.faq-section details p {
    max-width: 78ch;
    padding: 0 2px 16px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .navbar-search {
        max-width: none;
    }

    .tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    :root {
        --nav-h: 60px;
    }

    .navbar-inner,
    .categories-inner,
    .tools-inner,
    .hero-inner {
        width: min(100% - 32px, 560px);
    }

    .search-kbd,
    .categories-meta {
        display: none;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .hero-inner {
        padding: 36px 0 30px;
    }

    .hero h1 {
        font-size: clamp(2rem, 7vw, 2.6rem);
    }

    .tool-card-arrow {
        display: none;
    }
}

@media (max-width: 440px) {
    :root {
        --nav-h: 56px;
    }

    .navbar-inner,
    .categories-inner,
    .tools-inner,
    .hero-inner {
        width: min(100% - 24px, 400px);
    }

    .navbar-inner {
        gap: 8px;
    }

    #searchInput {
        height: 38px;
        padding-left: 34px;
        padding-right: 12px;
        font-size: .82rem;
    }

    .navbar-search .search-icon {
        left: 11px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero > .hero-inner > p:not(.eyebrow) {
        font-size: .96rem;
    }

    .privacy-note {
        align-items: flex-start;
        border-radius: 12px;
        font-size: .76rem;
    }

    .tools-inner {
        padding: 26px 0 48px;
    }

    .tool-card-inner {
        padding: 17px;
    }

    .tool-card-footer {
        padding: 10px 17px;
    }

    .cat-pill {
        padding: 7px 12px;
        font-size: .78rem;
    }

    .content-section {
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ===== SELECTION / SCROLLBAR ===== */
::selection {
    background: var(--brand-soft-2);
    color: var(--text);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background: var(--line-strong);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}
