/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --primary: #6C63FF; 
    --primary-hover: #5a52d5;
    --accent: #FF6584; 
    --secondary: #4CAF50;
    --dark: #2D2D2D;
    --light: #F9F9F9;
    --white: #FFFFFF;
    --gradient: linear-gradient(135deg, #6C63FF 0%, #FF6584 100%);
    --game-bg: #f0f0f5;
}

/* Strict Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    overflow-x: hidden; /* Critical fix */
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--light);
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: none; }

/* Wrapper to push footer down if needed */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================
   2. LAYOUT & HEADER
   ========================================= */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px; /* Safe padding for mobile */
}

header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1005;
    padding: 15px 0;
    width: 100%;
}

.nav-wrapper { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    width: 100%;
}

.logo { 
    font-size: 1.5rem; 
    font-weight: 800; 
    color: var(--primary); 
    z-index: 1006; 
    position: relative; 
}
.logo span { color: var(--accent); }

/* Desktop Navigation */
nav.desktop-nav ul { display: flex; gap: 20px; }
nav.desktop-nav a { font-weight: 500; font-size: 0.95rem; }
nav.desktop-nav a:hover { color: var(--primary); }

.btn-cta {
    background: var(--primary);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    display: inline-block;
}
.btn-cta:hover { background: var(--primary-hover); transform: translateY(-2px); }

/* =========================================
   3. MOBILE MENU (OFF-CANVAS)
   ========================================= */
.mobile-menu-btn {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    cursor: pointer;
    z-index: 2000; /* Always on top */
    position: relative;
    margin-left: auto;
}

.mobile-menu-btn span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--dark);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
    transform-origin: left center;
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateX(100%);
    visibility: hidden; /* Fixes scroll issue */
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), visibility 0s linear 0.3s;
    overflow-y: auto;
}

.mobile-nav-overlay.active {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), visibility 0s linear 0s;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 0;
    margin-bottom: 40px;
    text-align: center;
}

.mobile-nav-links a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    display: block;
}

/* Burger Animation */
.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 8px;
    position: relative;
    transform-origin: center;
}
.mobile-menu-btn.active span:nth-child(2) {
    width: 0%;
    opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: -8px;
    position: relative;
    transform-origin: center;
}

/* =========================================
   4. COMMON SECTIONS
   ========================================= */
.section-padding { padding: 80px 0; }
.section-title { text-align: center; font-size: 2.2rem; margin-bottom: 15px; font-weight: 700; display: block; }
.section-subtitle { text-align: center; margin-bottom: 60px; color: #666; font-size: 1.1rem; max-width: 600px; margin-left: auto; margin-right: auto; }

/* =========================================
   5. HERO SECTION
   ========================================= */
.hero {
    background: var(--gradient);
    color: var(--white);
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50px; left: -50px;
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -30px; right: 10%;
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.hero-title { font-size: 3rem; margin-bottom: 20px; line-height: 1.2; position: relative; z-index: 2; font-weight: 800; }
.hero p { font-size: 1.25rem; max-width: 650px; margin: 0 auto 30px; opacity: 0.95; position: relative; z-index: 2; }

/* =========================================
   6. PORTFOLIO & GAMES
   ========================================= */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
}
.project-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.1); }

