/* ============================================================
   SmartAIGuide.ai — Apple-inspired design system
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Typography */
    --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Helvetica, Arial, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Helvetica, Arial, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

    /* Colors — Electric Indigo */
    --color-bg: #ffffff;
    --color-bg-secondary: #f8f7ff;
    --color-bg-tertiary: #fbfbfe;
    --color-text: #1d1d1f;
    --color-text-secondary: #6e6e73;
    --color-text-tertiary: #86868b;
    --color-accent: #5B21B6;
    --color-accent-hover: #7C3AED;
    --color-accent-subtle: rgba(91, 33, 182, 0.08);
    --color-accent-bright: #8B5CF6;
    --color-border: #d2d2d7;
    --color-border-light: #e8e8ed;
    --color-success: #28cd41;
    --color-warning: #ff9f0a;
    --color-danger: #ff3b30;
    --color-card-shadow: rgba(0, 0, 0, 0.04);
    --color-card-shadow-hover: rgba(0, 0, 0, 0.08);
    --color-overlay: rgba(29, 29, 31, 0.5);

    /* Spacing scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;
    --space-3xl: 96px;
    --space-4xl: 128px;

    /* Type scale */
    --text-xs: 12px;
    --text-sm: 14px;
    --text-base: 17px;
    --text-lg: 21px;
    --text-xl: 24px;
    --text-2xl: 28px;
    --text-3xl: 40px;
    --text-4xl: 48px;
    --text-5xl: 56px;
    --text-hero: 64px;

    /* Layout */
    --max-width: 980px;
    --max-width-wide: 1200px;
    --max-width-narrow: 680px;
    --nav-height: 52px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    /* Transitions */
    --ease-out: cubic-bezier(0.25, 0.1, 0.25, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 0.15s;
    --duration-base: 0.3s;
    --duration-slow: 0.5s;
}


/* --- Typography --- */
html {
    font-size: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.47059;
    color: var(--color-text);
    background: var(--color-bg);
    letter-spacing: -0.022em;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.08;
}

h1 { font-size: var(--text-hero); font-weight: 700; }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p { line-height: 1.47059; }

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--color-accent-hover); }

strong { font-weight: 600; }
small { font-size: var(--text-sm); }

.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }
.text-center { text-align: center; }
.text-balance { text-wrap: balance; }


/* --- Layout --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container--wide {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container--narrow {
    max-width: var(--max-width-narrow);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.section {
    padding: var(--space-3xl) 0;
}

.section--tinted {
    background: var(--color-bg-secondary);
}


/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--color-border-light);
    transition: background var(--duration-base) var(--ease-out);
}

.nav__inner {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav__logo {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -0.04em;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav__logo:hover { color: var(--color-text); }

.nav__logo-mark {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    list-style: none;
}

.nav__links a {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
    font-weight: 400;
}

.nav__links a:hover { color: var(--color-text); }
.nav__links a.active { color: var(--color-text); font-weight: 500; }

.nav__search {
    display: flex;
    align-items: center;
    padding: 4px;
    color: var(--color-text-tertiary) !important;
    transition: color var(--duration-fast) var(--ease-out);
}
.nav__search:hover { color: var(--color-text) !important; }

.nav__cta {
    font-size: var(--text-sm) !important;
    color: #fff !important;
    background: var(--color-accent);
    padding: 6px 16px;
    border-radius: 980px;
    transition: background var(--duration-fast) var(--ease-out) !important;
}
.nav__cta:hover { background: var(--color-accent-hover); color: #fff !important; }

/* Mobile nav toggle */
.nav__toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    position: relative;
}

.nav__toggle span {
    display: block;
    width: 18px;
    height: 1.5px;
    background: var(--color-text);
    margin: 4px auto;
    transition: all var(--duration-base) var(--ease-out);
    border-radius: 2px;
}


/* --- Hero --- */
.hero {
    padding: calc(var(--nav-height) + var(--space-4xl) + 20px) 0 var(--space-4xl);
    text-align: center;
    overflow: hidden;
}

