* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'Rough Pixel';
    src: url('RoughPixel/RoughPixel.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #fafafa;
    --text: #000;
    --dotted-color: #000;
    --spacing: 2rem;
    --gap: 1.5rem;
}

body {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    padding: 0;
    overflow-x: hidden;
    cursor: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom circular cursor */
.cursor {
    width: 8px;
    height: 8px;
    background: var(--text);
    border: 1px solid var(--bg);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    left: 0;
    top: 0;
    will-change: transform;
    display: none;
    box-shadow: 0 0 0 1px var(--bg), 0 0 4px rgba(255, 255, 255, 0.5);
}

@media (hover: hover) and (pointer: fine) {
    .cursor {
        display: block;
    }
    
    body:not(.safari-no-custom-cursor) {
        cursor: none;
    }
    
    body:not(.safari-no-custom-cursor) * {
        cursor: none !important;
    }
}

/* Restore default cursor for Safari */
body.safari-no-custom-cursor,
body.safari-no-custom-cursor * {
    cursor: auto !important;
}

/* Hover scale is now handled in JavaScript for better performance */


.info-link {
    color: var(--text);
    text-decoration: none;
    font-size: 12px;
    font-weight: normal;
    transition: color 0.3s ease-in-out, font-weight 0.3s ease-in-out;
    line-height: 1.4;
}

.info-link:hover {
    color: #7cb342;
    font-weight: bold;
}


/* Info Container - fixed on left side */
.info-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 360px;
    height: 100vh;
    background: var(--bg);
    border-right: 1px dotted var(--dotted-color);
    padding: var(--spacing);
    z-index: 99;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.info-name-link {
    text-decoration: none;
    color: var(--text);
    display: inline-block;
    transition: color 0.3s ease-in-out;
}

.info-name-link:hover {
    color: #7cb342;
}

.info-name-link:hover .info-name {
    font-weight: bold;
}

.info-name {
    font-size: 12px;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.info-birth {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.info-about {
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 0;
    hyphens: none;
    word-break: normal;
}

.info-current {
    font-size: 12px;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    padding-top: 0.75rem;
    border-top: 1px dotted var(--dotted-color);
    margin-top: 0.75rem;
    hyphens: none;
    word-break: normal;
}

.info-previous {
    font-size: 12px;
    margin-bottom: 0;
    line-height: 1.4;
    opacity: 0.7;
    hyphens: none;
    word-break: normal;
}

.info-location {
    font-size: 12px;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    opacity: 0.7;
    padding-top: 0.75rem;
    border-top: 1px dotted var(--dotted-color);
    margin-top: 0.75rem;
    hyphens: none;
    word-break: normal;
}

.info-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px dotted var(--dotted-color);
    margin-top: 0.75rem;
}

.info-links-secondary {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dotted var(--dotted-color);
}

/* Gallery */
.gallery-container {
    margin-left: 360px;
    width: calc(100% - 360px);
    padding: var(--spacing) var(--spacing) calc(var(--spacing) * 1.5) var(--spacing);
    box-sizing: border-box;
    min-height: 100vh;
}

/* Project Text Panel - middle column */
.project-text-panel {
    position: fixed;
    top: 0;
    left: 360px;
    width: 400px;
    height: 100vh;
    background: var(--bg);
    border-right: 1px dotted var(--dotted-color);
    padding: var(--spacing);
    overflow-y: auto;
    z-index: 98;
    box-sizing: border-box;
}

.project-back-link {
    display: inline-block;
    color: var(--text);
    text-decoration: none;
    font-size: 12px;
    margin-bottom: 1.5rem;
    transition: color 0.3s ease-in-out, font-weight 0.3s ease-in-out;
}

.project-back-link:hover {
    color: #7cb342;
    font-weight: bold;
}

/* Project Images Panel - right column */
.project-images-panel {
    margin-left: 760px;
    width: calc(100% - 760px);
    padding: var(--spacing);
    box-sizing: border-box;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: var(--spacing);
}

.project-image-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #e8e8e8 0%, #d0d0d0 100%);
    border: 1px dotted var(--dotted-color);
}

.project-images-panel img {
    width: 100%;
    display: block;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.project-images-panel img:hover {
    opacity: 0.9;
}

.project-images-panel video {
    width: 100%;
    display: block;
    object-fit: cover;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.project-images-panel video:hover {
    opacity: 0.9;
}

.project-images-panel video[controls] {
    pointer-events: auto;
}

.project-images-panel video[controls] {
    pointer-events: auto;
}

.vimeo-embed-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.vimeo-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.project-video-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing);
    width: 100%;
}

.project-video-row video {
    width: 100%;
    height: 100%;
    aspect-ratio: 4/3;
}

/* Typeface Showcase Styles */
.typeface-showcase {
    width: 100%;
    margin-bottom: var(--spacing);
}

.showcase-large {
    width: 100%;
    padding: calc(var(--spacing) * 3);
    background: #000;
    margin-bottom: calc(var(--spacing) * 2);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.showcase-text {
    color: #fff;
    text-align: center;
    word-break: break-word;
}

.showcase-samples {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing) * 1.5);
}

