/* Google Material Inspired Design System */
:root {
    /* Fonts */
    --font-main: 'Open Sans', system-ui, -apple-system, sans-serif;

    /* Light Mode Colors (Default) */
    --bg-body: #ffffff;
    --bg-surface: #f8f9fa;
    /* Google Grey 50 */
    --bg-card: #ffffff;
    --text-main: #202124;
    /* Google Grey 900 */
    --text-muted: #5f6368;
    /* Google Grey 700 */
    --primary: #1a73e8;
    /* Google Blue 600 */
    --primary-hover: #174ea6;
    --accent-gradient: linear-gradient(135deg, #1a73e8, #8ab4f8);
    --card-grad-start: #e8eaed;

    /* Shadows & Radius */
    --shadow-sm: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --radius-lg: 24px;
    --radius-md: 12px;
    --radius-full: 9999px;

    /* Transition */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-body: #202124;
    /* Google Dark Background */
    --bg-surface: #303134;
    /* Google Dark Surface */
    --bg-card: #303134;
    --text-main: #e8eaed;
    --text-muted: #9aa0a6;
    --primary: #8ab4f8;
    /* Lighter blue for dark mode */
    --primary-hover: #aecbfa;
    --accent-gradient: linear-gradient(135deg, #8ab4f8, #c58af9);
    --card-grad-start: #202124;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    /* Bold */
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2.25rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 5rem 0;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
    will-change: transform;
}

[data-theme="dark"] header {
    background: rgba(32, 33, 36, 0.8);
}

/* Smart Sticky states */
header.header-hidden:not(:has(.nav-links.active)) {
    transform: translateY(-100%);
}

header.header-scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] header.header-scrolled {
    background: rgba(32, 33, 36, 0.95);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    /* Above modal */
}

.hamburger span {
    width: 100%;
    height: 3px;
    background-color: var(--text-main);
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 2px;
}

/* Hamburger Animation */
.hamburger.active span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    transform: translateY(-8.5px) rotate(-45deg);
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    position: relative;
    height: 40px;
    min-width: 40px;
    /* Ensure at least enough space for the photo */
}

/* Rainbow Flash for Logo Transformation */
.logo-flash-overlay {
    position: absolute;
    inset: -5px -15px;
    background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    background-size: 400%;
    z-index: -1;
    border-radius: var(--radius-md);
    filter: blur(15px);
    opacity: 0;
    pointer-events: none;
    transition: none;
}

.logo.trigger-flash .logo-flash-overlay {
    animation: logo-rainbow-flash 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes logo-rainbow-flash {
    0% {
        opacity: 0;
        transform: scale(0.85);
        background-position: 0% 50%;
    }

    30% {
        opacity: 0.55;
        transform: scale(1.05);
    }

    100% {
        opacity: 0;
        transform: scale(1.15);
        background-position: 100% 50%;
    }
}

.logo-text-wrapper {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
}

.logo-project-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) translateY(10px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    white-space: nowrap;
}

.logo-home-link {
    display: block;
    width: 32px;
    height: 32px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-project-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    display: block;
}

.logo-project-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: color var(--transition-fast);
}