.hero__eyebrow {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-md);
}

.hero__title {
    font-size: var(--text-hero);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: var(--space-lg);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-wrap: balance;
}

.hero__subtitle {
    font-size: var(--text-xl);
    color: var(--color-text-secondary);
    line-height: 1.38;
    max-width: 600px;
    margin: 0 auto var(--space-xl);
    font-weight: 400;
}

.hero__actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* Tinted hero variant */
.hero--dark {
    background: var(--color-bg-secondary);
    padding-bottom: var(--space-3xl);
}

.hero--dark .hero__title { color: var(--color-text); }
.hero--dark .hero__subtitle { color: var(--color-text-secondary); }

/* Gradient hero — light version */
.hero--gradient {
    background: linear-gradient(180deg, var(--color-bg-secondary) 0%, var(--color-bg) 100%);
}
.hero--gradient .hero__title { color: var(--color-text); }
.hero--gradient .hero__subtitle { color: var(--color-text-secondary); }


/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 400;
    padding: 12px 28px;
    border-radius: 980px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
    white-space: nowrap;
    line-height: 1.17648;
}

.btn--primary {
    background: var(--color-accent);
    color: #fff;
}
.btn--primary:hover {
    background: var(--color-accent-hover);
    color: #fff;
}

.btn--secondary {
    background: transparent;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
}
.btn--secondary:hover {
    background: var(--color-accent);
    color: #fff;
}

.btn--ghost {
    background: transparent;
    color: var(--color-accent);
    padding: 12px 0;
}
.btn--ghost:hover { text-decoration: underline; }
.btn--ghost::after {
    content: '\203A';
    font-size: 1.2em;
    margin-left: 2px;
    transition: transform var(--duration-fast) var(--ease-out);
    display: inline-block;
}
.btn--ghost:hover::after {
    transform: translateX(3px);
}

.btn--dark {
    background: var(--color-text);
    color: #fff;
}
.btn--dark:hover { background: #333; color: #fff; }

.btn--white {
    background: rgba(255, 255, 255, 0.92);
    color: var(--color-text);
}
.btn--white:hover { background: #fff; color: var(--color-text); }

.btn--sm {
    font-size: var(--text-sm);
    padding: 8px 20px;
}

.btn--lg {
    font-size: var(--text-lg);
    padding: 16px 36px;
}

.btn--full { width: 100%; }

.btn--icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

.btn:disabled, .btn.disabled {
    opacity: 0.42;
    cursor: not-allowed;
    pointer-events: none;
}


/* --- Cards --- */
.card {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--color-border-light);
}

.card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    transform: translateY(-4px);
    border-color: transparent;
}

.card__image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--color-bg-secondary);
}

.card__body {
    padding: var(--space-lg);
}

.card__eyebrow {
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-sm);
}

.card__title {
    font-size: var(--text-xl);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin-bottom: var(--space-sm);
    color: var(--color-text);
}

.card__title a {
    color: inherit;
    text-decoration: none;
}
.card__title a:hover { color: var(--color-accent); }

.card__desc {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    line-height: 1.47;
}

.card__meta {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    margin-top: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.card__link:hover { color: inherit; }

/* Feature card — large, bold */
.card--feature {
    border: none;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-xl);
}

.card--feature .card__body {
    padding: var(--space-xl);
}

.card--feature .card__title {
    font-size: var(--text-2xl);
}

