/* ================================================================
   ISHAN CHOUDHURY — PORTFOLIO  |  styles.css
   Aesthetic: Pixel-noir / Retro Game UI
   ================================================================ */

/* ── Fonts ─────────────────────────────────────────────────────── */
@font-face {
    font-family: 'Emberly';
    src: url('fonts/Emberly-BoldNarrow.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}
@font-face {
    font-family: 'Lora';
    src: url('fonts/Lora-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* ── Custom properties ─────────────────────────────────────────── */
:root {
    --bg:        #1e1712;
    --surface:   #2a201b;
    --card:      #32251e;
    --cream:     #e6d4be;
    --cream-dim: #b89f87;
    --gold:      #c9933a;
    --gold-glow: rgba(201, 147, 58, 0.25);
    --gold-dim:  rgba(201, 147, 58, 0.08);
    --red:       #c94a3a;
    --font-head: 'Emberly', sans-serif;
    --font-body: 'Lora', serif;
    --radius:    6px;
    --transition: 0.3s cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--cream);
    overflow-x: hidden;
}

/* ── CRT / Scanline overlay ─────────────────────────────────────── */
.scanlines {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        rgba(0,0,0,0.08) 3px,
        rgba(0,0,0,0.08) 4px
    );
}

/* ── Noise overlay ─────────────────────────────────────────────── */
.noise {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 9997;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    animation: noiseShift 0.4s steps(1) infinite;
}
@keyframes noiseShift {
    0%   { background-position: 0 0; }
    25%  { background-position: 40px -20px; }
    50%  { background-position: -30px 15px; }
    75%  { background-position: 20px 40px; }
    100% { background-position: -10px -35px; }
}

/* ── Navbar ─────────────────────────────────────────────────────── */
#navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 18px 40px;
    background: transparent;
    transition: background var(--transition), padding var(--transition);
}
#navbar.scrolled {
    background: rgba(18, 12, 10, 0.92);
    backdrop-filter: blur(12px);
    padding: 12px 40px;
    border-bottom: 1px solid rgba(201, 147, 58, 0.2);
}
.nav-logo {
    font-family: var(--font-head);
    font-size: 1.6rem;
    color: var(--gold);
    letter-spacing: 2px;
    margin-right: auto;
}
.nav-links {
    list-style: none;
    display: flex;
    gap: 32px;
}
.nav-links a {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--cream-dim);
    text-decoration: none;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    position: relative;
    transition: color var(--transition);
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 1px;
    background: var(--gold);
    transition: width var(--transition);
}
.nav-links a:hover { color: var(--gold); }
.nav-links a:hover::after { width: 100%; }

/* scroll progress bar */
.nav-progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--gold), #f0c060);
    transition: width 0.1s linear;
}

/* ── Hero ───────────────────────────────────────────────────────── */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    padding: 120px 60px 80px;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse 80% 60% at 60% 50%, rgba(201,147,58,0.07) 0%, transparent 70%),
                var(--bg);
}

/* pixel grid bg */
.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(201,147,58,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201,147,58,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridDrift 20s linear infinite;
}
@keyframes gridDrift {
    from { background-position: 0 0; }
    to   { background-position: 40px 40px; }
}

/* corner decorations */
.hero-corner {
    position: absolute;
    width: 32px; height: 32px;
    border-color: var(--gold);
    border-style: solid;
    opacity: 0.6;
}
.hero-corner.tl { top: 80px; left: 30px; border-width: 2px 0 0 2px; }
.hero-corner.tr { top: 80px; right: 30px; border-width: 2px 2px 0 0; }
.hero-corner.bl { bottom: 30px; left: 30px; border-width: 0 0 2px 2px; }
.hero-corner.br { bottom: 30px; right: 30px; border-width: 0 2px 2px 0; }

.profile-pic {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    box-shadow:
        0 0 0 6px var(--gold-dim),
        0 0 40px var(--gold-glow),
        0 0 80px rgba(201,147,58,0.1);
    flex-shrink: 0;
    animation: picPulse 4s ease-in-out infinite;
}
@keyframes picPulse {
    0%, 100% { box-shadow: 0 0 0 6px var(--gold-dim), 0 0 40px var(--gold-glow); }
    50%       { box-shadow: 0 0 0 8px rgba(201,147,58,0.15), 0 0 60px rgba(201,147,58,0.4); }
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 560px;
}

