/* CANON Terminal - Hyper Minimal */

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

:root {
    --bg: #0a0a0a;
    --text: #e0e0e0;
    --text-dim: #666;
    --cursor: #e0e0e0;
}

html, body {
    height: 100%;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--text);
    color: var(--bg);
}

/* Terminal Container */
.terminal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 3rem;
}

.terminal-content {
    max-width: 600px;
    margin-bottom: 3rem;
}

/* Header - CANON title */
.terminal-header {
    margin-bottom: 2rem;
}

.terminal-header .typed-line {
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: 0.15em;
}

/* Body text */
.terminal-body {
    margin-bottom: 3rem;
}

.terminal-body p {
    margin-bottom: 0.25rem;
    color: var(--text-dim);
}

/* Typed line animation */
.typed-line {
    display: inline;
    visibility: hidden;
}

.typed-line.typing {
    visibility: visible;
}

.typed-line.typing::after {
    content: '_';
    animation: blink 0.7s steps(1) infinite;
}

.typed-line.done::after {
    display: none;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Prompt area */
.terminal-prompt {
    margin-bottom: 1rem;
}

.prompt-line {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.prompt-symbol {
    color: var(--text-dim);
    user-select: none;
}

.prompt-options {
    display: flex;
    gap: 1.5rem;
}

.prompt-btn {
    background: none;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.2s;
}

.prompt-btn:hover {
    opacity: 0.7;
}

.prompt-btn.secondary {
    color: var(--text-dim);
}

.prompt-label {
    color: var(--text-dim);
    white-space: nowrap;
}

/* Terminal Input */
.terminal-input {
    background: none;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: inherit;
    outline: none;
    flex: 1;
    min-width: 0;
    caret-color: var(--cursor);
}

.terminal-input::placeholder {
    color: var(--text-dim);
    opacity: 0.5;
}

/* Forms */
.terminal-form {
    margin-top: 1rem;
}

.form-actions {
    margin-top: 1rem;
}

.form-actions .prompt-btn {
    margin-right: 1.5rem;
}

.form-back {
    margin-top: 1.5rem;
}

/* Messages */
.terminal-error {
    color: #ff6b6b;
    margin-top: 1rem;
    font-size: 13px;
}

.terminal-success {
    color: var(--text-dim);
    margin-top: 1rem;
    font-size: 13px;
}

/* Project CV Section */
.project-cv {
    margin-top: 3rem;
}

.project-row {
    display: flex;
    gap: 4rem;
    align-items: flex-start;
}

.project-grid {
    position: relative;
    width: 380px;
    flex-shrink: 0;
}

.project-label {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    min-height: 1.2em;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.project-label.visible {
    opacity: 1;
}

/* Collapsible Project Sections */
.project-section {
    padding: 0.25rem 0;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.project-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0.5rem 0;
}

.project-title {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.project-date {
    color: #444;
    font-weight: 400;
    margin-left: 0.75rem;
    text-transform: none;
    letter-spacing: 0.02em;
}

.project-toggle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.7;
    flex-shrink: 0;
}

.project-toggle:hover {
    opacity: 1;
    transform: scale(1.2);
}

.project-section.expanded .project-toggle {
    opacity: 1;
}

.project-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    padding: 0;
}

.project-section.expanded .project-body {
    max-height: 600px;
    opacity: 1;
    padding: 1rem 0 0.5rem;
}

.project-description {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.7;
    max-width: 500px;
    margin-bottom: 0.75rem;
}

.project-role {
    color: #555;
    font-size: 11px;
    font-style: italic;
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
}

.project-images {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.project-images .gallery-image {
    width: 140px;
    height: 100px;
    object-fit: cover;
    border-radius: 3px;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.project-images .gallery-image:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .project-images .gallery-image {
        width: 100px;
        height: 70px;
    }
}

/* Project body with side image */
.project-body-with-image {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.project-body-with-image .project-text {
    flex: 1;
}

.project-image-single {
    flex-shrink: 0;
}

.project-image-single .gallery-image {
    width: 180px;
    height: auto;
    max-height: 140px;
    object-fit: cover;
    border-radius: 3px;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.project-image-single .gallery-image:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .project-body-with-image {
        flex-direction: column;
        gap: 1rem;
    }

    .project-image-single .gallery-image {
        width: 140px;
        max-height: 100px;
    }
}

/* Artwork Mosaic */
.artwork-mosaic {
    position: relative;
    height: 280px;
}

.grid-label {
    display: block;
    margin-top: 0.75rem;
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.02em;
}

.mosaic-tile {
    position: absolute;
    background-size: cover;
    background-position: center;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 3px;
}

/* Project Hero - Blurred Teaser */
.project-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-shrink: 0;
}

.hero-blur {
    position: relative;
    width: 248px;
    height: 248px;
    background: #0a0a0a;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid #333;
}

.hero-blur::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 25% 30%, rgba(80, 80, 90, 0.4) 0%, transparent 40%),
        radial-gradient(circle at 75% 70%, rgba(60, 60, 70, 0.3) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(40, 40, 50, 0.5) 0%, transparent 60%);
    filter: blur(20px);
}

.hero-blur::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.15;
    mix-blend-mode: overlay;
}

