/* ==========================================================================
   Design Tokens & CSS Variables (Bright Minimalist Theme)
   ========================================================================== */
:root {
    /* Color Palette */
    --color-bg: #ffffff;
    --color-bg-alt: #faf9f6;                  /* Warm Moroccan Sand/Paper */
    --color-surface: #ffffff;
    --color-surface-hover: #fafafa;
    --color-accent: hsl(12, 68%, 54%);       /* Terracotta Clay */
    --color-accent-hover: hsl(12, 75%, 60%);
    --color-accent-muted: hsl(12, 20%, 94%);
    --color-secondary: hsl(158, 40%, 26%);    /* Deep Atlas Olive Green */
    --color-border: #e2e8f0;                  /* Soft gray border */
    --color-border-light: #f1f5f9;
    --color-text-primary: #0f172a;            /* Obsidian Slate */
    --color-text-muted: #57657a;              /* Slate Gray */

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    /* Transitions & Radii */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Base Layout Container */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: 100px 0;
    position: relative;
}

/* ==========================================================================
   Typography & Accents
   ========================================================================== */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
}

.text-gradient {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Badges & Taglines */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 24px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background-color: var(--color-accent);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--color-accent);
}

.section-tag {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-accent);
    margin-bottom: 12px;
}

.section-header {
    text-align: center;
    max-width: 650px;
    margin: 0 auto 56px auto;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
}

.btn-primary {
    background-color: var(--color-text-primary);
    color: var(--color-bg);
    border: 1px solid var(--color-text-primary);
}

.btn-primary:hover {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-bg-alt);
    border-color: var(--color-text-primary);
    transform: translateY(-1px);
}

/* ==========================================================================
   Main Header & Navigation
   ========================================================================== */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background-color: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid var(--color-border-light);
    transition: var(--transition-smooth);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--color-text-primary);
}

.logo-svg {
    width: 38px;
    height: 38px;
    color: var(--color-text-primary);
    transition: var(--transition-smooth);
}

.logo-group:hover .logo-svg {
    transform: rotate(45deg);
    color: var(--color-accent);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.logo-subtitle {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}

.nav-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-text-primary);
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--color-text-primary);
    color: var(--color-bg);
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.nav-btn:hover {
    background: var(--color-accent);
}

.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 20px;
    height: 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 110;
}

.mobile-nav-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--color-text-primary);
    transition: var(--transition-fast);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
    padding-top: 100px;
    padding-bottom: 80px;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

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

.hero-title {
    font-size: 3.8rem;
    line-height: 1.1;
    margin-bottom: 20px;
    font-weight: 800;
}

.hero-lead {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    margin-bottom: 32px;
}

.hero-actions {
    display: flex;
    gap: 12px;
}

/* Card Deck Aesthetics (Bright Theme Paper style) */
.hero-interactive {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 420px;
}

.deck-container {
    position: relative;
    width: 250px;
    height: 360px;
    perspective: 1000px;
}

.deck-shadow {
    position: absolute;
    bottom: -20px;
    left: 10%;
    width: 80%;
    height: 15px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.1) 0%, transparent 70%);
    filter: blur(8px);
    pointer-events: none;
}

.game-card {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), z-index 0s;
    transform-style: preserve-3d;
    z-index: calc(10 + var(--card-index));
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    padding: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Card Back (Zellij Pattern on terracotta) */
.card-pattern {
    background-color: var(--color-accent);
    background-image: 
        radial-gradient(hsla(12, 100%, 75%, 0.15) 1px, transparent 1px),
        radial-gradient(hsla(12, 100%, 75%, 0.15) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    border-color: var(--color-accent);
    display: flex;
    justify-content: center;
    align-items: center;
}

.zellij-center {
    width: 50px;
    height: 50px;
    background: hsla(12, 100%, 30%, 0.25);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    border: 1px solid var(--color-bg);
    position: relative;
}

.zellij-center::after {
    content: '';
    position: absolute;
    inset: 13px;
    background: var(--color-accent);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* Card Front */
.card-face-front {
    background: #ffffff;
    color: var(--color-text-primary);
    border-color: var(--color-border);
}

.card-corner {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.card-corner span {
    font-size: 0.9rem;
}

.card-corner.top-left {
    align-self: flex-start;
}

.card-corner.bottom-right {
    align-self: flex-end;
    transform: rotate(180deg);
}

.card-center {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-illustration {
    width: 90px;
    height: 90px;
}

/* Card Stack rotation offsets */
.game-card[style*="--card-index: 0"] { transform: rotate(-5deg) translate(-15px, 0); }
.game-card[style*="--card-index: 1"] { transform: rotate(0deg) translate(0, 0); }
.game-card[style*="--card-index: 2"] { transform: rotate(6deg) translate(15px, 8px); }

/* Deal/Flick classes toggled by JS */
.game-card.deal-0 { transform: translate(140px, -40px) rotate(12deg) !important; z-index: 20; }
.game-card.deal-1 { transform: translate(-120px, 30px) rotate(-14deg) !important; z-index: 21; }
.game-card.deal-2 { transform: translate(10px, -110px) rotate(1deg) !important; z-index: 22; }

.deck-instructions {
    position: absolute;
    bottom: -48px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.75rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
}

.tap-icon {
    font-size: 0.9rem;
    animation: bounce 1.5s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* ==========================================================================
   Games Section (Featured Showcase Card)
   ========================================================================== */
.games-section {
    background-color: var(--color-bg-alt);
    border-top: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border-light);
    padding: 80px 0;
}

/* Main Showcase Card Container */
.showcase-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 48px;
    padding: 48px;
    align-items: center;
}

.showcase-media {
    position: relative;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border-light);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.04);
    aspect-ratio: 16 / 11;
    background-color: var(--color-bg-alt);
}

.showcase-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition-smooth);
}

