/* ============================================================
   @jasontheflynn — AI Tool Directory
   Brand: navy + one orange accent. Montserrat display, Inter body.
   ============================================================ */
.dir-scope {
    /* ---- brand tokens (shared across themes) ---- */
    --orange-500: #F28C28;
    --orange-600: #D9761A;
    --orange-400: #F5A85A;
    --orange-100: #FDEBD6;
    --navy-900: #0F1A2E;
    --navy-800: #162238;
    --navy-700: #1E2D48;
    --navy-600: #2A3B5A;
    --navy-500: #3E5175;
    --navy-400: #6B7B9A;
    --gray-50: #F9FAFB;
    --gray-100: #F2F3F4;
    --gray-200: #E6E7E8;
    --gray-300: #C7C9CC;
    --gray-500: #8A8C8F;
    --gray-700: #58595B;
    --font-display: "Montserrat", ui-sans-serif, system-ui, -apple-system, sans-serif;
    --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
    --r-md: 4px;
    --r-lg: 8px;
    --r-xl: 12px;
    --r-pill: 999px;
    --dur-fast: 120ms;
    --dur-base: 200ms;
    --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1)
    }
/* ---- dark theme (default) ---- */
.dir-scope, .dir-scope {
    --bg: var(--navy-800);
    --bg-hero: var(--navy-900);
    --bg-card: var(--navy-700);
    --bg-chip: var(--navy-600);
    --border: var(--navy-600);
    --text-primary: #FFF;
    --text-secondary: #C7D1E1;
    --text-muted: var(--navy-400);
    --shadow-card: 0 8px 24px rgba(15, 26, 46, 0.45);
    --shadow-modal: 0 20px 48px rgba(15, 26, 46, 0.55);
    --logo-tile-bg: #F9FAFB
    }
/* ---- light theme ---- */
[data-theme="light"] .dir-scope {
    --bg: var(--gray-50);
    --bg-hero: #FFF;
    --bg-card: #FFF;
    --bg-chip: var(--gray-100);
    --border: var(--gray-200);
    --text-primary: var(--navy-900);
    --text-secondary: var(--gray-700);
    --text-muted: var(--gray-500);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.22);
    --logo-tile-bg: #FFF
    }
.dir-scope * {
    box-sizing: border-box
    }
.dir-scope a {
    color: inherit
    }
/* ---------------- Header / hero ---------------- */
.dir-scope .hero {
    background: var(--bg-hero);
    border-bottom: 1px solid var(--border);
    padding: 56px 24px 40px;
    text-align: center;
    position: relative;
    transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out)
    }
.dir-scope .theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out)
    }
.dir-scope .theme-toggle:hover {
    border-color: var(--orange-500);
    transform: translatey(-1px)
    }
.dir-scope .theme-toggle svg {
    width: 18px;
    height: 18px
    }
.dir-scope .eyebrow {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--orange-500);
    margin: 0 0 14px
    }
.dir-scope h1.site-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(28px, 5vw, 44px);
    letter-spacing: -0.02em;
    margin: 0 0 12px;
    line-height: 1.1
    }
.dir-scope .site-sub {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.5
    }
/* ---------------- Controls ---------------- */
.dir-scope .controls {
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px 24px 0
    }
.dir-scope .controls-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px
    }
.dir-scope .search-input {
    flex: 1 1 240px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--r-lg);
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: border-color var(--dur-fast) var(--ease-out)
    }
.dir-scope .search-input::placeholder {
    color: var(--text-muted)
    }
.dir-scope .search-input:focus {
    border-color: var(--orange-500)
    }
.dir-scope .sort-select {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--r-lg);
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    cursor: pointer
    }
.dir-scope .shortcuts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px
    }
.dir-scope .pill {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 9px 16px;
    border-radius: var(--r-pill);
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
    white-space: nowrap
    }
.dir-scope .pill:hover {
    border-color: var(--orange-500);
    color: var(--text-primary)
    }
.dir-scope .pill.active {
    background: var(--orange-500);
    border-color: var(--orange-500);
    color: var(--navy-900)
    }
.dir-scope .result-count {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 8px
    }
/* ---------------- Card grid ---------------- */
.dir-scope .grid {
    max-width: 1120px;
    margin: 0 auto;
    padding: 8px 24px 80px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px
    }
.dir-scope .card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-card);
    padding: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
    text-align: left
    }
.dir-scope .card:hover {
    transform: translatey(-3px);
    border-color: var(--orange-500)
    }
.dir-scope .card-top {
    display: flex;
    align-items: center;
    gap: 12px
    }
.dir-scope .logo-tile {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: var(--r-md);
    background: var(--logo-tile-bg);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden
    }
.dir-scope .logo-tile img {
    width: 30px;
    height: 30px;
    object-fit: contain
    }
