/* ============================================
   Modern Portfolio CSS
   ============================================ */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: #1e293b;
    background: #f8fafc;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ============================================
   STYLE TOGGLE
   ============================================ */
.style-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    text-decoration: none;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.25);
    transition: all 0.3s ease;
}

.style-toggle:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
    color: #ffffff;
}

.toggle-icon { font-size: 16px; line-height: 1; }

/* ============================================
   BANNER
   ============================================ */
.banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 96px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
}

.banner-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.banner-content h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    margin-bottom: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1s ease-out;
}

.banner-content p {
    font-size: clamp(1.125rem, 3vw, 1.5rem);
    opacity: 0.9;
    font-weight: 400;
    margin-bottom: 48px;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.banner-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    color: #ffffff;
    padding: 16px 32px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 1s ease-out 0.4s both;
}

.banner-cta:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

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

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 96px 32px;
    position: relative;
}

.projects-section { margin-top: 96px; }

.section-title {
    text-align: center;
    margin-bottom: 64px;
}

.section-title h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 16px;
    position: relative;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 4px;
}

.section-title p {
    font-size: 1.125rem;
    color: #475569;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   PROJECTS GRID
   ============================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 48px;
    margin-top: 64px;
}

.project-card {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    display: block;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInUp 0.6s ease-out forwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes slideInUp {
    to { opacity: 1; transform: translateY(0); }
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    border-color: #cbd5e1;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    transform: scaleX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left;
}

.project-card:hover::before { transform: scaleX(1); }

.project-image {
    height: 200px;
    overflow: hidden;
    position: relative;
    background: #f1f5f9;
}

.project-image::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.project-card:hover .project-image::after { transform: translateX(100%); }

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-image img { transform: scale(1.1); }

.project-title {
    padding: 32px;
    text-align: center;
    position: relative;
}

.project-title h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #0f172a;
    transition: color 0.15s;
}

.project-card:hover .project-title h3 { color: #334155; }

.project-subtitle {
    margin-top: 6px;
    color: #475569;
    font-size: 0.95rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin-top: 8px;
}

.tech-tag {
    background: #f1f5f9;
    color: #475569;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.15s;
}

.project-card:hover .tech-tag {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #ffffff;
    transform: translateY(-1px);
}

/* Project expanded content */
.project-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.project-card.expanded .project-content {
    max-height: 600px;
    padding: 32px;
}

.project-description { margin-bottom: 24px; }
.project-description p { color: #475569; line-height: 1.7; font-size: 0.95rem; }

.project-details {
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.project-details h4 {
    color: #0f172a;
    margin-bottom: 16px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-details h4::before { content: '\26A1'; font-size: 1.2rem; }

.project-details ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.project-details li {
    padding: 8px;
    color: #475569;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.15s;
    border: 1px solid #e2e8f0;
}

.project-details li:hover {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #ffffff;
    transform: translateY(-1px);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

::selection { background: #667eea; color: #ffffff; }

/* Focus states */
.project-card:focus-visible { outline: 2px solid #4facfe; outline-offset: 2px; }
.banner-cta:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .projects-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; }
    .main-content { padding: 64px 24px; }
}

@media (max-width: 768px) {
    .banner { min-height: 80vh; padding: 48px 24px; }
    .projects-grid { grid-template-columns: 1fr; gap: 24px; }
    .main-content { padding: 48px 16px; }
    .project-title { padding: 24px; }
    .project-details ul { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
}

@media (max-width: 480px) {
    .banner { min-height: 70vh; padding: 32px 16px; }
    .main-content { padding: 32px 8px; }
    .project-card { border-radius: 16px; }
    .project-title { padding: 16px; }
    .project-details { padding: 16px; }
    .project-details ul { grid-template-columns: 1fr; gap: 4px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
