/* ==========================================================================
   RAUNAK SINHA - GAME DESIGNER PORTFOLIO
   Design System & Styling (Light & Dark Theme Engine)
   ========================================================================== */

/* --- Custom Properties & Theme Palette --- */
:root {
    /* Brand Accent Colors (Light Mode) */
    --color-primary-teal: #006D77;
    --color-primary-teal-hover: #00565e;
    --color-primary-teal-light: rgba(0, 109, 119, 0.08);
    --color-secondary-cyan: #83C5BE;
    --color-secondary-cyan-soft: rgba(131, 197, 190, 0.25);
    
    /* Neutrals */
    --color-bg-canvas: #F8FAF9;
    --color-bg-card: #FFFFFF;
    --color-bg-subtle: #F1F5F9;
    --color-bg-subtle-section: rgba(255, 255, 255, 0.75);
    --color-header-bg: rgba(255, 255, 255, 0.92);
    --color-footer-bg: #FFFFFF;
    --color-border: #E2E8F0;
    --color-border-dark: #CBD5E1;
    
    /* Typography Colors */
    --color-text-heading: #1A202C;
    --color-text-body: #334155;
    --color-text-muted: #64748B;
    
    /* Elevation Shadows */
    --shadow-subtle: 0 4px 20px rgba(0, 109, 119, 0.06);
    --shadow-card: 0 8px 30px rgba(0, 109, 119, 0.08);
    --shadow-card-hover: 0 16px 40px rgba(0, 109, 119, 0.16);
    --shadow-btn: 0 4px 14px rgba(0, 109, 119, 0.25);
    --shadow-btn-hover: 0 6px 20px rgba(0, 109, 119, 0.35);
}

/* --- Dark Theme Engine (High-Contrast Professional) --- */
html.dark {
    /* Brand Accent Colors (Dark Mode) */
    --color-primary-teal: #14B8A6;
    --color-primary-teal-hover: #2DD4BF;
    --color-primary-teal-light: rgba(20, 184, 166, 0.14);
    --color-secondary-cyan: #83C5BE;
    --color-secondary-cyan-soft: rgba(131, 197, 190, 0.2);
    
    /* Neutrals */
    --color-bg-canvas: #0B111A;
    --color-bg-card: #131D2A;
    --color-bg-subtle: #182333;
    --color-bg-subtle-section: #0E1622;
    --color-header-bg: rgba(11, 17, 26, 0.92);
    --color-footer-bg: #0E1622;
    --color-border: #1E293B;
    --color-border-dark: #334155;
    
    /* Typography Colors */
    --color-text-heading: #F8FAFC;
    --color-text-body: #CBD5E1;
    --color-text-muted: #94A3B8;
    
    /* Elevation Shadows */
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(20, 184, 166, 0.04);
    --shadow-card-hover: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 25px rgba(20, 184, 166, 0.18);
    --shadow-btn: 0 4px 14px rgba(20, 184, 166, 0.3);
    --shadow-btn-hover: 0 6px 22px rgba(20, 184, 166, 0.45);
}

/* --- Base Resets & Global Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--color-bg-canvas);
    color: var(--color-text-body);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Typography Hierarchy --- */
h1, h2, h3, h4, .font-heading {
    font-family: 'Outfit', sans-serif;
    color: var(--color-text-heading);
    letter-spacing: 0.04em;
    font-weight: 700;
    transition: color 0.3s ease;
}

.heading-tracked {
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Accent Line Below Section Titles */
.section-accent-line {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary-teal), var(--color-secondary-cyan));
    border-radius: 2px;
    margin-top: 0.75rem;
}

.section-accent-line.center {
    margin-left: auto;
    margin-right: auto;
}

/* --- Particle Canvas Background --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Navigation Bar --- */
.header-glass {
    background-color: var(--color-header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.header-glass.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

html.dark .header-glass.scrolled {
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);
}

.nav-link {
    position: relative;
    color: var(--color-text-body);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.25s ease;
    padding: 0.25rem 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--color-primary-teal);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--color-primary-teal);
    transition: width 0.25s ease;
    border-radius: 1px;
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* --- Smooth Slider-Type Theme Switch --- */
.theme-switch-slider {
    position: relative;
    width: 58px;
    height: 30px;
    background-color: var(--color-bg-subtle);
    border: 1.5px solid var(--color-border);
    border-radius: 9999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    flex-shrink: 0;
}

