/* =========================================
   bada.studio v2 - Cinematic Typography
   =========================================
   Typography:
     "Playfair Display" 900  - kinetic display
     "Cormorant Garamond" 300i / 500 - manifesto
     "Inconsolata" 400/500 - UI / mono labels
   Palette:
     --deep-void:          #0a0a0f
     --gilded-serif:       #c9a96e
     --parchment-whisper:  #e8d5b7
     --ember-punctuation:  #d4553a
     --smoke-layer:        #1e1e28
     --frost-trace:        #8a8a9e
   ========================================= */

:root {
    --deep-void:          #0a0a0f;
    --gilded-serif:       #c9a96e;
    --parchment-whisper:  #e8d5b7;
    --ember-punctuation:  #d4553a;
    --smoke-layer:        #1e1e28;
    --frost-trace:        #8a8a9e;
    --film-bg:            #1e1e28;

    --font-display: "Playfair Display", "Cormorant Garamond", Georgia, serif;
    --font-serif:   "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --font-mono:    "Inconsolata", "Courier New", ui-monospace, monospace;

    --frame-w: 100vw;
    --frame-h: 100vh;
}

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

html, body {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: var(--deep-void);
    color: var(--parchment-whisper);
    font-family: var(--font-serif);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    position: relative;
}

body.shake {
    animation: screen-shake 100ms steps(2, end) 3;
}

@keyframes screen-shake {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(2px, 1px); }
    50%  { transform: translate(-1px, -2px); }
    75%  { transform: translate(1px, 2px); }
    100% { transform: translate(0, 0); }
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================================
   Filmstrip - horizontal scroll container
   ========================================= */

#filmstrip {
    display: flex;
    flex-direction: row;
    width: 100vw;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#filmstrip::-webkit-scrollbar {
    display: none;
}

.frame {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    position: relative;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
    background-color: var(--deep-void);
}

/* Frame meta tag (top-left) */
.frame-meta {
    position: absolute;
    top: 28px;
    left: 32px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--frost-trace);
    z-index: 6;
    display: flex;
    gap: 10px;
    align-items: center;
}

.meta-tag {
    color: var(--gilded-serif);
}

.meta-tag + .meta-tag {
    color: var(--frost-trace);
}

.meta-divider {
    color: var(--frost-trace);
    opacity: 0.6;
}

/* Frame corners */
.frame-corner {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--frost-trace);
    z-index: 6;
}

.frame-corner.bottom-left {
    bottom: 36px;
    left: 32px;
}

.frame-corner.bottom-right {
    bottom: 36px;
    right: 32px;
}

/* =========================================
   Progress track + counter + dots + label
   ========================================= */

#progress-track {
    position: fixed;
    bottom: 14px;
    left: 32px;
    right: 32px;
    height: 3px;
    background: rgba(138, 138, 158, 0.18);
    z-index: 50;
    border-radius: 2px;
    overflow: hidden;
}

#progress-bar {
    width: 12%;
    height: 100%;
    background: var(--gilded-serif);
    transition: width 240ms ease-out;
    box-shadow: 0 0 8px rgba(201, 169, 110, 0.4);
}

#frame-counter {
    position: fixed;
    top: 28px;
    right: 32px;
    z-index: 50;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gilded-serif);
}

#frame-counter .counter-divider {
    color: var(--frost-trace);
    margin: 0 6px;
    opacity: 0.6;
}

#frame-current {
    color: var(--gilded-serif);
    font-weight: 500;
}

#frame-total {
    color: var(--frost-trace);
}

#frame-dots {
    position: fixed;
    bottom: 36px;
    right: 32px;
    z-index: 50;
    display: flex;
    gap: 12px;
    align-items: center;
}

#frame-dots .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--frost-trace);
    opacity: 0.4;
    transition: background 320ms ease, opacity 320ms ease, transform 320ms ease;
    cursor: pointer;
}

#frame-dots .dot.active {
    background: var(--ember-punctuation);
    opacity: 1;
    transform: scale(1.5);
    box-shadow: 0 0 10px rgba(212, 85, 58, 0.5);
}

#frame-dots .dot:hover {
    opacity: 0.9;
}

#frame-label {
    position: fixed;
    bottom: 36px;
    left: 32px;
    z-index: 50;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--frost-trace);
    transition: color 240ms ease;
}

#scroll-hint {
    position: fixed;
    top: 50%;
    right: 28px;
    transform: translateY(-50%);
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--frost-trace);
    opacity: 0.7;
    transition: opacity 600ms ease;
    pointer-events: none;
}

#scroll-hint .hint-arrow {
    color: var(--gilded-serif);
    font-size: 14px;
    animation: hint-pulse 2200ms ease-in-out infinite;
}

@keyframes hint-pulse {
    0%, 100% { transform: translateX(0); opacity: 0.6; }
    50%      { transform: translateX(6px); opacity: 1; }
}

body.scrolled #scroll-hint {
    opacity: 0;
}