.hero-text {
    margin-top: 0.75rem;
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.02em;
}


/* Artwork Info Panel (hover) */
.artwork-info-panel {
    position: relative;
    width: 280px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.artwork-info-panel.visible {
    opacity: 1;
}

.artwork-info-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 3px;
    margin-bottom: 1rem;
}

.artwork-info-meta {
    font-size: 12px;
    line-height: 1.6;
}

.artwork-info-meta p {
    margin-bottom: 0.25rem;
}

.artwork-artist {
    color: var(--text);
    font-weight: 500;
}

.artwork-title {
    color: var(--text-dim);
}

.artwork-token {
    color: var(--text-dim);
    font-size: 11px;
}

.artwork-placed {
    color: var(--text-dim);
    font-size: 11px;
    margin-top: 0.5rem;
}

.artwork-sold {
    color: #d4af37;
    font-size: 11px;
    font-weight: 500;
}

/* Project Detailed Row (with images and text) */
.project-row-detailed {
    flex-direction: column;
    gap: 1rem;
}

.project-content {
    max-width: 700px;
}

.project-gallery {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.gallery-image {
    flex: 1;
    height: 140px;
    object-fit: cover;
    border-radius: 3px;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-image:hover {
    opacity: 1;
    transform: scale(1.02);
}

.project-caption {
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.6;
}

.project-caption .project-role {
    color: var(--text);
    font-style: italic;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
    cursor: zoom-out;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

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

.lightbox-close:hover {
    color: var(--text);
}

@media (max-width: 768px) {
    .project-gallery {
        gap: 0.35rem;
    }

    .gallery-image {
        height: 100px;
    }

    .project-caption {
        font-size: 11px;
    }
}

/* Project Divider */
.project-divider {
    height: 1px;
    background: #222;
    margin: 2.5rem 0;
}

/* Desktop/Mobile visibility */
.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

/* Info Sections */
.info-panel {
    display: none;
    margin-top: 1.5rem;
    padding-left: 1.25rem;
    border-left: 1px solid #333;
    max-width: 500px;
}

.info-panel.active {
    display: block;
}

.info-panel p {
    color: var(--text-dim);
    margin-bottom: 0.75rem;
    font-size: 13px;
    line-height: 1.7;
}

.info-panel .info-stat {
    color: var(--text);
    margin-bottom: 1rem;
}

.info-panel .info-close {
    color: var(--text-dim);
    cursor: pointer;
    font-size: 12px;
    margin-top: 1rem;
    display: inline-block;
}

.info-panel .info-close:hover {
    color: var(--text);
}

/* Responsive */
@media (max-width: 768px) {
    .terminal {
        padding: 2rem 1.25rem;
    }

    .terminal-header .typed-line {
        font-size: 1.5rem;
    }

    body {
        font-size: 13px;
    }

    .project-row {
        flex-direction: column;
    }

    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: flex;
        width: 100%;
        height: 200px;
        margin-top: 2rem;
    }

    .artwork-mosaic {
        height: 240px;
    }

    .info-panel {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .terminal {
        padding: 1.5rem 1rem;
    }

    .terminal-header .typed-line {
        font-size: 1.25rem;
    }

    .prompt-options {
        flex-wrap: wrap;
        gap: 0.75rem 1.25rem;
    }

    .artwork-mosaic {
        gap: 1px;
    }

    .mosaic-tile {
        /* Size set by JS */
    }

    .terminal-input {
        font-size: 16px; /* Prevents iOS zoom */
    }
}

/* Mobile Bottom Sheet */
.bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 100;
}

.bottom-sheet-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 101;
    max-height: 85vh;
    overflow: hidden;
}

.bottom-sheet.visible {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 36px;
    height: 4px;
    background: #444;
    border-radius: 2px;
    margin: 12px auto;
}

.bottom-sheet-content {
    padding: 0 1.5rem 2rem;
}

.bottom-sheet-image {
    width: 100%;
    height: 240px;
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    margin-bottom: 1.25rem;
}

.bottom-sheet-meta {
    font-size: 14px;
    line-height: 1.6;
}

.bottom-sheet-meta p {
    margin-bottom: 0.35rem;
}

.bottom-sheet-artist {
    color: var(--text);
    font-weight: 500;
    font-size: 16px;
}

.bottom-sheet-title {
    color: var(--text-dim);
}

.bottom-sheet-token {
    color: var(--text-dim);
    font-size: 13px;
}

.bottom-sheet-placed {
    color: var(--text-dim);
    font-size: 13px;
    margin-top: 0.75rem;
}

.bottom-sheet-sold {
    color: #d4af37;
    font-size: 13px;
    font-weight: 500;
}

/* Hide desktop hover panel on mobile */
@media (max-width: 768px) {
    .artwork-info-panel {
        display: none;
    }
}

/* Hide bottom sheet on desktop */
@media (min-width: 769px) {
    .bottom-sheet,
    .bottom-sheet-overlay {
        display: none;
    }
}

/* Hide scrollbar but allow scroll */
body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body::-webkit-scrollbar {
    display: none;
}

/* Grid label row with toggle */
.grid-label-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.view-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    opacity: 0.4;
    transition: opacity 0.2s, color 0.2s;
    height: 100%;
}