.showcase-media:hover .showcase-img {
    transform: scale(1.02);
}

/* Right side details */
.showcase-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.game-header-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.game-app-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.game-app-icon svg, .game-app-icon img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

.game-title-group h3 {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
}

.game-version {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.game-description {
    color: var(--color-text-muted);
    font-size: 1rem;
    margin-bottom: 28px;
}

/* Bullet list specs */
.game-bullets {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--color-border-light);
}

.game-bullets li {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    position: relative;
    padding-left: 18px;
}

.game-bullets li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: bold;
    font-size: 1.1rem;
    line-height: 1;
}

.game-bullets li strong {
    color: var(--color-text-primary);
}

/* Download badging */
.download-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    padding: 10px 18px;
    color: var(--color-text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
    flex: 1;
    min-width: 150px;
}

.download-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: var(--color-text-primary);
}

.download-lbl {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.download-lbl span {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.download-lbl strong {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
}

.download-btn:hover {
    background-color: var(--color-bg-alt);
    border-color: var(--color-text-primary);
    transform: translateY(-1px);
}

/* Play Now Browser Highlight button */
.download-btn.highlight {
    background-color: var(--color-text-primary);
    border-color: var(--color-text-primary);
}

.download-btn.highlight .download-icon {
    color: var(--color-bg);
}

.download-btn.highlight .download-lbl span {
    color: rgba(255, 255, 255, 0.7);
}

.download-btn.highlight .download-lbl strong {
    color: var(--color-bg);
}

.download-btn.highlight:hover {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 4px 12px rgba(217, 91, 61, 0.2);
}

.download-btn.highlight:hover .download-lbl span,
.download-btn.highlight:hover .download-lbl strong,
.download-btn.highlight:hover .download-icon {
    color: var(--color-bg);
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about-section {
    padding: 100px 0;
    border-bottom: 1px solid var(--color-border-light);
}

.about-container {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 64px;
    align-items: flex-start;
}

.about-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-top: 8px;
}

.about-content p {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    margin-bottom: 20px;
}

.about-content p:last-child {
    margin-bottom: 0;
}

.about-content strong {
    color: var(--color-text-primary);
}

/* ==========================================================================
   Footer Section
   ========================================================================== */
.main-footer {
    padding: 64px 0 32px 0;
    background-color: var(--color-bg);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
}

.footer-desc {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-top: 8px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-link-item {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.footer-link-item:hover {
    color: var(--color-accent);
}

.dot-separator {
    color: var(--color-border);
    font-size: 0.8rem;
    pointer-events: none;
}

.footer-bottom {
    border-top: 1px solid var(--color-border-light);
    padding-top: 24px;
}

.footer-bottom-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.footer-love {
    font-weight: 500;
}

/* ==========================================================================
   Responsive Media Queries
   ========================================================================== */
@media (max-width: 1024px) {
    section {
        padding: 80px 0;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        gap: 60px;
        text-align: center;
    }
    
    .hero-content {
        max-width: 1000px;
        margin: 0 auto;
    }
    
    .hero-title {
        font-size: 3.2rem;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .showcase-card {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 32px;
    }
    
    .about-container {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        right: 0;
        background-color: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        padding: 24px;
        z-index: 99;
    }
    
    .main-nav.active {
        display: block;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
        text-align: center;
    }
    
    .nav-btn {
        justify-content: center;
    }
    
    .mobile-nav-toggle {
        display: flex;
    }
    
    /* Cross style for active burger menu */
    .mobile-nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(4px, 4px);
    }
    
    .mobile-nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(4px, -4px);
    }
    
    .hero-title {
        font-size: 2.6rem;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }
    
    .footer-bottom-container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
    
    .game-bullets {
        grid-template-columns: 1fr;
        margin-bottom: 24px;
        padding-bottom: 16px;
    }
    
    .download-group {
        flex-direction: column;
        width: 100%;
    }
    
    .download-btn {
        width: 100%;
        justify-content: center;
    }
}
