/* =============================================
   GOUTHAM PORTFOLIO — Yannick Gregoire Inspired
   Retro Terminal / Pixel Aesthetic
   ============================================= */

/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
    --bg: #f0ede6;
    --fg: #0a0a0a;
    --fg-muted: #555;
    --accent: #00ffab;
    --accent-secondary: #a78bfa;
    --font-pixel: 'Press Start 2P', monospace;
    --font-mono: 'Space Mono', monospace;
    --nav-height: 60px;
    --section-padding: 120px;
    --max-width: 1400px;
    --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Inverted theme */
body.inverted {
    --bg: #0a0a0a;
    --fg: #f0ede6;
    --fg-muted: #aaa;
}

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

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

body {
    background-color: var(--bg);
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.7;
    transition: background-color var(--transition), color var(--transition);
    overflow-x: hidden;
    padding-bottom: var(--nav-height);
}

a {
    color: var(--fg);
    text-decoration: none;
    transition: color var(--transition), opacity var(--transition);
}

a:hover {
    opacity: 0.7;
}

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

/* ===== UTILITY ===== */
.pixel-font {
    font-family: var(--font-pixel);
}

/* ===== FLOATING SHAPES CANVAS ===== */
#shapes-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.15;
    transition: opacity var(--transition);
}

body.inverted #shapes-canvas {
    opacity: 0.08;
}

/* ===== SECTION HEADING ===== */
.section-heading {
    font-size: clamp(2rem, 6vw, 5rem);
    letter-spacing: 0.05em;
    margin-bottom: 80px;
    text-transform: uppercase;
    line-height: 1.1;
    position: relative;
    z-index: 1;
}

/* ===== HERO ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    position: relative;
    z-index: 1;
}

.hero__content {
    text-align: center;
    max-width: var(--max-width);
}

.hero__name {
    font-size: clamp(3rem, 12vw, 10rem);
    letter-spacing: 0.08em;
    line-height: 1;
    margin-bottom: 40px;
    animation: glitchIn 1.2s ease-out forwards;
    position: relative;
}

@keyframes glitchIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
        filter: blur(8px);
    }
    40% {
        opacity: 1;
        filter: blur(0);
    }
    50% {
        transform: translateX(-5px);
    }
    60% {
        transform: translateX(5px);
    }
    70% {
        transform: translateX(-2px);
    }
    80% {
        transform: translateX(2px);
    }
    100% {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
}

.hero__taglines {
    animation: fadeUp 1s ease-out 0.6s both;
}

.hero__tagline {
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--fg-muted);
    margin-bottom: 8px;
}

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

/* ===== BIOGRAPHY ===== */
.biography {
    padding: var(--section-padding) 40px;
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.bio__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px;
}

.bio__line {
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    line-height: 2;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.bio__line--accent {
    color: var(--accent);
}

body.inverted .bio__line--accent {
    color: var(--accent);
}

/* ===== PROJECTS ===== */
.projects {
    padding: var(--section-padding) 40px;
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.project-row {
    display: grid;
    grid-template-columns: 280px 1fr 200px;
    gap: 40px;
    padding: 50px 0;
    border-top: 1px solid var(--fg);
    position: relative;
    transition: all var(--transition);
}

.project-row:last-child {
    border-bottom: 1px solid var(--fg);
}

.project-row:hover {
    background-color: rgba(0, 255, 171, 0.03);
}

body.inverted .project-row:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.project-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--fg-muted);
    display: block;
    margin-bottom: 12px;
}

.project-title {
    font-family: var(--font-pixel);
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    line-height: 1.3;
    margin-bottom: 16px;
    transition: color var(--transition);
}

.project-row:hover .project-title {
    color: var(--accent);
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}

.project-year {
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
}

.project-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    display: inline-block;
}

.project-arrow {
    font-size: 1rem;
    color: var(--fg-muted);
}

.project-desc {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.8;
    margin-bottom: 20px;
}

.project-details p {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 4px;
    color: var(--fg-muted);
}

.project-details strong {
    color: var(--fg);
}