.card-thumb {
    height: 180px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.th-1 { background: linear-gradient(45deg, #FF9A9E 0%, #FECFEF 99%, #FECFEF 100%); }
.th-2 { background: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%); }
.th-3 { background: linear-gradient(to top, #cfd9df 0%, #e2ebf0 100%); color: #555; text-shadow: none; }

.card-badge {
    position: absolute;
    top: 15px; right: 15px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}
.badge-hot { background: #FF4757; }
.badge-new { background: #2ED573; }

.card-body { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; font-size: 0.9rem; color: #888; }
.rating { color: #FFA502; }
.card-title { font-size: 1.4rem; margin-bottom: 10px; color: var(--dark); font-weight: 700; }
.card-desc { font-size: 0.95rem; color: #666; margin-bottom: 20px; line-height: 1.5; flex-grow: 1; }

.card-footer {
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.platforms span {
    background: #f0f0f0; color: #555; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; margin-right: 5px;
}
.btn-card { color: var(--primary); font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; }
.btn-card:hover { color: var(--accent); }

/* =========================================
   7. TIMELINE (ROADMAP)
   ========================================= */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}
.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background: #e0e0e0;
    top: 0; bottom: 0; left: 50%;
    margin-left: -2px;
    border-radius: 2px;
}
.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}
.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    right: -10px;
    background-color: var(--white);
    border: 4px solid var(--primary);
    top: 25px;
    border-radius: 50%;
    z-index: 1;
}
.left { left: 0; text-align: right; }
.right { left: 50%; text-align: left; }
.left::after { right: -10px; }
.right::after { left: -10px; }

.timeline-content {
    padding: 25px;
    background-color: white;
    position: relative;
    border-radius: 16px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
    transition: 0.3s;
}
.timeline-content:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); border-color: var(--primary); }

.time-date { color: var(--accent); font-weight: 800; font-size: 0.85rem; margin-bottom: 8px; display: block; text-transform: uppercase; letter-spacing: 0.5px; }
.time-title { font-weight: 700; font-size: 1.2rem; margin-bottom: 8px; color: var(--dark); }
.time-desc { font-size: 0.95rem; color: #666; line-height: 1.5; }

/* =========================================
   8. R&D / CANVAS GAMES
   ========================================= */
.game-showcase {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    margin-bottom: 60px;
    overflow: hidden;
    border: 1px solid #eee;
}
.game-header {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fbfbfb;
}
.game-title { color: var(--dark); font-size: 1.4rem; font-weight: 700; }
.game-header .tag { background: var(--accent); color: white; padding: 4px 12px; border-radius: 12px; font-size: 0.8rem; text-transform: uppercase; font-weight: bold; }

.canvas-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: var(--game-bg);
    display: flex;
    justify-content: center;
    align-items: center;
}
canvas { background: #fff; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); max-width: 100%; max-height: 100%; }

.game-controls-info { padding: 15px; text-align: center; color: #666; font-size: 0.9rem; background: #fdfdfd; border-top: 1px solid #eee; }

.overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    color: white; z-index: 10;
}
.overlay-title { font-size: 2rem; font-weight: 800; margin-bottom: 10px; }

.btn-play {
    background: var(--primary); color: white; border: none; padding: 15px 40px;
    font-size: 1.2rem; border-radius: 50px; font-weight: bold; cursor: pointer; transition: 0.2s; margin-top: 10px;
}
.btn-play:hover { transform: scale(1.05); background: var(--accent); }

/* =========================================
   9. CAREER SECTION
   ========================================= */
.career-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}
.vacancy-card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border-left: 5px solid var(--primary);
    transition: 0.3s;
}
.vacancy-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.08); }
.vacancy-role { font-size: 0.8rem; text-transform: uppercase; color: #888; font-weight: 700; letter-spacing: 0.5px; }
.vacancy-title { font-size: 1.25rem; font-weight: 700; margin: 10px 0; color: var(--dark); }
.vacancy-tags { display: flex; gap: 10px; flex-wrap: wrap; margin: 15px 0; }
.v-tag { background: #f0f0f5; padding: 4px 10px; border-radius: 6px; font-size: 0.8rem; color: #555; }
.btn-apply { color: var(--primary); font-weight: 600; font-size: 0.9rem; display: inline-block; margin-top: 10px; }

/* =========================================
   10. SEO CONTENT & GRAPHICS
   ========================================= */
.seo-box-wrapper {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
    margin-bottom: 40px;
}
.seo-scroll-content {
    height: 350px;
    overflow-y: auto;
    padding-right: 15px;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.7;
}
.seo-scroll-content::-webkit-scrollbar { width: 8px; }
.seo-scroll-content::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.seo-scroll-content::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.seo-scroll-content::-webkit-scrollbar-thumb:hover { background: #bbb; }

.seo-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 15px; color: var(--dark); margin-top: 0; }

.seo-visual-block { margin: 25px 0; padding: 20px; background: #fdfdfd; border: 1px solid #f0f0f0; border-radius: 8px; }
.seo-visual-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 15px; color: #444; text-align: center; margin-top: 0; }

.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.seo-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: 500px; }
.seo-table th, .seo-table td { padding: 8px 12px; border-bottom: 1px solid #eee; text-align: left; }
.seo-table th { color: #666; font-weight: 600; background: #fafafa; }
.seo-table tr:last-child td { border-bottom: none; }

.seo-chart { display: flex; align-items: flex-end; height: 120px; gap: 20px; padding: 0 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar { width: 40px; background: var(--gradient); border-radius: 4px 4px 0 0; position: relative; min-height: 2px; }
.bar span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 0.7rem; font-weight: bold; color: var(--primary); }
.col-label { margin-top: 8px; font-size: 0.75rem; color: #888; text-align: center; line-height: 1.2; }

/* =========================================
   11. CONTACT FORM
   ========================================= */
.contact { background: #EFEFF5; }
.contact-wrapper {
    background: var(--white);
    padding: 40px;
    border-radius: 15px;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; }
.form-control {
    width: 100%; padding: 12px 15px; border: 2px solid #eee; border-radius: 8px; font-size: 1rem; transition: 0.3s; font-family: inherit;
}
.form-control:focus { border-color: var(--primary); outline: none; }
textarea.form-control { resize: vertical; min-height: 120px; }

.btn-submit {
    width: 100%; padding: 15px; background: var(--dark); color: white; font-weight: bold; border-radius: 8px; transition: 0.3s;
}
.btn-submit:hover { background: var(--primary); }
.btn-submit:disabled { background: #ccc; cursor: not-allowed; }

.success-message {
    display: none; text-align: center; color: #28a745; font-weight: bold; margin-top: 15px; padding: 10px; background: #e6ffed; border-radius: 8px;
}

/* =========================================
   12. PRIVACY POLICY PAGE STYLES
   ========================================= */
.policy-header-bg { background: var(--dark); color: var(--white); padding: 80px 0 60px; text-align: center; width: 100%; }
.policy-title { 
    font-size: 2.5rem; 
    margin-bottom: 15px; 
    font-weight: 800; 
    line-height: 1.2;
    word-wrap: break-word; 
    overflow-wrap: break-word;
}
.policy-date { color: #aaa; font-size: 0.9rem; }
.policy-container { 
    max-width: 800px; 
    margin: 0 auto; 
    padding: 60px 20px; 
    background: var(--white); 
    box-shadow: 0 5px 30px rgba(0,0,0,0.03); 
    margin-top: -40px; 
    border-radius: 12px; 
    position: relative; 
    z-index: 2; 
    width: 90%; 
}
.policy-content { width: 100%; overflow-wrap: break-word; }
.policy-content h2 { font-size: 1.5rem; color: var(--dark); margin-top: 40px; margin-bottom: 20px; border-bottom: 2px solid #f0f0f0; padding-bottom: 10px; }
.policy-content h3 { font-size: 1.1rem; color: var(--primary); margin-top: 25px; margin-bottom: 10px; }
.policy-content p { margin-bottom: 15px; color: #555; line-height: 1.8; font-size: 1rem; }
.policy-content ul { margin-bottom: 20px; padding-left: 20px; list-style-type: disc; }
.policy-content li { margin-bottom: 8px; color: #555; }
.back-link { display: inline-block; margin-top: 30px; color: var(--primary); font-weight: 600; }

/* =========================================
   13. FOOTER
   ========================================= */
footer { background: #1a1a1a; color: #888; padding: 60px 0 30px; font-size: 0.9rem; width: 100%; margin-top: auto; }
.footer-content { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 30px; }
.footer-title { color: var(--white); margin-bottom: 20px; font-size: 1.1rem; font-weight: 700; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul li a { color: #aaa; }
.footer-col ul li a:hover { color: var(--white); }

/* =========================================
   14. RESPONSIVE / MEDIA QUERIES
   ========================================= */
@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }
    nav.desktop-nav { display: none; }
    .btn-cta.desktop-cta { display: none; }
    
    .hero-title { font-size: 2rem; }
    .game-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .canvas-container { height: 300px; }
    
    /* Timeline Mobile Fix */
    .timeline::after { left: 31px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 0; text-align: left; }
    .timeline-item::after { left: 21px; }
    .left::after, .right::after { left: 21px; }
    .right { left: 0%; }
}

@media (max-width: 480px) {
    .section-padding { padding: 60px 0; }
    .policy-title { font-size: 1.8rem; }
    .policy-container { padding: 40px 20px; width: 95%; margin-top: -20px; }
}