/* ========================================
   Andrew Gui - Portfolio
   Black / Neon Green / Gold Aesthetic
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --neon: #00ff87;
    --neon-dim: #00cc6a;
    --gold: #ffd700;
    --gold-dim: #c9a800;
    --bg: #050505;
    --bg-card: #0d0d0d;
    --bg-card-hover: #141414;
    --bg-elevated: #1a1a1a;
    --text: #f0f0f0;
    --text-muted: #888;
    --border: #1f1f1f;
    --glow-neon: 0 0 20px rgba(0, 255, 135, 0.3);
    --glow-gold: 0 0 20px rgba(255, 215, 0, 0.3);
    --glow-neon-strong: 0 0 40px rgba(0, 255, 135, 0.4), 0 0 80px rgba(0, 255, 135, 0.1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--neon);
    text-decoration: none;
    transition: all 0.3s;
}

a:hover {
    color: var(--gold);
}

/* ====== NAVIGATION ====== */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

nav a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s;
}

nav a:hover {
    color: var(--neon);
    background: rgba(0, 255, 135, 0.08);
    text-shadow: 0 0 10px rgba(0, 255, 135, 0.5);
}

/* Hamburger */
nav .nav-toggle {
    display: none;
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 1001;
}

nav .nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 5px 0;
    background: var(--neon);
    transition: 0.3s;
    border-radius: 2px;
}

nav.open .nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

nav.open .nav-toggle span:nth-child(2) {
    opacity: 0;
}

nav.open .nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ====== HERO ====== */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 255, 135, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    z-index: 2;
    padding: 2rem;
}

.hero h1 {
    font-size: clamp(3rem, 10vw, 5.5rem);
    margin-bottom: 0.5rem;
    color: #fff;
    text-shadow: 0 0 40px rgba(0, 255, 135, 0.3);
    animation: fadeInUp 0.8s ease-out;
}

.hero .tagline {
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    animation: fadeInUp 0.8s 0.15s ease-out both;
}

.hero .badges {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s 0.3s ease-out both;
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    transition: all 0.3s;
}

.badge:hover {
    border-color: var(--neon);
    color: var(--neon);
    box-shadow: var(--glow-neon);
}

/* ====== SECTIONS ====== */
section {
    padding: 5rem 1.5rem;
    width: 100%;
    background: var(--bg);
}

.section-content {
    max-width: 900px;
    margin: 0 auto;
}

.section-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    text-align: center;
    margin-bottom: 3rem;
    color: var(--neon);
    text-shadow: 0 0 30px rgba(0, 255, 135, 0.2);
}

/* Divider between sections */
section + section {
    border-top: 1px solid var(--border);
}

/* ====== ABOUT ====== */
.about-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
}

.about-image-wrapper {
    flex-shrink: 0;
}

.about-image {
    width: 180px;
    height: 180px;
    object-fit: cover;
    object-position: top left;
    border-radius: 50%;
    border: 3px solid var(--neon);
    box-shadow: var(--glow-neon);
}

.about-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-muted);
    max-width: 650px;
}

.about-text p {
    margin-bottom: 1rem;
}

.about-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.about-tag {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--gold);
    background: rgba(255, 215, 0, 0.05);
}

/* ====== RSO / FITNESS TECH ====== */
.rso-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.rso-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--neon), var(--gold));
}

.rso-logo {
    width: 140px;
    height: 140px;
    object-fit: contain;
    margin: 0 auto 1.5rem;
    border-radius: 16px;
}

.rso-card h3 {
    font-size: 1.6rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.rso-card p {
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
}

.rso-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-neon {
    background: var(--neon);
    color: #000;
}

.btn-neon:hover {
    box-shadow: var(--glow-neon-strong);
    color: #000;
    transform: translateY(-2px);
}

.btn-outline {
    border: 1px solid var(--border);
    color: var(--text);
    background: transparent;
}

.btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
    box-shadow: var(--glow-gold);
    transform: translateY(-2px);
}

.btn-discord {
    background: #5865F2;
    color: #fff;
}

.btn-discord:hover {
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.4);
    color: #fff;
    transform: translateY(-2px);
}

/* ====== RESEARCH CARDS ====== */
.research-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.research-card:hover {
    border-color: var(--neon);
    box-shadow: 0 0 30px rgba(0, 255, 135, 0.08);
    transform: translateY(-3px);
}

.research-card h3 {
    font-size: 1.2rem;
    color: var(--neon);
    margin-bottom: 0.8rem;
}

.research-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.2rem;
}

.tech-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(0, 255, 135, 0.2);
    color: var(--neon);
    background: rgba(0, 255, 135, 0.05);
}

/* ====== FITNESS ====== */
.fitness-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.fitness-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.fitness-card:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.08);
}

.fitness-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: top center;
}

/* Per-image focal point adjustments */
.fitness-card:nth-child(1) img {
    object-position: center 20%;
}

.fitness-card:nth-child(4) img {
    object-position: center 30%;
}

.fitness-card-content {
    padding: 1.2rem;
}

.fitness-card-content h3 {
    color: var(--gold);
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.fitness-card-content p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.progress-bar {
    background: var(--border);
    height: 4px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.8rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon), var(--gold));
    animation: progressAnimation 2s ease-out;
}

