/* --- 1. Root Variables & Theme --- */
:root {
    --bg-dark: #0d001a;
    --bg-light: #1a0033;
    --card-bg: rgba(30, 0, 60, 0.75);
    --primary-text: #e4d9ff;
    --heading-text: #f4eaff;
    --accent-primary: #b266ff; /* Lighter purple for links, interactive elements */
    --accent-secondary: #a020f0; /* Deeper purple for gradients, accents */
    --accent-glow: rgba(178, 102, 255, 0.15);
    --border-color: rgba(228, 217, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.6);
    --font-family-main: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --border-radius-md: 12px;
    --border-radius-sm: 6px;
}

/* --- 2. General Body & Typography --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-family-main);
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 15% 15%, var(--bg-light) 0%, var(--bg-dark) 40%);

    color: var(--primary-text);
    line-height: 1.8;
    overflow-x: hidden;
}

/* --- 3. Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* --- 4. Layout & Containers --- */
.container {
    width: 100%;
    max-width: 900px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

.page-header {
    text-align: center;
    margin-bottom: 4rem;
}

/* --- 5. Tutorial Section Card Styling --- */
.tutorial-section {
    background-color: var(--card-bg);
    border-radius: var(--border-radius-md);
    padding: 2.5rem;
    margin-bottom: 4rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px var(--shadow-color);
    backdrop-filter: blur(12px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tutorial-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px var(--shadow-color), 0 0 25px var(--accent-glow);
}

/* --- 6. Heading Styles --- */
h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    background: linear-gradient(-45deg, #731ba9, var(--accent-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: var(--heading-text);
    margin-bottom: 2rem;
    font-weight: 600;
    position: relative;
    padding-left: 1.5rem;
}

h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 5px;
    background: linear-gradient(var(--accent-primary), var(--accent-secondary));
    border-radius: 5px;
}

h3 {
    font-size: 1.5rem;
    color: var(--heading-text);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* --- 7. Paragraph and Link Styles --- */
p {
    margin-bottom: 1.25rem;
    max-width: 70ch;
    font-weight: 300;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.2s ease-in-out;
}

a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 1px;
    bottom: -3px;
    left: 0;
    background-color: var(--accent-primary);
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}

a:hover {
    color: #d8baff; /* Lighter purple on hover */
}

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

/* --- 8. Image Styling --- */
.tutorial-image {
    width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto 4rem auto;
    border-radius: var(--border-radius-md);
    box-shadow: 0 8px 25px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tutorial-image:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 35px var(--shadow-color), 0 0 30px var(--accent-glow);
}

/* --- 9. Component Styling (Disclaimer, Code) --- */
.browserSupportText {
    background-color: rgba(160, 32, 240, 0.1);
    border-left: 4px solid var(--accent-secondary);
    color: var(--primary-text);
    padding: 1.5rem;
    border-radius: var(--border-radius-sm);
    margin: 2rem 0;
    font-size: 0.95rem;
    line-height: 1.7;
}

code {
    font-family: 'Courier New', Courier, monospace;
    background-color: rgba(178, 102, 255, 0.15);
    color: var(--accent-primary);
    padding: 0.2em 0.5em;
    border-radius: var(--border-radius-sm);
    font-size: 0.9em;
    white-space: nowrap;
}

/* --- 10. Navigation Button --- */
.navigate-button {
    position: fixed; /* Updated: Changed to fixed for consistency */
    display: flex;
    align-items: center;
    justify-content: center;
    top: max(10px, env(safe-area-inset-top)); /* Updated: Account for safe area */
    left: 10px;
    z-index: 1000;
    padding: 15px 20px; /* Updated: Increased padding for touch */
    border: 2px solid #6900c5;
    background-color: #1d003e;
    box-shadow: 0 0 10px rgba(0, 30, 255, 0.7);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin: 10px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    touch-action: manipulation; /* Updated: Improve touch responsiveness */
    min-height: 44px; /* Updated: Ensure touch target size */
}

.navigate-button:hover,
.navigate-button:active { /* Updated: Added :active for touch */
    background-color: #100023;
    border-color: #490089;
    transform: scale(1.1);
}

.home-button-icon {
    width: 20px;
    height: 20px;
    image-rendering: crisp-edges;
    margin: 5px;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.navigate-button:hover .home-button-icon,
.navigate-button:active .home-button-icon { /* Updated: Added :active for touch */
    transform: translateX(-5px); /* Updated: Simplified movement */
}

li {
    margin-bottom: 10px;
}
 
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}