@media (max-width: 768px) {
    .logo-project-title {
        max-width: 15ch;
        /* Limit to roughly 15 characters on mobile */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.logo-project-title:hover {
    color: var(--primary);
}

/* Project Showcase Modal */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.project-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: background 0.4s ease;
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    width: 90%;
    max-width: 900px;
    /* Increased for two-column */
    padding: 0;
    /* Handled by internal columns */
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    overflow: hidden;
    display: flex;
    text-align: left;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 2001;
}

[data-theme="dark"] .modal-content {
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-info {
    flex: 1;
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-image-container {
    flex: 1.2;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.project-modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: fixed;
    /* Fixed relative to screen */
    top: 2rem;
    right: 2rem;
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--text-muted);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-main);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2100;
    /* Above overlay and content */
}

.modal-close:hover {
    background: var(--bg-body);
    border-color: var(--primary);
    color: var(--primary);
    transform: rotate(90deg) scale(1.1);
    box-shadow: var(--shadow-md);
}

.modal-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.modal-title {
    font-size: 3rem;
    margin-bottom: 0;
    color: var(--text-main);
    line-height: 1.1;
}

.modal-image {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: block;
}

.modal-branding {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 2200;
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.project-modal.active .modal-branding {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.branding-photo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 50%;
}

.branding-text {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-main);
}

@media (max-width: 992px) {
    .modal-content {
        flex-direction: column;
        max-width: 600px;
    }

    .modal-info {
        padding: 3rem 2rem 2rem 2rem;
        text-align: center;
    }

    .modal-title {
        font-size: 2rem;
    }

    .modal-image-container {
        padding: 0 2rem 3rem 2rem;
    }
}

header.header-project-mode .logo-text-wrapper {
    opacity: 0;
    transform: translateY(-50%) translateY(-10px);
    pointer-events: none;
}

header.header-project-mode .logo-project-wrapper {
    opacity: 1;
    transform: translateY(-50%);
    pointer-events: all;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast);
}