.showcase-sample {
    width: 100%;
    padding: calc(var(--spacing) * 1.5);
    border: 1px dotted var(--dotted-color);
    background: var(--bg);
}

.showcase-sample-large {
    padding: calc(var(--spacing) * 2);
}

.showcase-sample-small {
    padding: var(--spacing);
}

.showcase-sample-label {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.showcase-sample-text {
    color: var(--text);
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
}

/* Typeface Tester Styles */
.typeface-tester {
    width: 100%;
    padding: var(--spacing);
    background: var(--bg);
}

.typeface-tester-header {
    margin-bottom: var(--spacing);
}

.typeface-tester-title {
    font-size: 18px;
    font-weight: normal;
    margin-bottom: 0.5rem;
}

.typeface-tester-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: var(--spacing);
    padding: var(--spacing);
    border: 1px dotted var(--dotted-color);
    background: var(--bg);
}

.tester-control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tester-sliders-row {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-items: flex-start;
}

.tester-sliders-row .tester-control-group {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.tester-sliders-row .tester-control-group label {
    min-width: 100px;
    margin-bottom: 0;
}

.tester-sliders-row .tester-control-group .tester-slider {
    flex: 1;
}

.tester-sliders-row .tester-control-group .tester-value {
    min-width: 50px;
    text-align: left;
}

.tester-control-group label {
    font-size: 12px;
    opacity: 0.7;
}

.tester-input {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    border: 1px dotted var(--dotted-color);
    background: var(--bg);
    color: var(--text);
    resize: vertical;
    line-height: 1.6;
}

.tester-input:focus {
    outline: none;
    border-color: var(--text);
}

.tester-slider {
    width: 100%;
    height: 4px;
    background: var(--bg);
    border: 1px dotted var(--dotted-color);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.tester-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--text);
    border: 1px solid var(--bg);
    cursor: pointer;
}

.tester-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--text);
    border: 1px solid var(--bg);
    cursor: pointer;
}

.tester-value {
    font-size: 12px;
    opacity: 0.7;
    text-align: right;
}

.typeface-tester-display {
    margin-bottom: var(--spacing);
    padding: var(--spacing);
    border: 1px dotted var(--dotted-color);
    background: var(--bg);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tester-output {
    width: 100%;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: var(--text);
}

.typeface-charset {
    margin-bottom: var(--spacing);
}

.charset-title {
    font-size: 14px;
    font-weight: normal;
    margin-bottom: 1rem;
}

.charset-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.charset-section {
    padding: var(--spacing);
    border: 1px dotted var(--dotted-color);
    background: var(--bg);
}

.charset-label {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.charset-text {
    font-size: 24px;
    line-height: 1.4;
    word-break: break-all;
}

.typeface-samples {
    display: flex;
    flex-direction: column;
    gap: var(--spacing);
}

.sample-block {
    padding: var(--spacing);
    border: 1px dotted var(--dotted-color);
    background: var(--bg);
}

.sample-label {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sample-text {
    color: var(--text);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .typeface-tester-controls {
        padding: 1rem;
    }
    
    .charset-text {
        font-size: 18px;
    }
    
    .sample-text {
        font-size: 14px !important;
    }
    
    /* Rough Pixel mobile fixes */
    .showcase-large {
        padding: var(--spacing);
        min-height: 250px;
    }
    
    .showcase-text {
        font-size: clamp(32px, 12vw, 128px) !important;
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: none;
    }
    
    .showcase-sample {
        padding: var(--spacing);
    }
    
    .showcase-sample-large {
        padding: var(--spacing);
    }
    
    .showcase-sample-text {
        font-size: clamp(20px, 8vw, 64px) !important;
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: none;
    }
    
    .showcase-sample-small .showcase-sample-text {
        font-size: clamp(24px, 10vw, 72px) !important;
    }
    
    .tester-sliders-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .tester-sliders-row .tester-control-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tester-sliders-row .tester-control-group label {
        min-width: auto;
    }
    
    .tester-output {
        font-size: clamp(20px, 6vw, 48px) !important;
    }
    
    .charset-text {
        font-size: clamp(12px, 3vw, 18px) !important;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    .sample-text {
        font-size: clamp(14px, 4vw, 24px) !important;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    .sample-block .sample-text[style*="font-size: 64px"] {
        font-size: clamp(24px, 10vw, 64px) !important;
    }
    
    .sample-block .sample-text[style*="font-size: 16px"] {
        font-size: clamp(12px, 3vw, 16px) !important;
    }
    
    .project-title[style*="font-size: 36px"] {
        font-size: clamp(24px, 6vw, 36px) !important;
    }
}


.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    row-gap: 0.5rem;
    width: 100%;
    max-width: 100%;
}

/* Motion Gallery */
.motion-header {
    margin-bottom: 2rem;
}

.motion-title {
    font-size: 24px;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.motion-subtitle {
    font-size: 12px;
    opacity: 0.7;
    line-height: 1.4;
}

.archive-message {
    font-size: 12px;
    opacity: 0.6;
    line-height: 1.6;
    margin-top: 2rem;
    font-style: italic;
}

.motion-featured {
    width: 100%;
    aspect-ratio: 16/9;
    margin-bottom: 3rem;
    overflow: hidden;
    background: #000;
}

.motion-featured-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    background: #000;
}

.motion-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--gap);
    width: 100%;
}

.illustrations-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--gap);
    width: 100%;
}

