/* ============================================================
   PALLAV SEN CGI — Main Stylesheet
   ============================================================ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:           #050505;
    --bg-card:      #0a0a0a;
    --bg-card-hover:#111111;
    --white:        #ffffff;
    --neutral-300:  #d4d4d4;
    --neutral-400:  #a3a3a3;
    --neutral-500:  #737373;
    --neutral-600:  #525252;
    --neutral-900:  #171717;
    --border:       rgba(255,255,255,0.10);
    --border-hover: rgba(255,255,255,0.40);
    --radius-xl:    1rem;
    --radius-2xl:   1.5rem;
    --radius-3xl:   1.875rem;
    --radius-full:  9999px;
    --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition:   0.3s ease;
    --nav-h:        72px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a  { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ============================================================
   LOADING SCREEN
   ============================================================ */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-logo {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 2.5rem;
    animation: pulse 2s ease-in-out infinite;
}

.loading-logo span { color: var(--neutral-500); font-weight: 300; }

.loading-bar-track {
    width: 16rem;
    height: 2px;
    background: rgba(255,255,255,0.10);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.loading-bar-fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    background: var(--white);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 0.3s ease-out;
}

.loading-label {
    margin-top: 1.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--neutral-500);
    font-weight: 500;
}

@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:0.5 } }

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-header {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    width: max-content;
    max-width: calc(100vw - 2rem);
}

.nav-pill {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: rgba(0,0,0,0.40);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.75rem 1.5rem;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--white);
    white-space: nowrap;
}
.nav-logo span { color: var(--neutral-500); font-weight: 300; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--neutral-400);
    transition: color var(--transition);
}
.nav-link:hover,
.nav-link.active { color: var(--white); }

.nav-mobile-toggle {
    display: none;
    color: var(--white);
    padding: 0.25rem;
}

/* ── Mobile Menu ── */
.mobile-menu {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 600;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu.is-open  { display: flex; }

.mobile-menu-close {
    position: absolute;
    top: 2.5rem;
    right: 2.5rem;
    color: var(--white);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}
.mobile-nav-links a {
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--neutral-600);
    transition: color var(--transition);
}
.mobile-nav-links a:hover,
.mobile-nav-links a.active { color: var(--white); }

/* ── Responsive Nav ── */
@media (max-width: 767px) {
    .nav-links     { display: none; }
    .nav-mobile-toggle { display: block; }
    .nav-pill      { gap: 1rem; }
}

/* ============================================================
   SITE MAIN & FOOTER
   ============================================================ */
.site-main { min-height: 100vh; }

.site-footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 3rem 1.5rem;
}
.footer-inner {
    max-width: 87.5rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.footer-brand {
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--white);
}
.footer-brand span { color: var(--neutral-500); font-weight: 300; }
.footer-meta { font-size: 0.875rem; color: var(--neutral-500); }

@media (min-width: 768px) {
    .footer-inner { flex-direction: row; justify-content: space-between; }
}

/* ============================================================
   HOME — SCROLL SEQUENCER
   ============================================================ */
.sequencer-section {
    position: relative;
    height: 400vh;
    background: var(--bg);
}

.sequencer-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.sequencer-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: var(--bg);
}

/* ── Slide Text ── */
.sequencer-slides {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.seq-slide {
    position: absolute;
    text-align: center;
    max-width: 56rem;
    padding: 0 1.5rem;
    opacity: 0;
    will-change: opacity, transform;
    transition: opacity 0.1s ease-out, transform 0.1s ease-out;
}

.seq-title {
    font-size: clamp(2.5rem, 8vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.seq-desc {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--neutral-300);
    font-weight: 300;
    max-width: 40rem;
    margin: 0 auto;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    line-height: 1.5;
}

/* ── Scroll Hint ── */
.scroll-hint {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.5;
    color: var(--white);
}
.scroll-hint span {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}
.bounce-icon { animation: bounce 1.5s ease-in-out infinite; }

@keyframes bounce {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(6px); }
}

/* ============================================================
   HOME — SELECTED WORKS GALLERY
   ============================================================ */
.gallery-section {
    position: relative;
    z-index: 10;
    background: var(--bg);
    padding: 8rem 1rem;
}

.gallery-wrapper { max-width: 87.5rem; margin: 0 auto; }

.gallery-header {
    margin-bottom: 6rem;
    text-align: center;
}
.gallery-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 1rem;
}
.gallery-subtitle { color: var(--neutral-400); }

.stacked-gallery {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    padding-bottom: 8rem;
}

@media (min-width: 768px) { .stacked-gallery { gap: 8rem; } }

.stacked-card {
    position: sticky;
    height: 70vh;
    overflow: hidden;
    border-radius: var(--radius-2xl);
    background: var(--neutral-900);
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
    transition: transform 0.5s ease;
}
.stacked-card:hover { transform: scale(1.01); }

.stacked-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: opacity var(--transition);
}
.stacked-card:hover img { opacity: 1; }

/* ============================================================
   PAGE HERO (shared across Showcase / Labs)
   ============================================================ */
.page-hero {
    margin-bottom: 5rem;
}

.page-hero-title {
    font-size: clamp(3.5rem, 10vw, 7rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 0.95;
    margin-bottom: 1.5rem;
}

.page-hero-desc {
    font-size: 1.25rem;
    color: var(--neutral-400);
    max-width: 40rem;
    line-height: 1.7;
}

/* ============================================================
   PAGE SHOWCASE
   ============================================================ */
.page-showcase {
    min-height: 100vh;
    background: var(--bg);
    padding: 8rem 1rem 6rem;
}

@media (min-width: 768px) { .page-showcase { padding: 8rem 3rem 6rem; } }

.bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    auto-rows: 250px;
    gap: 1rem;
}