.project-col--link {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

.project-visit {
    font-family: var(--font-pixel);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 12px 0;
    border-bottom: 2px solid transparent;
    transition: border-color var(--transition), color var(--transition);
    white-space: nowrap;
}

.project-visit:hover {
    border-bottom-color: var(--fg);
    opacity: 1;
}

/* ===== CERTIFICATIONS — ANTI-DESIGN ===== */
.certifications {
    padding: var(--section-padding) 40px 60px;
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* --- Anti heading with ghost stroke --- */
.anti-heading-wrap {
    position: relative;
    margin-bottom: 80px;
}

.anti-heading {
    position: relative;
    z-index: 2;
}

.anti-heading-stroke {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: clamp(2rem, 6vw, 5rem);
    letter-spacing: 0.05em;
    -webkit-text-stroke: 2px var(--fg);
    color: transparent;
    opacity: 0.15;
    z-index: 1;
    user-select: none;
    line-height: 1.1;
}

.anti-count {
    position: absolute;
    top: -30px;
    right: 0;
    font-family: var(--font-pixel);
    font-size: clamp(4rem, 10vw, 8rem);
    color: var(--accent);
    opacity: 0.12;
    z-index: 0;
    line-height: 1;
}

/* --- Scattered layout — no grid, pure chaos --- */
.cert-chaos {
    position: relative;
    width: 100%;
    height: 1000px;
}

.cert-card {
    position: absolute;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease, z-index 0s;
    cursor: pointer;
}

.cert-card__inner {
    position: relative;
    overflow: hidden;
    border: 3px solid var(--fg);
    box-shadow: 8px 8px 0 rgba(0,0,0,0.08);
}

/* --- Each card: wildly scattered like dumped from a bag --- */
.cert-card:nth-child(1) {
    width: 360px; top: 30px; left: -2%;
    transform: rotate(-8deg);
    z-index: 3;
}
.cert-card:nth-child(2) {
    width: 250px; top: 80px; left: 45%;
    transform: rotate(6deg);
    z-index: 5;
}
.cert-card:nth-child(3) {
    width: 320px; top: 0px; right: -1%;
    transform: rotate(12deg);
    z-index: 2;
}
.cert-card:nth-child(4) {
    width: 280px; top: 310px; left: 15%;
    transform: rotate(-5deg);
    z-index: 7;
}
.cert-card:nth-child(5) {
    width: 340px; top: 380px; left: 50%;
    transform: rotate(9deg);
    z-index: 4;
}
.cert-card:nth-child(6) {
    width: 230px; top: 250px; right: 8%;
    transform: rotate(-11deg);
    z-index: 8;
}
.cert-card:nth-child(7) {
    width: 380px; top: 620px; left: 22%;
    transform: rotate(-3deg);
    z-index: 6;
}

/* --- Hover: snap straight + glitch --- */
.cert-card:hover {
    transform: rotate(0deg) translateY(0) scale(1.05) !important;
    z-index: 10;
    filter: contrast(1.2) saturate(1.3);
}

.cert-card:hover .cert-card__inner {
    border-color: var(--accent);
    box-shadow:
        4px 4px 0 var(--accent),
        -2px -2px 0 #ff6b6b;
}

.cert-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease, filter 0.3s ease;
    mix-blend-mode: normal;
}

.cert-card:hover img {
    transform: scale(1.08);
}

body.inverted .cert-card img {
    filter: brightness(0.9);
}

/* --- Index number overlay --- */
.cert-index {
    position: absolute;
    top: -10px;
    left: -5px;
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--accent);
    opacity: 0.7;
    z-index: 3;
    line-height: 1;
    mix-blend-mode: difference;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.cert-card:hover .cert-index {
    opacity: 1;
    transform: translate(5px, 5px);
}

/* --- Label overlay --- */
.cert-label {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--fg);
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 6px 12px;
    z-index: 3;
    transition: background var(--transition), color var(--transition);
}

.cert-card:hover .cert-label {
    background: var(--accent);
    color: #0a0a0a;
}

/* --- Scrolling marquee --- */
.anti-marquee {
    margin-top: 60px;
    overflow: hidden;
    border-top: 2px solid var(--fg);
    border-bottom: 2px solid var(--fg);
    padding: 14px 0;
}

.anti-marquee__track {
    display: flex;
    width: max-content;
    animation: marqueeScroll 20s linear infinite;
}

.anti-marquee__track span {
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--fg-muted);
}

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ===== SERVICES ===== */
.services {
    padding: var(--section-padding) 40px;
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.service-item {
    border-top: 1px solid var(--fg);
    padding: 50px 0;
    cursor: pointer;
    transition: background-color var(--transition);
}

.service-item:last-child {
    border-bottom: 1px solid var(--fg);
}

.service-item:hover {
    background-color: rgba(0, 255, 171, 0.03);
}

.service-title {
    font-family: var(--font-pixel);
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0;
    transition: color var(--transition);
    line-height: 1.5;
}

.service-item:hover .service-title {
    color: var(--accent);
}

.service-arrow {
    color: var(--fg-muted);
    margin-left: 16px;
    font-size: 0.8em;
}

.service-desc {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s ease, padding 0.6s ease, opacity 0.4s ease;
    opacity: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.9;
    color: var(--fg-muted);
    padding-top: 0;
}

.service-item.active .service-desc {
    max-height: 300px;
    opacity: 1;
    padding-top: 24px;
}

/* ===== CONTACT / FOOTER ===== */
.contact {
    padding: var(--section-padding) 40px;
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.contact__grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact__info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact__label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--fg-muted);
    margin-bottom: 20px;
}

