:root {
    --bg: #ffffff;
    --fg: #111111;
    --fg-muted: #666666;
    --accent: #111111;
    --accent-light: #f5f5f5;
    --border: #e5e5e5;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
    /* Remotion-inspired easing */
    --ease-remotion: cubic-bezier(0.16, 1, 0.3, 1);
    --transition: all 0.8s var(--ease-remotion);
}

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

body {
    background-color: var(--bg);
    color: var(--fg);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4rem;
}

/* Cinematic Reveal Animations */
@keyframes cinematicReveal {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    animation: cinematicReveal 1.2s var(--ease-remotion) forwards;
}

.reveal--1 { animation-delay: 0.1s; }
.reveal--2 { animation-delay: 0.3s; }
.reveal--3 { animation-delay: 0.5s; }
.reveal--4 { animation-delay: 0.7s; }

@media (max-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }
}

/* Header */
.header {
    padding: 10rem 0 6rem;
    text-align: center;
}

@media (max-width: 768px) {
    .header {
        padding: 6rem 0 4rem;
    }
}

.eyebrow {
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-size: 0.7rem;
    color: var(--fg-muted);
    display: block;
    margin-bottom: 2rem;
    font-weight: 600;
}

.title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 400;
    line-height: 1;
    margin-bottom: 2.5rem;
    letter-spacing: -0.03em;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--fg-muted);
    max-width: 550px;
    margin: 0 auto;
    font-weight: 400;
}

/* Gallery Grid */
.gallery {
    padding-bottom: 10rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4rem;
}

/* Card Styling */
.card {
    grid-column: span 6;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.card--large {
    grid-column: span 7;
}

.card--wide {
    grid-column: span 12;
}

.card:nth-child(2) {
    grid-column: span 5;
    margin-top: 6rem;
}

.card:nth-child(3) {
    grid-column: span 5;
}

.card:nth-child(4) {
    margin-top: -3rem;
}

/* Asymmetric Imperfect Card Shapes */
.card__visual {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--accent-light);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: var(--transition);
    /* Organic, slightly 'shaky' rectangle shape */
    clip-path: polygon(
        2% 1%, 98% 3%, 99% 97%, 1% 99%
    );
    border-radius: 8px;
}

.card:nth-child(even) .card__visual {
    clip-path: polygon(
        1% 3%, 97% 1%, 98% 99%, 3% 97%
    );
}

.card--wide .card__visual {
    aspect-ratio: 24 / 10;
    clip-path: polygon(
        0.5% 2%, 99.5% 1%, 99% 98%, 1% 97%
    );
}

.card:hover .card__visual {
    border-color: var(--fg);
    transform: translateY(-8px) rotate(0.5deg);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); /* Straighten on hover */
}

/* Template Description Section */
.template-descriptions {
    padding: 8rem 0;
    background-color: #fafafa;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 8rem;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 3rem;
    margin-bottom: 4rem;
    text-align: center;
}

.desc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 4rem;
}

.desc-item {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.desc-item h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    position: relative;
    padding-bottom: 1rem;
}

.desc-item h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 1px;
    background: var(--fg);
}

.desc-item p {
    color: var(--fg-muted);
    font-size: 1rem;
    line-height: 1.8;
}

/* Update Nav to support anchor links */
html {
    scroll-behavior: smooth;
}

.nav-label {
    max-width: 0;
    opacity: 0;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: var(--transition);
}

/* Template Previews (Light Theme Adaptation) */
.preview-box {
    position: absolute;
    inset: 3.5rem;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    transition: var(--transition);
}

.card:hover .preview-box {
    transform: scale(1.02);
}

.preview-line {
    height: 6px;
    background: #f0f0f0;
    border-radius: 100px;
    width: 100%;
}

.preview-line--short { width: 60%; }
.preview-line--title { 
    height: 8px; 
    background: #111111; 
    width: 35%; 
    margin-bottom: 0.5rem;
}