.theme-switch-slider:hover {
    border-color: var(--color-primary-teal);
    box-shadow: 0 0 10px var(--color-primary-teal-light);
}

html.dark .theme-switch-slider {
    background-color: #172334;
    border-color: #2DD4BF;
    box-shadow: 0 0 12px rgba(20, 184, 166, 0.25);
}

.theme-switch-icon-sun {
    width: 14px;
    height: 14px;
    color: #D97706;
    transition: transform 0.3s ease, opacity 0.3s ease, color 0.3s ease;
    opacity: 0.85;
}

.theme-switch-icon-moon {
    width: 14px;
    height: 14px;
    color: #0F172A; /* Moon is black in light mode */
    transition: transform 0.3s ease, opacity 0.3s ease, color 0.3s ease;
    opacity: 1;
}

html.dark .theme-switch-icon-sun {
    color: #FFFFFF; /* Sun is white in dark mode */
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.6));
}

html.dark .theme-switch-icon-moon {
    opacity: 0.6;
    color: #5EEAD4;
}

.theme-switch-thumb {
    position: absolute;
    top: 3px;
    left: 4px;
    width: 22px;
    height: 22px;
    background-color: #FFFFFF;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

html.dark .theme-switch-thumb {
    transform: translateX(26px);
    background-color: #14B8A6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.theme-switch-thumb-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-primary-teal);
    transition: background-color 0.3s ease;
}

html.dark .theme-switch-thumb-dot {
    background-color: #0B111A;
}

/* --- Profile Frame & Hero Visuals --- */
.profile-frame-container {
    position: relative;
    width: 240px;
    height: 240px;
}

@media (min-width: 768px) {
    .profile-frame-container {
        width: 280px;
        height: 280px;
    }
}

.profile-offset-border {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid var(--color-secondary-cyan);
    transform: translate(8px, 8px);
    transition: transform 0.3s ease;
    z-index: 1;
}

.profile-frame-container:hover .profile-offset-border {
    transform: translate(12px, 12px);
}

.profile-avatar-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--color-primary-teal);
    background: linear-gradient(135deg, #006D77 0%, #83C5BE 100%);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

html.dark .profile-avatar-inner {
    background: linear-gradient(135deg, #0F766E 0%, #14B8A6 100%);
    border-color: #14B8A6;
}

.profile-avatar-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-frame-container:hover .profile-avatar-inner img {
    transform: scale(1.06);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background-color: var(--color-primary-teal-light);
    border: 1px solid rgba(0, 109, 119, 0.2);
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary-teal);
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
}

html.dark .status-badge {
    border-color: rgba(20, 184, 166, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* --- Buttons & Interactive Elements --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--color-primary-teal);
    color: #FFFFFF;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    padding: 0.75rem 1.6rem;
    border-radius: 8px;
    border: 2px solid var(--color-primary-teal);
    box-shadow: var(--shadow-btn);
    transition: all 0.25s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: var(--color-primary-teal-hover);
    border-color: var(--color-primary-teal-hover);
    box-shadow: var(--shadow-btn-hover);
    transform: translateY(-2px);
    color: #FFFFFF;
}

html.dark .btn-primary {
    color: #0B111A;
    font-weight: 700;
}

html.dark .btn-primary:hover {
    color: #0B111A;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--color-bg-card);
    color: var(--color-primary-teal);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    padding: 0.75rem 1.6rem;
    border-radius: 8px;
    border: 2px solid var(--color-primary-teal);
    transition: all 0.25s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: var(--color-primary-teal-light);
    transform: translateY(-2px);
    color: var(--color-primary-teal-hover);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Quick Contact Chips */
.contact-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-body);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
    text-decoration: none;
}

