/* Base settings */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
    overflow: hidden;
}

/* ----------------------------- */
/* 3D Laptop Styles              */
/* ----------------------------- */

.perspective-2000 {
    perspective: 2000px;
}

.transform-style-3d {
    transform-style: preserve-3d;
}

.laptop-scene {
    width: 600px;
    height: 380px;
    position: relative;
    transform: scale(0.6);
}

@media (min-width: 768px) {
    .laptop-scene {
        transform: scale(1);
    }
}

.macbook {
    width: 100%;
    height: 100%;
    position: relative;
    /* KEY CHANGE: 0deg rotation means we look straight at the front edge (closed) */
    transform: rotateX(0deg); 
}

/* --- LID (High Quality) --- */
.lid {
    position: absolute;
    top: 0;
    left: 0;
    width: 600px;
    height: 380px;
    transform-origin: bottom;
    /* Closed flat against base */
    transform: rotateX(-84.5deg);
}

.lid-face {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #0d0d0d;
    border-radius: 18px 18px 0 0;
    border: 1px solid #333;
    overflow: hidden;
    transform: translateZ(1px); 
}

.lid-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2b2b2b 0%, #1a1a1a 100%);
    border-radius: 18px 18px 0 0;
    transform: rotateY(180deg) translateZ(1px);
}

/* Bezel */
.screen-bezel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: black;
    border-radius: 16px 16px 0 0;
    padding: 12px 12px 0 12px;
}

/* Screen Notch */
.camera-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 18px;
    background: black;
    border-radius: 0 0 8px 8px;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
}

.camera-lens {
    width: 6px;
    height: 6px;
    background: #1a1a2e;
    border-radius: 50%;
    box-shadow: inset 0 0 2px rgba(255,255,255,0.2);
}

/* Actual Screen */
.screen-content {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 4px 4px 0 0;
    position: relative;
    overflow: hidden;
}

/* --- BASE (Simple Slab Restored) --- */
.macbook-base {
    position: absolute;
    top: 380px; /* Positioned slightly below lid pivot to prevent overlap */
    left: 50%;
    transform: translateX(-50%) translateZ(-10px);
    width: 715px; /* Wider to match lid when viewed in perspective */
    height: 18px; /* Simple thickness */
    background: #1a1a1a;
    border-radius: 0 0 20px 20px;
    transform-style: preserve-3d;
}

.macbook-base-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #2a2a2a, #1a1a1a);
    border-radius: 0 0 20px 20px;
    border-top: 1px solid #333;
}

.macbook-opener-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 8px;
    background: #151515;
    border-radius: 0 0 10px 10px;
    border: 1px solid #222;
    border-top: none;
}

/* ----------------------------- */
/* General Animations            */
/* ----------------------------- */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up {
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pulse-slow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

.animate-pulse-slow {
    animation: pulse-slow 8s infinite ease-in-out;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.animate-blink {
    animation: blink 1s step-end infinite;
}

/* Scrollbar Hide */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Skill Tags */
.skill-tag {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #cbd5e1; 
    transition: all 0.2s ease-in-out;
    cursor: default;
}

.skill-tag:hover {
    background-color: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

/* Glass Card */
.glass-card {
    background: linear-gradient(145deg, rgba(20, 20, 20, 0.8), rgba(10, 10, 10, 0.9));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.glass-card:hover {
    transform: translateY(-8px);
    border-color: rgba(56, 189, 248, 0.4); 
    box-shadow: 0 10px 40px -10px rgba(56, 189, 248, 0.15);
}

/* Typing Cursor */
.type-cursor::after {
    content: '|';
    animation: blink 1s step-end infinite;
    color: #38bdf8;
    margin-left: 4px;
}

#mobile-menu {
    transition: opacity 0.3s ease-in-out, visibility 0.3s;
}