@media (min-width: 768px) {
    .bento-grid {
        grid-template-columns: repeat(4, 1fr);
        auto-rows: 300px;
    }

    .bento-item.span-large-square { grid-column: span 2; grid-row: span 2; }
    .bento-item.span-wide         { grid-column: span 2; grid-row: span 1; }
    .bento-item.span-tall         { grid-column: span 1; grid-row: span 2; }
    .bento-item.span-default      { grid-column: span 1; grid-row: span 1; }
}

.bento-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: var(--neutral-900);
    border: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
}

.bento-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease, opacity 0.3s ease;
}
.bento-item:hover img { transform: scale(1.05); opacity: 0.6; }

.bento-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}
.bento-item:hover .bento-overlay { opacity: 1; }

.bento-view-btn {
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--white);
}

/* ============================================================
   PAGE LABS
   ============================================================ */
.page-labs {
    min-height: 100vh;
    background: var(--bg);
    padding: 8rem 1rem 6rem;
}

@media (min-width: 768px) { .page-labs { padding: 8rem 3rem 6rem; } }

.labs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .labs-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
}

.lab-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-3xl);
    padding: 2.5rem;
    cursor: pointer;
    overflow: hidden;
    transition: background var(--transition);
}
.lab-card:hover { background: var(--bg-card-hover); }

@media (min-width: 768px) { .lab-card { padding: 3.5rem; } }

.lab-card-bg-icon {
    position: absolute;
    top: 0; right: 0;
    padding: 2rem;
    opacity: 0.10;
    transform: translate(1rem, -1rem);
    transition: opacity var(--transition), transform var(--transition);
    color: var(--white);
    pointer-events: none;
}
.lab-card:hover .lab-card-bg-icon { opacity: 0.20; transform: translate(0.5rem, -0.5rem) scale(1.05); }

.lab-card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lab-card-icon-wrap {
    width: 3.5rem;
    height: 3.5rem;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    color: var(--neutral-300);
}

.lab-card-title {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.lab-card-desc {
    color: var(--neutral-400);
    font-size: 1.125rem;
    line-height: 1.75;
    flex-grow: 1;
}

.lab-card-cta {
    margin-top: 3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--neutral-500);
    transition: color var(--transition);
}
.lab-card-cta svg { transition: transform var(--transition); }
.lab-card:hover .lab-card-cta       { color: var(--white); }
.lab-card:hover .lab-card-cta svg   { transform: translateX(0.5rem); }

/* ============================================================
   PAGE CONTACT
   ============================================================ */
.page-contact {
    min-height: 100vh;
    background: var(--bg);
    padding: 8rem 1rem 6rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (min-width: 768px) { .page-contact { padding: 8rem 3rem 6rem; } }

.contact-grid {
    max-width: 75rem;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
}

@media (min-width: 768px) {
    .contact-grid { grid-template-columns: 1fr 1fr; gap: 6rem; }
}

.contact-title {
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 0.9;
    margin-bottom: 2rem;
}

.contact-intro {
    font-size: 1.25rem;
    color: var(--neutral-400);
    margin-bottom: 3rem;
    max-width: 24rem;
    line-height: 1.7;
}

.contact-links { display: flex; flex-direction: column; gap: 1.5rem; }

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.125rem;
    color: var(--white);
    transition: color var(--transition);
}
.contact-link:hover { color: var(--neutral-400); }

.contact-link-icon {
    width: 3rem;
    height: 3rem;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

/* ── Contact Form ── */
.contact-form-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-3xl);
    padding: 2.5rem;
}

@media (min-width: 768px) { .contact-form-wrap { padding: 3.5rem; } }

.contact-form { display: flex; flex-direction: column; gap: 1.5rem; }

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 640px) { .form-row-2 { grid-template-columns: 1fr 1fr; } }

.form-field { display: flex; flex-direction: column; gap: 0.5rem; }

.form-field label {
    font-size: 0.7rem;
    color: var(--neutral-500);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.form-field input,
.form-field select,
.form-field textarea {
    background: #000;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1rem;
    color: var(--white);
    font-family: var(--font);
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition);
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
}

.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--neutral-600); }

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--border-hover); }

.form-field textarea { resize: none; }

/* Status Message */
.form-status {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-xl);
    font-size: 0.9rem;
    font-weight: 500;
}
.form-status.success {
    background: rgba(34,197,94,0.12);
    border: 1px solid rgba(34,197,94,0.30);
    color: #4ade80;
}
.form-status.error {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.30);
    color: #f87171;
}

.form-submit {
    margin-top: 1rem;
    background: var(--white);
    color: #000;
    font-weight: 700;
    padding: 1rem;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-family: var(--font);
    transition: background var(--transition);
    cursor: pointer;
}
.form-submit:hover:not(:disabled)  { background: var(--neutral-300); }
.form-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* ============================================================
   PAGE DEFAULT (fallback)
   ============================================================ */
.page-default { padding: 8rem 2rem 6rem; }
.page-inner   { max-width: 56rem; margin: 0 auto; }
.entry-content { color: var(--neutral-300); line-height: 1.8; font-size: 1.1rem; }
.entry-content p { margin-bottom: 1.5rem; }

/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar         { width: 6px; }
::-webkit-scrollbar-track   { background: var(--bg); }
::-webkit-scrollbar-thumb   { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ============================================================
   SELECTION
   ============================================================ */
::selection { background: var(--white); color: #000; }