/* Dark card */
.card--dark {
    background: var(--color-text);
    color: #fff;
    border-color: transparent;
}
.card--dark .card__title { color: #f5f5f7; }
.card--dark .card__desc { color: #a1a1a6; }
.card--dark .card__eyebrow { color: #86868b; }


/* --- Grid --- */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.grid--auto-fill {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}


/* --- Tags / Badges --- */
.tag {
    display: inline-flex;
    align-items: center;
    font-size: var(--text-xs);
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 980px;
    background: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    letter-spacing: 0;
}

.tag--accent {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
}

.tag--success {
    background: rgba(40, 205, 65, 0.1);
    color: #1b8a2e;
}

.tag--warning {
    background: rgba(255, 159, 10, 0.1);
    color: #b36b00;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 600;
    background: var(--color-accent);
    color: #fff;
}


/* --- Rating --- */
.rating {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    font-weight: 600;
}

.rating__score {
    background: var(--color-text);
    color: #fff;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.rating__score--high { background: #1b8a2e; }
.rating__score--mid { background: #b36b00; }
.rating__score--low { background: var(--color-danger); }
.rating__score--unrated { background: var(--color-text-tertiary); font-size: var(--text-xs); }

.rating__bar {
    flex: 1;
    height: 4px;
    background: var(--color-border-light);
    border-radius: 2px;
    overflow: hidden;
}

.rating__bar-fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: 2px;
    transition: width var(--duration-slow) var(--ease-out);
}


/* --- Forms --- */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    font-family: var(--font-body);
    font-size: var(--text-base);
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px var(--color-accent-subtle);
}

.form-input::placeholder { color: var(--color-text-tertiary); }

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Inline subscribe form */
.form-inline {
    display: flex;
    gap: var(--space-sm);
    max-width: 480px;
}

.form-inline .form-input {
    flex: 1;
    border-radius: 980px;
    padding: 14px 20px;
}

.form-inline .btn {
    flex-shrink: 0;
}

.form-hint {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    margin-top: var(--space-xs);
}

.form-error {
    font-size: var(--text-sm);
    color: var(--color-danger);
    margin-top: var(--space-xs);
}

.form-success {
    font-size: var(--text-sm);
    color: var(--color-success);
    margin-top: var(--space-xs);
}


/* --- Prose (article body) --- */
.prose {
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--color-text);
}

.prose h2 {
    font-size: var(--text-2xl);
    margin: var(--space-2xl) 0 var(--space-md);
    letter-spacing: -0.025em;
}

.prose h3 {
    font-size: var(--text-xl);
    margin: var(--space-xl) 0 var(--space-md);
}

.prose p {
    margin-bottom: var(--space-md);
}

.prose ul, .prose ol {
    margin: var(--space-md) 0;
    padding-left: var(--space-lg);
}

.prose li {
    margin-bottom: var(--space-sm);
}

.prose blockquote {
    border-left: 3px solid var(--color-accent);
    padding: var(--space-md) var(--space-lg);
    margin: var(--space-xl) 0;
    color: var(--color-text-secondary);
    font-style: italic;
    background: var(--color-bg-secondary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.prose code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    padding: 2px 8px;
    background: var(--color-bg-secondary);
    border-radius: 4px;
    color: var(--color-text);
}

.prose pre {
    background: #1d1d1f;
    color: #f5f5f7;
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: var(--space-xl) 0;
    line-height: 1.5;
}

.prose pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: var(--text-sm);
}

.prose img {
    width: 100%;
    border-radius: var(--radius-md);
    margin: var(--space-xl) 0;
}

.prose a {
    text-decoration: underline;
    text-underline-offset: 2px;
}


/* --- Pricing Table --- */
.pricing {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    max-width: 860px;
    margin: 0 auto;
}

.pricing__card {
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    position: relative;
    transition: all var(--duration-base) var(--ease-out);
}

.pricing__card:hover {
    box-shadow: 0 8px 40px var(--color-card-shadow-hover);
}

.pricing__card--featured {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px var(--color-accent);
}

.pricing__card--featured::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-accent);
    color: #fff;
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 4px 16px;
    border-radius: 980px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pricing__plan {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.pricing__price {
    font-size: var(--text-4xl);
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: var(--space-xs);
}

.pricing__price span {
    font-size: var(--text-base);
    font-weight: 400;
    color: var(--color-text-secondary);
}

.pricing__period {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-xl);
}

.pricing__features {
    list-style: none;
    text-align: left;
    margin-bottom: var(--space-xl);
}

.pricing__features li {
    font-size: var(--text-base);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.pricing__features li:last-child { border-bottom: none; }

.pricing__features li::before {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-accent-subtle);
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235B21B6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}


/* --- Tool Card (specialized) --- */
.tool-card {
    display: flex;
    gap: var(--space-lg);
    padding: var(--space-lg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    transition: all var(--duration-base) var(--ease-out);
    text-decoration: none;
    color: inherit;
    background: var(--color-bg);
}

.tool-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    transform: translateY(-4px);
    border-color: transparent;
    color: inherit;
}

.tool-card__icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--color-bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text-secondary);
    overflow: hidden;
}