/* =========================================
   FRAME 1 - Title sequence
   ========================================= */

.frame-1 {
    background-color: var(--deep-void);
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.kinetic-title {
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-end;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(80px, 18vw, 280px);
    color: var(--gilded-serif);
    letter-spacing: -0.04em;
    line-height: 1;
    margin: 0;
    z-index: 2;
}

.kinetic-title .letter {
    display: inline-block;
    transform: translateY(-120vh);
    animation: drop 1300ms cubic-bezier(0.34, 1.56, 0.64, 1) var(--delay, 0ms) forwards;
    will-change: transform, opacity;
    position: relative;
}

.kinetic-title.run-explode .letter {
    animation: explode 800ms ease-in forwards;
    animation-delay: 0ms;
}

@keyframes drop {
    0%   { transform: translateY(-120vh); }
    70%  { transform: translateY(8vh); }
    85%  { transform: translateY(-2vh); }
    100% { transform: translateY(0); }
}

@keyframes explode {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--dx, 0), var(--dy, 0)) scale(0.2); opacity: 0; }
}

/* Particle clones rendered by JS */
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--gilded-serif);
    pointer-events: none;
    opacity: 0;
    transform: translate(0, 0);
    will-change: transform, opacity;
}

.particle.fly {
    animation: particle-fly 1200ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes particle-fly {
    0%   { opacity: 0.85; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(0.2); }
}

.title-suffix {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--parchment-whisper);
    opacity: 0;
    transition: opacity 600ms ease 200ms;
    z-index: 3;
}

.title-suffix .suffix-dot {
    color: var(--ember-punctuation);
    margin-right: 1px;
}

.kinetic-title.run-explode ~ .title-suffix {
    opacity: 1;
}

/* =========================================
   FRAME 2 - Manifesto / Philosophy
   ========================================= */

.frame-2 {
    background-color: var(--deep-void);
    display: flex;
    align-items: center;
    justify-content: center;
}

.manifesto-stage {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.manifesto-stage::before,
.manifesto-stage::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 18vh;
    z-index: 3;
    pointer-events: none;
}

.manifesto-stage::before {
    top: 0;
    background: linear-gradient(to bottom, var(--deep-void) 30%, rgba(10, 10, 15, 0));
}

.manifesto-stage::after {
    bottom: 0;
    background: linear-gradient(to top, var(--deep-void) 30%, rgba(10, 10, 15, 0));
}

.manifesto-track {
    position: relative;
    width: min(820px, 80vw);
    text-align: center;
    transform: translateY(100vh);
    will-change: transform;
}

.frame-2.is-active .manifesto-track {
    animation: manifesto-scroll 32s linear forwards;
}

@keyframes manifesto-scroll {
    0%   { transform: translateY(100vh); }
    100% { transform: translateY(-220vh); }
}

.manifesto-line {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 300;
    color: var(--parchment-whisper);
    font-size: clamp(20px, 2.6vw, 34px);
    line-height: 2.0;
    letter-spacing: 0.005em;
    margin: 0;
}

.manifesto-line em {
    font-style: italic;
}

.manifesto-line .beat {
    font-family: var(--font-display);
    font-style: normal;
    font-weight: 900;
    color: var(--gilded-serif);
    letter-spacing: -0.01em;
}

.manifesto-line .glitch-word {
    font-family: var(--font-display);
    font-style: normal;
    font-weight: 700;
    color: var(--parchment-whisper);
    position: relative;
    display: inline-block;
}

.manifesto-line .glitch-word.glitching {
    animation: word-glitch 120ms steps(4, end) 1;
    color: var(--ember-punctuation);
}

@keyframes word-glitch {
    0%   { transform: translate(0, 0);   clip-path: inset(0 0 0 0); }
    25%  { transform: translate(2px, -1px); clip-path: inset(20% 0 30% 0); }
    50%  { transform: translate(-3px, 2px); clip-path: inset(50% 0 10% 0); }
    75%  { transform: translate(2px, 1px);  clip-path: inset(10% 0 60% 0); }
    100% { transform: translate(0, 0);    clip-path: inset(0 0 0 0); }
}

/* =========================================
   FRAME 3 - Works diagonal
   ========================================= */

.frame-3 {
    background-color: var(--deep-void);
    overflow: hidden;
    position: relative;
}

.works-heading {
    position: absolute;
    top: 90px;
    left: 32px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.works-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(28px, 4vw, 56px);
    color: var(--parchment-whisper);
    letter-spacing: -0.02em;
    line-height: 1;
}

.works-count {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gilded-serif);
}

.diagonal-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diagonal-grid {
    width: 140vw;
    height: 140vh;
    transform: rotate(-15deg) scale(1.2);
    transform-origin: center center;
    display: grid;
    grid-template-columns: repeat(3, 320px);
    grid-template-rows: repeat(3, 320px);
    gap: 60px;
    place-content: center;
    transition: transform 800ms ease;
}

