:root {
    --primary: #3b82f6;
    /* Blue 500 */
    --primary-light: #60a5fa;
    /* Blue 400 */
    --primary-dark: #2563eb;
    /* Blue 600 */
    --bg-main: #f8fafc;
    /* Slate 50 */
    --bg-card: #ffffff;
    --text-main: #1e293b;
    /* Slate 800 */
    --text-muted: #64748b;
    /* Slate 500 */
    --accent: #0ea5e9;
    /* Sky 500 */
    --sky-pale: #f0f9ff;
    --sky-light: #e0f2fe;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 6rem 0;
}

h1,
h2,
h3 {
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

h1 {
    font-size: 3.5rem;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

p {
    font-size: 1.125rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 9999px;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-ghost {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary-light);
}

.btn-ghost:hover {
    background-color: var(--sky-light);
}

/* Glassmorphism utility */
.glass {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* Hero Stats */
.hero-stats>div {
    display: flex;
    flex-direction: column;
}

/* Phone Mockup */
.phone-container {
    perspective: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.phone-frame {
    width: 320px;
    height: 640px;
    background: #1e293b;
    border-radius: 3rem;
    padding: 12px;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.25), 0 30px 60px -30px rgba(0, 0, 0, 0.3), inset 0 -2px 6px 0 rgba(255, 255, 255, 0.1);
    border: 8px solid #334155;
    position: relative;
    transform: rotateX(5deg) rotateY(-5deg);
    transition: transform 0.5s ease;
    user-select: none;
    -webkit-user-select: none;
}

.phone-frame:hover {
    transform: rotateX(0deg) rotateY(0deg);
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 2.2rem;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.ios-status-bar {
    padding: 10px 20px;
    color: white;
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
    z-index: 10;
}

.view-toggle {
    display: flex;
    background: #e2e8f0;
    padding: 4px;
    border-radius: 999px;
    z-index: 10;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.toggle-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.swipe-area {
    flex: 1;
    position: relative;
    margin: 10px;
    overflow: hidden;
    border-radius: 1.5rem;
    cursor: grab;
    z-index: 5;
}

.swipe-area:active {
    cursor: grabbing;
}

.card {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: white;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-size: cover;
    background-position: center;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
}

.card.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    z-index: 10;
}

.card.prev {
    transform: translateY(-100%) scale(0.9);
    opacity: 0;
    z-index: 5;
    pointer-events: none;
}

.card.next {
    transform: translateY(100%) scale(0.9);
    opacity: 0;
    z-index: 5;
    pointer-events: none;
}

.card-content {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
    pointer-events: none;
    /* Allow clicks to pass through to iframe */
}

.game-iframe {
    width: 100%;
    height: calc(100% + 38px);
    border: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Phone UI - Player View (TikTok Style) */
.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
    pointer-events: none;
    /* Let clicks pass through if needed */
}

.right-actions {
    position: absolute;
    right: 10px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    pointer-events: auto;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.action-btn i {
    font-size: 1.8rem;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.bottom-info {
    margin-right: 60px;
    /* Space for right actions */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: auto;
}

.creator-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e11d48;
    /* fallback color */
    border: 2px solid white;
}

.creator-badge span {
    font-weight: 700;
    font-size: 0.9rem;
}

.follow-btn {
    background: transparent;
    border: 1px solid white;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
}

.game-desc {
    font-size: 0.9rem;
    line-height: 1.3;
}

/* Phone UI - Developer View */
.developer-overlay {
    background: rgba(15, 23, 42, 0.95);
    /* Darker slate */
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 25%;
    /* Lift it up a bit */
    margin-left: 10px;
    margin-right: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: absolute;
    bottom: 2rem;
    width: calc(100% - 20px);
    pointer-events: auto;
    /* Allow interaction with metrics panel if needed, and block game clicks here */
}

.phone-screen.developer-mode .card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 1;
    pointer-events: none;
}

.phone-screen.developer-mode .swipe-hint {
    display: none;
}

.dev-metric-row {
    display: flex;
    flex-direction: column;
}

.dev-label {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.dev-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    font-family: monospace;
    /* Tech feel */
}

.dev-val.good {
    color: #4ade80;
}

.dev-val.money {
    color: #fbbf24;
}

.swipe-hint {
    color: white;
    text-align: center;
    font-size: 0.8rem;
    padding: 15px;
    opacity: 0.8;
    animation: bounce 2s infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-5px);
    }

    60% {
        transform: translateY(-3px);
    }
}

.strategy-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    background: white;
}

/* Scrollytelling visual transitions */
.narrative-visual-content.active {
    animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 968px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text {
        order: 2;
    }

    .hero-visual {
        order: 1;
        margin-bottom: 4rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    .scroll-narrative {
        grid-column: span 2;
    }

    .scroll-visual {
        display: none;
    }
}

/* Scrollytelling Issue Tags */
.issue-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #fca5a5;
}

/* Business Model Cards */
.model-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--sky-light);
    text-align: center;
    transition: transform 0.2s;
}

