/* ═══════════════════════════════════════════════════════════════════
   CG Portfolio — Awwwards-inspired Dark Theme
   ═══════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────────────── */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #5a5a72;
    --accent: #4dabff;
    --accent-glow: rgba(77, 171, 255, 0.15);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1280px;
    --nav-height: 72px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

/* ── Utility ───────────────────────────────────────────────────── */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 100px 0;
}

.section--alt {
    background: var(--bg-secondary);
}

.section__title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 48px;
}

.section__cta {
    text-align: center;
    margin-top: 56px;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 80px 0;
}

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

/* ── Reveal on scroll ───────────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.btn--primary {
    background: var(--accent);
    color: #000;
    box-shadow: 0 4px 24px var(--accent-glow);
}
.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--accent-glow);
}

.btn--outline {
    border: 1.5px solid var(--border-hover);
    color: var(--text-primary);
}
.btn--outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(77, 171, 255, 0.05);
}

/* ── Navigation ─────────────────────────────────────────────────── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-height);
    transition: background var(--transition), box-shadow var(--transition);
}

.nav.scrolled {
    background: rgba(10, 10, 15, 0.96);
    box-shadow: 0 1px 0 var(--border);
}

.nav__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav__logo {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    transition: opacity var(--transition);
}
.nav__logo:hover { opacity: 0.8; }
.nav__logo-dot { color: var(--accent); }

.nav__links {
    display: flex;
    gap: 36px;
}

.nav__link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
    position: relative;
    padding: 4px 0;
    transition: color var(--transition);
}
.nav__link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
}
.nav__link:hover,
.nav__link--active {
    color: var(--text-primary);
}
.nav__link:hover::after,
.nav__link--active::after {
    width: 100%;
}

/* Hamburger */
.nav__burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
    z-index: 1001;
}
.nav__burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition);
    transform-origin: center;
}
.nav__burger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── Hero ────────────────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero__bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 50% 40%, rgba(77, 171, 255, 0.04), transparent),
        radial-gradient(ellipse 80% 60% at 80% 80%, rgba(77, 171, 255, 0.03), transparent);
    pointer-events: none;
}

.hero__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 120px 24px 80px;
    position: relative;
    z-index: 1;
}

.hero__overline {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
}

.hero__title {
    font-size: clamp(3.5rem, 8vw, 7rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 28px;
}

.hero__sub {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 480px;
    margin-bottom: 44px;
}

.hero__actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero__vibe {
    margin-top: 32px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    letter-spacing: 0.04em;
}

/* ── Page Hero (inner pages) ─────────────────────────────────────── */
.page-hero {
    padding: 160px 0 80px;
    text-align: center;
}

.page-hero__title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.page-hero__sub {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* ── Category Cards (Home) ──────────────────────────────────────── */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.cat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition);
    display: block;
}
.cat-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.cat-card__media {
    position: relative;
    aspect-ratio: 16/10;
    background: var(--bg-secondary);
    overflow: hidden;
}
.cat-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}
.cat-card:hover .cat-card__media img {
    transform: scale(1.05);
}

.cat-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-card-hover));
}
.cat-card__placeholder svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    transition: color var(--transition), transform var(--transition);
}
.cat-card:hover .cat-card__placeholder svg {
    color: var(--accent);
    transform: scale(1.15);
}

.cat-card__overlay {
    position: absolute;
    top: 12px;
    right: 12px;
}
.cat-card__count {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-secondary);
}

.cat-card__body {
    padding: 20px 24px;
}

.cat-card__title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}

.cat-card__subs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cat-card__tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 3px 10px;
    background: var(--bg-secondary);
    border-radius: 20px;
}

/* ── Work Cards ──────────────────────────────────────────────────── */
.work-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.work-grid--4col { grid-template-columns: repeat(4, 1fr); }

.work-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition);
}
.work-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.work-card__thumb {
    position: relative;
    aspect-ratio: 16/10;
    background: var(--bg-secondary);
    overflow: hidden;
    cursor: pointer;
}
.work-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}
.work-card:hover .work-card__thumb img {
    transform: scale(1.04);
}

.work-card__video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(77, 171, 255, 0.06), rgba(77, 171, 255, 0.02));
}
.work-card__video-placeholder svg {
    width: 40px;
    height: 40px;
    color: var(--text-muted);
}

.work-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity var(--transition);
}
.work-card__thumb:hover .work-card__overlay {
    opacity: 1;
}

.work-card__play-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transition: transform var(--transition), background var(--transition);
}
.work-card__play-icon svg {
    width: 22px;
    height: 22px;
    color: #fff;
}
.work-card__thumb:hover .work-card__play-icon {
    transform: scale(1.1);
    background: var(--accent);
    box-shadow: 0 8px 32px var(--accent-glow);
}

.work-card__info {
    padding: 16px 20px;
}

.work-card__title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.work-card__cat {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Portfolio Groups ───────────────────────────────────────────── */
.portfolio-group {
    margin-bottom: 64px;
}
.portfolio-group__title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 28px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.portfolio-subgroup {
    margin-bottom: 32px;
}
.portfolio-subgroup__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}