.tool-card__icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.tool-card__info { flex: 1; min-width: 0; }

.tool-card__name {
    font-size: var(--text-lg);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 2px;
}

.tool-card__tagline {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.tool-card__tags {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.tool-card__rating {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


/* --- Sidebar --- */
.layout-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-2xl);
    align-items: start;
}

.sidebar { position: sticky; top: calc(var(--nav-height) + var(--space-lg)); }

.sidebar__block {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.sidebar__block-title {
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-md);
}


/* --- Newsletter CTA --- */
.newsletter-cta {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    text-align: center;
    color: var(--color-text);
}

.newsletter-cta__title {
    font-size: var(--text-3xl);
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-sm);
    color: var(--color-text);
}

.newsletter-cta__desc {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.newsletter-cta .form-inline {
    margin: 0 auto;
}

.newsletter-cta .form-input {
    background: var(--color-bg);
    border-color: var(--color-border);
    color: var(--color-text);
}

.newsletter-cta .form-input::placeholder {
    color: var(--color-text-tertiary);
}

.newsletter-cta .form-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px var(--color-accent-subtle);
}

.newsletter-cta .form-hint {
    color: var(--color-text-tertiary);
    margin-top: var(--space-md);
}


/* --- Footer --- */
.footer {
    background: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    border-top: 1px solid var(--color-border-light);
    padding: var(--space-2xl) 0 var(--space-xl);
    font-size: var(--text-sm);
}

.footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer__brand p {
    color: var(--color-text-tertiary);
    max-width: 280px;
    line-height: 1.5;
    margin-top: var(--space-sm);
}

.footer__heading {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-md);
}

.footer__links {
    list-style: none;
}

.footer__links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    display: block;
    padding: 4px 0;
    transition: color var(--duration-fast) var(--ease-out);
}
.footer__links a:hover { color: var(--color-text); }

.footer__bottom {
    border-top: 1px solid var(--color-border-light);
    padding-top: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-text-tertiary);
}


/* --- Share buttons --- */
.share-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding-top: var(--space-xl);
    margin-top: var(--space-xl);
    border-top: 1px solid var(--color-border-light);
}

.share-buttons__label {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    font-weight: 500;
    margin-right: var(--space-sm);
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--color-border-light);
    background: var(--color-bg);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    text-decoration: none;
    font-size: var(--text-xs);
    font-family: var(--font-body);
}

.share-btn:hover {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}


/* --- Breadcrumbs --- */
.breadcrumbs {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-lg);
    padding-top: calc(var(--nav-height) + var(--space-lg));
}

.breadcrumbs a {
    color: var(--color-text-secondary);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--color-accent);
}

.breadcrumbs__sep {
    margin: 0 var(--space-sm);
    color: var(--color-border);
}


/* --- Article Page --- */
.article-header {
    padding: calc(var(--nav-height) + var(--space-2xl)) 0 var(--space-xl);
    text-align: center;
}

.article-header__category {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--space-md);
}

.article-header__title {
    font-size: var(--text-4xl);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.1;
    max-width: 720px;
    margin: 0 auto var(--space-lg);
    text-wrap: balance;
}

.article-header__meta {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    align-items: center;
}

.article-header__meta span::before {
    content: '\00b7';
    margin-right: var(--space-md);
}
.article-header__meta span:first-child::before { display: none; }


