/* ═══════════════════════════════════════════════════════════════
   DEVAM LATHIYA — PORTFOLIO
   Theme: full dark, premium minimal, consistent throughout
═══════════════════════════════════════════════════════════════ */

:root {
    --bg:          #0c0c0c;
    --bg-card:     #111111;
    --bg-hover:    #161616;
    --line:        rgba(255,255,255,0.07);
    --text:        #f0ede8;
    --text-dim:    rgba(240,237,232,0.38);
    --text-mid:    rgba(240,237,232,0.62);
    --accent:      #f0ede8;
    --font-head:   'Satoshi', sans-serif;
    --font-mono:   'JetBrains Mono', monospace;
}

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

html { 
    scroll-behavior: auto;
    overflow-x: hidden;
    width: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-head);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
}




/* ── Custom cursor: dot + trailing ring ── */
* { cursor: none !important; }

.cursor-dot {
    width: 6px;
    height: 6px;
    background: #111;
    border-radius: 50%;
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 99999;
    opacity: 0;
    transform: translate(-50%, -50%);
    will-change: transform;
    transition: background 0.2s ease;
}

.cursor-ring {
    width: 38px;
    height: 38px;
    border: 1.5px solid rgba(0,0,0,0.6);
    border-radius: 50%;
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 99998;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, border-color 0.2s ease, background 0.2s ease;
    will-change: transform;
}

