/* NOMAD'E LA — Everything is a card */

/* ===== LANDING ===== */

.landing {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.landing.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.landing-logo {
    height: 200px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
    margin-bottom: 16px;
}

.landing-tagline {
    font-size: 17px;
    letter-spacing: 2px;
    color: var(--text-secondary);
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
    text-align: center;
    max-width: 360px;
    line-height: 1.6;
}

.landing-enter {
    margin-top: 48px;
    background: none;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 12px 36px;
    border-radius: var(--radius-full);
    font-family: var(--font-serif);
    font-size: 15px;
    letter-spacing: 1px;
    transition: all var(--transition-base);
    backdrop-filter: blur(4px);
    animation: gentle-float 3s ease-in-out infinite;
}

.landing-enter:hover {
    color: var(--text-primary);
    border-color: var(--accent-gold-dim);
    background: var(--accent-gold-glow);
}

@keyframes gentle-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}


/* ===== FEED ===== */

.feed {
    position: fixed;
    inset: 0;
    z-index: var(--z-covers);
    background: var(--bg-primary);
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    -webkit-overflow-scrolling: touch;
}

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

.feed-logo {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: center;
    padding: 24px 0 14px;
    background: var(--bg-primary);
}

.feed-logo img {
    height: 40px;
    width: auto;
    opacity: 0.8;
}

.feed-stream {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 16px 16px;
    max-width: 480px;
    margin: 0 auto;
}


/* ===== DROP HEADER ===== */

.drop-header {
    font-family: var(--font-serif);
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: center;
    padding: 8px 0 4px;
    opacity: 0;
    transform: translateY(500px);
}

.drop-header.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1.2s ease, transform 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== BRAND CARD ===== */

.brand-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(120, 150, 200, 0.25);
    border-radius: 2px;
    padding: 12px;
    background: rgba(120, 150, 200, 0.03);
    opacity: 0;
    transform: translateY(500px);
}

.brand-card-inner {
    aspect-ratio: 4 / 5;
    background-color: var(--bg-surface);
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
    padding: 40px 28px;
    position: relative;
}

.brand-card-inner[style*="background-image"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(12, 14, 24, 0.8);
    z-index: 0;
}

.brand-card-inner > * {
    position: relative;
    z-index: 1;
}

.brand-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1.2s ease, transform 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-card-logo {
    height: 44px;
    width: auto;
    opacity: 0.4;
    margin-bottom: 4px;
}

.brand-card-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
}

.brand-card-chapter {
    position: absolute;
    top: 16px;
    left: 20px;
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.brand-card-collection {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.3;
}

.brand-card-tagline {
    font-family: var(--font-serif);
    font-size: 15px;
    font-style: italic;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-top: 12px;
}

.brand-card-cn {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-primary);
    opacity: 0.5;
    letter-spacing: 0.05em;
    margin-top: 6px;
}

.brand-card-sub {
    font-family: var(--font-serif);
    font-size: 13px;
    font-style: italic;
    line-height: 1.7;
    color: var(--text-muted);
    margin-top: auto;
}


/* ===== PIECE CARD (with internal swipe) ===== */

.piece-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(120, 150, 200, 0.25);
    border-radius: 2px;
    padding: 12px;
    background: rgba(120, 150, 200, 0.03);
    /* Start far below — cards chase the camera upward */
    opacity: 0;
    transform: translateY(500px);
}

.piece-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1.2s ease, transform 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Internal slide track */
.piece-slides {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.piece-slides::-webkit-scrollbar {
    display: none;
}

/* Each slide page */
.piece-slide {
    width: 100%;
    min-width: 100%;
    flex-shrink: 0;
    scroll-snap-align: start;
}

/* Image slide */
.piece-slide--image {
    aspect-ratio: 4 / 5;
    position: relative;
}

.piece-slide--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* All story slides are image-based now */
.piece-slide--story {
    aspect-ratio: 4 / 5;
    position: relative;
}

.piece-slide--story img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Chapter marker (origin / story / craft) */
.piece-slide-chapter {
    position: absolute;
    top: 16px;
    left: 20px;
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    z-index: 2;
    /* Start hidden, dissolve out when leaving */
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Text overlay on image */
.piece-slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 80px 20px 44px;
    background: linear-gradient(to top, rgba(10, 14, 26, 0.8) 0%, rgba(10, 14, 26, 0.3) 60%, transparent 100%);
    z-index: 2;
    /* Start hidden, dissolve out when leaving */
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.piece-slide-overlay-text {
    font-family: var(--font-serif);
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
}

/* Piece name overlay (slide 1) */
.piece-slide-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 20px 44px;
    background: linear-gradient(to top, rgba(10, 14, 26, 0.7) 0%, transparent 100%);
    z-index: 2;
    /* Start hidden, dissolve out when leaving */
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Top-left name variant */
.piece-slide-name--top {
    top: 0;
    bottom: auto;
    padding: 44px 20px 60px;
    background: linear-gradient(to bottom, rgba(10, 14, 26, 0.7) 0%, transparent 100%);
    transform: translateY(-12px);
}

.piece-slide-name-title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
}

.piece-slide-name-cn {
    font-family: var(--font-sans);
    font-size: 16px;  /* 80% of 20px title */
    color: rgba(255, 255, 255, 0.65);
    margin-top: 6px;
    letter-spacing: 0.02em;
}

/* ── Arrive animation ── */
/* JS adds .arrived after slide becomes active */

.piece-slide.arrived .piece-slide-chapter {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.35s ease 0.15s, transform 0.35s ease 0.15s;
}

.piece-slide.arrived .piece-slide-name {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease 0.25s, transform 0.4s ease 0.25s;
}

.piece-slide.arrived .piece-slide-name--top {
    opacity: 1;
    transform: translateY(0);
}

.piece-slide.arrived .piece-slide-overlay {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease 0.3s, transform 0.4s ease 0.3s;
}

/* Staggered word animation */
.stagger-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    margin-right: 0.25em;
}