.contact__link {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 8px 0;
    border-bottom: 1px solid transparent;
    display: inline-block;
    width: fit-content;
    transition: border-color var(--transition), color var(--transition);
}

.contact__link:hover {
    border-bottom-color: var(--fg);
    opacity: 1;
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: var(--bg);
    border-top: 1px solid var(--fg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 100;
    transition: background-color var(--transition), border-color var(--transition);
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-key {
    font-family: var(--font-pixel);
    font-size: 0.55rem;
    padding: 4px 8px;
    border: 1px solid var(--fg);
    border-radius: 3px;
    text-transform: none;
    color: var(--fg-muted);
    transition: color var(--transition), border-color var(--transition);
    line-height: 1;
}

.nav-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--fg);
    cursor: pointer;
    transition: color var(--transition);
}

.nav-label:hover,
.nav-label--action:hover {
    color: var(--accent);
}

.nav-label--action {
    cursor: pointer;
    user-select: none;
}

/* ===== SCROLL REVEAL ANIMATIONS ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== SELECTION ===== */
::selection {
    background-color: var(--accent);
    color: #0a0a0a;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--fg-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fg);
}

/* ===== CURSOR BLINK ===== */
.hero__name::after {
    content: '_';
    animation: blink 1s step-end infinite;
    color: var(--accent);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

/* Tablet */
@media screen and (max-width: 1024px) {
    :root {
        --section-padding: 80px;
    }

    .section-heading {
        margin-bottom: 50px;
    }

    .project-row {
        grid-template-columns: 220px 1fr 160px;
        gap: 30px;
        padding: 40px 0;
    }

    .bio__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }

    .cert-chaos {
        height: 750px;
    }

    .cert-card:nth-child(1) { width: 260px; }
    .cert-card:nth-child(2) { width: 240px; left: 30%; }
    .cert-card:nth-child(3) { width: 230px; }
    .cert-card:nth-child(4) { width: 250px; }
    .cert-card:nth-child(5) { width: 230px; left: 38%; }
    .cert-card:nth-child(6) { width: 240px; }
    .cert-card:nth-child(7) { width: 260px; }

    .bottom-nav {
        padding: 0 20px;
        gap: 8px;
        overflow-x: auto;
    }

    .nav-group {
        gap: 6px;
        flex-shrink: 0;
    }
}

/* Mobile Large */
@media screen and (max-width: 768px) {
    :root {
        --section-padding: 60px;
        --nav-height: 50px;
    }

    .hero {
        padding: 40px 24px;
    }

    .hero__name {
        font-size: clamp(2rem, 14vw, 4rem);
    }

    .biography,
    .projects,
    .certifications,
    .services,
    .contact {
        padding-left: 24px;
        padding-right: 24px;
    }

    .bio__grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .project-row {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 30px 0;
    }

    .project-col--link {
        justify-content: flex-start;
    }

    .cert-chaos {
        height: auto;
        display: flex;
        flex-wrap: wrap;
        gap: 16px;
        justify-content: center;
    }

    .cert-card {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: 45% !important;
    }

    .cert-card:nth-child(odd) { transform: rotate(-2deg) !important; }
    .cert-card:nth-child(even) { transform: rotate(2deg) !important; }

    .cert-index {
        font-size: 1.8rem;
    }

    .anti-heading-stroke {
        display: none;
    }

    .section-heading {
        font-size: clamp(1.5rem, 8vw, 3rem);
        margin-bottom: 40px;
    }

    /* Hide some nav items on mobile */
    .bottom-nav {
        padding: 0 12px;
        justify-content: center;
        gap: 12px;
        flex-wrap: wrap;
        height: auto;
        min-height: var(--nav-height);
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .nav-key {
        display: none;
    }

    .nav-label {
        font-size: 0.6rem;
    }
}

/* Mobile Small */
@media screen and (max-width: 480px) {
    .hero__name {
        font-size: clamp(1.5rem, 12vw, 3rem);
        letter-spacing: 0.04em;
    }

    .hero__tagline {
        font-size: 0.65rem;
    }

    .project-title {
        font-size: 1rem;
    }

    .service-title {
        font-size: 0.85rem;
    }

    .bottom-nav {
        gap: 8px;
    }
}