/* shadcn/ui inspired design system */
:root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --border: 214.3 31.8% 91.4%;
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    --radius: 0.5rem;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

/* Enable scrolling on mobile devices only */
@media (max-width: 768px) {
    html, body {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        height: auto !important;
        min-height: 100vh;
    }
    
    .layout {
        overflow: visible;
        min-height: 100vh;
        height: auto;
    }
    
    .content-wrapper {
        overflow: visible;
    }
    
    .notes-container,
    .projects-container {
        overflow: visible;
    }
    
    .scroll-indicator {
        display: none !important;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.layout {
    display: flex;
    height: 100vh;
    width: 100v;
    overflow: hidden;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: hsl(var(--background));
    z-index: 10;
}

.nav-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 3.5rem;
}

.nav-line {
    position: fixed;
    width: 1px;
    left: calc(2.5rem + 10px);
    background-color: hsl(var(--background));
    pointer-events: none;
    z-index: 1;
}

.nav-link {
    font-size: 1rem;
    font-weight: 400;
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    transition: color 0.2s ease;
    letter-spacing: -0.01em;
}

.nav-link:hover {
    color: hsl(var(--foreground));
}

.nav-link.active {
    color: hsl(var(--foreground));
    font-weight: 500;
}

/* Social Icons */
.social-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    flex: 1;
    justify-content: flex-end;
}

.social-icons {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: flex-start;
    margin-bottom: 3.5rem;
}

.social-line {
    position: fixed;
    width: 1px;
    left: calc(2.5rem + 10px);
    background-color: hsl(var(--background));
    pointer-events: none;
    z-index: 1;
}