.theme-toggle:hover {
    background-color: var(--bg-surface);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Hero Section */
.hero {
    min-height: 90vh;
    /* Increased height for globe space */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 1100px;
    z-index: 1;
    animation: fadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Old hero styles removed (hero-image) */

.hero-title {
    padding-top: 4rem;
    margin-bottom: 1.5rem;
    background: var(--text-main);
    background-clip: text;
    -webkit-background-clip: text;
    font-size: 4rem;
    /* Slightly larger */
}

.hero-subtitle {
    font-size: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Project Grid */
.projects-grid {
    display: grid;
    /* Adjusted to 400px for better balance */
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    margin-top: 4rem;
    perspective: 1000px;
}

.project-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    display: block;
    position: relative;
    opacity: 0;
    /* JS will trigger fade in */
    animation: fadeUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.card-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    background-color: var(--bg-surface);
    transition: transform 0.5s ease;
}

.project-card:hover .card-image {
    transform: scale(1.03);
}

.card-content {
    padding: 1.5rem 2rem;
}

.card-category {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* About Page */
.about-hero {
    text-align: center;
}

.about-hero h1 {
    padding-top: 4rem;
}

.about-hero h1,
.about-hero p {
    margin-left: auto;
    margin-right: auto;
}

/* Project Overview Section */
.project-overview {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
    margin-bottom: 4rem;
    width: 100%;
    /* Ensure background is visible */
    background-size: cover;
    background-position: center;
}

.overview-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2.5rem;
    max-width: 1100px;
    width: 100%;
}

@media (max-width: 480px) {
    .overview-grid {
        gap: 1.5rem;
    }
}

.project-overview .case-section-title {
    color: var(--text-main);
    /* Match other text */
    margin-bottom: 4rem;
    text-align: center;
    /* Removed text-shadow to be cleaner like other sections */
}

/* Unique Gradients - Light Mode (Pastel/Soft) */
.gradient-default {
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
}

.gradient-project-fallback {
    /* Discrete Light Blue */
    background: linear-gradient(135deg, #f5f8ff 0%, #e8efff 100%);
}

.gradient-cinesnack {
    /* Light Red + Very Light Yellow */
    background: linear-gradient(135deg, #ffedea 0%, #fffdf0 100%);
}

.gradient-singsong {
    /* Pink + Light Blue very light */
    background: linear-gradient(135deg, #fff0f5 0%, #e6f7ff 100%);
}

.gradient-miasa {
    /* Very Light Green + Light Blue */
    background: linear-gradient(135deg, #f0fff4 0%, #e6f7ff 100%);
}

/* Dark Mode Gradients (Darker/Muted) */
[data-theme="dark"] .gradient-default {
    background: linear-gradient(135deg, #232526 0%, #414345 100%);
}

[data-theme="dark"] .gradient-project-fallback {
    /* Discrete Deep Blue for Dark Mode */
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

[data-theme="dark"] .gradient-cinesnack {
    /* Deep Red + Deep Amber/Gold */
    background: linear-gradient(135deg, #4a0d0d 0%, #4a3b00 100%);
}

[data-theme="dark"] .gradient-singsong {
    /* Deep Pink + Deep Blue */
    background: linear-gradient(135deg, #4a0d36 0%, #0d1b4a 100%);
}

[data-theme="dark"] .gradient-miasa {
    /* Deep Green + Deep Teal/Blue */
    background: linear-gradient(135deg, #0d3b15 0%, #0d2b3a 100%);
}

/* Specific overrides removed as they are now handled above */

.overview-card {
    background: var(--bg-body);
    /* Main background color as requested */
    padding: 4rem 3rem;
    /* Increased padding as requested */
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-smooth);
    width: 100%;
    max-width: 400px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .overview-card {
        padding: 3rem 1.5rem;
    }
}

.expertise-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.expertise-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.expertise-item {
    background: linear-gradient(to bottom left, var(--card-grad-start), var(--bg-surface));
    padding: 2rem;
    border-radius: var(--radius-lg);
    transition: transform var(--transition-fast);
}

.expertise-item:hover {
    transform: translateY(-5px);
}

.expertise-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-body);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {

    h1,
    .hero-title,
    .about-hero h1 {
        font-size: 2.5rem;
        padding-top: 2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile Navigation Modal */
    .nav-links {
        display: flex;
        /* Force flex display */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        /* Modern mobile height */
        background-color: var(--bg-body);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        /* Slightly reduced gap */
        z-index: 1000;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        pointer-events: all;
    }

    .nav-link {
        font-size: 2rem;
        font-weight: 700;
        text-transform: uppercase;
        /* Match user request for capitalized vibe if needed */
        letter-spacing: 0.05em;
    }

    .hamburger {
        display: flex;
    }

    /* Adjust theme toggle in modal */
    .theme-toggle svg {
        width: 32px;
        height: 32px;
    }

    /* Reduce Language Toggle size on mobile so it's not huge like the menu links */
    #lang-toggle {
        font-size: 1.125rem;
        /* 18px */
        font-weight: 600;
    }
}

/* --- Portfolio Case Study System --- */

/* Section Layouts */
.case-section {
    padding: 6rem 0;
    width: 100%;
}

.case-header {
    padding-top: 8rem;
    padding-bottom: 4rem;
}

.case-container {
    max-width: 1100px;
    /* Increased for larger images */
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 10;
}

.text-center {
    text-align: center;
}

/* Typography for Cases */
.case-title {
    font-size: 4rem;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.case-subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 4rem auto;
    font-weight: 400;
}

.case-section-title {
    font-size: 2.5rem;
    /* Distinct from global h2 */
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.case-text p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    /* Optimal reading width handled by parent */
}

.case-content-block {
    margin-bottom: 4rem;
}

/* Image Layouts */
.full-width-image-container {
    width: 100%;
    overflow: hidden;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.full-width-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.large-image-container {
    width: 100%;
    margin-top: 2rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.case-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
}

.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

.two-col-grid .case-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 4/3;
    /* Consistent aspect ratio */
}

/* Mobile Responsiveness for Cases */
@media (max-width: 768px) {
    .case-title {
        font-size: 2.5rem;
    }

    .case-subtitle {
        font-size: 1.125rem;
        margin-bottom: 2rem;
    }

    .two-col-grid {
        grid-template-columns: 1fr;
        /* Stack on mobile */
        gap: 1.5rem;
    }

    .case-section {
        padding: 4rem 0;
    }

    .case-header {
        padding-top: 10rem;
    }
}

/* Scroll Reveal Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays handled via nth-child logic if needed, 
   but for now we'll just let them trigger naturally on scroll 
   or add specific classes if we need strict staggering. 
   Natural scroll usually provides enough stagger. */

/* Reduce Motion Preference */
@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        transition: none;
        opacity: 1;
        transform: none;
    }

    .hero-content,
    .project-card {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* --- UX Portfolio Specifics --- */

/* User Research & Usability Grids */
.case-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.ux-card {
    background: var(--bg-surface);
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}

.ux-card:hover {
    transform: translateY(-5px);
}

.ux-card-title {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.ux-card p {
    font-size: 1rem;
    margin-bottom: 0;
}

/* Usability Study Parameters */
.parameter-image {
    width: 100%;
    height: 200px;
    /* Fixed smaller height */
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

/* Usability Findings (Photo Left, Text Right) */
.finding-item {
    display: flex;
    align-items: stretch;
    margin-bottom: 3rem;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.finding-content {
    padding: 2rem;
    background: transparent;
    margin-top: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 0;
}

.finding-image {
    width: 300px;
    /* Small fixed width */
    min-height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

@media (max-width: 768px) {
    .finding-item {
        flex-direction: column;
    }

    .finding-image {
        width: 100%;
        height: 200px;
    }
}

/* Next Steps (Single Item: Left Text, Right Image) */
.next-step-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
    margin-top: 3rem;
}

.next-step-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.step-number {
    font-size: 6rem;
    /* Slightly larger for impact since it's the only one */
    font-weight: 800;
    line-height: 0.8;
    color: var(--text-main);
    /* Standardized solid text color */
    opacity: 0.8;
    margin-bottom: 1rem;
    font-family: var(--font-main);
}


.step-description {
    font-size: 1.25rem;
    color: var(--text-main);
}

/* Carousel Styles */
.carousel-container {
    position: relative;
    width: 100%;
    min-height: 250px;
    overflow: hidden;
}

.carousel-slides {
    display: grid;
    grid-template-areas: "stack";
    width: 100%;
    /* Remove scroll props */
    cursor: grab;
    /* Indicate draggable/swipeable */
    touch-action: pan-y;
    /* Allow vertical scroll, handle horizontal in JS */
    user-select: none;
    /* Prevent text selection during swipe */
}

.carousel-slide {
    grid-area: stack;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    pointer-events: none;
    /* Let clicks pass through inactive slides if needed, or just z-index */
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
}



.carousel-dots {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    width: 100%;
}

.dots-group {
    display: flex;
    gap: 0.75rem;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
    opacity: 0.3;
}

.dot:hover {
    opacity: 0.6;
}

.dot.active {
    background-color: var(--primary);
    opacity: 1;
    transform: scale(1.2);
}

.carousel-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    transition: color var(--transition-fast), transform var(--transition-fast);
    opacity: 0.6;
}

.carousel-toggle:hover {
    color: var(--primary);
    opacity: 1;
}

.carousel-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.toggle-text {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.next-step-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    object-fit: cover;
}

@media (max-width: 768px) {
    .next-step-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .step-number {
        font-size: 4rem;
    }
}

/* Force standardized text color for UX Cards */
.overview-title,
.ux-card-title,
.overview-text,
.ux-card p,
.finding-content h3,
.finding-content p {
    color: var(--text-main);
}

/* --- Project Navigation --- */
.project-navigation {
    padding: 6rem 0;
    border-top: 1px solid var(--bg-surface);
    margin-top: 4rem;
}

.nav-closing-section {
    max-width: 1100px;
    margin: 0 auto 4rem auto;
    padding: 0 2rem;
    text-align: center;
}

.nav-closing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.nav-closing-photo {
    width: 50px;
    height: 50px;
    object-fit: cover;
    flex-shrink: 0;
}

.nav-closing-text {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-main);
    max-width: 300px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .nav-closing-photo {
        width: 45px;
        height: 45px;
    }

    .nav-closing-text {
        font-size: 1rem;
    }
}

.nav-cards-container {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.nav-card {
    flex: 1;
    max-width: 450px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.nav-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.nav-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background-color: var(--bg-surface);
}

.nav-card-content {
    padding: 1.25rem 1.5rem;
}

.nav-label {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.nav-project-title {
    font-size: 1.125rem;
    margin-bottom: 0;
}

/* Specific alignments */
.nav-card.prev {
    text-align: left;
}

.nav-card.next {
    text-align: right;
}

@media (max-width: 768px) {
    .nav-cards-container {
        flex-direction: column-reverse;
        align-items: center;
    }

    .nav-card {
        width: 100%;
        max-width: 100%;
    }

    .nav-card.next {
        text-align: left;
        /* Stacked, better to keep them consistent on mobile */
    }
}

/* --- Return to Project Card (About Page) --- */
.return-card {
    display: flex;
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    background: var(--bg-surface);
    padding: 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
    transform: translateY(calc(100% + 2rem));
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
}

[data-theme="dark"] .return-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.return-card.visible {
    transform: translateY(0);
    opacity: 1;
}

/* Utility for About page when card is present */
.has-return-card main {
    padding-bottom: 8rem;
}

/* Hide card when footer is visible */
.return-card.footer-visible {
    transform: translateY(calc(100% + 2rem));
    opacity: 0;
    pointer-events: none;
}

@media (min-width: 500px) {
    .return-card {
        bottom: 2rem;
        left: auto;
        right: 2rem;
        border-radius: var(--radius-md);
        transform: translateY(20px);
    }

    .return-card.visible {
        transform: translateY(0);
    }

    .return-card.footer-visible {
        transform: translateY(20px);
    }
}

.return-content {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.return-content:hover {
    background-color: var(--bg-body);
}

.return-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.return-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.return-project-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.return-project-image {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.return-close {
    background: none;
    border: none;
    padding: 1rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid var(--border-color, rgba(0, 0, 0, 0.05));
    transition: color var(--transition-fast), background-color var(--transition-fast);
    height: 100%;
    align-self: stretch;
}

[data-theme="dark"] .return-close {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.return-close:hover {
    color: var(--text-main);
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .return-close:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.return-close svg {
    width: 18px;
    height: 18px;
}

/* Footer & Scroll Top */
footer.section {
    padding-top: 0.5rem;
    /* Pushed arrow higher up */
    padding-bottom: 4rem;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    /* Adjusted gap */
}

@property --reveal-progress {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 0%;
}

.scroll-top {
    position: relative;
    background: var(--bg-surface);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        color var(--transition-fast),
        background-color var(--transition-fast);
    border: 1px solid transparent;
    /* Container for relative sizing */
    box-shadow: var(--shadow-sm);
    margin-bottom: 2.5rem;
    z-index: 10;
}

/* Rainbow Gradient Shadow */
.scroll-top::before {
    content: '';
    position: absolute;
    inset: -3px;
    /* Slightly larger for better glow visibility */
    background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    background-size: 400%;
    z-index: -1;
    border-radius: 50%;
    filter: blur(12px);
    /* Softer, more elegant blur */
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Revealing Border Path */
.scroll-top::after {
    content: '';
    position: absolute;
    inset: -2px;
    /* Adjusted for thicker border */
    border: 2.5px solid var(--text-main);
    border-radius: 50%;
    opacity: 0;
    /* Circular path mask */
    --reveal-progress: 0%;
    mask-image: conic-gradient(#000 var(--reveal-progress), transparent var(--reveal-progress));
    -webkit-mask-image: conic-gradient(#000 var(--reveal-progress), transparent var(--reveal-progress));
    transition: --reveal-progress 0.6s cubic-bezier(0.4, 0, 0.1, 1), opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.scroll-top:hover {
    transform: translateY(-6px);
    /* Slightly more elevation */
}

.scroll-top:hover::before {
    opacity: 0.55;
    /* Balanced transparency */
    animation: rainbow-glow 10s linear infinite;
}

.scroll-top:hover::after {
    opacity: 1;
    --reveal-progress: 100%;
}

@keyframes rainbow-glow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.scroll-top svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.5;
    position: relative;
    z-index: 2;
    transition: transform 0.4s ease;
}

.scroll-top:hover svg {
    transform: translateY(-2px);
    /* Micro-animation for the icon itself */
}

.copyright-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}