/* --- 1. RESET & VARIABLES --- */
:root {
    --bg-main: #0a0a0a;
    --bg-card: #171717;
    --bg-hover: #262626;
    --text-main: #ededed;
    --text-muted: #a1a1aa;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --border: #333333;
    --max-width: 1100px;
    --radius: 12px;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text-main); text-decoration: none; transition: 0.2s; }
a:hover { color: var(--accent); }

/* --- 2. NAVIGATION --- */
.navbar {
    position: sticky;
    top: 0;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 1rem 0;
}

.nav-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { font-weight: 700; font-size: 1.1rem; }
.nav-links { display: flex; gap: 1.5rem; font-size: 0.9rem; align-items: center; }

/* --- 3. TOP SCROLLING TICKER (Seamless Loop) --- */
.top-ticker {
    background-color: #0a0a0a;
    border-bottom: none;
    color: #ffffff;
    font-size: 0.85rem;
    padding: 0.6rem 0;
    overflow: hidden;
    position: relative;
    z-index: 2000;
    margin-bottom: 1rem; /* Adds the empty space */
}

.ticker-track {
    display: flex;
    width: max-content; /* Forces text to stay in one long line */
    animation: scroll-seamless 35s linear infinite; /* Adjust '20s' to make it faster/slower */
}

.ticker-track span {
    padding-right: 4rem; /* The gap between the repeated sentences */
    white-space: nowrap;
    font-family: 'Courier New', monospace;
}

/* THE SEAMLESS LOGIC:
   We have 4 identical items. We move the track left by exactly 25% (width of 1 item).
   When it hits -25%, it snaps back to 0 instantly.
   Because Item 2 is identical to Item 1, the snap is invisible. */
@keyframes scroll-seamless {
    0% { transform: translateX(0); }
    100% { transform: translateX(-25%); }
    
}

/* --- 4. HEADER & HERO --- */
.main-header { padding: 4rem 0; }
.header-grid {
    display: flex;
    flex-direction: column-reverse; /* Text below image on mobile */
    gap: 3rem;
    align-items: center;
}

.container-wide {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.header-intro { flex: 1; }
/* Hero Title & Typewriter */
.hero-title {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
    min-height: 1.2em; /* Prevents layout jump */
}

.cursor {
    display: inline-block;
    color: var(--accent);
    margin-left: 2px;
    font-weight: 700;
    /* Solid cursor while typing */
}

.cursor.typing-done {
    display: none; /* Hides cursor when typing finishes */
}

.welcome-text { color: var(--accent); font-weight: 500; margin-bottom: 1.5rem; }
.headline { font-size: 2rem; margin-top: 1.5rem; margin-bottom: 1rem; line-height: 1.2; }
.sub-headline { color: var(--text-muted); font-size: 1.1rem; max-width: 600px; }

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-card);
}

.profile-photo {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* --- 5. CARDS & LAYOUT --- */
section { padding: 4rem 0; }
.section-title { font-size: 1.75rem; margin-bottom: 2rem; color: var(--text-main); }

.bento-grid, .bento-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: transform 0.2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--text-muted); }

.card-featured { border: 1px solid var(--accent); background: var(--accent-glow); margin-bottom: 2rem; }
.card-top { margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.meta { color: var(--text-muted); font-size: 0.9rem; }
/* --- 3-COLUMN GRID FOR EDUCATION --- */
.bento-grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .bento-grid-3 {
        grid-template-columns: repeat(3, 1fr); /* 3 Side-by-Side */
    }
}

