/* ============================================================
   QUOC HUYNH — Neo-Brutalist / Bento Portfolio
   ============================================================ */
:root {
    --bg: #050505;
    --bg-card: #0a0a0a;
    --neon: #00ff88;
    --border: #1a1a1a;
    --text-primary: #f5f5f5;
    --text-muted: #888888;

    --font-serif: 'Playfair Display', serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Outfit', sans-serif;

    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none; /* Custom cursor everywhere */
}

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-sans);
    overflow-x: hidden;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Typography Classes */
.serif { font-family: var(--font-serif); }
.mono { font-family: var(--font-mono); letter-spacing: -0.02em; }
.sans { font-family: var(--font-sans); }
.accent { color: var(--neon); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 2rem; }
.text-2xl { font-size: 1.5rem; }

/* Custom Cursor */
.cursor-dot, .cursor-ring {
    position: fixed;
    top: 0; left: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    border-radius: 50%;
}
.cursor-dot {
    width: 8px; height: 8px;
    background-color: var(--neon);
    transition: transform 0.2s ease;
}
.cursor-ring {
    width: 40px; height: 40px;
    border: 1px solid var(--neon);
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease, transform 0.1s;
}
.cursor-dot.active {
    transform: translate(-50%, -50%) scale(0);
}
.cursor-ring.active {
    width: 80px; height: 80px;
    background-color: rgba(0, 255, 136, 0.1);
    backdrop-filter: invert(100%); /* Optional inversion effect */
}
@media (max-width: 768px) {
    * { cursor: auto; }
    .cursor-dot, .cursor-ring { display: none; }
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    mix-blend-mode: overlay;
}

/* Background Blobs */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
    animation: float-blob 10s infinite alternate ease-in-out;
}
.blob-1 {
    width: 60vw; height: 60vw;
    max-width: 600px; max-height: 600px;
    background: radial-gradient(circle, var(--neon), transparent 70%);
    top: -10%; left: -10%;
    animation-duration: 12s;
}
.blob-2 {
    width: 50vw; height: 50vw;
    max-width: 500px; max-height: 500px;
    background: radial-gradient(circle, #00d4ff, transparent 70%);
    bottom: -10%; right: -10%;
    animation-duration: 15s;
}
@keyframes float-blob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    padding: 2rem 4rem;
    z-index: 1000;
    mix-blend-mode: difference;
}
.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-family: var(--font-serif);
    font-weight: 900;
    font-size: 1.5rem;
}
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* Hero */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 4rem;
}
.hero-typography {
    text-align: center;
    position: relative;
    z-index: 10;
}
.hero h1 {
    font-size: clamp(5rem, 15vw, 12rem);
    line-height: 0.85;
    margin-bottom: 2rem;
    color: var(--text-primary);
    text-transform: uppercase;
}
.hero-meta {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--neon);
    border-radius: 100px;
    background: rgba(0, 255, 136, 0.05);
}
.pulse-dot {
    width: 8px; height: 8px;
    background: var(--neon);
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

/* Bento Grid */
.section {
    padding: 6rem 4rem;
    max-width: 1440px;
    margin: 0 auto;
}
.section-title {
    font-size: clamp(3rem, 6vw, 5rem);
    margin-bottom: 3rem;
    text-transform: lowercase;
}
.massive-text {
    font-size: clamp(4rem, 8vw, 7rem);
}

.bento-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 300px;
    gap: 1.5rem;
}

.bento-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: border-color var(--transition);
    transform-style: preserve-3d;
}
.bento-card:hover {
    border-color: var(--neon);
}
.bento-card .card-glow {
    position: absolute;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(0,255,136,0.15) 0%, transparent 70%);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
    z-index: 0;
}
.bento-card:hover .card-glow { opacity: 1; }
.bento-card > *:not(.card-glow) { z-index: 1; position: relative; }