/* ── Glitch effect ──────────────────────────────────────────────── */
.glitch-wrapper { position: relative; }
.glitch {
    font-family: var(--font-head);
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: bold;
    color: var(--cream);
    letter-spacing: 0.02em;
    position: relative;
    display: inline-block;
}
.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    clip-path: inset(0);
}
.glitch::before {
    color: var(--gold);
    animation: glitchTop 4s steps(1) infinite;
    text-shadow: -2px 0 var(--red);
}
.glitch::after {
    color: var(--cream);
    animation: glitchBot 4s steps(1) infinite;
    text-shadow: 2px 0 var(--gold);
}
@keyframes glitchTop {
    0%, 90%, 92%, 100% { clip-path: inset(100% 0 0 0); transform: none; opacity: 0; }
    91% { clip-path: inset(0 0 60% 0); transform: translateX(-4px); opacity: 1; }
}
@keyframes glitchBot {
    0%, 93%, 96%, 100% { clip-path: inset(100% 0 0 0); transform: none; opacity: 0; }
    94%, 95% { clip-path: inset(55% 0 0 0); transform: translateX(4px); opacity: 1; }
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--gold);
    letter-spacing: 0.05em;
    min-height: 1.6em;
}
.cursor-blink {
    animation: blink 0.8s step-end infinite;
    color: var(--gold);
}
@keyframes blink { 50% { opacity: 0; } }

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.badge {
    font-size: 0.72rem;
    padding: 4px 12px;
    border: 1px solid rgba(201,147,58,0.4);
    border-radius: 2px;
    color: var(--cream-dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(201,147,58,0.06);
    transition: all var(--transition);
}
.badge:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-dim);
}

/* ── Sections ───────────────────────────────────────────────────── */
section {
    padding: 80px 40px;
    max-width: 1280px;
    margin: 0 auto;
}

.section-label {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--gold);
    letter-spacing: 0.15em;
    margin-bottom: 8px;
    opacity: 0.8;
}

h2 {
    font-family: var(--font-head);
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: bold;
    color: var(--cream);
    margin-bottom: 36px;
    position: relative;
    display: inline-block;
}
h2::after {
    content: '';
    position: absolute;
    bottom: -8px; left: 0;
    width: 48px; height: 3px;
    background: var(--gold);
    border-radius: 2px;
}

/* ── About ──────────────────────────────────────────────────────── */
#about { text-align: center; }
#about h2::after { left: 50%; transform: translateX(-50%); }
.about-text {
    max-width: 680px;
    margin: 0 auto 48px;
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--cream-dim);
}

/* Showreel */
.video-container.showreel {
    position: relative;
    width: 70%;
    max-width: 860px;
    margin: 0 auto;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 0 0 2px rgba(201,147,58,0.3), 0 20px 60px rgba(0,0,0,0.6);
    transition: box-shadow var(--transition);
}
.video-container.showreel:hover {
    box-shadow: 0 0 0 2px var(--gold), 0 24px 70px rgba(0,0,0,0.7);
}
.video-chrome {
    background: var(--surface);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid rgba(201,147,58,0.15);
}
.chrome-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
}
.chrome-dot.red    { background: #ff5f57; }
.chrome-dot.yellow { background: #febc2e; }
.chrome-dot.green  { background: #28c840; }
.chrome-label {
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--cream-dim);
    margin-left: 8px;
    letter-spacing: 0.1em;
}
/* inner iframe container keeps 16:9 */
.video-container.showreel > iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
}

/* ── Projects grid ──────────────────────────────────────────────── */
#projects { text-align: left; }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 28px;
}

.project {
    background: var(--card);
    border: 1px solid rgba(201,147,58,0.12);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.project::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}
.project:hover {
    transform: translateY(-6px);
    border-color: rgba(201,147,58,0.4);
    box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 0 30px var(--gold-glow);
}
.project:hover::before { opacity: 1; }

/* featured card accent */
.project.featured {
    border-color: rgba(201,147,58,0.22);
    background: linear-gradient(145deg, var(--card), #3a2820);
}

.featured-ribbon {
    position: absolute;
    top: 16px; right: -30px;
    background: var(--gold);
    color: var(--bg);
    font-family: monospace;
    font-size: 0.65rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    padding: 4px 40px;
    transform: rotate(35deg);
    transform-origin: center;
}

.project-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.project-number {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--gold);
    opacity: 0.7;
    padding-top: 4px;
    flex-shrink: 0;
}
.project h3 {
    font-family: var(--font-head);
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--cream);
    margin-bottom: 4px;
}
.project-type {
    font-size: 0.78rem;
    color: var(--cream-dim);
    letter-spacing: 0.04em;
}

/* project video */
.project .video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(201,147,58,0.15);
    flex-shrink: 0;
}
.project iframe {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    border: none;
}

