:root {
    --bg-color: #050505;
    --text-color: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent: #ffffff;
    
    /* Gradient Story Colors - Deep, rich tones */
    --color-1: #050505; /* Deep black/hero */
    --color-2: #0a0f18; /* Deep Navy - About */
    --color-3: #0f0a14; /* Deep Purple - Work */
    --color-4: #0a1210; /* Deep Forest - Projects */
    --color-5: #100a0f; /* Deep Wine - Other */
    --color-6: #050505; /* Final Black - Connect */
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    margin: 0;
    line-height: 1.7;
    overflow-x: hidden;
    transition: background-color 1.2s cubic-bezier(0.22, 1, 0.36, 1); /* Smooth transition */
}

/* Typography */
h1, h2, h3 {
    font-weight: 300;
    margin: 0;
}

h1 {
    font-size: clamp(3.5rem, 9vw, 7rem);
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    font-weight: 300;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.6;
}

/* Nav */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    mix-blend-mode: difference;
}

.logo {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Layout & Sections */
main {
    width: 100%;
}

.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 10%;
    position: relative;
}

.content-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

/* Hero Specifics */
.hero {
    align-items: flex-start;
    justify-content: center;
}

.hero-content {
    z-index: 2;
    max-width: 900px;
}

.hero-subtitle {
    font-size: clamp(1.4rem, 3vw, 2rem) !important;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.85) !important;
}

.scramble-word {
    display: inline-block;
    min-width: 2ch;
    font-family: 'Inter', monospace;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.5;
    pointer-events: auto;
    transition: opacity 1.2s ease;
    cursor: grab;
}

#canvas-container:active {
    cursor: grabbing;
}

/* When zoomed in close, show pointer for clickable core */
body.can-click-core #canvas-container {
    cursor: pointer;
}

/* Story & Work */
.chapter-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.story-text {
    font-size: clamp(1.3rem, 2.5vw, 2.2rem);
    line-height: 1.5;
    max-width: 850px;
    font-weight: 300;
    color: #f0f0f0;
}

.highlight {
    font-weight: 500;
    font-style: italic;
}

/* Project List - Compact grid layout */
.project-list {
    margin-top: 3rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 3rem;
    position: relative;
}

.project-item {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: relative;
}

.project-header {
    display: flex;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-item:hover .project-header {
    transform: translateX(8px);
}

.project-number {
    font-family: 'Inter', sans-serif;
    color: var(--text-secondary);
    margin-right: 1.2rem;
    font-size: 0.75rem;
    opacity: 0.5;
    min-width: 1.2rem;
}

.project-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.project-info h3::after {
    content: '+';
    font-size: 1rem;
    font-weight: 300;
    opacity: 0.4;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.project-item.expanded .project-info h3::after {
    content: '−';
    opacity: 0.7;
}

.project-info .tagline {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.5;
    margin-top: 0.25rem;
}

/* Expandable dropdown content */
.project-dropdown {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1), 
                opacity 0.4s ease;
    margin-top: 0;
    will-change: max-height, opacity;
}

.project-item.expanded .project-dropdown {
    max-height: 1200px;
    opacity: 1;
    margin-top: 1rem;
    padding-top: 1rem;
    padding-bottom: 0.5rem;
    transform: translateZ(0); /* Force GPU acceleration */
}

.project-dropdown p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 1.5rem 0;
    max-width: 500px;
}

.project-dropdown p a {
    position: relative;
    color: var(--text-secondary);
    text-decoration: none;
}

.project-dropdown p a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.1rem;
    height: 1px;
    background: currentColor;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.project-dropdown p a:hover::after {
    opacity: 0.8;
}

