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

body, html {
    width: 100%;
    height: 100%;
    font-family: 'Outfit', sans-serif;
    background-color: #050505;
    color: #e0e0e0;
    overflow-x: hidden;
}

#sk-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

.overlay {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* pointer-events removed so mobile scrolling works seamlessly */
}

header {
    text-align: center;
    margin-bottom: 5rem;
    pointer-events: auto;
}

h1 {
    font-size: 3.5rem;
    font-weight: 600;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #ffffff, #888888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.2rem;
    color: #888;
    font-weight: 300;
}

#projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2.5rem;
    width: 100%;
    max-width: 1200px;
    pointer-events: auto; /* Cards must be clickable */
}

.card {
    background: rgba(20, 20, 20, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.card:hover::before {
    opacity: 1;
}

.card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-category {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #00e5ff; /* Cyan accent matching spin +1 */
    margin-bottom: 1rem;
    font-weight: 600;
}

.card-title {
    font-size: 1.3rem;
    line-height: 1.5;
    font-weight: 400;
    margin-bottom: 2rem;
    color: #fff;
}

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: #aaa;
    font-weight: 300;
}

.card-footer svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    transition: color 0.3s ease, transform 0.3s ease;
}

.card:hover .card-footer {
    color: #00e5ff;
}

.card:hover .card-footer svg {
    transform: translateX(4px);
}

.explanation {
    margin-top: 6rem;
    max-width: 800px;
    background: rgba(15, 15, 15, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 3rem;
    pointer-events: auto;
}

.explanation h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #fff;
}

.explanation h3 {
    font-size: 1.4rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #00e5ff;
    font-weight: 400;
}

.explanation p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: #ddd;
}

.explanation ul {
    list-style-position: inside;
    margin-left: 1rem;
}

.explanation li {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #ccc;
}

.explanation ul ul {
    margin-top: 0.5rem;
    margin-left: 1.5rem;
    list-style-type: circle;
}

.explanation ul ul li {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: #aaa;
}

.explanation strong {
    color: #00e5ff;
}

#hud-container {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 4rem;
    pointer-events: none;
    flex-wrap: wrap;
    gap: 1rem;
}

.hud-panel {
    width: 140px;
    background: rgba(10, 10, 10, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pd-title {
    font-size: 0.65rem;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-align: center;
}

#phase-diagram, #matrix-canvas {
    width: 120px;
    height: 120px;
}

@media (min-width: 769px) {
    #hud-container {
        position: fixed;
        bottom: 2rem;
        left: 2rem;
        width: calc(100vw - 4rem);
        justify-content: space-between;
        margin-top: 0;
        z-index: 10;
    }
}
