/* ========================================================
   Design System Tokens (No-PX Policy)
   ======================================================== */
:root {
    --neo-dark: #18181b;
    --neo-light: #f4f4f5;
    --neo-white: #ffffff;
    --neo-yellow: #fde047;
    --neo-stroke: #18181b;
    --neo-blue: #0284c7;
    --text-muted: #71717a;
    
    --border-thick: 0.125rem;
    --shadow-solid: 0.25rem 0.25rem 0 var(--neo-stroke);
    --shadow-solid-sm: 0.125rem 0.125rem 0 var(--neo-stroke);
    
    --radius-pill: 3rem;
    --radius-card: 1rem;
    
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;

    --font-base: clamp(1rem, 1.2vw, 1.125rem);
    --font-h1: clamp(1.875rem, 4vw, 3rem);
    --font-h2: clamp(1.375rem, 2.5vw, 2rem);
}

:root[data-theme="dark"] {
    --neo-dark: #f4f4f5;
    --neo-light: #18181b;
    --neo-white: #27272a;
    --neo-stroke: #000000;
    --neo-yellow: #ca8a04;
    --neo-blue: #38bdf8;
    --text-muted: #a1a1aa;
}

/* ========================================================
   Resets & Base Styles
   ======================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--font-base);
    color: var(--neo-dark);
    background-color: var(--neo-light);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.2s ease, color 0.2s ease;
}

a { text-decoration: none; color: inherit; }
.visually-hidden { position: absolute; width: 0.0625rem; height: 0.0625rem; overflow: hidden; clip: rect(0,0,0,0); }
.skip-link { position: absolute; top: -3rem; left: 1rem; background: var(--neo-yellow); color: var(--neo-dark); padding: var(--space-xs) var(--space-sm); z-index: 1000; border: var(--border-thick) solid var(--neo-stroke); font-weight: 700; transition: top 0.2s; }
.skip-link:focus { top: 1rem; }
.container { width: 100%; max-width: 80rem; margin: 0 auto; padding: 0 var(--space-sm); }

/* ========================================================
   Header & Actions
   ======================================================== */
.neo-header { background: var(--neo-white); border-bottom: var(--border-thick) solid var(--neo-stroke); position: sticky; top: 0; z-index: 100; }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 5rem; }
.brand-logo { display: flex; align-items: center; gap: 0.75rem; font-weight: 800; font-size: 1.5rem; letter-spacing: -0.05em; }
.logo-icon { font-size: 1.75rem; padding: 0.25rem 0.5rem; border: var(--border-thick) solid var(--neo-stroke); border-radius: 0.5rem; background: var(--neo-yellow); box-shadow: var(--shadow-solid-sm); }
.brand-logo span { color: var(--neo-blue); }
.header-actions { display: flex; gap: var(--space-sm); align-items: center; }

/* Buttons */
.neo-btn {
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.625rem 1.25rem;
    border: var(--border-thick) solid var(--neo-stroke);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-solid-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--neo-white);
    color: var(--neo-dark);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.neo-btn:active { transform: translate(0.125rem, 0.125rem); box-shadow: 0 0 0 var(--neo-stroke); }
.btn-yellow { background-color: var(--neo-yellow); color: #18181b; }
.btn-green { background-color: #4ade80; color: #18181b; }
.btn-red { background-color: #f87171; color: #18181b; }
.btn-blue { background-color: #38bdf8; color: #18181b; }
.btn-outline { background-color: transparent; }
.btn-icon { padding: 0.5rem; font-size: 1.25rem; aspect-ratio: 1 / 1; justify-content: center; }

/* ========================================================
   Hero & Hub UI
   ======================================================== */
.neo-hero { background: var(--neo-white); border-bottom: var(--border-thick) solid var(--neo-stroke); padding: var(--space-lg) 0; }
.eyebrow-badge { display: inline-block; background: #d9f99d; border: var(--border-thick) solid var(--neo-stroke); padding: 0.25rem 0.75rem; border-radius: var(--radius-pill); font-weight: 700; font-size: 0.85rem; margin-bottom: var(--space-sm); box-shadow: var(--shadow-solid-sm); color: #18181b; }
.search-box-wrapper input {
    width: 100%;
    max-width: 35rem;
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
    font-family: inherit;
    border: var(--border-thick) solid var(--neo-stroke);
    border-radius: var(--radius-pill);
    outline: none;
    box-shadow: var(--shadow-solid);
    background: var(--neo-white);
    color: var(--neo-dark);
}
.search-box-wrapper input:focus { transform: translate(-0.125rem, -0.125rem); box-shadow: 0.375rem 0.375rem 0 var(--neo-stroke); }

/* ========================================================
   Tools Directory Grid
   ======================================================== */
.tools-section { padding: var(--space-lg) 0; }
.section-heading { text-align: center; margin-bottom: var(--space-md); }
.section-heading h2 { font-size: var(--font-h2); font-weight: 800; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: var(--space-sm); }
.neo-tool-card {
    background: var(--neo-white);
    border: var(--border-thick) solid var(--neo-stroke);
    border-radius: var(--radius-card);
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-solid);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}
.neo-tool-card:hover { transform: translate(-0.25rem, -0.25rem); box-shadow: 0.5rem 0.5rem 0 var(--neo-stroke); }
.neo-tool-card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; font-weight: 800; }
.neo-tool-card h3 a::after { content: ''; position: absolute; inset: 0; }
.neo-tool-card p { color: var(--text-muted); font-size: 0.95rem; flex-grow: 1; margin-bottom: var(--space-sm); }
.card-link { font-weight: 700; color: var(--neo-blue); display: flex; align-items: center; justify-content: space-between; margin-top: auto; }

.tool-tag { display: inline-block; padding: 0.2rem 0.6rem; border: var(--border-thick) solid var(--neo-stroke); border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 700; width: fit-content; margin-bottom: 0.5rem; color: #18181b; }
.tag-text { background: #ddd6fe; }
.tag-health { background: #a7f3d0; }
.tag-random { background: #fde047; }
.tag-time { background: #fbcfe8; }
.tag-math { background-color: #c084fc; color: #18181b; border: var(--border-thick) solid #18181b;}
.tag-utility { background-color: #f472b6; color: #18181b; }

/* ========================================================
   Monetization UI & Footer
   ======================================================== */
.neo-ad-slot { background: var(--neo-white); border: var(--border-thick) dashed var(--neo-stroke); border-radius: var(--radius-card); min-height: 5.625rem; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-weight: 700; font-size: 0.875rem; box-shadow: var(--shadow-solid-sm); margin: var(--space-md) auto; }
.neo-footer { background: var(--neo-white); border-top: var(--border-thick) solid var(--neo-stroke); padding: var(--space-md) 0; margin-top: auto; }
.footer-content { display: flex; flex-direction: column; gap: 1rem; text-align: center; font-weight: 600; }
@media (min-width: 48rem) { .footer-content { flex-direction: row; justify-content: space-between; text-align: left; } }
.footer-links { display: flex; gap: var(--space-sm); justify-content: center; color: var(--text-muted); }
.hidden { display: none !important; }
