/* ==========================================================
   pzz.lu — Post-cyberpunk, grounded-earthy design
   Palette: Terminal Dark #1C1C20, Stone Gray #2A2A30,
            Muted Teal #5A8B8B, Muted Violet #7B6B8B,
            Aged Silver #A0A0A8, Paper Bone #E8E4DC,
            Warm Slate #4A4A50
   ========================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.4vw, 17px);
    line-height: 1.7;
    color: #E8E4DC;
    background-color: #1C1C20;
    overflow-x: hidden;
}

.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Section Title --- */
.section-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(28px, 4vw, 52px);
    color: #E8E4DC;
    margin-bottom: 40px;
}

/* --- Stone Overlay (noise texture) --- */
.stone-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.02' numOctaves='4'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    background-repeat: repeat;
    pointer-events: none;
    z-index: 1;
}

/* ==========================================================
   SECTION 1: Terminal Gate
   ========================================================== */
#terminal-gate {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background-color: #1C1C20;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Photography strip */
#photo-strip {
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 45%;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 2;
}

#photo-strip.visible {
    opacity: 0.8;
}

.photo-strip-inner {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 3px;
}

.photo-cell {
    flex: 1;
    filter: grayscale(0.6) contrast(0.9) brightness(0.95);
    position: relative;
    overflow: hidden;
}

.photo-cell::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(90, 139, 139, 0.08) 0%,
        transparent 40%,
        rgba(123, 107, 139, 0.06) 70%,
        transparent 100%
    );
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(28, 28, 32, 0.4) 0%,
        rgba(28, 28, 32, 0.1) 40%,
        rgba(28, 28, 32, 0.3) 100%
    );
    pointer-events: none;
}

/* Wordmark */
#wordmark {
    position: relative;
    z-index: 3;
    text-align: center;
    opacity: 0;
    transition: opacity 1.2s ease;
}

#wordmark.visible {
    opacity: 1;
}

.wordmark-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(48px, 8vw, 120px);
    color: #E8E4DC;
    letter-spacing: 0.04em;
    line-height: 1;
    text-shadow: 0 2px 40px rgba(28, 28, 32, 0.8);
}

.wordmark-sub {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: #A0A0A8;
    margin-top: 16px;
    text-transform: uppercase;
}

/* Gate wave at bottom */
#gate-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    z-index: 4;
}

#gate-wave svg {
    width: 100%;
    height: 100%;
}

/* ==========================================================
   SECTION 2: Portfolio Grid
   ========================================================== */
#portfolio {
    position: relative;
    padding: 100px 40px;
    background-color: #1C1C20;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: 55fr 45fr;
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

/* Card container for 3D perspective */
.card-container {
    perspective: 1000px;
}

.card {
    position: relative;
    width: 100%;
    min-height: 380px;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
    cursor: pointer;
}

.card.flipped {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    background: #2A2A30;
    border: 1px solid rgba(160, 160, 168, 0.15);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-back {
    transform: rotateY(180deg);
    padding: 32px;
    justify-content: center;
}

/* Card front - image area */
.card-image {
    width: 100%;
    height: 180px;
    position: relative;
    overflow: hidden;
    filter: grayscale(0.6) contrast(0.9) brightness(0.95);
}

.card-image-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.15;
}

/* Generative patterns for card images */
.card-image-pattern[data-pattern="grid"] {
    background-image:
        linear-gradient(rgba(90, 139, 139, 0.4) 1px, transparent 1px),
        linear-gradient(90deg, rgba(90, 139, 139, 0.4) 1px, transparent 1px);
    background-size: 24px 24px;
}

.card-image-pattern[data-pattern="lines"] {
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(123, 107, 139, 0.3),
        rgba(123, 107, 139, 0.3) 1px,
        transparent 1px,
        transparent 16px
    );
}

.card-image-pattern[data-pattern="dots"] {
    background-image: radial-gradient(
        circle,
        rgba(90, 139, 139, 0.4) 1px,
        transparent 1px
    );
    background-size: 16px 16px;
}

.card-image-pattern[data-pattern="circuit"] {
    background-image:
        linear-gradient(90deg, rgba(160, 160, 168, 0.2) 1px, transparent 1px),
        linear-gradient(rgba(160, 160, 168, 0.2) 1px, transparent 1px),
        radial-gradient(circle 2px, rgba(90, 139, 139, 0.3) 100%, transparent 100%);
    background-size: 40px 40px, 40px 40px, 40px 40px;
    background-position: 0 0, 0 0, 20px 20px;
}