.illustration-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
}

.illustration-item:hover {
    transform: translateY(-4px);
    opacity: 0.9;
}

.illustration-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: var(--bg);
}

.motion-video-item {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
    background: #000;
}

.motion-video-item:hover {
    transform: translateY(-4px);
    opacity: 0.9;
}

.motion-video-item video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    background: #000;
}

/* Video Zoom Modal */
.video-zoom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
    will-change: opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.video-zoom-modal.active ~ .cursor,
body:has(.video-zoom-modal.active) .cursor,
.video-zoom-modal[style*="flex"] ~ .cursor,
body:has(.video-zoom-modal[style*="flex"]) .cursor {
    background: var(--bg);
    border-color: var(--text);
    box-shadow: 0 0 0 1px var(--text), 0 0 4px rgba(0, 0, 0, 0.5);
}


.video-zoom-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: var(--bg);
    font-size: 32px;
    cursor: pointer;
    z-index: 10001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    line-height: 1;
    padding: 0;
    margin: 0;
    text-align: center;
}

.video-zoom-close::before {
    content: '×';
    display: block;
    line-height: 1;
    margin: 0;
    padding: 0;
    width: 100%;
    text-align: center;
}

.video-zoom-close:hover {
    transform: scale(1.1);
    font-weight: bold;
}

.video-zoom-container {
    width: 100%;
    max-width: 1200px;
    position: relative;
}

#zoomedVideo {
    width: 100%;
    height: auto;
    max-height: 90vh;
    display: block;
    object-fit: contain;
    background: transparent;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    display: block;
    background: #000;
    cursor: pointer;
}

/* Image Zoom Modal */
.image-zoom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
    will-change: opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.image-zoom-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: var(--bg);
    font-size: 32px;
    cursor: pointer;
    z-index: 10001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    line-height: 1;
    padding: 0;
    margin: 0;
    text-align: center;
}

.image-zoom-close::before {
    content: '×';
    display: block;
    line-height: 1;
    margin: 0;
    padding: 0;
    width: 100%;
    text-align: center;
}

.image-zoom-close:hover {
    transform: scale(1.1);
    font-weight: bold;
}

.image-zoom-container {
    width: 100%;
    max-width: 1200px;
    position: relative;
}

#zoomedImage {
    width: 100%;
    height: auto;
    max-height: 90vh;
    display: block;
    object-fit: contain;
    background: transparent;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.image-zoom-modal.active ~ .cursor,
body:has(.image-zoom-modal.active) .cursor,
.image-zoom-modal[style*="flex"] ~ .cursor,
body:has(.image-zoom-modal[style*="flex"]) .cursor {
    background: var(--bg);
    border-color: var(--text);
    box-shadow: 0 0 0 1px var(--text), 0 0 4px rgba(0, 0, 0, 0.5);
}


/* Project Thumbnail */
.project-thumb {
    position: relative;
    cursor: pointer;
    aspect-ratio: 5/4;
    overflow: hidden;
    transition: transform 0.2s ease, opacity 0.2s ease;
    margin: 0;
    padding: 0;
    border: 1px dotted var(--dotted-color);
}

.project-thumb:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    background: var(--bg);
    image-rendering: auto;
    will-change: transform;
    /* Maintain aspect ratio while fitting container */
    max-width: 100%;
    max-height: 100%;
}