.model-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-light);
}

.model-icon {
    width: 3rem;
    height: 3rem;
    background: var(--sky-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem auto;
}


/* How It Works Section */
.hiw-header {
    text-align: center;
    margin-bottom: 3rem;
}

.hiw-subtitle {
    color: #8b5cf6;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: block;
}

.hiw-toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.hiw-toggle {
    background: #f1f5f9;
    padding: 4px;
    border-radius: 999px;
    display: flex;
    position: relative;
    border: 1px solid #e2e8f0;
}

.hiw-btn {
    padding: 0.75rem 2rem;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.hiw-btn.active {
    background: #8b5cf6;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(139, 92, 246, 0.3);
}

.hiw-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    transition: opacity 0.3s;
    animation: fadeInUp 0.5s ease-out;
}

.hiw-grid[hidden] {
    display: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hiw-card {
    background: white;
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid #f3f4f6;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: transform 0.3s;
}

.hiw-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.hiw-number {
    position: absolute;
    top: -15px;
    left: 2rem;
    background: #8b5cf6;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.4);
}

.hiw-icon-box {
    width: 3.5rem;
    height: 3.5rem;
    background: #f3e8ff;
    color: #8b5cf6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}


/* Competitor Comparison Section */
.comp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.comp-card {
    padding: 2.5rem;
    border-radius: 1.5rem;
    position: relative;
    overflow: hidden;
}

.comp-card.gizmo,
.comp-card.remix {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.comp-card.crudegamez {
    background: white;
    border: 2px solid var(--primary);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(1.05);
    /* Proper pop effect */
    z-index: 10;
}

.comp-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.comp-title {
    font-size: 1.25rem;
    font-weight: 800;
}

.comp-title a {
    text-decoration: none;
    color: inherit;
}

.comp-title a:hover {
    text-decoration: underline;
}

.comp-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comp-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.4;
}

.comp-item i {
    font-size: 1.25rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.comp-card.gizmo .comp-item i,
.comp-card.remix .comp-item i {
    color: #ef4444;
    /* Red X */
}

.comp-card.crudegamez .comp-item i {
    color: #10b981;
    /* Green Check */
}

@media (max-width: 1024px) {
    .comp-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        max-width: 600px;
    }

    .comp-card.crudegamez {
        transform: none;
    }
}

/* --- Mobile Frame Focus Mode --- */
.focus-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.focus-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.phone-frame.focused {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.15) !important;
    z-index: 2000;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    cursor: default;
}

/* Add a prompt to click */
.phone-frame:not(.focused) {
    cursor: pointer;
}

/* --- ANIMATIONS & LIFE --- */

/* --- Mobile Restriction --- */
#mobile-restriction {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-main);
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

@media (max-width: 968px) {
    #mobile-restriction {
        display: flex;
    }

    /* Hide main content to prevent scrolling behind overlay */
    nav,
    section,
    footer {
        display: none !important;
    }
}

/* Dynamic Background */
body {
    background: linear-gradient(-45deg, #f8fafc, #f1f5f9, #eff6ff, #f0f9ff);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Scroll Revealers */
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-up.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-in {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-in.active {
    opacity: 1;
    transform: scale(1);
}

/* Delays */
.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

/* Mouse Tilt Effect Class (Applied via JS) */
.tilt-card {
    transition: transform 0.1s ease-out;
    /* Fast response for mouse move */
    will-change: transform;
}

/* Flip Card Styles */
.flip-card {
    background-color: transparent;
    width: 100%;
    /* Fixed height to prevent layout shifts */
    height: 400px;
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 1.5rem;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.flip-card-front {
    /* Front content styles (Strategy Card) */
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    transform: rotateY(0deg) !important;
    z-index: 2;
}

.flip-card-back {
    /* Back content styles (Model Card) */
    background: white;
    transform: rotateY(180deg) !important;
    border: 1px solid var(--primary-light);
    box-shadow: var(--shadow-md);
}

/* Ensure content inside fits well */
.flip-card-front .icon,
.flip-card-back .model-icon {
    /* Reuse existing icon styles but ensure flex behavior works */
    flex-shrink: 0;
}

/* Navigation Buttons */
.nav-buttons {
    position: absolute;
    right: -60px;
    /* Position to the right of the phone frame */
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 20;
}

.nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    color: var(--primary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.nav-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .nav-buttons {
        right: -50px;
    }
}