.card-image-pattern[data-pattern="wave"] {
    background-image: repeating-linear-gradient(
        0deg,
        rgba(90, 139, 139, 0.2),
        rgba(90, 139, 139, 0.2) 2px,
        transparent 2px,
        transparent 12px
    );
}

.card-image-pattern[data-pattern="mesh"] {
    background-image:
        linear-gradient(60deg, rgba(123, 107, 139, 0.2) 1px, transparent 1px),
        linear-gradient(-60deg, rgba(123, 107, 139, 0.2) 1px, transparent 1px);
    background-size: 20px 34px;
}

/* Card body */
.card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(20px, 2.5vw, 28px);
    color: #E8E4DC;
    margin-bottom: 12px;
}

.card-desc {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1.2vw, 16px);
    color: #A0A0A8;
    line-height: 1.6;
    flex: 1;
}

.card-flip-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #5A8B8B;
    letter-spacing: 0.06em;
    margin-top: 12px;
    display: block;
}

/* Card back styles */
.card-back-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 22px;
    color: #E8E4DC;
    margin-bottom: 20px;
}

.card-tech {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.tech-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.03em;
    color: #5A8B8B;
    background: rgba(90, 139, 139, 0.1);
    border: 1px solid rgba(90, 139, 139, 0.2);
    padding: 4px 10px;
    border-radius: 2px;
}

.card-meta {
    margin-top: auto;
}

.card-timeline,
.card-outcome {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: #A0A0A8;
    margin-bottom: 6px;
}

.meta-label {
    font-weight: 500;
    color: #E8E4DC;
}

/* ==========================================================
   SECTION 3: Wave-form Data
   ========================================================== */
#waveform-data {
    position: relative;
    padding: 100px 40px 60px;
    background-color: #2A2A30;
    overflow: hidden;
}

.wave-content {
    max-width: 1100px;
    margin: 0 auto 40px;
    position: relative;
    z-index: 2;
}

.wave-description {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(15px, 1.4vw, 17px);
    color: #A0A0A8;
    max-width: 600px;
    margin-bottom: 24px;
}

.wave-labels {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.wave-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.03em;
    color: #A0A0A8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wave-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.wave-dot.teal {
    background-color: #5A8B8B;
}

.wave-dot.violet {
    background-color: #7B6B8B;
}

.wave-dot.silver {
    background-color: #A0A0A8;
}

.wave-canvas {
    width: 100%;
    height: 200px;
    position: relative;
}

#data-waves {
    width: 100%;
    height: 100%;
}

/* ==========================================================
   SECTION 4: Stone Footer
   ========================================================== */
#stone-footer {
    position: relative;
    background-color: #2A2A30;
    padding: 60px 40px;
    border-top: 1px solid rgba(74, 74, 80, 0.4);
}

.footer-content {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-brand {
    flex: 1;
    min-width: 200px;
}

.footer-wordmark {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 32px;
    color: #E8E4DC;
    display: block;
    margin-bottom: 8px;
}

.footer-tagline {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 16px;
    color: #7B6B8B;
}

.footer-nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.footer-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.06em;
    color: #A0A0A8;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.3s ease;
    position: relative;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #5A8B8B;
    transition: width 0.3s ease;
}

.footer-link:hover {
    color: #E8E4DC;
}

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

.footer-credits {
    text-align: right;
    min-width: 200px;
}

.footer-credit-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: #A0A0A8;
    margin-bottom: 4px;
}

.footer-mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #4A4A50;
    letter-spacing: 0.03em;
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card {
        min-height: 340px;
    }

    #photo-strip {
        width: 85%;
        left: 50%;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-credits {
        text-align: left;
    }

    #portfolio {
        padding: 60px 20px;
    }

    #waveform-data {
        padding: 60px 20px 40px;
    }

    #stone-footer {
        padding: 40px 20px;
    }
}

@media (max-width: 480px) {
    .wordmark-text {
        font-size: clamp(36px, 12vw, 60px);
    }

    .card-image {
        height: 140px;
    }

    .card {
        min-height: 300px;
    }
}