/* ── Filter Bar ──────────────────────────────────────────────────── */
.filter-bar {
    padding: 20px 0;
    position: sticky;
    top: var(--nav-height);
    z-index: 100;
    background: rgba(10, 10, 15, 0.97);
    border-bottom: 1px solid var(--border);
}

.filter-bar__inner {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}
.filter-btn--active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* ── About Page ──────────────────────────────────────────────────── */
.about-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 56px;
    align-items: start;
    margin-bottom: 80px;
}

.about__avatar-placeholder {
    width: 200px;
    height: 200px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.about__avatar-placeholder svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
}
.about__avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

.about__heading {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

.about__bio p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    max-width: 600px;
    font-size: 1.05rem;
    line-height: 1.8;
}
.about__bio .btn { margin-top: 8px; }

.about__skills { margin-bottom: 80px; }

.skill-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 800px;
}

.skill-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color var(--transition);
}
.skill-item:hover {
    border-color: var(--border-hover);
}
.skill-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.skill-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 28px;
    max-width: 560px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: var(--border);
}

.timeline__item {
    position: relative;
    margin-bottom: 32px;
}
.timeline__dot {
    position: absolute;
    left: -28px;
    top: 4px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.timeline__date {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.timeline__content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 4px 0;
}
.timeline__content p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ── Contact Page ────────────────────────────────────────────────── */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

.contact__heading {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}
.contact__info p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
}

.contact__details {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}
.contact__detail {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
}
.contact__detail svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--accent);
}

.contact__social {
    display: flex;
    gap: 20px;
}
.contact__social-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition);
}
.contact__social-link:hover { color: var(--accent); }

/* Form */
.contact__form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
}

.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: var(--font);
    transition: border-color var(--transition);
    outline: none;
}
.form-input:focus {
    border-color: var(--accent);
}
.form-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.form-textarea { resize: vertical; min-height: 120px; }

.form-note {
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.footer {
    border-top: 1px solid var(--border);
    padding: 48px 24px 32px;
    background: var(--bg-secondary);
}

.footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
}

.footer__logo {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}
.footer__logo span { color: var(--accent); }

.footer__brand p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.footer__social {
    display: flex;
    gap: 16px;
    align-items: center;
}
.footer__icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all var(--transition);
}
.footer__icon svg { width: 16px; height: 16px; }
.footer__icon:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
}

.footer__copy {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ── Lightbox ───────────────────────────────────────────────────── */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.96);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease;
}
.lightbox.open {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lightbox__close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    font-size: 1.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    transition: all var(--transition);
    z-index: 2;
}
.lightbox__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.lightbox__prev,
.lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    font-size: 2.4rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    transition: all var(--transition);
    z-index: 2;
    line-height: 1;
}
.lightbox__prev:hover,
.lightbox__next:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}
.lightbox__prev { left: 20px; }
.lightbox__next { right: 20px; }

.lightbox__content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox__content img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius);
}
.lightbox__content video {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: var(--radius);
    outline: none;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .cat-grid { grid-template-columns: repeat(2, 1fr); }
    .work-grid { grid-template-columns: repeat(2, 1fr); }
    .about-layout { grid-template-columns: 1fr; text-align: center; }
    .about__avatar { display: flex; justify-content: center; }
    .about__bio p { max-width: 100%; }
    .skill-grid { grid-template-columns: 1fr; max-width: 100%; }
    .about__skills, .about__timeline { margin-left: auto; margin-right: auto; }
    .timeline { margin: 0 auto; }
}

@media (max-width: 768px) {
    :root { --nav-height: 60px; }

    .nav__links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        flex-direction: column;
        gap: 0;
        background: rgba(10, 10, 15, 0.98);
        padding: 100px 32px 32px;
        transition: right var(--transition);
    }
    .nav__links.open { right: 0; }
    .nav__link { font-size: 1.1rem; padding: 14px 0; }

    .nav__burger { display: flex; }

    .cat-grid { grid-template-columns: 1fr; }
    .work-grid { grid-template-columns: 1fr; }

    .contact-layout { grid-template-columns: 1fr; gap: 40px; }

    .hero__actions { flex-direction: column; }
    .hero__actions .btn { justify-content: center; }

    .section { padding: 64px 0; }
    .page-hero { padding: 120px 0 48px; }

    .footer__inner { grid-template-columns: 1fr; text-align: center; }
    .footer__social { justify-content: center; }

    .lightbox__prev { left: 8px; width: 40px; height: 40px; font-size: 1.8rem; }
    .lightbox__next { right: 8px; width: 40px; height: 40px; font-size: 1.8rem; }
}

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes subtlePulse {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}

/* Stagger reveal delay utility */
.reveal:nth-child(1) { transition-delay: 0.05s; }
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.15s; }
.reveal:nth-child(4) { transition-delay: 0.2s; }
.reveal:nth-child(5) { transition-delay: 0.25s; }
.reveal:nth-child(6) { transition-delay: 0.3s; }
.reveal:nth-child(7) { transition-delay: 0.35s; }
.reveal:nth-child(8) { transition-delay: 0.4s; }