/* Below hero (dark bg) → white cursor */
body.cursor-light .cursor-dot  { background: #ffffff; }
body.cursor-light .cursor-ring { border-color: rgba(255,255,255,0.6); }

/* Hover: ring expands */
.cursor-ring.is-hover { width: 58px; height: 58px; }
body.cursor-light .cursor-ring.is-hover { border-color: rgba(255,255,255,0.35); }

/* ── Container ── */
.container {
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
    padding: 0 2.5rem;
}

/* ── Mono utility ── */
.mono {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* ── Sections ── */
section {
    padding: 9rem 2.5rem;
    position: relative;
}

section + section {
    border-top: 1px solid var(--line);
}

/* ── Reveal base ── */
.reveal {
    opacity: 0;
    transform: translateY(28px);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 9999px;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text);
    background: transparent;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.btn:hover {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

/* ── Services grid ── */
.grid-services {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.service-card {
    padding: 2.5rem 2.5rem 2.5rem 0;
    border-right: 1px solid var(--line);
}

.service-card:last-child {
    border-right: none;
    padding-right: 0;
    padding-left: 2.5rem;
}

.service-card:nth-child(2) {
    padding-left: 2.5rem;
}

.service-image {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 2rem;
    background: #1a1a1a;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    transition: opacity 0.5s ease, transform 0.6s ease;
    filter: grayscale(30%);
}

.service-card:hover .service-image img {
    opacity: 0.75;
    transform: scale(1.04);
}

/* ── Marquee ── */
.marquee-container {
    overflow: hidden;
    white-space: nowrap;
    padding: 1.5rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.marquee-content {
    display: inline-block;
    animation: marquee 28s linear infinite;
    font-family: var(--font-head);
    font-weight: 900;
    font-size: clamp(3.5rem, 10vw, 9rem);
    color: transparent;
    -webkit-text-stroke: 2px rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ── Contact form ── */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.input-group {
    position: relative;
    border-bottom: 1px solid var(--line);
    transition: border-color 0.3s;
}

.input-group:focus-within {
    border-bottom-color: rgba(255,255,255,0.4);
}

.input-group input,
.input-group textarea {
    width: 100%;
    background: transparent;
    border: none;
    padding: 1.4rem 0;
    font-family: var(--font-head);
    font-size: 1rem;
    color: var(--text);
    resize: none;
    outline: none;
}

.input-group textarea { min-height: 100px; }

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* ── Modal ── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(16px);
    opacity: 0;
}

.modal-content {
    position: relative;
    background: #111;
    border: 1px solid var(--line);
    width: 90%;
    max-width: 720px;
    padding: 3.5rem;
    border-radius: 1.25rem;
    transform: translateY(50px);
    opacity: 0;
    z-index: 1001;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.3rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover { color: var(--text); }

/* ── Mobile menu ── */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: #0c0c0c;
    z-index: 100000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    align-items: center;
}

.mobile-link {
    font-size: 2rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mobile-menu-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

/* ── Footer ── */
footer {
    padding: 2.5rem;
    border-top: 1px solid var(--line);
}

/* ── Image hover (about) ── */
.image-hover-container { cursor: pointer; position: relative; }

.hover-image { transition: opacity 0.6s ease !important; }

@media (hover: hover) {
    .image-hover-container:hover .hover-image { opacity: 1 !important; }
    .image-hover-container:hover .base-image  { opacity: 0.8; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .grid-services {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .service-card,
    .service-card:nth-child(2),
    .service-card:last-child {
        border-right: none;
        border-bottom: 1px solid var(--line);
        padding: 0 0 3rem 0;
    }

    .service-card:last-child { border-bottom: none; }
}

@media (max-width: 768px) {
    section { padding: 6rem 1.5rem; }
    .container { padding: 0 1.5rem; }
}



/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — full coverage
═══════════════════════════════════════════════════════════════ */

/* ── Hide custom cursor on touch devices ── */
@media (hover: none) {
    .cursor-dot, .cursor-ring { display: none !important; }
    * { cursor: auto !important; }
}

/* ══════════════════════════
   TABLET — max 1024px
══════════════════════════ */
@media (max-width: 1024px) {
    .about-grid {
        grid-template-columns: 1fr 1.4fr;
        gap: 3rem;
    }

    .grid-services {
        grid-template-columns: 1fr 1fr;
    }

    .service-card:last-child {
        grid-column: 1 / -1;
        border-right: none;
        border-bottom: none;
        padding: 2.5rem 0 0 0;
        border-top: 1px solid var(--line);
    }

    .service-card:nth-child(2) {
        border-right: none;
        padding-right: 0;
    }
}

/* ══════════════════════════
   MOBILE — max 768px
══════════════════════════ */
@media (max-width: 768px) {

    /* ── Global spacing ── */
    section { padding: 5rem 1.25rem; }
    .container { padding: 0 1.25rem; }

    /* ── Services: single column ── */
    .grid-services {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .service-card,
    .service-card:nth-child(2),
    .service-card:last-child {
        border-right: none;
        border-bottom: 1px solid var(--line);
        border-top: none;
        padding: 2.5rem 0;
        grid-column: auto;
    }

    .service-card:last-child { border-bottom: none; }
    
    /* ── Service images: better mobile aspect ratio ── */
    .service-image {
        aspect-ratio: 16/10;
        margin-bottom: 1.5rem;
    }

    /* ── Works: hide tags, simplify grid ── */
    .work-item {
        grid-template-columns: 3rem 1fr;
        gap: 1rem;
        padding: 1.6rem 0.5rem;
        cursor: pointer;
    }

    .work-tags { display: none; }

    .work-title { font-size: 1.1rem; }

    /* ── About: single column ── */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .about-image-wrap {
        aspect-ratio: 4/3;
        max-height: 320px;
    }

    .about-stats {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
        margin-top: 2rem;
    }

    .stat { padding: 1.1rem; }
    .stat-num { font-size: 1.6rem; }

    /* ── Contact: single column ── */
    #contact > .container > div[style*="grid"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 3rem !important;
    }
    
    /* ── Contact buttons: stack vertically on mobile ── */
    #contact [style*="margin-top:3rem"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    #contact .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
        padding: 1rem 1.5rem;
        font-size: 0.65rem;
    }

    /* ── Footer ── */
    footer .container {
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
    }

    /* ── Section headings ── */
    h2[style*="clamp"] {
        font-size: clamp(1.8rem, 8vw, 3rem) !important;
    }

    /* ── Marquee text smaller ── */
    .marquee-content {
        font-size: clamp(3rem, 15vw, 6rem) !important;
    }

    /* ── Modal ── */
    .modal-content {
        padding: 2rem 1.5rem;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* ── Buttons: larger touch targets ── */
    .btn { 
        font-size: 0.62rem; 
        padding: 0.9rem 1.6rem;
        min-height: 44px; /* iOS minimum touch target */
    }
    
    /* ── Mobile menu improvements ── */
    .mobile-link {
        font-size: 1.8rem;
        padding: 0.5rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* ══════════════════════════
   SMALL MOBILE — max 480px
══════════════════════════ */
@media (max-width: 480px) {

    section { padding: 4rem 1rem; }
    .container { padding: 0 1rem; }

    /* ── Hero left panel: bigger name on small screens ── */
    .hero-hello { font-size: 0.9rem; }
    .hero-fullname { font-size: clamp(2.2rem, 11vw, 3rem) !important; }

    /* ── About stats: 2 cols still but tighter ── */
    .about-stats { gap: 0.6rem; }
    .stat-num { font-size: 1.4rem; }
    .stat-label { font-size: 0.55rem; }

    /* ── Works ── */
    .work-item { padding: 1.4rem 0.4rem; }
    .work-title { font-size: 1rem; }
    .work-num { font-size: 0.6rem; }

    /* ── Contact email link ── */
    a[href^="mailto"] {
        font-size: 0.78rem !important;
        word-break: break-all;
    }

    /* ── Preloader counter smaller ── */
    .pre-counter-num { font-size: 2.5rem; }
    .pre-name { font-size: clamp(1rem, 6vw, 1.8rem); }
    
    /* ── Buttons: extra large touch targets ── */
    .btn {
        padding: 1rem 1.4rem;
        font-size: 0.6rem;
        min-height: 48px;
    }
    
    /* ── Input fields: larger for mobile ── */
    .input-group input,
    .input-group textarea {
        padding: 1.6rem 0;
        font-size: 1.05rem;
    }
    
    /* ── Service images: better ratio for small screens ── */
    .service-image {
        aspect-ratio: 1/1;
        margin-bottom: 1.2rem;
    }
    
    /* ── Marquee: even smaller on tiny screens ── */
    .marquee-content {
        font-size: clamp(2rem, 12vw, 4rem) !important;
        -webkit-text-stroke: 1.5px rgba(255,255,255,0.3);
    }
    
    /* ── Section labels smaller ── */
    .section-label {
        font-size: 0.6rem;
        margin-bottom: 2rem;
    }
}

/* ── Contact grid ── */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: start;
}

/* ── Contact section button container ── */
#contact [style*="margin-top:3rem"] {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    /* ── Contact buttons: stack vertically on mobile ── */
    #contact [style*="margin-top:3rem"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    #contact .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    /* ── Even smaller buttons on tiny screens ── */
    #contact .btn {
        padding: 0.9rem 1.2rem;
        font-size: 0.6rem;
    }
}

/* ══════════════════════════════════════════════════════════════
   LANDSCAPE MOBILE — better UX for horizontal phones
══════════════════════════════════════════════════════════════ */
@media (max-height: 600px) and (orientation: landscape) {
    /* Hero adjustments for landscape */
    #hero {
        height: 100vh;
        min-height: 500px;
    }
    
    .hero-left {
        left: 2rem;
        bottom: 2rem;
    }
    
    .hero-fullname {
        font-size: clamp(1.2rem, 6vh, 2rem);
    }
    
    .hero-scroll {
        display: none; /* Hide scroll indicator in landscape */
    }
    
    .floating-text-line span {
        font-size: clamp(2rem, 8vh, 4rem);
    }
    
    /* Sections more compact */
    section {
        padding: 3rem 1.5rem;
    }
    
    /* Modal smaller in landscape */
    .modal-content {
        max-height: 85vh;
        padding: 1.5rem;
    }
}
