:root {
    /* Premium Color Palette - Nature & Elegance */
    --clr-primary: #1b3022;
    /* Deep Forest */
    --clr-primary-light: #2d5a27;
    --clr-accent: #d4af37;
    /* Metallic Gold */
    --clr-accent-light: #f1e5ac;
    --clr-text: #1a1a1a;
    --clr-text-light: #666666;
    --clr-white: #ffffff;
    --clr-bg: #faf9f6;
    /* Off-white / Parchment hint */
    --clr-bg-alt: #f0ede5;

    /* System Tokens */
    --font-main: 'Inter', sans-serif;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --glass: rgba(255, 255, 255, 0.8);
    --glass-dark: rgba(27, 48, 34, 0.8);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--clr-bg);
    color: var(--clr-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.2;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Glassmorphism utility */
.glass {
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
    padding: 1.5rem 0;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    backdrop-filter: blur(0px);
    transition: var(--transition);
    z-index: -1;
}

header.scrolled {
    padding: 0.75rem 0;
}

header.scrolled::before {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--clr-white);
    text-decoration: none;
    transition: var(--transition);
}

header.scrolled .logo {
    color: var(--clr-primary);
}

.logo img {
    height: 60px;
    width: 60px;
    object-fit: contain;
    background: var(--clr-white);
    padding: 8px;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--clr-accent);
    transition: var(--transition);
}

.logo:hover img {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-lg);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links li a {
    text-decoration: none;
    color: var(--clr-white);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    position: relative;
    transition: var(--transition);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

header.scrolled .nav-links li a {
    color: var(--clr-text);
    text-shadow: none;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--clr-accent);
    transition: var(--transition);
}

.nav-links li a:hover {
    color: var(--clr-accent);
}

.nav-links li a:hover::after {
    width: 100%;
}

/* Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--clr-white);
    border-radius: 10px;
    transition: var(--transition);
}

header.scrolled .menu-toggle span {
    background-color: var(--clr-primary);
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Sections */
section {
    padding: 140px 0;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background-size: cover !important;
    background-position: center !important;
    background-color: var(--clr-primary);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(27, 48, 34, 0.8) 0%, rgba(27, 48, 34, 0.2) 100%);
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero-content {
    max-width: 650px;
}

.hero-content h1 {
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--clr-white);
    line-height: 1.1;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.hero-content h1 span {
    color: var(--clr-accent);
    display: block;
}

.hero-content .lead {
    font-size: 1.4rem;
    margin-bottom: 3rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 500px;
}

.cta-group {
    display: flex;
    gap: 1.5rem;
}

.btn {
    display: inline-block;
    padding: 1.1rem 2.8rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    text-align: center;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--clr-accent);
    color: var(--clr-primary);
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.2);
}

.btn-primary:hover {
    transform: translateY(-4px);
    background: var(--clr-accent-light);
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.3);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.1);
    color: var(--clr-white);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    border-color: var(--clr-white);
}

/* Card Types Section */
.card-types {
    background-color: var(--clr-white);
}

.types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
}

.type-card {
    padding: 3rem 2rem;
    text-align: center;
    border-radius: 24px;
    background: var(--clr-white);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid #eee;
}

.type-card:hover {
    transform: translateY(-10px);
}

.type-icon {
    margin-bottom: 1.5rem;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.type-icon img {
    height: 100%;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.type-card h3 {
    margin-bottom: 1rem;
    color: var(--clr-primary);
}

.type-card p {
    font-size: 0.95rem;
    color: var(--clr-text-light);
}

/* Color Themes for Types */
.confrontation {
    border-top: 6px solid #e74c3c;
}

.chance {
    border-top: 6px solid var(--clr-accent);
}

.prudence {
    border-top: 6px solid #3498db;
}

.duel {
    border-top: 6px solid #2c3e50;
}

/* Section Titles */
.section-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 5rem;
    color: var(--clr-primary);
    position: relative;
    display: inline-block;
}

.section-title::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--clr-accent);
}

.text-center {
    text-align: center;
    width: 100%;
}

/* Villageois Gallery */
.villageois {
    background-color: var(--clr-bg);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2rem;
}

/* Card Flip Effect */
.card-container {
    perspective: 1200px;
    width: 100%;
    height: 350px;
    /* Fallback height */
    aspect-ratio: 2 / 3;
    cursor: pointer;
}

@supports (aspect-ratio: 2/3) {
    .card-container {
        height: auto;
    }
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.card-container:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: var(--clr-bg-alt);
    /* Fallback background */
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.card-container:hover .card-front img {
    transform: scale(1.1);
}

.card-back {
    background: var(--clr-white);
    transform: rotateY(180deg);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border: 3px solid var(--clr-accent);
}

.card-back h3 {
    color: var(--clr-primary);
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
    text-align: center;
}

.card-back .category {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--clr-accent);
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: 1.5px;
    text-align: center;
}

.card-back .rules {
    font-size: 0.85rem;
    color: var(--clr-text-light);
    line-height: 1.5;
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 1rem;
    overflow-y: auto;
    flex-grow: 1;
}

/* Custom scrollbar for long rules */
.card-back .rules::-webkit-scrollbar {
    width: 4px;
}

.card-back .rules::-webkit-scrollbar-track {
    background: transparent;
}

.card-back .rules::-webkit-scrollbar-thumb {
    background: var(--clr-accent-light);
    border-radius: 10px;
}

/* Presentation */
.presentation {
    background-color: var(--clr-bg-alt);
}

.presentation-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 6rem;
    align-items: center;
}

.presentation-img {
    position: relative;
}

.presentation-img::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: -20px;
    bottom: -20px;
    border: 2px solid var(--clr-accent);
    border-radius: 20px;
    z-index: -1;
}

.presentation-img img {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    display: block;
}

.presentation-text h3 {
    font-size: 2.5rem;
    color: var(--clr-primary);
    margin-bottom: 1.5rem;
}

.features-list {
    list-style: none;
    margin: 2.5rem 0;
}

.features-list li {
    margin-bottom: 1rem;
    padding-left: 2rem;
    position: relative;
    font-weight: 500;
    color: var(--clr-text);
}

.features-list li::before {
    content: '◈';
    position: absolute;
    left: 0;
    color: var(--clr-accent);
    font-weight: bold;
}

/* Boutique / Shop */
.shop {
    background-color: var(--clr-primary);
    color: var(--clr-white);
}

.shop .section-title {
    color: var(--clr-white);
}

.shop .glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.shop h3 {
    color: var(--clr-accent);
}


footer {
    background: var(--clr-primary);
    color: var(--clr-white);
    padding: 3rem 0;
    text-align: center;
}

/* Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 968px) {

    .hero-grid,
    .presentation-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .cta-group {
        justify-content: center;
    }

    .nav-links {
        display: none;
    }

    .download-grid {
        grid-template-columns: 1fr;
    }
}

/* Improved Responsive styles */
@media (max-width: 968px) {
    header {
        padding: 1rem 0;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background: var(--clr-white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;
        transition: 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        padding: 2rem;
        display: flex;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li a {
        color: var(--clr-text);
        font-size: 1.5rem;
        text-shadow: none;
    }

    .menu-toggle.active span {
        background-color: var(--clr-primary) !important;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .lead {
        font-size: 1.1rem !important;
        margin: 0 auto 2rem !important;
    }

    .cta-group {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .presentation-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .presentation-img::after {
        display: none;
    }

    .section-title {
        font-size: 2.2rem;
        margin-bottom: 3rem;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    section {
        padding: 80px 0;
    }
}

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

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .card-container {
        max-width: 300px;
        margin: 0 auto;
    }
}