.thumb {
    position: relative;
    width: 280px;
    height: 280px;
    background: var(--smoke-layer);
    box-shadow:
        10px 10px 0 rgba(10, 10, 15, 0.95),
        20px 20px 0 rgba(10, 10, 15, 0.7),
        30px 30px 0 rgba(10, 10, 15, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 500ms cubic-bezier(0.175, 0.885, 0.32, 1.275),
                box-shadow 500ms ease,
                background 500ms ease;
    overflow: hidden;
    cursor: pointer;
}

.thumb::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(201, 169, 110, 0.12);
    pointer-events: none;
    transition: border-color 400ms ease;
}

.thumb-glyph {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 200px;
    line-height: 1;
    color: var(--gilded-serif);
    letter-spacing: -0.04em;
    transform: translate(-12%, -8%);
    user-select: none;
    transition: color 400ms ease, transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.thumb-meta {
    position: absolute;
    bottom: 14px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--frost-trace);
    opacity: 0.5;
    transition: opacity 400ms ease, color 400ms ease;
}

.thumb-num {
    color: var(--gilded-serif);
}

.thumb:hover {
    transform: rotate(15deg) scale(1.4);
    background: var(--smoke-layer);
    box-shadow:
        14px 14px 0 var(--ember-punctuation),
        24px 24px 0 rgba(10, 10, 15, 0.6);
    z-index: 5;
}

.thumb:hover::before {
    border-color: rgba(201, 169, 110, 0.5);
}

.thumb:hover .thumb-glyph {
    color: var(--parchment-whisper);
    transform: translate(-12%, -4%) scale(1.05);
}

.thumb:hover .thumb-meta {
    opacity: 1;
    color: var(--parchment-whisper);
}

/* =========================================
   FRAME 4 - Contact / Ampersand
   ========================================= */

.frame-4 {
    background-color: var(--deep-void);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ampersand-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 90vw;
    line-height: 1;
    color: var(--parchment-whisper);
    opacity: 0.04;
    pointer-events: none;
    user-select: none;
    z-index: 1;
    transform: translate(0, 4vh);
}

.frame-4.is-active .ampersand-watermark {
    animation: ampersand-breathe 8s ease-in-out infinite;
}

@keyframes ampersand-breathe {
    0%, 100% { opacity: 0.04; transform: translate(0, 4vh) scale(1); }
    50%      { opacity: 0.06; transform: translate(0, 4vh) scale(1.02); }
}

.contact-card {
    position: relative;
    z-index: 2;
    width: min(560px, 86vw);
    background: rgba(10, 10, 15, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    padding: 44px 48px;
    border: 1px solid rgba(201, 169, 110, 0.18);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.contact-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px dashed rgba(138, 138, 158, 0.18);
    gap: 24px;
}

.contact-row:last-of-type {
    border-bottom: none;
}

.contact-key {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--frost-trace);
    flex: 0 0 auto;
}

.contact-value {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.06em;
    color: var(--parchment-whisper);
    text-align: right;
}

.contact-link {
    color: var(--gilded-serif);
    border-bottom: 1px solid transparent;
    transition: color 240ms ease, border-color 240ms ease;
}

.contact-link:hover {
    color: var(--ember-punctuation);
    border-bottom-color: var(--ember-punctuation);
}

.contact-divider {
    width: 24px;
    height: 1px;
    background: var(--gilded-serif);
    margin: 22px auto 16px;
    opacity: 0.5;
}

.contact-tagline {
    text-align: center;
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 300;
    color: var(--parchment-whisper);
    font-size: 18px;
    letter-spacing: 0.02em;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
}

.tagline-mark {
    color: var(--gilded-serif);
    font-style: normal;
}

/* =========================================
   Responsive adjustments
   ========================================= */

@media (max-width: 768px) {
    .frame-meta {
        top: 18px;
        left: 18px;
        font-size: 10px;
    }

    .frame-corner.bottom-left,
    .frame-corner.bottom-right {
        bottom: 28px;
        font-size: 9px;
    }

    .frame-corner.bottom-left { left: 18px; }
    .frame-corner.bottom-right { right: 18px; }

    #progress-track {
        left: 18px;
        right: 18px;
        bottom: 12px;
    }

    #frame-counter {
        top: 18px;
        right: 18px;
        font-size: 10px;
    }

    #frame-dots {
        right: 18px;
        bottom: 28px;
    }

    #frame-label {
        left: 18px;
        bottom: 28px;
        font-size: 9px;
    }

    .works-heading {
        top: 72px;
        left: 18px;
    }

    .diagonal-grid {
        grid-template-columns: repeat(3, 200px);
        grid-template-rows: repeat(3, 200px);
        gap: 40px;
    }

    .thumb {
        width: 180px;
        height: 180px;
    }

    .thumb-glyph {
        font-size: 130px;
    }

    .contact-card {
        padding: 28px;
    }

    .contact-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .contact-value {
        text-align: left;
    }
}
