/* ==========================================================================
   AI Lensly V2 — Base Styles
   Design tokens, reset, typography, layout, header, footer.
   Loaded sitewide.
   ========================================================================== */

/* --- Design Tokens --- */
:root {
    /* Colors — deep blue for text/titles, green for primary CTA */
    --color-text: #0f1729;
    --color-text-secondary: #475569;
    --color-text-muted: #94a3b8;
    --color-heading: #0f1729;

    --color-primary: #16a34a;         /* Green CTA */
    --color-primary-hover: #15803d;
    --color-primary-light: #dcfce7;

    --color-secondary: #2563eb;        /* Blue for secondary actions */
    --color-secondary-hover: #1d4ed8;
    --color-secondary-light: #dbeafe;

    --color-accent: #0ea5e9;           /* Light blue for hints */
    --color-accent-light: #e0f2fe;

    --color-success: #16a34a;
    --color-warning: #d97706;
    --color-danger: #dc2626;

    --color-bg: #ffffff;
    --color-bg-alt: #f8fafc;
    --color-bg-card: #ffffff;
    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;
    --color-shadow: rgba(15, 23, 41, 0.08);
    --color-shadow-hover: rgba(15, 23, 41, 0.15);

    /* Typography — system font stack, zero external requests */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;

    --line-height-tight: 1.25;
    --line-height-base: 1.6;
    --line-height-relaxed: 1.75;

    /* Layout */
    --container-max: 1180px;
    --content-max: 760px;
    --content-wide: 1120px;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Borders */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(15, 23, 41, 0.05);
    --shadow-md: 0 2px 8px var(--color-shadow);
    --shadow-lg: 0 8px 24px var(--color-shadow);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-bg-alt);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, video {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-secondary-hover);
}

ul, ol {
    list-style-position: inside;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-heading);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }

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

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 9999;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-primary);
    color: white;
}

.skip-link:focus {
    left: 0;
}

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

.site-content {
    min-height: 60vh;
    padding: var(--space-2xl) 0 0;
}

/* --- Header --- */
.site-header {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.site-branding {
    display: flex;
    align-items: center;
}

.site-title-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.site-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-heading);
    letter-spacing: -0.02em;
}

.site-tagline-small {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    font-weight: var(--font-weight-normal);
    letter-spacing: 0.03em;
    padding-left: var(--space-sm);
    border-left: 1px solid var(--color-border);
}

.main-navigation {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    gap: var(--space-xl);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    padding: var(--space-sm) 0;
    position: relative;
}

.nav-menu a:hover {
    color: var(--color-primary);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition-fast);
}

.nav-menu a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

.menu-toggle-icon,
.menu-toggle-icon::before,
.menu-toggle-icon::after {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-heading);
    transition: var(--transition-fast);
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
    content: '';
    position: absolute;
}

.menu-toggle-icon::before { transform: translateY(-7px); }
.menu-toggle-icon::after { transform: translateY(7px); }

/* --- Footer --- */
.site-footer {
    background: var(--color-heading);
    color: #cbd5e1;
    padding: 2.5rem 0 1.5rem;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--space-lg);
    margin-bottom: 1.5rem;
}

.footer-brand {
    max-width: 340px;
}

.footer-site-title {
    font-size: var(--font-size-base);
    color: white;
    font-weight: var(--font-weight-bold);
    display: block;
    margin-bottom: 4px;
}

.footer-tagline {
    font-size: var(--font-size-xs);
    color: #94a3b8;
    margin: 0;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-menu a {
    color: #cbd5e1;
    font-size: var(--font-size-sm);
}

.footer-menu a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.footer-copyright,
.footer-affiliate-note {
    font-size: var(--font-size-xs);
    color: #94a3b8;
}

/* --- Breadcrumb --- */
.breadcrumb {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-xs);
}

.breadcrumb a {
    color: var(--color-text-secondary);
}

.breadcrumb a:hover {
    color: var(--color-primary);
}

.breadcrumb-sep {
    color: var(--color-text-muted);
}

.breadcrumb-current {
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

/* --- Section Title --- */
.section-title {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-lg);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        position: relative;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--color-bg);
        flex-direction: column;
        padding: var(--space-md) var(--space-lg);
        box-shadow: var(--shadow-md);
        border-bottom: 1px solid var(--color-border);
    }

    .nav-menu.open {
        display: flex;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .site-tagline-small {
        display: none;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .site-content {
        padding: var(--space-xl) 0;
    }

    h1 { font-size: var(--font-size-xl); }
    h2 { font-size: var(--font-size-xl); }
}