.preview-box--bistro { background: #fdfdfd; border-color: #111111; }
.preview-box--ledger { background: #ffffff; flex-direction: row; gap: 0; padding: 0; }
.preview-box--ledger .preview-page { flex: 1; padding: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; border-right: 1px solid #f0f0f0; }
.preview-box--aurora { background: #f9f9f9; }
.preview-box--brasserie { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.preview-box--brasserie .preview-col { display: flex; flex-direction: column; gap: 0.75rem; }
.preview-box--onyx { background: #111111; border: none; align-items: center; justify-content: center; padding: 3rem; }
.preview-box--onyx .preview-line--title { background: #ffffff; width: 50%; height: 1px; }
.preview-box--onyx .preview-line { background: #ffffff; opacity: 0.2; width: 30%; height: 1px; }

/* Button UI */
.btn--secondary {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 3rem;
    border: 1px solid var(--fg);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-weight: 700;
    background: transparent;
    color: var(--fg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.btn--secondary::after {
    content: '→';
    font-family: var(--font-sans);
    transition: var(--transition);
    transform: translateX(0);
}

.btn--secondary:hover {
    background: var(--fg);
    color: var(--bg);
    padding-right: 3.5rem;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    transform: scale(1.05);
}

.btn--secondary:active {
    transform: scale(0.98);
}

.btn--secondary:hover::after {
    transform: translateX(5px);
    color: var(--bg);
}

.card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.card:hover .card__overlay {
    opacity: 1;
}

/* Footer */
.footer {
    padding: 8rem 0;
    border-top: 1px solid var(--border);
    color: var(--fg-muted);
}

.footer__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer__qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.qr-code {
    width: 80px;
    height: 80px;
    padding: 0.5rem;
    background: white;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.qr-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--fg);
    font-weight: 600;
}

/* Glass Navigator (Light Mode) */
.glass-nav {
    position: fixed;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 100px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    width: auto;
    min-width: 280px;
}

.nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 100px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    color: var(--fg-muted);
    transition: var(--transition);
}

.nav-item.active {
    background-color: var(--fg);
    color: var(--bg);
}

.nav-item.active .nav-label {
    max-width: 100px;
    opacity: 1;
    margin-left: 0.5rem;
}

.nav-label {
    max-width: 0;
    opacity: 0;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: var(--transition);
}

/* Responsive Overrides */
@media (max-width: 1024px) {
    .grid { gap: 3rem; }
    .card, .card--large, .card:nth-child(2), .card:nth-child(3), .card:nth-child(4) {
        grid-column: span 12 !important;
        margin-top: 0 !important;
    }
    .footer__content { flex-direction: column; gap: 3rem; text-align: center; }
}

@media (max-width: 768px) {
    .header { padding: 6rem 0 4rem; }
    .title { font-size: 3.5rem; }
    .section-title { font-size: 2.5rem; }
    .desc-grid { gap: 2rem; }
    .glass-nav { 
        bottom: 1.5rem; 
        width: 90%; 
        min-width: 0; 
        justify-content: space-around; 
        padding: 0.25rem;
    }
    .nav-item { padding: 0.5rem 1rem; }
    .nav-item .nav-label { display: none; }
    .nav-item.active .nav-label { display: none; }
}

@media (max-width: 480px) {
    .container { padding: 0 1.5rem; }
    .title { font-size: 2.5rem; }
    .subtitle { font-size: 1rem; }
    .card__visual { aspect-ratio: 1/1; }
    .preview-box { inset: 1.5rem; }
    .btn--secondary { width: 100%; justify-content: center; }
}

/* Premium Minimalist Top Navigation (Refero style) */
.collection-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    background-color: rgba(255, 255, 255, 0.85); /* premium translucent white */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border); /* thin border */
    transition: all 0.3s ease;
}

.collection-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collection-nav-brand {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem;
    letter-spacing: 0.05em;
    color: var(--fg); /* dark charcoal color for logo text */
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 400;
    transition: opacity 0.3s ease;
}

.collection-nav-brand:hover {
    opacity: 0.7;
}

.collection-logo-accent {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: #533AFD;
    vertical-align: super;
}

.collection-nav-links {
    display: flex;
    gap: 1.5rem; /* adjusted gap to balance capsule padding */
    align-items: center;
}

.collection-nav-link {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-muted); /* muted text color for inactive state */
    position: relative;
    padding: 0.6rem 1.25rem;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.collection-nav-link:hover {
    color: var(--fg); /* brighten text on hover */
    cursor: pointer;
}

.collection-nav-link.active {
    color: var(--fg);
    background: transparent;
    position: relative;
}

.collection-nav-link.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 30px;
    padding: 2px; /* border thickness */
    background: linear-gradient(90deg, #C02BFF 0%, #7B3EFF 35%, #3E4BFF 70%, #00C8FF 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}

@media (max-width: 768px) {
    .collection-nav-container {
        padding: 1.25rem 2rem;
    }
    .collection-nav-links {
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .collection-nav-container {
        padding: 1rem 1.5rem;
    }
    .collection-nav-links {
        gap: 1.5rem;
    }
}

/* Mobile Navigation overrides & Floating Tab Bar */
.mobile-tab-bar {
    display: none;
}

@media (max-width: 48rem) {
    .collection-nav-links {
        display: none !important;
    }
    
    .collection-nav-container {
        justify-content: center !important;
    }

    .mobile-tab-bar {
        position: fixed;
        bottom: 1.5rem;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 2.5rem);
        max-width: 28rem;
        height: 4.2rem;
        background: rgba(255, 255, 255, 0.65);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border: 1px solid var(--border);
        border-radius: 100px;
        box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.08), 
                    0 2px 10px -2px rgba(0, 0, 0, 0.04);
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 0 0.6rem;
        z-index: 9999;
        transition: all 0.4s var(--ease-remotion, cubic-bezier(0.16, 1, 0.3, 1));
    }

    .mobile-tab-item {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.6rem 1.2rem;
        border-radius: 100px;
        color: var(--fg-muted);
        text-decoration: none;
        transition: all 0.35s var(--ease-remotion, cubic-bezier(0.16, 1, 0.3, 1));
    }

    .mobile-tab-item .mobile-tab-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.3s ease;
    }

    .mobile-tab-item .mobile-tab-icon svg {
        width: 20px !important;
        height: 20px !important;
        display: block;
        transition: stroke 0.3s ease, fill 0.3s ease;
        stroke: var(--fg-muted);
    }

    .mobile-tab-item .mobile-tab-label {
        font-family: var(--font-sans);
        font-size: 0.75rem;
        font-weight: 500;
        opacity: 1;
        overflow: hidden;
        white-space: nowrap;
        transition: color 0.3s ease;
    }

    /* Active/Hover State */
    .mobile-tab-item:hover, .mobile-tab-item:active {
        background-color: var(--accent-light);
        color: var(--fg);
    }

    .mobile-tab-item:hover .mobile-tab-icon svg, .mobile-tab-item:active .mobile-tab-icon svg {
        stroke: var(--fg);
        transform: scale(1.05);
    }
}