/* Boxing feature */
.boxing-feature {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    margin-top: 2rem;
    text-align: center;
}

.boxing-feature h3 {
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

.boxing-photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 500px;
    margin: 1.5rem auto;
}

.boxing-photos img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid var(--gold);
    box-shadow: var(--glow-gold);
}

/* Training grid */
.training-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.train-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
}

.train-card:hover {
    border-color: var(--neon);
}

.train-card .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.train-card h4 {
    color: var(--text);
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.train-card p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ====== WORK EXPERIENCE ====== */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--neon), var(--gold), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.35rem;
    top: 1.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--neon);
    box-shadow: 0 0 10px rgba(0, 255, 135, 0.5);
}

.work-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.work-card:hover {
    border-color: var(--neon);
}

.work-card h3 {
    color: var(--text);
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
}

.work-date {
    color: var(--neon);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.6rem;
}

.work-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ====== SKILLS ====== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.skill-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.skill-card h3 {
    color: var(--neon);
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.skill-card ul {
    list-style: none;
    padding: 0;
}

.skill-card li {
    color: var(--text-muted);
    padding: 0.3rem 0;
    font-size: 0.85rem;
}

/* ====== PORTFOLIO ====== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--neon), var(--gold));
    opacity: 0;
    transition: opacity 0.3s;
}

.project-card:hover {
    border-color: var(--neon);
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 255, 135, 0.1);
}

.project-card:hover::before {
    opacity: 1;
}

.project-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.project-card h3 {
    color: var(--text);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.project-card .subtitle {
    color: var(--neon);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.8rem;
}

.project-card .desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.project-tags span {
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.7rem;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.release-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--neon);
    margin-left: 6px;
    background: rgba(0, 255, 135, 0.1);
    padding: 2px 8px;
    border-radius: 100px;
}

/* ====== PUBLICATION ====== */
.publication-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.publication-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--neon));
}

.publication-box h3 {
    color: var(--gold);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.publication-box p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.publication-box a {
    color: var(--neon);
    font-weight: 600;
}

/* ====== CONTACT ====== */
.contact {
    text-align: center;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.contact-links a {
    color: var(--text);
    font-size: 0.95rem;
    padding: 0.7rem 1.3rem;
    background: var(--bg-card);
    border-radius: 10px;
    text-decoration: none;
    border: 1px solid var(--border);
    font-weight: 500;
    transition: all 0.3s;
}

.contact-links a:hover {
    border-color: var(--neon);
    color: var(--neon);
    box-shadow: var(--glow-neon);
    transform: translateY(-2px);
}

/* ====== ANIMATIONS ====== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes progressAnimation {
    from {
        width: 0;
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ====== RESPONSIVE - MOBILE FIRST ====== */

/* Small phones */
@media (max-width: 380px) {
    section {
        padding: 3rem 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .fitness-gallery {
        grid-template-columns: 1fr;
    }

    .boxing-photos {
        grid-template-columns: 1fr;
    }

    .training-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* Phone (iPhone default) */
@media (max-width: 768px) {
    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background: rgba(5, 5, 5, 0.98);
        position: absolute;
        top: 100%;
        left: 0;
        text-align: center;
        gap: 0.2rem;
        padding: 1rem 0;
        border-bottom: 1px solid var(--border);
    }

    nav.open ul {
        display: flex;
    }

    nav .nav-toggle {
        display: block;
    }

    section {
        padding: 3.5rem 1.2rem;
    }

    .section-title {
        margin-bottom: 2rem;
    }

    .about-image {
        width: 140px;
        height: 140px;
    }

    .fitness-gallery {
        grid-template-columns: 1fr;
    }

    .fitness-card img {
        aspect-ratio: auto;
        display: block;
        max-height: 550px;
        object-position: top center;
    }

    .boxing-feature {
        padding: 1.5rem 1rem;
    }

    .boxing-photos {
        grid-template-columns: 1fr 1fr;
        max-width: 100%;
    }

    .boxing-photos img {
        height: 160px;
    }

    .training-grid {
        grid-template-columns: 1fr;
    }

    .train-card {
        display: flex;
        align-items: center;
        gap: 1rem;
        text-align: left;
        padding: 1rem 1.2rem;
    }

    .train-card .icon {
        font-size: 1.8rem;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .timeline {
        padding-left: 1.5rem;
    }

    .timeline-item::before {
        left: -1.85rem;
        width: 10px;
        height: 10px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .rso-card {
        padding: 2rem 1.5rem;
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }

    .contact-links a {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }

    .rso-links {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .fitness-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .training-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large screens */
@media (min-width: 1025px) {
    .section-content {
        max-width: 960px;
    }

    .fitness-gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Touch device optimization */
@media (hover: none) {
    .fitness-card:hover,
    .research-card:hover,
    .work-card:hover,
    .project-card:hover {
        transform: none;
    }
}

/* Safe area for notch phones */
@supports (padding: env(safe-area-inset-bottom)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .contact {
        padding-bottom: calc(3rem + env(safe-area-inset-bottom));
    }
}