.project-thumb img.cycling-thumbnail {
    object-fit: cover;
}

.project-thumb[data-project-id="project-5"] img.cycling-thumbnail {
    object-fit: cover;
    /* Self Declaration fills the container */
}

.project-thumb video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: var(--bg);
    object-position: center;
    /* Maintain aspect ratio while fitting container */
    max-width: 100%;
    max-height: 100%;
}

/* Hide Safari's native play button overlay - comprehensive approach */
.project-thumb video {
    -webkit-media-controls: none !important;
    -webkit-media-controls-enclosure: none !important;
}

.project-thumb video::-webkit-media-controls,
.project-thumb video::-webkit-media-controls-panel,
.project-thumb video::-webkit-media-controls-play-button,
.project-thumb video::-webkit-media-controls-start-playback-button,
.project-thumb video::-webkit-media-controls-overlay-play-button,
.project-thumb video::-webkit-media-controls-overlay-enclosure,
.project-thumb video::-webkit-media-controls-enclosure {
    display: none !important;
    -webkit-appearance: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
}

.motion-thumb-video::-webkit-media-controls,
.motion-thumb-video::-webkit-media-controls-panel,
.motion-thumb-video::-webkit-media-controls-play-button,
.motion-thumb-video::-webkit-media-controls-start-playback-button,
.motion-thumb-video::-webkit-media-controls-overlay-play-button,
.motion-thumb-video::-webkit-media-controls-overlay-enclosure {
    display: none !important;
    -webkit-appearance: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.motion-thumb-video {
    -webkit-media-controls: none !important;
    -webkit-media-controls-enclosure: none !important;
}

/* Additional Safari-specific hiding */
video:not([controls])::-webkit-media-controls,
video:not([controls])::-webkit-media-controls-panel,
video:not([controls])::-webkit-media-controls-play-button {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.project-thumb[data-project-id="project-1"] video {
    object-fit: cover;
    /* Pinoy Plus fills the container */
}

.project-thumb[data-project-id="project-3"] video {
    object-fit: cover;
    /* Breakout Games fills the container */
}

.project-thumb[data-project-id="project-6"] {
    background: #1e4178 !important;
    border: 1px dotted var(--dotted-color) !important;
}

.project-thumb[data-project-id="project-6"] video {
    background: #1e4178 !important;
    transition: opacity 0.2s ease;
}

.project-thumb[data-project-id="project-8"] {
    background: #d3d2dd !important;
    border: 1px dotted var(--dotted-color) !important;
}

.project-thumb[data-project-id="project-8"] video {
    background: #d3d2dd !important;
    transition: opacity 0.2s ease;
}

.project-thumb[data-project-id="project-4"] video {
    object-fit: cover;
    /* Bounce Museum fills the container */
    background: var(--bg);
}

/* Safari play overlay */
.safari-play-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    cursor: pointer;
    padding: 1rem;
    box-sizing: border-box;
}

.safari-play-button {
    background: var(--bg);
    color: var(--text);
    border: 1px dotted var(--dotted-color);
    padding: 0.6rem 1.2rem;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    text-align: center;
    max-width: 90%;
    word-wrap: break-word;
}

.safari-play-button:hover {
    background: var(--text);
    color: var(--bg);
}

/* Safari play all button for project pages and homepage - bottom right, smaller */
.safari-play-all-button {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--bg);
    color: var(--text);
    border: 1px dotted var(--dotted-color);
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 11px;
    font-weight: normal;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    z-index: 9999;
    display: none;
    letter-spacing: 0.05em;
}

.safari-play-all-button:hover {
    background: var(--text);
    color: var(--bg);
}