.social-icon {
    color: hsl(var(--muted-foreground));
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.social-icon:hover {
    color: hsl(var(--foreground));
}

.social-icon svg {
    width: 100%;
    height: 100%;
}

/* Main Content Area */
.content {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 2rem;
    margin-left: 120px; /* Space for sidebar */
    padding-left: 4rem; /* Good padding from sidebar */
    height: 100vh;
    overflow-y: auto; /* Allow vertical scrolling */
    overflow-x: hidden;
}

.content-wrapper {
    display: grid;
    grid-template-columns: minmax(auto, 32rem) auto; /* Match content max-width */
    gap: 8rem; /* Reduced gap for tighter spacing */
    width: 100%;
    align-items: center;
    margin-top: auto;
    margin-bottom: auto;
}

.text-column {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.game-column {
    width: 400px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Hide game on smaller screens - only show when there's enough room */
@media (max-width: 1200px) {
    .game-column {
        display: none;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr; /* Single column layout */
        gap: 0;
    }
}

.notes-container {
    width: 100%;
    max-width: 32rem; /* Restored original max-width */
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.note {
    padding: 0;
}

.note-text {
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    line-height: 1.7;
    color: hsl(var(--foreground));
    letter-spacing: -0.01em;
    font-weight: 400;
}

.about-title {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 600;
    color: hsl(var(--foreground));
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

/* Inline Icons */
.company-with-icon {
    display: inline-flex;
    align-items: baseline;
    margin-left: 0.25rem;
}

.inline-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
    position: relative;
    top: 2px;
    flex-shrink: 0;
}

/* Projects Section */
.projects-container {
    width: 100%;
    max-width: 32rem; /* Same max-width as notes container */
    display: flex;
    flex-direction: column;
    gap: 3rem;
    padding-right: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-top: 0;
    padding-bottom: 2rem;
    /* Height will be set by JS to match about section */
}

.scroll-indicator {
    position: absolute;
    bottom: -2rem; /* Position below the container */
    left: 50%;
    transform: translateX(-50%);
    background: none;
    border: none;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    padding: 0.5rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-indicator:hover {
    opacity: 1;
    color: hsl(var(--foreground));
    transform: translateX(-50%) translateY(2px);
}

/* Ensure text column has relative positioning for absolute child */
.text-column {
    position: relative;
}

/* Make game fixed and centered on viewport when projects are visible */
.game-column.fixed-center {
    position: fixed !important;
    top: 50% !important;
    left: calc(120px + 4rem + 32rem + 8rem) !important;
    transform: translateY(-50%) !important;
}

/* Game Widget Styles */
.game-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.game-box {
    /* border: 1px solid hsl(var(--foreground)); */
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background-color: transparent;
    position: relative; /* For absolute positioning of dropdown */
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: lowercase;
    color: hsl(var(--foreground));
    font-family: 'Inter', monospace;
    height: 24px; /* Fixed height for alignment */
}

.header-left {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-right {
    position: relative;
    display: flex;
    align-items: center;
}

.leaderboard-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: hsl(var(--muted-foreground));
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.leaderboard-toggle:hover {
    color: hsl(var(--foreground));
}

.leaderboard-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1rem;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none; /* Hidden by default */
    margin-top: 0.5rem;
}

.leaderboard-dropdown.active {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.game-canvas {
    width: 100%;
    height: auto;
    aspect-ratio: 3/4;
    background-color: transparent;
    /* Optional: faint dot grid handled in canvas or CSS background */
    image-rendering: pixelated;
    border: 1px solid hsl(var(--foreground)); /* Add border to canvas instead of box */
    position: relative; /* So overlay can position relative to canvas */
}

.game-footer {
    text-align: center;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin-top: 0.25rem;
}

/* Name Input Overlay */
.name-input-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    border-radius: 0;
}

.name-input-container {
    background-color: hsl(var(--background));
    border: 2px solid hsl(var(--foreground));
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 280px;
    width: 90%;
    text-align: center;
}

.name-input-title {
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    font-family: 'Inter', monospace;
    text-transform: lowercase;
}

.name-input {
    padding: 0.75rem;
    border: 2px solid hsl(var(--foreground));
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    text-align: center;
    outline: none;
    transition: border-color 0.2s ease;
}

.name-input:focus {
    border-color: hsl(var(--muted-foreground));
}

.name-input-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.name-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid hsl(var(--foreground));
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: 'Inter', monospace;
    font-size: 0.75rem;
    text-transform: lowercase;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.name-btn:hover {
    background-color: hsl(var(--foreground));
    color: hsl(var(--background));
}

.name-btn:active {
    transform: scale(0.95);
}

.name-btn-primary {
    background-color: hsl(var(--foreground));
    color: hsl(var(--background));
}

.name-btn-primary:hover {
    background-color: hsl(var(--muted-foreground));
}

.name-btn-secondary {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
}

/* Removed .leaderboard styles as they are now inside dropdown or unused */

.leaderboard-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    text-transform: lowercase;
    border-bottom: 1px solid hsl(var(--border));
    padding-bottom: 0.25rem;
}

.leaderboard-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    font-family: 'Inter', monospace;
}

.leaderboard-item.highlight {
    color: hsl(var(--foreground));
    font-weight: 600;
}


/* Hide scrollbar for webkit browsers */
.projects-container::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.project {
    padding: 0;
}

.project-header {
    margin-bottom: 0.5rem;
}

.project-title {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 600;
    color: hsl(var(--foreground));
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
    transition: color 0.2s ease;
}

.project-title:hover {
    color: hsl(var(--muted-foreground));
}

.external-link-icon {
    width: 16px;
    height: 16px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.project-title:hover .external-link-icon {
    opacity: 1;
}

.project-tagline {
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    line-height: 1.6;
    color: hsl(var(--muted-foreground));
    letter-spacing: -0.01em;
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.project-description {
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    line-height: 1.7;
    color: hsl(var(--foreground));
    letter-spacing: -0.01em;
    font-weight: 400;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .content-wrapper {
        flex-direction: column;
        gap: 3rem;
        align-items: center;
    }

    .text-column {
        max-width: 100%;
    }

    .game-column {
        width: 100%;
        max-width: 400px; /* Limit width on tablet/mobile */
        position: static; /* Remove sticky on mobile */
        order: 2; /* Ensure game is below text */
    }
    
    .game-box {
        width: 100%;
    }
    
    #game-canvas {
        width: 100%;
        height: auto;
    }

    .scroll-indicator {
        display: none !important;
    }
}

/* Also hide on touch devices regardless of width if they have coarse pointers */
@media (hover: none) and (pointer: coarse) {
    .scroll-indicator {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }
    
    .sidebar {
        position: relative;
        height: auto;
        width: 100%;
        padding: 0.5rem 1.5rem; /* Reduced vertical padding */
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-right: none;
        border-bottom: none;
        flex-shrink: 0;
    }
    
    .nav-section {
        flex-direction: row;
        align-items: center;
    }
    
    .nav-links {
        flex-direction: row;
        gap: 2rem;
        margin-top: 0;
    }
    
    .nav-line {
        display: none;
    }
    
    .social-section {
        flex-direction: row;
        align-items: center;
        gap: 1.5rem;
        flex: 1;
        justify-content: flex-end;
    }
    
    .social-icons {
        flex-direction: row;
        gap: 1.5rem;
        margin-bottom: 0;
    }
    
    .social-line {
        display: none;
    }
    
    .content {
        margin-left: 0;
        padding: 1.5rem;
        padding-top: 1rem; /* Ensure content starts near top */
        justify-content: flex-start;
        align-items: flex-start; /* Align to top */
        flex: 1;
        min-height: 0;
        height: auto; /* Allow content to expand on mobile */
        overflow-y: visible; /* Let parent handle scrolling on mobile */
    }
    
    .content-wrapper {
        width: 100%;
        gap: 2.5rem;
        grid-template-columns: 1fr; /* Single column layout on mobile */
        margin-top: 0;
        margin-bottom: 0;
    }
    
    .game-column {
        display: none; /* Hide game on mobile */
    }

    .notes-container,
    .projects-container {
        max-width: 100%;
        width: 100%;
        /* Remove vertical centering */
        align-self: flex-start;
        margin-top: 0;
        margin-bottom: 0;
    }
    
    .projects-container {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .sidebar {
        padding: 1.25rem 1.5rem;
    }
    
    .nav-links {
        gap: 1.5rem;
    }
    
    .social-icons {
        gap: 1.25rem;
    }
    
    .social-line {
        width: 80px;
    }
    
    .content {
        padding: 1rem;
    }
    
    .notes-container {
        gap: 1.25rem;
    }
    
    .note-text {
        font-size: clamp(0.8125rem, 4vw, 0.9375rem);
    }
}

/* Target Cursor Styles */
.target-cursor-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
}

.target-cursor-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    will-change: transform;
}

.target-cursor-corner {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 12px;
    border: 3px solid #fff;
    will-change: transform;
}

.corner-tl {
    transform: translate(-150%, -150%);
    border-right: none;
    border-bottom: none;
}

.corner-tr {
    transform: translate(50%, -150%);
    border-left: none;
    border-bottom: none;
}

.corner-br {
    transform: translate(50%, 50%);
    border-left: none;
    border-top: none;
}

.corner-bl {
    transform: translate(-150%, 50%);
    border-right: none;
    border-top: none;
}

/* Locked-on text class - makes bold text trigger cursor lock */
.locked-on {
    cursor: none;
    display: inline;
}

.locked-on strong,
.locked-on b {
    cursor: none;
}






