/* 
  Sovereign Global Design System
  Consistent, Premium, Classic aesthetics.
*/

:root {
    /* Colors - Classic Dark Premium Palette */
    --color-void: #010409;
    --color-deep: #0d1117;
    --color-surface: #161b22;
    --color-border: #30363d;
    --color-text-primary: #c9d1d9;
    --color-text-secondary: #8b949e;
    --color-text-dim: #484f58;
    --color-accent: #58a6ff;
    --color-accent-soft: rgba(88, 166, 255, 0.1);
    --color-gold: #c69b3d;
    --color-gold-hover: #d4af37;
    
    /* Spacing Scale */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-xxl: 4rem;

    /* Typography */
    --font-heading: 'Outfit', -apple-system, system-ui, sans-serif;
    --font-body: 'Inter', -apple-system, system-ui, sans-serif;
    
    /* Other Constants */
    --container-max-width: 1200px;
    --border-radius-sm: 6px;
    --border-radius-md: 12px;
    --transition-standard: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-void);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: #fff;
    margin-bottom: var(--space-sm);
    line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 700; }
h3 { font-size: 1.5rem; font-weight: 600; }

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: var(--transition-standard);
}

a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* Premium Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-standard);
    font-family: var(--font-heading);
    text-decoration: none;
}

.btn-primary {
    background: var(--color-gold);
    color: #000;
}

.btn-primary:hover {
    background: var(--color-gold-hover);
    transform: translateY(-2px);
    text-decoration: none;
}

.card {
    background: var(--color-deep);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: var(--space-md);
    transition: var(--transition-standard);
}

.card:hover {
    border-color: var(--color-accent);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

/* Navigation and Mobile Menu - Apply only to library/trust pages */
body:not(.homepage) header {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    background: rgba(1, 4, 9, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 48px;
    width: auto;
}

#mainNav {
    display: flex;
    align-items: center;
}

.nav-link {
    color: var(--color-text-secondary);
    font-weight: 500;
    margin-left: var(--space-md);
    transition: var(--transition-standard);
}

.nav-link:hover {
    color: var(--color-accent);
    text-decoration: none;
}

/* Hamburger Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    
    #mainNav {
        display: none; /* Controlled by JS class */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-deep);
        flex-direction: column;
        padding: var(--space-md);
        border-bottom: 1px solid var(--color-border);
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    }

    #mainNav.active { display: flex; }

    .nav-link {
        margin-left: 0;
        margin-bottom: var(--space-md);
        font-size: 1.1rem;
    }

    /* Footer fix for cramped mobile views */
    footer {
        padding: var(--space-lg) var(--space-sm);
        font-size: 0.85rem;
    }
    footer div a {
        display: inline-block;
        margin: 5px 10px !important;
    }
}

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

/* Homepage Specific Styles */
.homepage header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: none;
    padding: var(--space-md) 0;
}

.hero {
    padding: 160px 0 100px;
    background: radial-gradient(circle at center, #1a1f26 0%, var(--color-void) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(var(--color-accent-soft) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.2;
    z-index: 0;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 1;
}

.hero-tag {
    display: inline-block;
    color: var(--color-gold);
    font-weight: 700;
    letter-spacing: 0.15em;
    font-size: 0.85rem;
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    margin: var(--space-md) 0 var(--space-xl);
    max-width: 600px;
}

.btn-outline {
    background: transparent;
}

.btn-outline:hover {
    background: var(--color-accent-soft);
    transform: translateY(-2px);
}

/* Featured Products Animation */
.card {
    border: 1px solid var(--color-border);
    transition: var(--transition-standard);
}

.card:hover h3 {
    color: var(--color-gold);
}

@media (max-width: 768px) {
    .hero { padding-top: 120px; text-align: center; }
    .hero-subtitle { margin-left: auto; margin-right: auto; }
    .hero-actions { display: flex; flex-direction: column; gap: 1rem; }
    .hero-actions .btn { margin-left: 0 !important; width: 100%; }
}

/* ======================================
   Affiliate Link Cards — Stacked Design
   ====================================== */
.affiliate-section {
    padding: var(--space-xl) 0;
    background: var(--color-void);
}

.affiliate-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.affiliate-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(22, 27, 34, 0.9) 0%, rgba(13, 17, 23, 0.95) 100%);
    border: 1px solid rgba(48, 54, 61, 0.6);
    border-radius: var(--border-radius-md);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.affiliate-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 0% 50%, rgba(88, 166, 255, 0.04) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.affiliate-card:hover {
    border-color: rgba(88, 166, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 40px rgba(88, 166, 255, 0.05);
    text-decoration: none;
}

.affiliate-card:hover::before {
    opacity: 1;
}

.affiliate-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 1.3rem;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.affiliate-card-content {
    flex: 1;
    min-width: 0;
}

.affiliate-card-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-dim);
    margin-bottom: 0.25rem;
}

.affiliate-card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.affiliate-card-chevron {
    color: var(--color-text-dim);
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.affiliate-card:hover .affiliate-card-chevron {
    color: var(--color-accent);
    transform: translateX(3px);
}

/* ======================================
   Footer Newsletter — Hidden Wisdom Letters
   ====================================== */
.footer-newsletter {
    background: linear-gradient(180deg, rgba(13, 17, 23, 0.95) 0%, rgba(1, 4, 9, 1) 100%);
    border-top: 1px solid var(--color-border);
    padding: var(--space-xxl) 0 var(--space-xl);
}

.newsletter-card {
    max-width: 520px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    background: linear-gradient(135deg, rgba(22, 27, 34, 0.8) 0%, rgba(13, 17, 23, 0.9) 100%);
    border: 1px solid rgba(48, 54, 61, 0.5);
    border-radius: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.newsletter-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 0%, rgba(88, 166, 255, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.newsletter-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    color: var(--color-text-secondary);
}

.newsletter-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.newsletter-subtitle {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.newsletter-field-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-dim);
    margin-bottom: 0.4rem;
    text-align: left;
}

.newsletter-input {
    width: 100%;
    padding: 0.9rem 1.1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(48, 54, 61, 0.6);
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: all 0.3s ease;
    outline: none;
}

.newsletter-input::placeholder {
    color: var(--color-text-dim);
}

.newsletter-input:focus {
    border-color: rgba(88, 166, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.08);
}

.newsletter-submit {
    width: 100%;
    padding: 1rem;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.newsletter-submit:hover {
    background: var(--color-gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(198, 155, 61, 0.3);
}

/* Footer bottom bar */
.footer-bottom {
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--color-border);
    text-align: center;
    color: var(--color-text-dim);
    font-size: 0.85rem;
}

.footer-bottom-links {
    margin-top: 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.footer-bottom-links a {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.footer-bottom-links a:hover {
    color: var(--color-accent);
    text-decoration: none;
}

.footer-star {
    color: var(--color-gold);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .affiliate-card {
        padding: 1rem 1.25rem;
        gap: 1rem;
    }
    .affiliate-card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    .affiliate-card-title {
        font-size: 1rem;
    }
    .newsletter-card {
        padding: 2rem 1.25rem;
        margin: 0 1rem;
    }
    .footer-bottom-links {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Category Discovery */
.category-nav {
    margin: 2rem 0;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

.category-nav::-webkit-scrollbar {
    height: 4px;
}

.category-nav::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.category-pills {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.category-pill {
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    border-radius: 50px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.category-pill:hover, .category-pill.active {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.1);
}

.category-pill .count {
    margin-left: 6px;
    opacity: 0.5;
    font-size: 0.75rem;
}

