@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --font-headings: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Default Light Theme */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --border-color: rgba(15, 23, 42, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent-indigo: #6366f1;
    --accent-cyan: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    --accent-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #0891b2 100%);
    --accent-glow: rgba(99, 102, 241, 0.15);
    
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.1);
    
    --glow-spot-1: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08), transparent 40%);
    --glow-spot-2: radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.08), transparent 40%);
}

/* Dark Theme overrides when preferred by device/browser */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #030712;
        --bg-secondary: #0b0f19;
        --bg-glass: rgba(11, 15, 25, 0.7);
        --border-color: rgba(255, 255, 255, 0.08);
        --text-primary: #f9fafb;
        --text-secondary: #9ca3af;
        --text-muted: #6b7280;
        
        --accent-indigo: #818cf8;
        --accent-cyan: #22d3ee;
        --accent-gradient: linear-gradient(135deg, #818cf8 0%, #22d3ee 100%);
        --accent-gradient-hover: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
        --accent-glow: rgba(129, 140, 248, 0.2);
        
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
        --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.35);
        --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
        
        --glow-spot-1: radial-gradient(circle at 10% 20%, rgba(129, 140, 248, 0.07), transparent 45%);
        --glow-spot-2: radial-gradient(circle at 90% 80%, rgba(34, 211, 238, 0.07), transparent 45%);
    }
}

/* Explicit class override for light theme (set by user preference toggle) */
body.light-theme {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --border-color: rgba(15, 23, 42, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent-indigo: #6366f1;
    --accent-cyan: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    --accent-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #0891b2 100%);
    --accent-glow: rgba(99, 102, 241, 0.15);
    
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.1);
    
    --glow-spot-1: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08), transparent 40%);
    --glow-spot-2: radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.08), transparent 40%);
}

/* Explicit class override for dark theme (set by user preference toggle) */
body.dark-theme {
    --bg-primary: #030712;
    --bg-secondary: #0b0f19;
    --bg-glass: rgba(11, 15, 25, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-indigo: #818cf8;
    --accent-cyan: #22d3ee;
    --accent-gradient: linear-gradient(135deg, #818cf8 0%, #22d3ee 100%);
    --accent-gradient-hover: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    --accent-glow: rgba(129, 140, 248, 0.2);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
    
    --glow-spot-1: radial-gradient(circle at 10% 20%, rgba(129, 140, 248, 0.07), transparent 45%);
    --glow-spot-2: radial-gradient(circle at 90% 80%, rgba(34, 211, 238, 0.07), transparent 45%);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    background-image: var(--glow-spot-1), var(--glow-spot-2);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

/* Background glowing blob decoration */
body::before {
    content: '';
    position: fixed;
    top: -10%;
    left: 30%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    animation: floatGlow 15s ease-in-out infinite alternate;
}

@keyframes floatGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, 15%) scale(1.1); }
}

/* Typography elements */
h1, h2, h3, h4 {
    font-family: var(--font-headings);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    margin-bottom: 1.5rem;
}

h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    margin-bottom: 1.2rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    font-weight: 400;
}

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

/* Custom Selection style */
::selection {
    background: var(--accent-indigo);
    color: #ffffff;
}

/* Navigation & Header */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 2rem;
    transition: var(--transition-normal);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header a.logo {
    font-family: var(--font-headings);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    position: relative;
    outline: none;
}

header a.logo strong {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: var(--transition-normal);
}

header a.logo:hover strong {
    filter: brightness(1.15);
}

header nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

header nav a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-sm);
    position: relative;
}

header nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.8rem;
    right: 0.8rem;
    height: 2px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

header nav a:hover {
    color: var(--text-primary);
}

header nav a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

header nav a.active {
    color: var(--text-primary);
}

header nav a.active::after {
    transform: scaleX(1);
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
    outline: none;
}

.theme-toggle:hover {
    background-color: var(--border-color);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    position: absolute;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
}

/* Show/hide Sun and Moon icons based on current theme */
/* If body has light-theme, show moon and hide sun (meaning: click to set dark) */
body.light-theme .theme-toggle .sun-icon {
    transform: translateY(-40px) rotate(90deg);
    opacity: 0;
}
body.light-theme .theme-toggle .moon-icon {
    transform: translateY(0) rotate(0);
    opacity: 1;
}

/* If body has dark-theme, show sun and hide moon (meaning: click to set light) */
body.dark-theme .theme-toggle .sun-icon {
    transform: translateY(0) rotate(0);
    opacity: 1;
}
body.dark-theme .theme-toggle .moon-icon {
    transform: translateY(40px) rotate(-90deg);
    opacity: 0;
}