/* Lists & Tags */
.card ul { list-style-type: disc; padding-left: 1.2rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.card ul li { margin-bottom: 0.5rem; }
.clean-list { list-style: none !important; padding-left: 0 !important; }

.skills-tag-container h4 { font-size: 0.9rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.5rem; letter-spacing: 1px; }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags span {
    background: #262626;
    color: var(--text-main);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* --- 6. CERTIFICATES --- */
/* Pill Buttons */
.cert-link {
    display: inline-block;
    background-color: var(--accent);
    color: #ffffff !important;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.85rem;
    margin-top: 0.6rem;
    border: 1px solid var(--accent);
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}
.cert-link:hover {
    background-color: transparent;
    color: var(--accent) !important;
    transform: translateY(-2px);
}
.cert-link i { margin-right: 6px; }

/* Master Button (Bottom) */
.cert-master-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 0.8rem;
    background-color: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}
.cert-master-btn:hover {
    background-color: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* --- 7. GAME ROOM --- */
/* The Blue Box Wrapper */
.game-room-wrapper {
    background: rgba(59, 130, 246, 0.08);
    border: 2px solid var(--accent);
    border-radius: 16px;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
    max-width: 850px;
    margin: 1rem auto;
    padding: 1.5rem;
}

/* Games Row Layout */
.games-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* Individual Game Cards */
.game-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.2rem;
    border-radius: var(--radius);
    text-align: center;
    height: 100%;
}

.game-room-wrapper h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.game-room-wrapper p { margin-bottom: 1rem; font-size: 0.85rem; }

/* Game Buttons */
#grid-start, #grid-restart {
    background: var(--accent); color: white; border: none; padding: 0.8rem 2rem;
    border-radius: 6px; font-weight: 600; cursor: pointer; display: inline-block;
}
#grid-quit {
    background: transparent; border: 1px solid var(--border); color: var(--text-muted);
    padding: 0.8rem 2rem; border-radius: 6px; cursor: pointer;
}
#grid-abort {
    display: none; background-color: #ef4444; color: white; border: none;
    padding: 0.8rem 2rem; border-radius: 6px; font-weight: 600; cursor: pointer;
}
#grid-abort:hover { background-color: #dc2626; }

/* Speed Grid Internals */
#grid-area {
    display: none; margin: 1.5rem auto; grid-template-columns: repeat(4, 1fr);
    gap: 8px; max-width: 300px;
}
#grid-timer { margin-top: 1rem; font-size: 1.1rem; font-weight: 600; display: none; }
#grid-buttons { margin-top: 1.5rem; display: none; gap: 10px; justify-content: center; }

/* Memory Game Internals */
#memory-board {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    max-width: 400px; margin: 0 auto; perspective: 1000px;
}
.mem-card {
    background-color: transparent; height: 80px; cursor: pointer;
    position: relative; transform-style: preserve-3d; transition: transform 0.5s;
}
.mem-card.flip { transform: rotateY(180deg); }
.mem-front, .mem-back {
    width: 100%; height: 100%; position: absolute; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; font-size: 2rem;
    backface-visibility: hidden; border: 1px solid var(--border);
}
.mem-front { background: #262626; color: var(--text-muted); }
.mem-back { background: var(--accent); color: white; transform: rotateY(180deg); }

#mem-restart {
    background: var(--bg-hover); color: var(--text-main); border: 1px solid var(--border);
    padding: 0.8rem 2rem; border-radius: 6px; cursor: pointer; font-weight: 600;
}
#mem-restart:hover { background: var(--border); }

/* --- 8. FOOTER & UTILS --- */
footer {
    text-align: center; padding: 3rem 0; color: var(--text-muted);
    font-size: 0.9rem; border-top: 1px solid var(--border);
}

.fade-in { animation: fadeIn 0.8s ease forwards; opacity: 0; transform: translateY(10px); }
@keyframes fadeIn { to { opacity: 1; transform: translateY(0); } }

/* --- 9. MEDIA QUERIES (DESKTOP & MOBILE) --- */
@media (min-width: 768px) {
    /* Desktop Layouts */
    .header-grid { flex-direction: row; }
    .header-intro { text-align: left; }
    .bento-grid, .bento-grid-2 { grid-template-columns: repeat(2, 1fr); }
    .span-2 { grid-column: span 2; }
    .games-row { grid-template-columns: 1fr 1fr; } /* Side by side games */
}

@media (max-width: 768px) {
    /* Mobile Adjustments */
    .nav-content { flex-direction: column; gap: 0.8rem; padding: 0.8rem 1rem; }
    .nav-links { flex-wrap: wrap; justify-content: center; gap: 15px; width: 100%; }
    .header-intro { text-align: center; }
    .header-intro h1 { font-size: 2.2rem; }
    .profile-photo { max-width: 220px; margin: 0 auto 1.5rem auto; display: block; }
}
