@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Modern, Vibrant Color Palette */
    --primary: #4f46e5;       /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --secondary: #ec4899;     /* Pink 500 */
    --background: #f8fafc;    /* Slate 50 */
    --text-main: #0f172a;     /* Slate 900 */
    --text-muted: #475569;    /* Slate 600 */
    
    /* Layout & Cards */
    --card-bg: rgba(255, 255, 255, 0.85);
    --nav-bg: rgba(255, 255, 255, 0.75);
    --border-color: #e2e8f0;
    
    /* Styling variables */
    --radius-sm: 8px;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.3);
    
    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* -----------------------------
   GLOBAL RESET
----------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    /* Subtle mesh gradient background */
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,0) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0) 0, transparent 50%);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* -----------------------------
   TYPOGRAPHY
----------------------------- */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.2;
    margin-top: 2rem;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

a:hover, a:focus-visible {
    color: var(--primary-hover);
    text-decoration: underline;
}

strong {
    color: var(--text-main);
    font-weight: 600;
}

pre, code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    border-radius: var(--radius-sm);
}

code {
    background: #e2e8f0;
    color: #0f172a;
    padding: 0.2em 0.4em;
}

pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* -----------------------------
   LAYOUT
----------------------------- */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding-inline: 1.5rem;
}

/* -----------------------------
   COMPONENTS
----------------------------- */
/* Header & Navigation */
header {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

nav {
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 1rem;
    z-index: 100;
    transition: box-shadow 0.3s ease;
}

nav.elevated {
    box-shadow: var(--shadow-lg);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

nav ul li a {
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 99px;
    transition: all 0.3s ease;
}

nav ul li a:hover, nav ul li a.active {
    background: var(--primary);
    color: white;
    text-decoration: none;
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
    padding: 4rem 0;
}

@media (min-width: 768px) {
    .hero {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

.hero-content .eyebrow {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(236, 72, 153, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.125rem;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.hero-image {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 4px solid white;
    transform: rotate(2deg);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hero-image:hover {
    transform: rotate(0deg) scale(1.02);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.39);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.23);
    color: white;
    text-decoration: none;
}

.btn-ghost {
    background: transparent;
    color: var(--text-main);
    border: 2px solid var(--border-color);
}

.btn-ghost:hover {
    border-color: var(--text-muted);
    background: var(--border-color);
    text-decoration: none;
}

/* Cards & Sections */
section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card h3 {
    margin-top: 0;
    color: var(--primary);
}

.card ul {
    margin-top: auto;
    padding-left: 1.5rem;
}

/* Lists */
ul, ol {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

li {
    margin-bottom: 0.5rem;
}

ul#bordered-list {
    border: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow-sm);
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: #f1f5f9;
    font-weight: 600;
    color: var(--text-main);
}

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

/* Forms */
input, select, textarea {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: 100%;
    max-width: 400px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    color: var(--text-main);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Quiz Specifics */
.quiz form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quiz button {
    border-radius: var(--radius-sm);
}

.quiz .feedback {
    font-weight: 600;
    margin-top: 1rem;
    min-height: 1.5rem;
}
.quiz .feedback.success { color: #10b981; } /* Emerald 500 */
.quiz .feedback.error { color: #ef4444; }   /* Red 500 */

/* Footer */
footer {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

/* -----------------------------
   UTILITIES & ANIMATIONS
----------------------------- */
.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1em;
    background-color: var(--primary);
    color: white;
    text-decoration: none;
}

.skip-link:focus {
    left: 50%;
    transform: translateX(-50%);
}

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

/* Scroll To Top */
.to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
}

.to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.to-top-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Dark Mode (optional but nice) */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #0f172a;
        --text-main: #f8fafc;
        --text-muted: #cbd5e1;
        --card-bg: rgba(30, 41, 59, 0.7);
        --nav-bg: rgba(30, 41, 59, 0.85);
        --border-color: #334155;
    }

    body {
        background-image: 
            radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.15) 0, transparent 50%), 
            radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.1) 0, transparent 50%);
    }

    .card { background: #1e293b; }
    th { background: #1e293b; }
    input, select, textarea { background: #1e293b; color: #f8fafc; }
}