:root {
    /* Default (Dark Mode) Variables */
    --bg-void: #030303;
    --text-silver: #E1E1E1;
    --text-mercury: #A0A0A0;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-bg: rgba(20, 20, 20, 0.4);
    --grid-line: rgba(255, 255, 255, 0.03);
    --vignette-color: #030303;
    --selection-bg: rgba(255, 255, 255, 0.2);
    --selection-text: #FFFFFF;
    --spotlight-color: rgba(255, 255, 255, 0.06);
    --spotlight-border: rgba(255, 255, 255, 0.3);
}

/* Light Mode Overrides */
.light-mode {
    --bg-void: #FFFFFF;
    --text-silver: #111111;
    --text-mercury: #444444;
    --glass-bg: rgba(0, 0, 0, 0.03);
    --glass-border: rgba(0, 0, 0, 0.08);
    --card-bg: rgba(255, 255, 255, 0.8);
    --grid-line: rgba(0, 0, 0, 0.05);
    --vignette-color: transparent;
    /* Remove vignette in light mode for pure white feel */
    --selection-bg: rgba(0, 0, 0, 0.1);
    --selection-text: #000000;
    --spotlight-color: rgba(0, 0, 0, 0.05);
    --spotlight-border: rgba(0, 0, 0, 0.2);
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-void);
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

/* --- Typography Handling --- */
.line-wrapper {
    overflow: hidden;
    display: block;
    position: relative;
    padding-bottom: 0.1em;
}

.reveal-text {
    display: block;
    transform: translateY(120%);
    animation-fill-mode: forwards;
}

/* --- Magnetic Button Styles --- */
.magnetic-btn {
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- Gradient Text --- */
.metallic-text {
    background: linear-gradient(to bottom, var(--text-silver) 30%, var(--text-mercury) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Glass Card --- */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

/* --- Subtle Grid with Scanning Light --- */
.bg-grid-scan {
    background-size: 50px 50px;
    /* The grid lines */
    background-image:
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
}

/* The moving light wave overlay */
.scan-overlay {
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(255, 255, 255, 0.02) 40%,
            rgba(255, 255, 255, 0.05) 50%,
            rgba(255, 255, 255, 0.02) 60%,
            transparent 100%);
    background-size: 100% 200%;
    animation: scan 15s linear infinite;
}

/* --- Noise Grain --- */
.noise-bg {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
}

/* --- Spotlight Card Effect --- */
.spotlight-card {
    background-color: var(--glass-bg);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

/* The spotlight glow */
.spotlight-card::before {
    content: "";
    position: absolute;
    height: 100%;
    width: 100%;
    left: 0;
    top: 0;
    background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            var(--spotlight-color),
            transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 1;
}

/* Border Glow Effect */
.spotlight-card::after {
    content: "";
    position: absolute;
    height: 100%;
    width: 100%;
    left: 0;
    top: 0;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            var(--spotlight-border),
            transparent 40%);
    opacity: 0;
    z-index: 3;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.spotlight-group:hover .spotlight-card::before,
.spotlight-group:hover .spotlight-card::after {
    opacity: 1;
}

/* --- Scroll Reveal Animations --- */
.reveal-section {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s ease-out;
}

.reveal-section.active {
    opacity: 1;
    transform: translateY(0);
}

.stagger-child {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.reveal-section.active .stagger-child {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Delays */
.reveal-section.active .stagger-child:nth-child(1) {
    transition-delay: 0.1s;
}

.reveal-section.active .stagger-child:nth-child(2) {
    transition-delay: 0.2s;
}

.reveal-section.active .stagger-child:nth-child(3) {
    transition-delay: 0.3s;
}

.reveal-section.active .stagger-child:nth-child(4) {
    transition-delay: 0.4s;
}

.reveal-section.active .stagger-child:nth-child(5) {
    transition-delay: 0.5s;
}

/* --- Section Divider --- */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    position: relative;
    margin: 0 auto;
    max-width: 60%;
}

.section-divider::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* --- Impact Section Background --- */
.impact-section-bg {
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.01) 50%,
            rgba(255, 255, 255, 0) 100%);
}

/* --- Checklist Item Styling --- */
.checklist-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
}

.checklist-item:hover {
    border-color: var(--glass-border);
    background: var(--glass-bg);
    padding-left: 10px;
}

/* --- Tab System --- */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tab-btn {
    position: relative;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--text-silver);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-btn.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.tab-btn.active {
    color: var(--text-silver);
}

/* --- Tech Spec List Item --- */
.spec-item {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 0.75rem;
}

.spec-item:last-child {
    border-bottom: none;
}

.spec-bullet {
    width: 6px;
    height: 6px;
    background: var(--glass-border);
    transform: rotate(45deg);
}

/* --- Tool Chip --- */
.tool-chip {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.tool-chip:hover {
    background: var(--glass-border);
    border-color: var(--text-mercury);
    transform: translateY(-2px);
}

/* --- Badge/Chip Styling --- */
.credential-chip {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.credential-chip:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

/* --- Magnetic Button (CTA) --- */
.cta-button {
    position: relative;
    background: linear-gradient(to bottom, #e0e0e0, #a0a0a0);
    color: #030303;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
}

.cta-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    opacity: 0;
    transition: opacity 0.3s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.15);
}

.cta-button:hover::after {
    opacity: 1;
}

/* --- Social Icon Hover --- */
.social-link {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-link:hover {
    transform: translateY(-5px) scale(1.2);
    color: var(--text-silver);
}

/* --- Interactive Stream Item (Torch Effect) --- */
.stream-item {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-bottom: 1px solid var(--glass-border);
}

/* The Torch/Spotlight Gradient */
.stream-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(600px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
            rgba(255, 255, 255, 0.08),
            transparent 40%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
    pointer-events: none;
}

.stream-item:hover::before {
    opacity: 1;
}

.stream-item:hover {
    border-color: var(--text-mercury);
    padding-left: 1rem;
}

/* --- Mask Image Fade --- */
.mask-image-b-fade {
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

/* --- Video Portfolio Specific Styles --- */

/* Video Container Holographic Style */
.video-holo-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    transition: all 0.5s ease;
}

.video-holo-container::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    pointer-events: none;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.video-aspect {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    background: #050505;
}

/* Chapter Chip */
.chapter-chip {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.chapter-chip:hover {
    background: var(--glass-border);
    border-color: var(--text-mercury);
    transform: translateY(-2px);
}

/* --- Timeline Styles (Professional Experience & Case Studies) --- */
.timeline-line {
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--glass-border), transparent);
}

@media (min-width: 1024px) {
    .timeline-line {
        left: 50%;
        transform: translateX(-50%);
    }
}

.timeline-dot {
    position: absolute;
    left: 16px;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-void);
    border: 2px solid var(--text-silver);
    z-index: 10;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.group:hover .timeline-dot {
    background: var(--text-silver);
    box-shadow: 0 0 15px var(--text-silver);
}

@media (min-width: 1024px) {
    .timeline-dot {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* --- Role & Skill Lists --- */
ul.role-list li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-mercury);
    font-size: 0.9rem;
    line-height: 1.6;
}

ul.role-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--text-silver);
}