@media (max-width: 768px) {
    .safari-play-button {
        font-size: 11px;
        padding: 0.5rem 1rem;
    }
    
    .safari-play-all-button {
        bottom: 1rem;
        right: 1rem;
        font-size: 10px;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .safari-play-button {
        font-size: 10px;
        padding: 0.4rem 0.8rem;
    }
    
    .safari-play-all-button {
        bottom: 0.75rem;
        right: 0.75rem;
        font-size: 9px;
        padding: 0.35rem 0.7rem;
    }
}

/* Placeholder styling */
.project-thumb.placeholder {
    background: linear-gradient(135deg, #e8e8e8 0%, #d0d0d0 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-thumb.placeholder::before {
    content: '';
}

.project-thumb.placeholder::after {
    content: attr(data-project-index);
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    font-size: 10px;
    opacity: 0.3;
    color: var(--text);
}

.project-thumb.motion-thumb {
    background: #000;
    position: relative;
    overflow: hidden;
}

.project-thumb.motion-thumb .motion-thumb-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    will-change: opacity;
    backface-visibility: hidden;
}

.project-thumb[data-project-id="illustrations"] {
    background: #000;
}

.project-thumb[data-project-id="illustrations"] {
    position: relative;
    overflow: hidden;
}

.project-thumb[data-project-id="illustrations"] img.cycling-thumbnail {
    object-fit: contain;
    background: #000;
    will-change: opacity;
    backface-visibility: hidden;
}

.project-thumb.font-preview {
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-width: 0; /* Allow flex item to shrink */
    aspect-ratio: 5/4; /* Match video thumbnail aspect ratio */
    container-type: size; /* Enable container queries */
}

.font-preview-text {
    color: var(--text);
    text-align: center;
    word-break: break-word;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    min-width: 0; /* Allow flex item to shrink */
}

.project-tooltip {
    position: fixed;
    background: var(--bg);
    border: 1px dotted var(--dotted-color);
    padding: 0.4rem 0.6rem;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
    transform: translate(5px, 5px);
}

.project-thumb:hover .project-tooltip {
    opacity: 1;
}

.project-tooltip-title {
    font-size: 10px;
    font-weight: normal;
    margin-bottom: 0.15rem;
    line-height: 1.1;
}

.project-tooltip-subtitle {
    font-size: 9px;
    opacity: 0.7;
    line-height: 1.1;
}



.project-header {
    border-top: 1px dotted var(--dotted-color);
    padding-top: var(--spacing);
    margin-bottom: var(--spacing);
}


.project-title {
    font-size: 24px;
    margin-bottom: 1rem;
    font-weight: normal;
}

.project-blurb {
    font-size: 14px;
    margin-bottom: 2rem;
    line-height: 1.8;
}



.project-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: var(--spacing);
    padding: var(--spacing);
    border: 1px dotted var(--dotted-color);
    background: var(--bg);
}

.project-meta-item {
    font-size: 12px;
}

.project-meta-label {
    opacity: 0.6;
    margin-bottom: 0.25rem;
}

.project-meta-value {
    font-weight: normal;
}

.project-text {
    font-size: 14px;
    line-height: 1.8;
    padding: var(--spacing);
    border: 1px dotted var(--dotted-color);
    background: var(--bg);
}

/* Bento-like grid layout for text sections */
.project-text-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing);
}

.project-text p {
    margin-bottom: 1rem;
}

.project-text p:last-child {
    margin-bottom: 0;
}

.project-section {
    border: 1px dotted var(--dotted-color);
    padding: var(--spacing);
    background: var(--bg);
}




/* Responsive */
@media (max-width: 1200px) {
    .project-text-panel {
        width: 350px;
    }
    
    .project-images-panel {
        margin-left: 710px;
        width: calc(100% - 710px);
    }
}

@media (max-width: 768px) {
    .info-container {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px dotted var(--dotted-color);
        padding: var(--spacing);
    }
    
    .project-text-panel {
        position: relative;
        width: 100%;
        height: auto;
        left: 0;
        border-right: none;
        border-bottom: 1px dotted var(--dotted-color);
        padding: var(--spacing);
    }
    
    .project-images-panel {
        margin-left: 0;
        width: 100%;
        padding: var(--spacing);
    }
    
    .gallery-container {
        margin-left: 0;
        width: 100%;
        padding: var(--spacing);
    }
    
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    body {
        padding: 0;
    }
}

@media (max-width: 480px) {
    .gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .info-container,
    .project-text-panel,
    .project-images-panel,
    .gallery-container {
        padding: 1rem;
    }
    
    .motion-gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .motion-title {
        font-size: 20px;
    }
    
    .info-name,
    .info-email,
    .info-about,
    .info-link,
    .archive-link {
        font-size: 11px;
    }
    

    .project-title {
        font-size: 20px;
    }
    
    .project-blurb,
    .project-text {
        font-size: 12px;
    }
    
    /* Rough Pixel mobile fixes - smaller screens */
    .showcase-large {
        padding: 1rem;
        min-height: 200px;
    }
    
    .showcase-text {
        font-size: clamp(28px, 15vw, 64px) !important;
    }
    
    .showcase-sample-text {
        font-size: clamp(16px, 10vw, 48px) !important;
    }
    
    .showcase-sample-small .showcase-sample-text {
        font-size: clamp(20px, 12vw, 56px) !important;
    }
    
    .tester-output {
        font-size: clamp(16px, 8vw, 36px) !important;
    }
    
    .typeface-tester-controls {
        padding: 0.75rem;
        gap: 1rem;
    }
    
    .tester-input {
        min-height: 80px;
        font-size: 11px;
    }
    
}