.piece-slide.arrived .stagger-word {
    opacity: 1;
    transform: translateY(0);
}

/* Remove .arrived → words dissolve back */
.piece-slide:not(.arrived) .stagger-word {
    opacity: 0;
    transform: translateY(8px);
}

/* Text-only slide (keeping as fallback but shouldn't be used) */
.piece-slide--text {
    aspect-ratio: 4 / 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: var(--bg-surface);
}

.piece-slide-text {
    font-family: var(--font-serif);
    font-size: 17px;
    font-style: italic;
    line-height: 1.8;
    color: var(--text-secondary);
    text-align: center;
    max-width: 320px;
}

/* CTA slide */
.piece-slide--cta-card {
    aspect-ratio: 4 / 5;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
}

.piece-slide--cta-card {
    flex-direction: column;
}

.cta-layout {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
}

.cta-top {
    padding: 40px 20px 0;
    text-align: left;
}

.cta-top .piece-slide-chapter {
    position: static;
    margin-bottom: 10px;
    padding: 0;
    left: auto;
}

.cta-top .cta-piece-name {
    text-align: left;
}

.cta-top .cta-piece-cn {
    text-align: left;
}

.cta-inner {
    text-align: center;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.cta-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    flex: 1;
    width: 100%;
}

.cta-bottom {
    width: 100%;
    padding: 0 20px 44px;
    text-align: center;
}

.cta-piece-name {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 400;
    line-height: 1.3;
    color: var(--text-primary);
}

.cta-piece-cn {
    font-family: var(--font-sans);
    font-size: 17px;  /* 80% of 22px name */
    color: var(--text-primary);
    opacity: 0.65;
    letter-spacing: 0.02em;
    margin-top: 8px;
}

.cta-price {
    font-family: var(--font-sans);
    font-size: 18px;
    color: var(--text-secondary);
    margin-top: 16px;
}

.cta-button {
    margin-top: 12px;
    width: 100%;
    padding: 16px 0;
    background: rgba(120, 150, 200, 0.04);
    border: 0.5px solid rgba(120, 150, 200, 0.2);
    border-radius: 0;
    color: rgba(100, 130, 190, 0.7);
    font-family: var(--font-sans);
    font-size: 14px;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all var(--transition-base);
}

.cta-button-price {
    font-size: 12px;
}

.cta-button:hover {
    background: rgba(120, 150, 200, 0.1);
    color: rgba(100, 130, 190, 1);
    border-color: rgba(120, 150, 200, 0.35);
}

.cta-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cta-tagline {
    font-family: var(--font-serif);
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 16px;
}

/* Provenance footer */
.cta-provenance {
    font-family: var(--font-sans);
    font-size: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-primary);
    opacity: 0.5;
    margin-top: 8px;
}

/* Mystery tier */
.cta-mystery-sub {
    font-family: var(--font-serif);
    font-size: 14px;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 20px;
    text-align: center;
}

.cta-button--gold {
    background: rgba(196, 168, 110, 0.06);
    border-color: rgba(196, 168, 110, 0.25);
    color: rgba(196, 168, 110, 0.7);
}

.cta-button--silver {
    background: rgba(160, 168, 184, 0.06);
    border-color: rgba(160, 168, 184, 0.25);
    color: rgba(160, 168, 184, 0.7);
}

.cta-button--silver:hover {
    background: rgba(160, 168, 184, 0.12);
    color: var(--accent-silver);
    border-color: rgba(160, 168, 184, 0.4);
}

.cta-button--gold:hover {
    background: rgba(196, 168, 110, 0.12);
    color: var(--accent-gold);
    border-color: rgba(196, 168, 110, 0.4);
}

/* Bespoke tier — story textarea */
.cta-story-field {
    width: 100%;
    min-height: 100px;
    padding: 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-serif);
    font-size: 14px;
    font-style: italic;
    line-height: 1.8;
    resize: none;
    outline: none;
}

.cta-story-field::placeholder {
    color: var(--text-ghost);
    font-style: italic;
}

.cta-story-field:focus {
    border-bottom-color: var(--accent-gold-dim);
}

.cta-word-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    margin-bottom: 16px;
}

