/* xity.one - Ocean-Deep Visual Archive */
/* Palette: #0a1628, #122240, #e8a832, #22d1b6, #c8d6e5, #f0f4f8, #e74c5e */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0a1628;
    color: #c8d6e5;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    overflow-x: hidden;
    position: relative;
}

/* ========== Grain Overlay ========== */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' 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");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ========== Wave Watermark ========== */
.wave-watermark {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ========== Opening Section ========== */
.opening-section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.opening-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.opening-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) blur(2px) saturate(0.85) contrast(1.1);
    animation: openingReveal 2.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes openingReveal {
    0% {
        filter: grayscale(1) blur(2px);
    }
    100% {
        filter: grayscale(0) blur(0) saturate(0.85) contrast(1.1);
    }
}

.kodachrome-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #e8a832;
    opacity: 0.06;
    pointer-events: none;
}

.opening-title {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    animation: titleFadeUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) 1.5s forwards;
}

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

.site-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 4.5vw;
    color: #f0f4f8;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.3em;
    text-shadow: 0 0 60px rgba(34, 209, 182, 0.2);
}

.site-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    color: #22d1b6;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* ========== Sprocket Hole Dividers ========== */
.sprocket-divider {
    position: relative;
    width: 100%;
    padding: 24px 0;
    display: flex;
    justify-content: center;
    z-index: 1;
}

.sprocket-holes {
    display: flex;
    gap: 16px;
    align-items: center;
}

.sprocket-holes::before {
    content: '';
    display: flex;
    gap: 16px;
}

.sprocket-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(200, 214, 229, 0.1), transparent);
}

.sprocket-holes {
    background: repeating-linear-gradient(
        to right,
        rgba(200, 214, 229, 0.2) 0px,
        rgba(200, 214, 229, 0.2) 4px,
        transparent 4px,
        transparent 20px
    );
    height: 6px;
    width: 300px;
    border-radius: 2px;
}

/* ========== Portfolio Section ========== */
.portfolio-section {
    position: relative;
    z-index: 1;
    padding: 40px 0 80px;
    margin-left: 3vw;
    margin-right: calc(48px + 12px);
}

.section-label {
    padding: 0 24px 32px;
}

.label-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    color: #c8d6e5;
    letter-spacing: 0.15em;
    opacity: 0.5;
}

/* ========== Portfolio Grid ========== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    padding: 0 24px;
}

.grid-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(34, 209, 182, 0.3);
    background-color: #122240;
    transform: scale(0.92);
    opacity: 0.7;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.35s ease-out,
                box-shadow 0.25s ease,
                border-color 0.25s ease;
    will-change: transform, opacity;
}

.grid-item.visible {
    transform: scale(1);
    opacity: 1;
}

.grid-item.span-2 {
    grid-column: span 2;
}

.grid-item:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 40px rgba(10, 22, 40, 0.6), 0 0 20px rgba(34, 209, 182, 0.1);
    border-color: rgba(34, 209, 182, 0.8);
    z-index: 2;
}

.grid-item:hover .item-meta {
    opacity: 1;
    transform: translateY(0);
}

/* ========== Grid Item Image ========== */
.item-image {
    width: 100%;
    height: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-image svg {
    width: 100%;
    height: auto;
    display: block;
    filter: saturate(0.85) contrast(1.1);
}

/* ========== Corner Marks ========== */
.item-corners {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.corner {
    position: absolute;
    width: 8px;
    height: 8px;
}

.corner.tl {
    top: 6px;
    left: 6px;
    border-top: 1px solid rgba(34, 209, 182, 0.5);
    border-left: 1px solid rgba(34, 209, 182, 0.5);
}

.corner.tr {
    top: 6px;
    right: 6px;
    border-top: 1px solid rgba(34, 209, 182, 0.5);
    border-right: 1px solid rgba(34, 209, 182, 0.5);
}

.corner.bl {
    bottom: 6px;
    left: 6px;
    border-bottom: 1px solid rgba(34, 209, 182, 0.5);
    border-left: 1px solid rgba(34, 209, 182, 0.5);
}

.corner.br {
    bottom: 6px;
    right: 6px;
    border-bottom: 1px solid rgba(34, 209, 182, 0.5);
    border-right: 1px solid rgba(34, 209, 182, 0.5);
}

/* ========== Item Meta ========== */
.item-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 12px 12px;
    background: linear-gradient(to top, rgba(10, 22, 40, 0.9), transparent);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.meta-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 12px;
    color: #f0f4f8;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.meta-date {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 10px;
    color: #22d1b6;
    letter-spacing: 0.05em;
}

/* ========== Loupe Effect ========== */
.loupe-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    background: radial-gradient(circle 60px at var(--loupe-x, 50%) var(--loupe-y, 50%),
        rgba(34, 209, 182, 0.12),
        transparent);
}

