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

/* Cross-browser fixes */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #333, #222);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #444, #333);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, #555, #444);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #333 #0a0a0a;
}

/* Standard Cursors */
body {
    background: #0f0f0f;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow-x: hidden;
    cursor: default;
}

a, button, .btn-primary, .nav a, .tech-tag, .tag {
    cursor: pointer;
}

.service-item, .project-image, .project-title {
    cursor: pointer;
}

input, textarea {
    cursor: text;
}

.contact-method {
    cursor: default;
    pointer-events: auto;
}

/* Subtle grid background */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    z-index: 0;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Scan line only for project images */
.project-scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: scanDownProject 3s linear infinite;
    z-index: 10;
}

@keyframes scanDownProject {
    0% { top: 0%; }
    100% { top: 100%; }
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    animation: headerGlow 3s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.1); }
    50% { box-shadow: 0 0 30px rgba(255, 255, 255, 0.2); }
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transition: all 0.3s;
}

.logo:hover {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
}


.nav {
    display: flex;
    gap: 40px;
}

.nav a {
    color: #999;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav a::before {
    content: '>';
    position: absolute;
    left: -15px;
    opacity: 0;
    transition: all 0.3s;
}

.nav a:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.nav a:hover::before {
    opacity: 1;
    left: -20px;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 20px 50px;
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 72px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 30px;
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: titleGlitch 5s infinite;
}

@keyframes titleGlitch {
    0%, 90%, 100% { transform: translate(0); }
    91% { transform: translate(-2px, 2px); }
    92% { transform: translate(2px, -2px); }
    93% { transform: translate(0); }
}

.hero-content p {
    font-size: 18px;
    color: #999;
    max-width: 800px;
    margin: 0 auto 40px;
    line-height: 1.8;
    animation: fadeInUp 1s ease-out;
}

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

.btn-primary {
    display: inline-block;
    padding: 15px 40px;
    background: transparent;
    color: #fff;
    text-decoration: none;
    border: 2px solid #fff;
    font-weight: 600;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #fff;
    transition: left 0.3s;
    z-index: -1;
}

.btn-primary:hover::before {
    left: 0;
}

.btn-primary:hover {
    color: #000;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 40px;
    position: relative;
    z-index: 2;
}

.section-title {
    font-size: 48px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    animation: titleFlicker 4s infinite;
}

@keyframes titleFlicker {
    0%, 100% { opacity: 1; }
    41% { opacity: 0.8; }
    43% { opacity: 0.9; }
}

.about-section {
    background: #0a0a0a;
    padding: 100px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.service-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.service-item::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: serviceShine 3s infinite;
}

@keyframes serviceShine {
    0% { top: -100%; }
    100% { top: 100%; }
}

.service-item:hover {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    transform: translateX(10px);
}