.card-large { grid-column: span 2; grid-row: span 2; justify-content: flex-start; }
.card-medium { grid-column: span 2; grid-row: span 1; }
.card-small { grid-column: span 1; grid-row: span 1; justify-content: center; align-items: center; text-align: center; }
.card-wide { grid-column: span 4; grid-row: span 1; flex-direction: row; align-items: center; justify-content: space-around; }

/* Profile Card */
.profile-img {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.6;
    filter: grayscale(100%);
    transition: all 0.5s ease;
}
.profile-card:hover .profile-img {
    filter: grayscale(0%);
    opacity: 0.8;
}
.profile-card .card-content {
    background: linear-gradient(to top, var(--bg-card) 20%, transparent);
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 2.5rem;
}
.profile-card h2 { font-size: 2rem; margin-bottom: 0.5rem; }

/* Stats Card */
.stat-card h3 { font-size: 0.9rem; margin-bottom: 1rem; color: var(--text-muted); }
.stat-number { font-size: 4rem; line-height: 1; color: var(--neon); }

/* Skills */
.skills-card h3 { margin-bottom: 1rem; }
.skills-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skills-list li {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.9rem;
}

/* Experience Wide */
.exp-item { text-align: center; }
.exp-meta { font-size: 0.85rem; margin-bottom: 0.5rem; }

/* Case Studies Bento */
.case-studies-bento {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.case-study-card {
    flex-direction: row;
    height: 400px;
    padding: 0;
}
.case-study-card.reverse { flex-direction: row-reverse; }
.cs-info {
    flex: 0 0 40%;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.cs-info h3 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.cs-info p.accent { font-size: 0.9rem; margin-bottom: 1.5rem; }
.cs-info p.sans { color: var(--text-muted); margin-bottom: 2rem; }

.btn-neo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border: 1px solid var(--neon);
    color: var(--neon);
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 0.8rem;
    align-self: flex-start;
    transition: all var(--transition);
}
.btn-neo:hover { background: var(--neon); color: var(--bg); }

.cs-gallery {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #000;
}
.cs-scroll-track {
    display: flex;
    gap: 1rem;
    height: 100%;
    align-items: center;
    width: max-content;
    will-change: transform;
}
.cs-scroll-track[data-direction="left"] {
    animation: scroll-left 25s linear infinite;
}
.cs-scroll-track[data-direction="right"] {
    animation: scroll-right 25s linear infinite;
}
@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 0.5rem)); }
}
@keyframes scroll-right {
    0% { transform: translateX(calc(-50% - 0.5rem)); }
    100% { transform: translateX(0); }
}
.cs-scroll-track img {
    height: 80%;
    border-radius: 10px;
    border: 2px solid var(--border);
}

/* Apps Bento */
.apps-bento {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 250px;
    gap: 1.5rem;
}
.app-card {
    align-items: center;
    text-align: center;
    justify-content: center;
    gap: 1rem;
}
.app-icon {
    width: 64px; height: 64px;
    border-radius: 20%;
}
.app-info h4 { font-size: 1.2rem; }
.app-info p { font-size: 0.85rem; }

/* Footer */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
}
.footer-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--text-primary);
}
.footer-links a:hover { color: var(--neon); }

/* Responsive */
@media (max-width: 1024px) {
    .bento-container { grid-template-columns: repeat(2, 1fr); }
    .card-wide { grid-column: span 2; flex-direction: column; gap: 2rem; }
    .case-study-card { flex-direction: column; height: auto; }
    .case-study-card.reverse { flex-direction: column; }
    .cs-info { flex: auto; }
    .cs-gallery { height: 300px; width: 100%; }
    .apps-bento { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .navbar { padding: 1.5rem 2rem; }
    .section { padding: 4rem 2rem; }
    .bento-container { grid-template-columns: 1fr; }
    .card-large, .card-medium, .card-wide { grid-column: span 1; }
    .apps-bento { grid-template-columns: 1fr; }
    .footer-links { flex-direction: column; align-items: center; gap: 1.5rem; }
}