.dir-scope .card-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    margin: 0;
    color: var(--text-primary)
    }
.dir-scope .card-category {
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--text-muted);
    margin: 2px 0 0
    }
.dir-scope .card-summary {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin: 0;
    flex: 1
    }
.dir-scope .tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px
    }
.dir-scope .tag {
    font-size: 10.5px;
    font-family: var(--font-body);
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    background: var(--bg-chip);
    color: var(--text-secondary);
    border: 1px solid var(--border)
    }
.dir-scope .tag.tag-top10 {
    background: var(--orange-100);
    color: var(--orange-600);
    border-color: var(--orange-400);
    font-weight: 700
    }
.dir-scope .empty-state {
    grid-column: 1/-1;
    text-align: center;
    color: var(--text-muted);
    padding: 60px 20px;
    font-size: 14px
    }
/* ---------------- Modal ---------------- */
.dir-scope .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 26, 46, 0.65);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-base) var(--ease-out)
    }
.dir-scope .modal-overlay.open {
    opacity: 1;
    pointer-events: auto
    }
.dir-scope .modal {
    background: var(--bg-card);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-modal);
    max-width: 520px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    transform: translatey(12px);
    transition: transform var(--dur-base) var(--ease-out)
    }
.dir-scope .modal-overlay.open .modal {
    transform: translatey(0)
    }
.dir-scope .modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: var(--r-md);
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center
    }
.dir-scope .modal-close:hover {
    border-color: var(--orange-500)
    }
.dir-scope .modal-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-right: 40px
    }
.dir-scope .modal-top .logo-tile {
    width: 64px;
    height: 64px
    }
.dir-scope .modal-top .logo-tile img {
    width: 40px;
    height: 40px
    }
.dir-scope .modal-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 24px;
    margin: 0 0 4px
    }
.dir-scope .modal-category {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0
    }
.dir-scope .modal-description {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text-secondary);
    margin: 0 0 20px
    }
.dir-scope .modal .tag-row {
    margin-bottom: 24px
    }
.dir-scope .modal-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--orange-500);
    color: var(--navy-900);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.04em;
    padding: 12px 20px;
    border-radius: var(--r-md);
    text-decoration: none;
    transition: background var(--dur-fast) var(--ease-out)
    }
.dir-scope .modal-cta:hover {
    background: var(--orange-600)
    }
.dir-scope .modal-affiliate-note {
    display: block;
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-muted)
    }
/* ---------------- Newsletter signup (placeholder) ---------------- */
.dir-scope .newsletter {
    background: var(--bg-hero);
    padding: 18px 24px
    }
.dir-scope .newsletter-top {
    border-bottom: 1px solid var(--border)
    }
.dir-scope .newsletter-bottom {
    border-top: 1px solid var(--border)
    }
.dir-scope .newsletter-inner {
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap
    }
.dir-scope .newsletter-copy {
    flex: 1 1 380px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0
    }
.dir-scope .newsletter-copy strong {
    font-family: var(--font-display);
    color: var(--text-primary)
    }
.dir-scope .newsletter-formblock {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px
    }
.dir-scope .newsletter-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end
    }
.dir-scope .newsletter-input {
    width: 200px;
    padding: 10px 14px;
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    transition: border-color var(--dur-fast) var(--ease-out)
    }
.dir-scope .newsletter-input::placeholder {
    color: var(--text-muted)
    }
.dir-scope .newsletter-input:focus {
    outline: none;
    border-color: var(--orange-500)
    }
.dir-scope .newsletter-button {
    padding: 10px 20px;
    border-radius: var(--r-lg);
    border: none;
    background: var(--orange-500);
    color: #FFF;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out)
    }
.dir-scope .newsletter-button:hover {
    background: var(--orange-600);
    transform: translatey(-1px)
    }
.dir-scope .newsletter-fineprint {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0
    }
/* ---------------- Footer ---------------- */
.dir-scope .site-footer {
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border)
    }
@media (max-width: 480px) {
.dir-scope .hero {
    padding: 48px 16px 32px
    }
.dir-scope .theme-toggle {
    top: 16px;
    right: 16px
    }
.dir-scope .grid {
    grid-template-columns: 1fr
    }
.dir-scope .newsletter {
    padding: 20px 16px
    }
.dir-scope .newsletter-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px
    }
.dir-scope .newsletter-copy {
    flex: 1 1 auto
    }
.dir-scope .newsletter-formblock {
    flex: 1 1 auto;
    align-items: stretch
    }
.dir-scope .newsletter-form {
    justify-content: stretch
    }
.dir-scope .newsletter-input, .dir-scope .newsletter-button {
    flex: 1 1 100%;
    width: auto;
    max-width: none
    }
.dir-scope .newsletter-fineprint {
    text-align: center
    }
}