.additional-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.additional-info p {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--cream-dim);
}
.additional-info a {
    color: var(--gold);
    text-decoration: none;
}
.additional-info a:hover { text-decoration: underline; }

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag {
    font-size: 0.67rem;
    padding: 3px 10px;
    border-radius: 2px;
    background: rgba(201,147,58,0.08);
    border: 1px solid rgba(201,147,58,0.2);
    color: var(--cream-dim);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.tech-line {
    font-family: monospace;
    font-size: 0.78rem !important;
    color: var(--cream-dim) !important;
}
.tech-line strong { color: var(--gold); font-weight: normal; }

/* ── Project action row ─────────────────────────────────────── */
.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

/* Shared button styling */
.dl-btn,
.gh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    align-self: flex-start;

    min-width: 140px;
    height: 40px;

    padding: 8px 20px;

    border: 1px solid var(--gold);
    border-radius: var(--radius);

    background: transparent;

    color: var(--gold) !important;

    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none !important;

    transition: all var(--transition);

    margin-top: 4px;
}

/* Shared hover effect */
.dl-btn:hover,
.gh-btn:hover {
    background: var(--gold);
    color: var(--bg) !important;
    box-shadow: 0 0 16px var(--gold-glow);
}

/* Optional: slightly larger icon alignment */
.dl-btn i,
.gh-btn i {
    font-size: 0.95rem;
    line-height: 1;
}
.dl-btn:hover {
    background: var(--gold);
    color: var(--bg) !important;
    box-shadow: 0 0 16px var(--gold-glow);
}

/* ── Scroll reveal ──────────────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
    opacity: 1;
    transform: none;
}
/* stagger project cards */
.projects-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.projects-grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.projects-grid .reveal:nth-child(4) { transition-delay: 0.24s; }
.projects-grid .reveal:nth-child(5) { transition-delay: 0.32s; }
.projects-grid .reveal:nth-child(6) { transition-delay: 0.40s; }
.projects-grid .reveal:nth-child(7) { transition-delay: 0.48s; }

/* ── Contact ────────────────────────────────────────────────────── */
#contact {
    text-align: center;
    background: linear-gradient(to bottom, transparent, rgba(201,147,58,0.04), transparent);
    border-top: 1px solid rgba(201,147,58,0.1);
    border-bottom: 1px solid rgba(201,147,58,0.1);
    max-width: 100%;
    padding: 80px 40px;
}
.contact-intro {
    color: var(--cream-dim);
    margin-bottom: 40px;
    font-size: 1rem;
}
.contact-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}
.contact-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--cream-dim);
    text-decoration: none;
    padding: 24px 32px;
    border: 1px solid rgba(201,147,58,0.15);
    border-radius: var(--radius);
    background: var(--card);
    min-width: 110px;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all var(--transition);
}
.contact-link i { font-size: 1.5rem; color: var(--gold); }
.contact-link:hover {
    border-color: var(--gold);
    color: var(--cream);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.4), 0 0 20px var(--gold-glow);
}

/* ── Footer ─────────────────────────────────────────────────────── */
footer {
    padding: 32px 40px;
    background: var(--surface);
    border-top: 1px solid rgba(201,147,58,0.15);
}
.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.footer-logo {
    font-family: var(--font-head);
    color: var(--gold);
    font-size: 1.2rem;
    letter-spacing: 2px;
}
footer p {
    font-size: 0.78rem;
    color: var(--cream-dim);
    letter-spacing: 0.04em;
}
.footer-cat { font-size: 1.4rem; }

/* ── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    #hero {
        flex-direction: column;
        text-align: center;
        padding: 110px 24px 60px;
        gap: 32px;
    }
    .profile-pic { width: 150px; height: 150px; }
    .hero-badges { justify-content: center; }
    #navbar { padding: 14px 20px; }
    #navbar.scrolled { padding: 10px 20px; }
    section { padding: 60px 20px; }
    .video-container.showreel { width: 100%; }
    .projects-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; gap: 10px; text-align: center; }
    body { cursor: auto; }
}

/* ================================================================
   MOBILE RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {

    /* NAVBAR */
    #navbar {
        padding: 12px 20px;
    }

    .nav-links {
        display: none;
    }

    /* HERO */
    #hero {
        flex-direction: column;
        text-align: center;
        gap: 30px;
        padding: 100px 20px 60px;
    }

    .profile-pic {
        width: 140px;
        height: 140px;
    }

    .header-text {
        align-items: center;
    }

    .glitch {
        font-size: 2rem;
    }

    /* SECTIONS */
    section {
        padding: 60px 20px;
    }

    h2 {
        font-size: 1.6rem;
    }

    .about-text {
        font-size: 0.95rem;
    }

    /* VIDEO */
    .video-container {
        width: 100% !important;
    }

    .video-container iframe {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    /* PROJECTS */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .project {
        padding: 20px;
    }

/* TAGS + BUTTON */
    .tags {
        flex-wrap: wrap;
    }

    .project-actions {
        width: 100%;
    }

    .dl-btn,
    .gh-btn {
        width: 100%;
        justify-content: center;
    }
}