ul.role-list strong {
    color: var(--text-silver);
    font-weight: 500;
}

.skill-pill {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--glass-bg);
    color: var(--text-mercury);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.skill-pill:hover {
    border-color: var(--text-silver);
    color: var(--text-silver);
    background: var(--glass-border);
}

/* --- Tools & Skills Page Specifics --- */
.skill-card {
    height: 100%;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.section-header {
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.tool-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tool-item:last-child {
    border-bottom: none;
}

.tool-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0.25rem;
}

.tool-desc {
    font-size: 0.75rem;
    color: var(--text-mercury);
    opacity: 0.7;
    font-weight: 300;
}

.stars {
    color: #FFD700;
    font-size: 0.7rem;
    letter-spacing: 2px;
}

ul.detail-list li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-mercury);
    font-size: 0.85rem;
    line-height: 1.6;
    font-weight: 300;
}

ul.detail-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--text-silver);
}

.progress-bar-bg {
    background: rgba(255, 255, 255, 0.1);
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar-fill {
    background: var(--text-silver);
    height: 100%;
    border-radius: 2px;
}

/* --- Contact Form Styles --- */
.form-input {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-silver);
    padding: 12px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
}

.form-input:focus {
    border-color: var(--text-mercury);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

select.form-input option {
    background-color: var(--bg-void);
    color: var(--text-silver);
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23A0A0A0'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.5em;
}

.contact-method-card {
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.contact-method-card:hover {
    border-color: var(--text-mercury);
    background: var(--glass-bg);
    transform: translateX(5px);
}

.btn-submit {
    background: var(--text-silver);
    color: var(--bg-void);
    font-family: 'Space Grotesk', monospace;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: none;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
    background: white;
}

/* --- Video Portfolio Kinetic Deck --- */
.deck-container {
    display: flex;
    gap: 1rem;
    height: 500px;
    width: 100%;
}

.deck-panel {
    position: relative;
    flex: 1;
    border-radius: 1rem;
    background: linear-gradient(180deg, var(--glass-bg) 0%, transparent 100%);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.deck-panel:hover {
    flex: 3;
    background: linear-gradient(180deg, var(--glass-bg) 0%, transparent 100%);
    border-color: var(--text-silver);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
}

.panel-content-collapsed {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.3s ease;
    white-space: nowrap;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 1rem;
    width: 100%;
    height: 100%;
    justify-content: flex-start;
    padding-bottom: 2rem;
}

.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-mercury);
}

.panel-content-expanded {
    position: absolute;
    inset: 0;
    padding: 3rem;
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: opacity 0.4s ease 0.1s;
    background: radial-gradient(circle at bottom left, var(--glass-bg), transparent 70%);
}

.deck-panel:hover .panel-content-collapsed {
    opacity: 0;
}

.deck-panel:hover .panel-content-expanded {
    opacity: 1;
}

@media (max-width: 1024px) {
    .deck-container {
        flex-direction: column;
        height: auto;
    }

    .deck-panel {
        height: 180px;
        flex: none;
    }

    .deck-panel:hover {
        flex: none;
        height: 220px;
    }

    .panel-content-collapsed {
        display: none;
    }

    .panel-content-expanded {
        opacity: 1;
        position: relative;
        padding: 2rem;
        background: none;
    }
}