/* Default state based on preference if no explicit class on body */
@media (prefers-color-scheme: dark) {
    body:not(.light-theme):not(.dark-theme) .theme-toggle .sun-icon {
        transform: translateY(0) rotate(0);
        opacity: 1;
    }
    body:not(.light-theme):not(.dark-theme) .theme-toggle .moon-icon {
        transform: translateY(40px) rotate(-90deg);
        opacity: 0;
    }
}
@media (prefers-color-scheme: light) {
    body:not(.light-theme):not(.dark-theme) .theme-toggle .sun-icon {
        transform: translateY(-40px) rotate(90deg);
        opacity: 0;
    }
    body:not(.light-theme):not(.dark-theme) .theme-toggle .moon-icon {
        transform: translateY(0) rotate(0);
        opacity: 1;
    }
}

/* Main Layout Grid & Containers */
main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 4rem 0 6rem;
    position: relative;
}

.hero-tagline {
    background: var(--border-color);
    color: var(--accent-indigo);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    display: inline-block;
    animation: fadeInDown 0.8s ease;
}

.hero h1 {
    max-width: 800px;
    animation: fadeInUp 0.8s ease 0.1s both;
}

.hero h1 span.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p.lead {
    max-width: 600px;
    font-size: 1.25rem;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    animation: fadeInUp 0.8s ease 0.3s both;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.85rem 1.8rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
    font-family: var(--font-headings);
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px var(--accent-glow);
    background: var(--accent-gradient-hover);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

/* Sections & Grids */
.section-header {
    margin-bottom: 3rem;
    text-align: center;
}

.section-header p {
    max-width: 600px;
    margin: 0.5rem auto 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    width: 100%;
}

/* Cards */
.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-indigo);
    box-shadow: var(--shadow-lg);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: var(--transition-normal);
}

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

.card-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-indigo);
    background-color: var(--accent-glow);
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-full);
    align-self: flex-start;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.card-title {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
    margin-top: auto;
}

.card-meta {
    font-weight: 700;
    font-size: 1.1rem;
    font-family: var(--font-headings);
}

.card-meta span {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.card-link {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent-indigo);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.card-link svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
    transition: transform var(--transition-fast);
}

.card:hover .card-link svg {
    transform: translateX(4px);
}

/* Privacy Policy Layout Styling */
.policy-container {
    max-width: 800px;
    margin: 0 auto;
    padding-top: 2rem;
}

.policy-container h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.policy-container p.updated {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    display: block;
}

.policy-container h2 {
    font-size: 1.6rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent-indigo);
    padding-left: 0.75rem;
}

.policy-container ul {
    list-style-type: none;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
}

.policy-container li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.policy-container li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-indigo);
    font-weight: bold;
}

.policy-container a {
    color: var(--accent-indigo);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.policy-container a:hover {
    color: var(--text-primary);
}

/* Footer Section */
footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 2rem;
    transition: var(--transition-normal);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.footer-logo {
    font-family: var(--font-headings);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.footer-logo strong {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-copy {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Cookie Consent Banner Redesign */
.cookie-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    left: auto;
    width: 100%;
    max-width: 420px;
    background-color: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cookie-banner p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

.cookie-banner a {
    color: var(--accent-indigo);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0;
}

.cookie-actions button {
    flex: 1;
    font-family: var(--font-headings);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-normal);
    border: 1px solid transparent;
}

#accept-cookies {
    background: var(--accent-gradient);
    color: #ffffff;
}

#accept-cookies:hover {
    background: var(--accent-gradient-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

#reject-cookies {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

#reject-cookies:hover {
    background: var(--bg-primary);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Article Detail View Reader Styling */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding-top: 2rem;
}

.article-header {
    margin-bottom: 3.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
    text-align: center;
}

.article-header h1 {
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.15;
}

.article-meta {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.article-body {
    font-size: 1.15rem;
    line-height: 1.8;
}

.article-body h2 {
    font-size: 1.8rem;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
}

.article-body p {
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
    line-height: 1.85;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header {
        padding: 1rem 1.5rem;
    }
    
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    header nav {
        width: 100%;
        justify-content: center;
        gap: 1rem;
    }
    
    main {
        padding: 2rem 1.5rem 4rem;
    }
    
    .hero {
        padding: 2rem 0 4rem;
    }
    
    .hero-cta {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }
    
    .btn {
        width: 100%;
    }
    
    .cookie-banner {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: calc(100% - 32px);
    }
}