.project-dropdown-content-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-dropdown .project-images {
    display: flex;
    gap: 0.75rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.project-dropdown .project-images figure {
    margin: 0;
}

/* Uniform preview card style */
.project-dropdown .project-images img {
    width: 180px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    will-change: transform;
    transform: translateZ(0); /* Force GPU acceleration */
}

.project-dropdown .project-images img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.project-dropdown .project-images img[src]:not([data-src]),
.project-dropdown .project-images img[src] {
    opacity: 1;
}

.project-dropdown .project-images img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.project-dropdown .project-images figcaption {
    font-size: 0.75rem;
    font-style: italic;
    opacity: 0.5;
    margin-top: 0.4rem;
    line-height: 1.4;
    max-width: 180px;
}

.project-dropdown .project-links {
    display: flex;
    gap: 1.5rem;
}

.project-dropdown .project-links a {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.project-dropdown .project-links a:hover {
    opacity: 1;
}

/* Design Portfolio Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-content {
    background: var(--bg-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    max-width: 900px;
    max-height: 85vh;
    width: 90%;
    padding: 2.5rem;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    opacity: 1;
}

.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.modal-subtitle {
    font-size: 0.9rem;
    opacity: 0.5;
    margin-bottom: 2rem;
}

.modal-gallery {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.modal-project {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-project-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
    font-weight: 500;
}

.modal-images {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-images img {
    width: 200px;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
    cursor: pointer;
}

.modal-images img:hover {
    transform: scale(1.03);
}

/* PDF Viewer in Modal */
.modal-pdf-viewer {
    margin-top: 0.5rem;
}

.modal-pdf-viewer .pdf-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.modal-pdf-viewer .pdf-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.modal-pdf-viewer .pdf-link svg {
    opacity: 0.7;
}

/* Fullscreen Image Viewer */
.image-viewer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-viewer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.image-viewer-container {
    position: relative;
    display: inline-block;
}

.image-viewer-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.image-viewer-close {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    color: white;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.2s ease, transform 0.2s ease;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Make all expandable images clickable */
.clickable-image {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    will-change: transform;
    transform: translateZ(0); /* Force GPU acceleration */
}

.clickable-image:hover {
    transform: scale(1.03) translateZ(0);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Link Preview Cards (Twitter/LinkedIn style) */
.link-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.link-preview-card {
    display: block;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.link-preview-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.link-preview-image {
    width: 100%;
    height: 140px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.link-preview-image img {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.link-preview-image img:not([src]),
.link-preview-image img[src=""] {
    display: none;
}

.link-preview-content {
    padding: 1rem 1.25rem 1.25rem;
}

.link-preview-domain {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.5;
    margin-bottom: 0.35rem;
    display: block;
}

.link-preview-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.link-preview-card p {
    font-size: 0.85rem;
    opacity: 0.7;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-card.long-description p {
    -webkit-line-clamp: 5;
}

/* Experiment List */
.experiment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.experiment-list li {
    margin-bottom: 1.5rem;
}

.experiment-list li:last-child {
    margin-bottom: 0;
}

/* Compact 2-column layout for tools */
.experiment-list.compact-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 2rem;
}

.experiment-list.compact-list li {
    margin-bottom: 0;
}

.experiment-list.compact-list .experiment-link {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.experiment-list.compact-list p {
    font-size: 0.8rem;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .experiment-list.compact-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Portfolio Pie Chart */
.portfolio-chart-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.portfolio-pie-chart {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}

.portfolio-legend {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .portfolio-chart-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .portfolio-pie-chart {
        width: 180px;
        height: 180px;
    }
}

.experiment-link {
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s ease;
    margin-bottom: 0.35rem;
}

.experiment-link:hover {
    text-decoration-color: rgba(255, 255, 255, 0.7);
}

.experiment-list p {
    margin: 0;
    opacity: 0.7;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Brand logo placeholders */
.brand-logo {
    width: 100px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1.5rem;
}

.hatch-logo {
    background: #e84c3d;
    color: white;
    letter-spacing: -0.05em;
}

.osfi-logo {
    background: #1e3a5f;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.05em;
}

/* Light mode adjustments */
body.light-mode .project-item {
    border-bottom-color: rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .project-list {
        grid-template-columns: 1fr;
    }
    
    .project-dropdown {
        width: 100%;
        padding-left: 0;
        flex-direction: column;
    }
    
    .project-item:nth-child(even) .project-dropdown {
        margin-left: 0;
        padding-left: 0;
    }
    
    .project-item.expanded .project-dropdown {
        display: block;
    }
    
    .project-dropdown p {
        min-width: 0;
        margin-bottom: 1.5rem;
    }
}

/* Craft Grid */
.craft-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem 6rem;
    margin-top: 5rem;
}

.craft-item h3 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.craft-item p {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .craft-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

/* Contact */
.contact-links {
    display: flex;
    gap: 4rem;
    margin-top: 4rem;
}

.minimal-link {
    font-size: 1.1rem;
    position: relative;
    padding-bottom: 5px;
}

.minimal-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background-color: var(--text-color);
    transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.minimal-link:hover::after {
    width: 100%;
}

.minimal-link:hover {
    opacity: 1;
}

footer {
    padding: 3rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

.wormhole-hint {
    font-size: 0.85rem;
    opacity: 0.75;
    margin-bottom: 1rem;
}

.wormhole-link {
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.5);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: opacity 0.3s ease, text-decoration-color 0.3s ease;
}

.wormhole-link:hover {
    opacity: 1;
    text-decoration-color: rgba(255, 255, 255, 0.9);
}

body.light-mode .wormhole-hint {
    display: none;
}

body.light-mode .wormhole-link {
    text-decoration: none;
}

body.light-mode .wormhole-link:hover {
    text-decoration: none;
}

/* Animations */
.reveal-text {
    opacity: 0;
    transform: translateY(30px);
    animation: reveal 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.delay-200 { animation-delay: 0.2s; }

@keyframes reveal {
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease, transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== LIGHT MODE ==================== */
body.light-mode {
    --bg-color: #ffffff;
    --text-color: #000000;
    --text-secondary: rgba(0, 0, 0, 0.6);
    --accent: rgba(0, 0, 0, 0.5);
    
    --color-1: #ffffff;
    --color-2: #fafafa;
    --color-3: #f5f5f5;
    --color-4: #f8f8f8;
    --color-5: #fafafa;
    --color-6: #ffffff;
    
    background-color: var(--bg-color) !important;
    color: var(--text-color);
}

body.light-mode h1,
body.light-mode h2,
body.light-mode h3 {
    color: #000000;
}

body.light-mode p {
    color: rgba(0, 0, 0, 0.7);
}

body.light-mode .story-text {
    color: #1a1a1a;
}

body.light-mode .chapter-label {
    color: rgba(0, 0, 0, 0.5);
    opacity: 1;
}

body.light-mode .minimal-link {
    color: #000000;
}

body.light-mode .minimal-link::after {
    background-color: #000;
}

body.light-mode .project-item:hover {
    transform: translateX(20px);
}

body.light-mode .project-number {
    color: rgba(0, 0, 0, 0.5);
    opacity: 1;
}

body.light-mode nav {
    mix-blend-mode: normal;
}

body.light-mode .logo,
body.light-mode .nav-links a {
    color: #000000;
}

body.light-mode footer {
    color: rgba(0, 0, 0, 0.5);
}

/* Swap content visibility */
.light-content { display: none; }
.dark-content { display: block; }

body.light-mode .light-content { display: block; }
body.light-mode .dark-content { display: none; }

/* Light mode canvas - gold particles on white */
body.light-mode #canvas-container {
    opacity: 1.0;
}

/* Mode toggle indicator */
.mode-indicator {
    display: none;
}

/* ==================== LIGHT MODE SECTIONS ==================== */

/* Travel Section */
.travel-polaroid-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    justify-items: center;
    align-items: start;
}

@keyframes polaroidFloat {
    0%, 100% {
        transform: translateY(0px) rotate(var(--rotation));
    }
    50% {
        transform: translateY(-8px) rotate(var(--rotation));
    }
}

.travel-photo {
    position: relative;
    aspect-ratio: 1;
    width: 100%;
    max-width: 240px;
    background: #ffffff;
    padding: 12px;
    padding-bottom: 45px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    animation: polaroidFloat 6s ease-in-out infinite;
}

.travel-photo:nth-child(1) { --rotation: -3deg; animation-delay: 0s; }
.travel-photo:nth-child(2) { --rotation: 2deg; animation-delay: 0.5s; }
.travel-photo:nth-child(3) { --rotation: -2deg; animation-delay: 1s; }
.travel-photo:nth-child(4) { --rotation: 3deg; animation-delay: 1.5s; }
.travel-photo:nth-child(5) { --rotation: -1deg; animation-delay: 2s; }
.travel-photo:nth-child(6) { --rotation: 2deg; animation-delay: 2.5s; }
.travel-photo:nth-child(7) { --rotation: -2deg; animation-delay: 3s; }
.travel-photo:nth-child(8) { --rotation: 1deg; animation-delay: 3.5s; }
.travel-photo:nth-child(9) { --rotation: -3deg; animation-delay: 4s; }
.travel-photo:nth-child(10) { --rotation: 2deg; animation-delay: 4.5s; }
.travel-photo:nth-child(11) { --rotation: -1deg; animation-delay: 5s; }
.travel-photo:nth-child(12) { --rotation: 3deg; animation-delay: 5.5s; }
.travel-photo:nth-child(13) { --rotation: -2deg; animation-delay: 0.3s; }
.travel-photo:nth-child(14) { --rotation: 1deg; animation-delay: 0.8s; }

.travel-photo:hover {
    transform: translateY(-12px) rotate(0deg) scale(1.05) !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.15);
    animation-play-state: paused;
    z-index: 10;
}

.travel-photo::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 45px;
    background: rgba(0, 0, 0, 0.03);
    z-index: 0;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 0, 0, 0.3);
    font-size: 0.9rem;
}

body.light-mode .photo-placeholder {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.3);
}

.travel-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    position: relative;
    z-index: 1;
}

.polaroid-caption {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    color: #333;
    z-index: 2;
    pointer-events: none;
}

@media (max-width: 768px) {
    .travel-polaroid-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .travel-photo {
        max-width: 180px;
    }
}

@media (max-width: 480px) {
    .travel-polaroid-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .travel-photo {
        max-width: 220px;
    }
}

/* Music Section */
.music-container {
    margin-top: 3rem;
}

.music-placeholder {
    padding: 4rem 2rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    text-align: center;
    border: 1px dashed rgba(0, 0, 0, 0.1);
}

body.light-mode .music-placeholder {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

.music-placeholder p {
    margin: 0;
    color: rgba(0, 0, 0, 0.5);
}

/* Hobbies Section */
.hobbies-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    margin-top: 3rem;
}

.hobby-item h3 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
    color: #000000;
}

.hobby-image {
    margin: 1rem 0 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
    /* aspect-ratio: 4/3; */
    max-height: 500px;
    background: rgba(0, 0, 0, 0.03);
}

.hobby-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.hobby-item p {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.7;
    margin: 0;
}

.hobby-gallery {
    margin: 1rem 0 1.5rem 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.hobby-gallery-item {
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: rgba(0, 0, 0, 0.03);
}

.hobby-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    display: block;
}

@media (max-width: 768px) {
    .hobbies-list {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Music Section - Album Grid
   ═══════════════════════════════════════════════════════════════════════════ */

.music-container {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    margin-top: 3rem;
}

.music-section-title {
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 1.5rem;
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.album-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, opacity 0.3s ease;
    min-width: 0; /* Prevent grid blowout */
}

.album-card:hover {
    transform: translateY(-4px);
}

.album-card:hover .album-cover img {
    transform: scale(1.05);
}

.album-cover {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0,0,0,0.05), rgba(0,0,0,0.1));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.album-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.album-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.song-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artist-name {
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Skeleton loading state */
.album-card.skeleton .album-cover {
    background: linear-gradient(90deg, 
        rgba(0,0,0,0.06) 25%, 
        rgba(0,0,0,0.1) 50%, 
        rgba(0,0,0,0.06) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.album-card.skeleton .song-title,
.album-card.skeleton .artist-name {
    background: rgba(0,0,0,0.08);
    border-radius: 4px;
    height: 0.85rem;
    width: 80%;
}

.album-card.skeleton .artist-name {
    width: 60%;
    height: 0.75rem;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Responsive */
@media (max-width: 1024px) {
    .album-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .album-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .song-title {
        font-size: 0.8rem;
    }
    
    .artist-name {
        font-size: 0.7rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Guestbook Section
   ═══════════════════════════════════════════════════════════════════════════ */

.guestbook-container {
    margin-top: 3rem;
}

.guestbook-form {
    margin-bottom: 3rem;
}

.canvas-hint {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
}

.guestbook-canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 350px;
    margin-bottom: 1rem;
}

#guestbook-canvas {
    width: 100%;
    max-width: 100%;
    height: 200px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    background: #fff;
    cursor: crosshair;
    touch-action: none;
    display: block;
    box-sizing: border-box;
}

.canvas-actions {
    display: flex;
    gap: 0.75rem;
}

.canvas-btn {
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    background: white;
    color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.canvas-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.25);
}

.canvas-btn.primary {
    background: #000;
    color: white;
    border-color: #000;
}

.canvas-btn.primary:hover {
    background: #222;
}

.canvas-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Doodles Wall */
.guestbook-entries {
    margin-top: 3rem;
}

.doodles-wall {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
}

.doodle-card {
    flex: 0 0 auto;
    max-width: 180px;
    transition: transform 0.2s ease;
}

.doodle-card:hover {
    transform: scale(1.05);
}

.doodle-card img {
    width: 100%;
    height: auto;
    display: block;
}

.no-doodles {
    color: rgba(0, 0, 0, 0.4);
    font-size: 0.9rem;
    font-style: italic;
}

@media (max-width: 768px) {
    .guestbook-canvas-wrapper {
        max-width: 100%;
    }
    
    #guestbook-canvas {
        height: 180px;
    }
    
    .doodles-wall {
        gap: 1rem;
    }
    
    .doodle-card {
        max-width: 140px;
    }
}

@media (max-width: 480px) {
    .doodle-card {
        max-width: 120px;
    }
    
    .canvas-actions {
        flex-direction: column;
    }
    
    .canvas-btn {
        width: 100%;
        text-align: center;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mobile Optimizations
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Navigation */
    nav {
        padding: 1.25rem 1.5rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .nav-links a {
        font-size: 0.75rem;
    }
    
    /* Sections */
    .section {
        padding: 0 5%;
        min-height: auto;
        padding-top: 100px;
        padding-bottom: 80px;
    }
    
    /* Hero */
    .hero {
        min-height: 100vh;
        padding-top: 120px;
    }
    
    h1 {
        font-size: clamp(2.5rem, 10vw, 4rem);
        margin-bottom: 1rem;
    }
    
    h2 {
        font-size: clamp(2rem, 7vw, 3rem);
        margin-bottom: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 4vw, 1.4rem) !important;
    }
    
    .story-text {
        font-size: clamp(1.1rem, 4vw, 1.5rem);
    }
    
    .chapter-label {
        font-size: 0.65rem;
        margin-bottom: 1rem;
    }
    
    /* Contact links */
    .contact-links {
        flex-direction: column;
        gap: 1.5rem;
        margin-top: 2.5rem;
    }
    
    .minimal-link {
        font-size: 1rem;
    }
    
    /* Project items */
    .project-number {
        font-size: 0.7rem;
        min-width: 20px;
    }
    
    .project-info h3 {
        font-size: 1.1rem;
    }
    
    .tagline {
        font-size: 0.75rem;
    }
    
    /* Modal */
    .modal-content {
        padding: 2rem 1.5rem;
        max-height: 90vh;
    }
    
    .modal-gallery {
        gap: 2rem;
    }
    
    .modal-images {
        grid-template-columns: 1fr;
    }
    
    /* Music section titles */
    .music-section-title {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }
    
    .music-container {
        gap: 3rem;
    }
    
    /* Hobby gallery (sports 2x2) */
    .hobby-gallery {
        gap: 0.5rem;
    }
    
    .hobby-item h3 {
        font-size: 1.25rem;
    }
    
    .hobby-item p {
        font-size: 0.9rem;
    }
    
    /* Travel */
    .destination-name {
        font-size: 1rem;
    }
    
    .travel-more-coming {
        font-size: 0.8rem !important;
        margin-top: 2rem !important;
    }
    
    /* Footer */
    footer {
        padding: 2rem 1.5rem;
    }
    
    .wormhole-hint {
        font-size: 0.75rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    nav {
        padding: 1rem;
    }
    
    .nav-links {
        gap: 0.75rem;
    }
    
    .nav-links a {
        font-size: 0.65rem;
        letter-spacing: 0.03em;
    }
    
    .section {
        padding: 0 4%;
        padding-top: 80px;
        padding-bottom: 60px;
    }
    
    h1 {
        font-size: clamp(2rem, 12vw, 3rem);
    }
    
    h2 {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }
    
    .story-text {
        font-size: 1rem;
    }
    
    /* Album grid - single column on very small screens */
    .album-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    /* Hobby gallery stays 2x2 but smaller gaps */
    .hobby-gallery {
        gap: 0.35rem;
    }
    
    .hobby-gallery-item {
        border-radius: 6px;
    }
    
    /* Travel photos */
    .travel-photo {
        border-radius: 8px;
    }
    
    /* Links and buttons - bigger touch targets */
    .minimal-link {
        padding: 0.5rem 0;
    }
    
    .experiment-link {
        padding: 0.25rem 0;
    }
    
    /* Project dropdowns */
    .project-dropdown p {
        font-size: 0.9rem;
    }
    
    .project-links a {
        font-size: 0.85rem;
        padding: 0.5rem 0;
        display: inline-block;
    }
}

/* Landscape phone optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding-top: 80px;
        padding-bottom: 40px;
    }
    
    .section {
        min-height: auto;
        padding-top: 60px;
        padding-bottom: 60px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch */
    .album-card:hover {
        transform: none;
    }
    
    .album-card:hover .album-cover img {
        transform: none;
    }
    
    .travel-photo:hover {
        transform: none;
    }
    
    .project-item:hover .project-header {
        transform: none;
    }
    
    /* Active states instead */
    .album-card:active {
        transform: scale(0.98);
    }
    
    .travel-photo:active {
        transform: scale(0.98);
    }
    
    /* Bigger touch targets */
    .nav-links a {
        padding: 0.5rem;
        margin: -0.5rem;
    }
    
    .minimal-link {
        padding: 0.75rem 0;
    }
}