.view-toggle:hover {
    opacity: 0.7;
}

.view-toggle.active {
    opacity: 1;
    color: #d4af37;
}

/* Timeline Hover Preview (fixed center, above tiles) */
.timeline-hover-preview {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    z-index: 100;
    pointer-events: none;
}

.timeline-hover-preview.visible {
    display: flex;
}

.timeline-hover-image {
    width: 220px;
    height: 220px;
    object-fit: contain;
    background: var(--bg);
}

.timeline-hover-info {
    text-align: center;
    line-height: 1.3;
}

.timeline-hover-artist {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    margin: 0;
}

.timeline-hover-title {
    font-size: 12px;
    color: var(--text-dim);
    margin: 0;
}

.timeline-hover-date {
    font-size: 11px;
    color: #d4af37;
    margin: 0.25rem 0 0 0;
}

/* Project grid needs relative positioning for hover preview */
.project-grid {
    position: relative;
}

/* Timeline mode - expand to full width, keep same height */
.project-row.timeline-mode {
    flex-direction: column;
}

.project-row.timeline-mode .project-grid {
    width: 100%;
}

.project-row.timeline-mode .artwork-mosaic {
    width: calc(100vw - 6rem);
    /* Keep same height as normal mode - don't change */
}

.project-row.timeline-mode .artwork-info-panel {
    display: none;
}

@media (max-width: 768px) {
    .view-toggle {
        display: none;
    }

    .timeline-hover-preview {
        display: none;
    }
}