.service-item h3 {
    font-size: 18px;
    color: #fff;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.service-item p {
    font-size: 14px;
    color: #999;
    line-height: 1.6;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.tech-tag {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid #666;
    color: #ccc;
    font-size: 13px;
    transition: all 0.3s;
}

.tech-tag:hover {
    border-color: #fff;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.projects {
    display: grid;
    gap: 80px;
}

.project {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    animation: projectSlideIn 1s ease-out;
}

@keyframes projectSlideIn {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

.project:nth-child(even) {
    direction: rtl;
}

.project:nth-child(even) > * {
    direction: ltr;
}

.project-image {
    width: 100%;
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    color: #333;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.project-image::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: projectImageShine 3s infinite;
    z-index: 5;
}

@keyframes projectImageShine {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.project-image:hover {
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2), inset 0 0 30px rgba(255, 255, 255, 0.05);
    transform: scale(1.05);
}

.project-title {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    transition: all 0.3s;
}

.project-title:hover {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.tag {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid #666;
    color: #999;
    font-size: 12px;
    transition: all 0.3s;
}

.tag:hover {
    border-color: #fff;
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.contact-section {
    text-align: center;
    padding: 100px 40px;
    background: #0a0a0a;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    justify-items: center;
}

.contact-method {
    transition: all 0.3s;
    min-width: 200px;
}

.contact-method:hover {
    transform: translateY(-10px);
}

.contact-label {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    font-weight: 600;
}

.contact-value {
    font-size: 18px;
    color: #fff;
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    cursor: text !important;
}

.copy-contact-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer !important;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    outline: none;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.copy-contact-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}

.copy-contact-btn:active {
    transform: translateY(0);
}

.approach-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

/* Tablet & Small Desktop */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 80px 30px;
    }
    
    .hero-content h1 {
        font-size: 56px;
    }
    
    .project {
        gap: 40px;
    }
}

/* Tablet Portrait */
@media (max-width: 768px) {
    .header {
        padding: 10px 15px;
        flex-wrap: wrap;
    }
    
    .logo {
        font-size: 16px;
    }
    
    .logo div {
        gap: 1px !important;
    }
    
    .logo div span:first-child {
        font-size: 18px !important;
        letter-spacing: 1px !important;
    }
    
    .logo div span:last-child {
        font-size: 7px !important;
        letter-spacing: 2px !important;
    }
    
    .nav {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
        gap: 18px;
    }
    
    .nav a {
        font-size: 11px;
        letter-spacing: 1px;
    }
    
    .hero {
        min-height: 80vh;
        padding: 100px 20px 50px;
    }
    
    .hero-content h1 {
        font-size: 42px;
        letter-spacing: 2px;
    }
    
    .hero-content p {
        font-size: 16px;
    }
    
    .container {
        padding: 60px 20px;
    }
    
    .section-title {
        font-size: 36px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .service-item {
        padding: 25px;
    }
    
    .tech-tags {
        gap: 10px;
    }
    
    .tech-tag {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .approach-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .project {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .project:nth-child(even) {
        direction: ltr;
    }
    
    .project-title {
        font-size: 28px;
    }
    
    .contact-methods {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .contact-method {
        min-width: auto;
        max-width: 100%;
    }
    
    .contact-section {
        padding: 60px 20px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .header {
        padding: 8px 12px;
    }
    
    .logo {
        font-size: 14px;
    }
    
    .logo div {
        gap: 1px !important;
    }
    
    .logo div span:first-child {
        font-size: 16px !important;
        letter-spacing: 0.5px !important;
    }
    
    .logo div span:last-child {
        font-size: 6px !important;
        letter-spacing: 1.5px !important;
    }
    
    .nav {
        gap: 12px;
        flex-wrap: wrap;
        margin-top: 6px;
    }
    
    .nav a {
        font-size: 10px;
        letter-spacing: 0.5px;
        padding: 2px 0;
    }
    
    .hero {
        padding: 80px 15px 40px;
    }
    
    .hero-content h1 {
        font-size: 32px;
        letter-spacing: 1px;
        line-height: 1.2;
    }
    
    .hero-content p {
        font-size: 14px;
        max-width: 100%;
    }
    
    .btn-primary {
        padding: 12px 30px;
        font-size: 13px;
    }
    
    .container {
        padding: 50px 15px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .section-subtitle {
        font-size: 16px;
    }
    
    .service-item {
        padding: 20px;
    }
    
    .service-item h3 {
        font-size: 16px;
    }
    
    .service-item p {
        font-size: 13px;
    }
    
    .tech-tag {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .project-image {
        font-size: 36px;
    }
    
    .project-title {
        font-size: 24px;
    }
    
    .project-desc {
        font-size: 14px;
    }
    
    .tag {
        padding: 5px 12px;
        font-size: 11px;
    }
    
    .contact-section h2 {
        font-size: 32px !important;
    }
    
    .contact-section > p {
        font-size: 16px !important;
    }
    
    .contact-methods {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .contact-method {
        min-width: 100%;
        max-width: 100%;
    }
    
    .contact-label {
        font-size: 12px;
    }
    
    .contact-value {
        font-size: 14px;
        word-break: break-word;
    }
    
    .copy-contact-btn {
        padding: 6px 16px;
        font-size: 11px;
        width: 100%;
        max-width: 150px;
    }
    
    .footer {
        padding: 30px 15px;
        font-size: 12px;
    }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
    .header {
        padding: 6px 10px;
    }
    
    .logo div span:first-child {
        font-size: 14px !important;
        letter-spacing: 0px !important;
    }
    
    .logo div span:last-child {
        font-size: 5px !important;
        letter-spacing: 1px !important;
    }
    
    .nav {
        gap: 10px;
        margin-top: 5px;
    }
    
    .nav a {
        font-size: 9px;
        letter-spacing: 0px;
    }
    
    .hero {
        padding: 70px 10px 30px;
    }
    
    .hero-content h1 {
        font-size: 28px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .tech-tags {
        gap: 8px;
    }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
    /* Reduce animations on mobile for better performance */
    .bg-grid {
        animation: none;
        opacity: 0.5;
    }
    
    .project-scan-line {
        animation-duration: 5s;
    }
    
    /* Disable expensive animations */
    .service-item::before,
    .project-image::before {
        animation: none;
    }
    
    /* Optimize hover effects for touch */
    .service-item:hover,
    .project-image:hover,
    .tech-tag:hover,
    .tag:hover {
        transform: none;
    }
    
    .contact-method:hover {
        transform: none;
    }
    
    .copy-contact-btn:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Prevent text selection issues on mobile */
@media (max-width: 768px) {
    .nav a,
    .btn-primary,
    .tech-tag,
    .tag {
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
        -webkit-touch-callout: none;
    }
    
    /* Allow selection in contact values */
    .contact-value {
        -webkit-touch-callout: default;
        user-select: text;
        -webkit-user-select: text;
    }
}

/* Support for older browsers */
@supports not (backdrop-filter: blur(10px)) {
    .header {
        background: rgba(0, 0, 0, 0.98);
    }
}

/* Fix for iOS Safari */
@supports (-webkit-overflow-scrolling: touch) {
    body {
        -webkit-overflow-scrolling: touch;
    }
}