/* --- Tool Detail --- */
.tool-detail {
    padding: calc(var(--nav-height) + var(--space-2xl)) 0 var(--space-xl);
}

.tool-detail__header {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
    margin-bottom: var(--space-xl);
}

.tool-detail__icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    background: var(--color-bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.tool-detail__title {
    font-size: var(--text-4xl);
    font-weight: 700;
    letter-spacing: -0.035em;
}

.tool-detail__tagline {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    margin-top: var(--space-xs);
}

.tool-detail__scores {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.tool-detail__score-item {
    text-align: center;
    padding: var(--space-lg);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
}

.tool-detail__score-value {
    font-size: var(--text-3xl);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.tool-detail__score-label {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: var(--space-xs);
}

.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
}

.pros-cons__list {
    list-style: none;
    padding: var(--space-lg);
    border-radius: var(--radius-md);
}

.pros-cons__list--pros {
    background: rgba(40, 205, 65, 0.05);
    border: 1px solid rgba(40, 205, 65, 0.15);
}

.pros-cons__list--cons {
    background: rgba(255, 59, 48, 0.05);
    border: 1px solid rgba(255, 59, 48, 0.15);
}

.pros-cons__heading {
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--space-md);
}

.pros-cons__list--pros .pros-cons__heading { color: #1b8a2e; }
.pros-cons__list--cons .pros-cons__heading { color: var(--color-danger); }

.pros-cons__list li {
    padding: var(--space-sm) 0;
    font-size: var(--text-base);
    display: flex;
    gap: var(--space-sm);
    align-items: baseline;
}

.pros-cons__list li::before {
    flex-shrink: 0;
    font-weight: 600;
}
.pros-cons__list--pros li::before { content: '+'; color: #1b8a2e; }
.pros-cons__list--cons li::before { content: '\2212'; color: var(--color-danger); }


/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-border-light);
}

.filter-search {
    margin-left: auto;
}

.filter-bar__btn {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 400;
    padding: 8px 18px;
    border-radius: 980px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.filter-bar__btn:hover {
    border-color: var(--color-text);
    color: var(--color-text);
}

.filter-bar__btn.active {
    background: var(--color-text);
    border-color: var(--color-text);
    color: #fff;
}


/* --- Admin --- */
.admin-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
    padding-top: var(--nav-height);
}

.admin-sidebar {
    background: var(--color-bg-secondary);
    border-right: 1px solid var(--color-border-light);
    padding: var(--space-lg) 0;
}

.admin-sidebar__nav { list-style: none; }

.admin-sidebar__nav a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
    border-left: 3px solid transparent;
}

.admin-sidebar__nav a:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.admin-sidebar__nav a.active {
    color: var(--color-accent);
    border-left-color: var(--color-accent);
    background: var(--color-accent-subtle);
    font-weight: 500;
}

.admin-main {
    padding: var(--space-xl);
    overflow-y: auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.admin-header h1 {
    font-size: var(--text-2xl);
}

/* Data table */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    table-layout: auto;
}

.table th {
    text-align: left;
    padding: var(--space-md) var(--space-lg);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-tertiary);
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border-light);
    white-space: nowrap;
}

.table td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }

.table tr:hover td { background: var(--color-bg-tertiary); }

/* Compare table */
.compare-table { min-width: 800px; }
.compare-table td { vertical-align: top; }
.compare-table ul { line-height: 1.6; }

/* Prose tables (inside articles) */
.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    margin: var(--space-xl) 0;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.prose th {
    text-align: left;
    padding: var(--space-md) var(--space-lg);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-tertiary);
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border-light);
    white-space: nowrap;
}

.prose td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: top;
}

.prose tr:last-child td { border-bottom: none; }

.prose tr:hover td { background: var(--color-bg-tertiary); }

/* Stat cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.stat-card__value {
    font-size: var(--text-3xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}

.stat-card__label {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    margin-top: var(--space-xs);
}


/* --- Alert / Flash --- */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.alert--success {
    background: rgba(40, 205, 65, 0.08);
    color: #1b8a2e;
    border: 1px solid rgba(40, 205, 65, 0.2);
}