.cta-button--bespoke:disabled {
    opacity: 0.25;
    cursor: default;
    transition: opacity 0.3s ease;
}

.cta-button--bespoke:not(:disabled) {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Accordion section */
.piece-accordion {
    border-top: 1px solid rgba(120, 150, 200, 0.15);
}

.piece-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    font-family: var(--font-sans);
    font-size: 13px;
    color: rgba(100, 130, 190, 0.7);
    letter-spacing: 0.03em;
    transition: color var(--transition-fast);
}

.piece-accordion-header:hover {
    color: rgba(100, 130, 190, 1);
}

.piece-accordion-icon {
    font-size: 16px;
    font-weight: 300;
    transition: transform 0.2s ease;
}

.piece-accordion.open .piece-accordion-icon {
    transform: rotate(45deg);
}

.piece-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.piece-accordion.open .piece-accordion-body {
    max-height: 300px;
}

.piece-accordion-text {
    font-family: var(--font-sans);
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
    padding-bottom: 16px;
}

/* Sold CTA */
.cta-sold-message {
    font-family: var(--font-serif);
    font-size: 16px;
    color: var(--sold-color);
    font-style: italic;
}

.cta-sold-sub {
    font-size: 13px;
    color: var(--text-muted);
}

/* Piece info — hidden now, name lives inside slides */
.piece-info { display: none; }

/* Slide arrows — hover bars over the image */
.piece-arrows {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 3;
    pointer-events: none;
}

.piece-arrow {
    pointer-events: auto;
    position: absolute;
    top: 0;
    width: 44px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 0;
    color: transparent;
    cursor: pointer;
    transition: all 0.25s ease;
}

.piece-arrow::after {
    content: '';
    position: absolute;
    top: 10%;
    bottom: 10%;
    width: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0);
    transition: background 0.3s ease;
}

.piece-arrow--prev { left: 0; }
.piece-arrow--next { right: 0; }
.piece-arrow--prev::after { left: 4px; }
.piece-arrow--next::after { right: 4px; }

.piece-arrow:hover::after {
    background: rgba(255, 255, 255, 0.4);
}

/* Slide dots — inside the image */
.piece-dots-inside {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 4;
}

.piece-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transition: all var(--transition-fast);
}

.piece-dot.active {
    background: rgba(255, 255, 255, 0.9);
}

/* Sold state — gold frame on dark blue */
.piece-card.sold {
    border: 2px solid rgba(196, 168, 110, 0.45);
    background: rgba(196, 168, 110, 0.25);
    padding: 11px; /* compensate for thicker border */
}

.piece-card.sold .piece-slide--story:not(.piece-slide--cta-card)::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(196, 168, 110, 0.22);
    pointer-events: none;
    z-index: 1;
}

.piece-card.sold .piece-dot.active {
    background: var(--sold-color);
}

.piece-card-sold-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-serif);
    font-size: 15px;
    font-style: italic;
    color: var(--sold-color);
    letter-spacing: 1px;
    z-index: 2;
    pointer-events: none;
}


/* ===== NOTIFY CARD ===== */

.notify-card {
    padding: 36px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(120, 150, 200, 0.25);
    border-radius: 2px;
    background: rgba(120, 150, 200, 0.03);
    opacity: 0;
    transform: translateY(500px);
}

.notify-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1.2s ease, transform 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.notify-card-text {
    font-family: var(--font-serif);
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
}

.notify-card-form {
    display: flex;
    gap: 8px;
}

.notify-card-form input {
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 0;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    outline: none;
    width: 200px;
}

.notify-card-form input::placeholder {
    color: var(--text-muted);
}

.notify-card-form input:focus {
    border-color: var(--accent-gold-dim);
}

.notify-card-form button {
    padding: 10px 18px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 0;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 12px;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.notify-card-form button:hover {
    color: var(--accent-gold);
    border-color: var(--accent-gold-dim);
}


/* ===== SECRET DRAWER (still works on pull-up within story viewer if we keep it) ===== */

.secret-drawer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: var(--z-drawer);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    max-height: 50vh;
    overflow-y: auto;
    padding: 0 24px 32px;
}

.secret-drawer.open {
    transform: translateY(0);
}

.drawer-handle {
    display: flex;
    justify-content: center;
    padding: 12px 0 16px;
    cursor: pointer;
}

.drawer-handle-bar {
    width: 36px;
    height: 4px;
    background: var(--text-ghost);
    border-radius: 2px;
}

.drawer-content {
    font-family: var(--font-serif);
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
}


/* ===== RESPONSIVE ===== */

@media (max-width: 520px) {
    .feed-stream {
        padding: 8px;
        gap: 12px;
    }

    .brand-card {
        padding: 32px 16px;
    }
}

/* Desktop: wider stream, could do 2-col for pieces later */
@media (min-width: 769px) {
    .feed-stream {
        max-width: 520px;
        padding: 32px 16px;
        gap: 24px;
    }

    .brand-card {
        padding: 56px 24px;
    }

    .piece-slide-text {
        font-size: 18px;
    }
}