.contact-chip:hover {
    border-color: var(--color-primary-teal);
    color: var(--color-primary-teal);
    background-color: var(--color-primary-teal-light);
    transform: translateY(-1px);
}

/* --- Project Cards --- */
.project-card {
    background-color: var(--color-bg-card);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.project-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #0B111A;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Role & Skill Pills */
.pill-role {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: var(--color-primary-teal-light);
    color: var(--color-primary-teal);
    border: 1px solid rgba(0, 109, 119, 0.2);
    transition: all 0.3s ease;
}

html.dark .pill-role {
    border-color: rgba(20, 184, 166, 0.3);
}

.pill-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: var(--color-bg-subtle);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

/* Project Highlights List */
.project-highlights-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 1.25rem 0;
}

.project-highlights-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text-body);
    line-height: 1.5;
    transition: color 0.3s ease;
}

.project-highlights-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-primary-teal);
}

/* --- Skills & Matrix Cards --- */
.skill-matrix-card {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: var(--shadow-subtle);
    transition: all 0.25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.skill-matrix-card:hover {
    border-color: var(--color-primary-teal);
    box-shadow: var(--shadow-card);
    transform: translateY(-2px);
}

.skill-category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.skill-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background-color: var(--color-primary-teal-light);
    color: var(--color-primary-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.skill-chip-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    background-color: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-heading);
    transition: all 0.2s ease;
}

.skill-chip-item:hover {
    background-color: var(--color-bg-card);
    border-color: var(--color-primary-teal);
    color: var(--color-primary-teal);
    box-shadow: 0 2px 8px var(--color-primary-teal-light);
}

/* Software Tool Grid (Without Percentages) */
.software-tool-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.software-tool-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    background-color: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-heading);
    transition: all 0.2s ease;
}

.software-tool-badge:hover {
    background-color: var(--color-bg-card);
    border-color: var(--color-primary-teal);
    color: var(--color-primary-teal);
    box-shadow: 0 2px 8px var(--color-primary-teal-light);
    transform: translateY(-1px);
}

.software-tool-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--color-primary-teal);
    flex-shrink: 0;
}

/* --- Timeline Section --- */
.timeline-container {
    position: relative;
    padding-left: 2rem;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background-color: var(--color-border);
    transition: background-color 0.3s ease;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--color-bg-card);
    border: 3px solid var(--color-primary-teal);
    box-shadow: 0 0 0 4px var(--color-primary-teal-light);
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-card {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-subtle);
    transition: all 0.25s ease;
}

.timeline-card:hover {
    border-color: var(--color-primary-teal);
    box-shadow: var(--shadow-card);
    transform: translateX(4px);
}

/* --- Contact & Social Elements --- */
.contact-card {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: var(--shadow-subtle);
    text-align: center;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}

.contact-card:hover {
    border-color: var(--color-primary-teal);
    box-shadow: var(--shadow-card);
    transform: translateY(-4px);
}

.contact-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--color-primary-teal-light);
    color: var(--color-primary-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: all 0.25s ease;
}

.contact-card:hover .contact-card-icon {
    background-color: var(--color-primary-teal);
    color: #FFFFFF;
    transform: scale(1.08);
}

html.dark .contact-card:hover .contact-card-icon {
    color: #0B111A;
}

/* --- Scroll Reveal Animations --- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

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

/* --- Video Modal Fix & Styling --- */
.video-modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(11, 17, 26, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.video-modal-container {
    position: relative;
    width: 100%;
    max-width: min(900px, 94vw);
    max-height: 90vh;
    background-color: #0B111A;
    border-radius: 12px;
    border: 1px solid rgba(131, 197, 190, 0.3);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(20, 184, 166, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.video-modal-backdrop.active .video-modal-container {
    transform: scale(1);
}

.video-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background-color: #131D2A;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.video-modal-title {
    color: #F8FAFC;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.video-modal-close-btn {
    background: transparent;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.video-modal-close-btn:hover {
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Aspect Ratio 16:9 Container for Iframe */
.video-responsive-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000000;
}

.video-responsive-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