.alert--error {
    background: rgba(255, 59, 48, 0.08);
    color: var(--color-danger);
    border: 1px solid rgba(255, 59, 48, 0.2);
}

.alert--info {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
    border: 1px solid rgba(0, 113, 227, 0.2);
}


/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
    color: var(--color-text-tertiary);
}

.empty-state__icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.4;
}

.empty-state__title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}


/* --- Scroll animations --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered children — add .stagger to a parent, children get cascading delays */
.stagger > .fade-in:nth-child(1) { transition-delay: 0s; }
.stagger > .fade-in:nth-child(2) { transition-delay: 0.08s; }
.stagger > .fade-in:nth-child(3) { transition-delay: 0.16s; }
.stagger > .fade-in:nth-child(4) { transition-delay: 0.24s; }
.stagger > .fade-in:nth-child(5) { transition-delay: 0.32s; }
.stagger > .fade-in:nth-child(6) { transition-delay: 0.40s; }
.stagger > .fade-in:nth-child(7) { transition-delay: 0.48s; }
.stagger > .fade-in:nth-child(8) { transition-delay: 0.56s; }
.stagger > .fade-in:nth-child(9) { transition-delay: 0.64s; }
.stagger > .fade-in:nth-child(10) { transition-delay: 0.72s; }

/* Slide from left */
.slide-in-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Slide from right */
.slide-in-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scale up from center */
.scale-in {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Blur-in — dramatic reveal */
.blur-in {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(20px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
                filter 1s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, filter, transform;
}
.blur-in.visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .fade-in, .slide-in-left, .slide-in-right, .scale-in, .blur-in {
        opacity: 1;
        transform: none;
        filter: none;
        transition: none;
    }
}


/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-xl);
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
}

.pagination a:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text);
}

.pagination .active {
    background: var(--color-text);
    color: #fff;
}


/* --- Utilities --- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-accent);
    color: #fff;
    padding: 8px 24px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 600;
    z-index: 10000;
    transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
    top: 0;
    color: #fff;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.mt-xs  { margin-top: var(--space-xs); }
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-xs  { margin-bottom: var(--space-xs); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }


/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1024px) {
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
    .layout-sidebar { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .footer__grid { grid-template-columns: repeat(2, 1fr); }
    .pricing { grid-template-columns: 1fr; max-width: 440px; }
    .tool-detail__scores { grid-template-columns: repeat(2, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; }
}

@media (max-width: 768px) {
    :root {
        --text-hero: 40px;
        --text-5xl: 36px;
        --text-4xl: 32px;
        --text-3xl: 28px;
        --space-3xl: 64px;
        --space-4xl: 80px;
    }

    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }

    .nav__links { display: none; }
    .nav__toggle { display: block; }

    /* Mobile menu open state */
    .nav.open .nav__links {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        padding: var(--space-lg);
        gap: 0;
        border-bottom: 1px solid var(--color-border-light);
    }

    .nav.open .nav__links a {
        padding: var(--space-md) 0;
        font-size: var(--text-base);
        border-bottom: 1px solid var(--color-border-light);
    }

    .nav.open .nav__links li:last-child a {
        border-bottom: none;
    }

    .hero { padding-top: calc(var(--nav-height) + var(--space-2xl)); }

    .form-inline {
        flex-direction: column;
    }

    .form-inline .btn { width: 100%; }

    .pros-cons { grid-template-columns: 1fr; }

    .footer__grid { grid-template-columns: 1fr; }
    .footer__bottom { flex-direction: column; gap: var(--space-md); text-align: center; }

    .article-header__title { font-size: var(--text-3xl); }

    .tool-detail__header { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    :root {
        --text-hero: 32px;
        --text-4xl: 28px;
        --text-3xl: 24px;
    }

    .container, .container--wide, .container--narrow {
        padding: 0 var(--space-md);
    }

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