.grid-item:hover .loupe-effect {
    opacity: 1;
}

/* ========== Metadata Ticker ========== */
.metadata-ticker {
    position: fixed;
    top: 0;
    right: 0;
    width: 48px;
    height: 100vh;
    background-color: rgba(10, 22, 40, 0.85);
    border-left: 1px solid rgba(34, 209, 182, 0.15);
    z-index: 100;
    overflow: hidden;
}

.ticker-content {
    display: flex;
    flex-direction: column;
    animation: tickerScroll 30s linear infinite;
}

.metadata-ticker:hover .ticker-content {
    animation-play-state: paused;
}

@keyframes tickerScroll {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%);
    }
}

.ticker-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 4px;
}

.ticker-item {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 9px;
    line-height: 12px;
    color: #22d1b6;
    text-align: center;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    writing-mode: horizontal-tb;
}

/* ========== Detail Panel ========== */
.detail-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.detail-panel.active {
    pointer-events: auto;
    opacity: 1;
}

.detail-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(8px) saturate(0.4);
    -webkit-backdrop-filter: blur(8px) saturate(0.4);
    background-color: rgba(10, 22, 40, 0.6);
}

.detail-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background-color: #122240;
    border: 1px solid rgba(34, 209, 182, 0.3);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}

.detail-panel.active .detail-content {
    transform: translateY(0);
}

.detail-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(10, 22, 40, 0.6);
    border: 1px solid rgba(34, 209, 182, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.detail-close svg {
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.detail-panel.active .detail-close svg {
    transform: rotate(0deg);
}

.detail-close:hover {
    border-color: #e8a832;
}

.detail-image-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #0a1628;
}

.detail-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-image svg {
    width: 100%;
    height: 100%;
}

.detail-info {
    padding: 32px;
}

.detail-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 28px;
    color: #f0f4f8;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.detail-metadata {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-meta-row {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(200, 214, 229, 0.08);
}

.detail-meta-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 10px;
    color: #22d1b6;
    letter-spacing: 0.15em;
    min-width: 80px;
    flex-shrink: 0;
}

.detail-meta-value {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #c8d6e5;
}

/* ========== Archive Footer ========== */
.archive-footer {
    position: relative;
    z-index: 1;
    padding: 48px 24px;
    margin-right: 48px;
    text-align: center;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.footer-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #f0f4f8;
    letter-spacing: 0.08em;
}

.footer-divider {
    color: rgba(200, 214, 229, 0.3);
}

.footer-tagline {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    color: #c8d6e5;
    letter-spacing: 0.1em;
    opacity: 0.6;
}

.footer-meta {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.footer-meta span {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 10px;
    color: #22d1b6;
    letter-spacing: 0.1em;
    opacity: 0.5;
}

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

    .site-title {
        font-size: 6vw;
    }

    .metadata-ticker {
        display: none;
    }

    .portfolio-section {
        margin-right: 0;
    }

    .archive-footer {
        margin-right: 0;
    }
}

@media (max-width: 640px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-item.span-2 {
        grid-column: span 2;
    }

    .site-title {
        font-size: 10vw;
    }

    .portfolio-section {
        margin-left: 0;
        padding: 20px 0 40px;
    }

    .portfolio-grid {
        padding: 0 12px;
        gap: 8px;
    }

    .detail-content {
        width: 100%;
    }

    .footer-content {
        flex-direction: column;
        gap: 8px;
    }

    .footer-meta {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
}