/* ============================================================
   CSS Reset & Variables
   ============================================================ */
:root {
    --bg-color: #111214;
    --bg-secondary: #18191d;
    --card-bg: #1f2023;
    --card-border: rgba(255,255,255,0.06);
    --text-main: #f0f0f0;
    --text-muted: #8c8f96;
    --accent: #f1c40f;
    --accent-hover: #d4ac0d;
    --accent-glow: rgba(241, 196, 15, 0.15);
    --green: #4ade80;
    --green-bg: rgba(74, 222, 128, 0.08);
    --radius-lg: 24px;
    --radius-md: 14px;
    --radius-sm: 8px;
    --max-w: 1200px;
    --transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

/* ============================================================
   Typography
   ============================================================ */
h1 {
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.08;
    margin-bottom: 22px;
    letter-spacing: -1.5px;
}

h2 {
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 15px;
    letter-spacing: -0.8px;
}

h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 6px;
}

h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

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

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
    background-color: var(--accent);
    color: #111214;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-block;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

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

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.15);
    transition: var(--transition);
    cursor: pointer;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

/* ============================================================
   Section Labels & Headers
   ============================================================ */
.section-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 18px;
    font-weight: 600;
}

.section-header {
    margin-bottom: 60px;
}

.section-desc {
    color: var(--text-muted);
    max-width: 480px;
    font-size: 1rem;
    margin-top: 12px;
}

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 5%;
    max-width: var(--max-w);
    margin: 0 auto;
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(17, 18, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

.navbar.scrolled {
    border-bottom-color: var(--card-border);
    max-width: 100%;
    padding-left: calc((100% - var(--max-w)) / 2 + 5%);
    padding-right: calc((100% - var(--max-w)) / 2 + 5%);
}

.logo {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}

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

nav a {
    margin-left: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s;
}

nav a:not(.btn-primary):hover {
    color: var(--text-main);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ============================================================
   Hero Section
   ============================================================ */
.hero {
    display: flex;
    align-items: center;
    max-width: var(--max-w);
    margin: 100px auto 80px;
    padding: 0 5%;
    gap: 60px;
}

.profile-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--card-border);
    flex-shrink: 0;
    box-shadow: 0 0 0 6px var(--accent-glow);
}

.hero-content {
    flex: 1;
}

.greeting {
    color: var(--green);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    background: var(--green-bg);
    border-radius: 50px;
    border: 1px solid rgba(74, 222, 128, 0.15);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 620px;
    margin-bottom: 36px;
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

/* ============================================================
   About Section
   ============================================================ */
.about-section {
    background: var(--bg-secondary);
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
    padding: 100px 5%;
}

.about-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

.about-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 36px;
    line-height: 1.85;
}

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

.meta-item {
    display: flex;
    gap: 16px;
    align-items: baseline;
}

.meta-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 600;
    min-width: 90px;
}

.meta-value {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
}

/* Skills Panel */
.skills-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 36px;
}

.skills-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 24px;
    color: var(--text-main);
    letter-spacing: -0.3px;
}

.skill-group {
    margin-bottom: 24px;
}

.skill-group:last-child {
    margin-bottom: 0;
}

.skill-group-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 12px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: rgba(241, 196, 15, 0.08);
    border: 1px solid rgba(241, 196, 15, 0.18);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 50px;
    transition: var(--transition);
}

.tag:hover {
    background: rgba(241, 196, 15, 0.18);
}

/* ============================================================
   Experience Section
   ============================================================ */
.experience-section {
    padding: 100px 5%;
}

.experience-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 80px;
    align-items: start;
}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: var(--card-border);
}

.timeline-item {
    position: relative;
    padding-bottom: 48px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -21px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.timeline-date {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 2px 10px;
    background: var(--accent-glow);
    border-radius: 50px;
}

.timeline-company {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.timeline-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.75;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timeline-desc li {
    padding-left: 16px;
    position: relative;
}

.timeline-desc li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

/* ============================================================
   Projects Section
   ============================================================ */
.projects-section {
    background: var(--bg-secondary);
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
    max-width: 100%;
    padding: 100px 5%;
}

.projects-section .section-header {
    max-width: var(--max-w);
    margin: 0 auto 60px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 28px;
    max-width: var(--max-w);
    margin: 0 auto;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s, border-color 0.4s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 340px;
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    border-color: rgba(241, 196, 15, 0.2);
}

.project-info {
    z-index: 2;
    position: relative;
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 20px;
    margin-top: 4px;
}

.explore-link {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.88rem;
    transition: transform 0.3s;
    display: inline-block;
}

.project-card:hover .explore-link {
    transform: translateX(6px);
}

.project-visuals {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 65%;
    height: 65%;
    z-index: 1;
}

.project-background {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    transform: rotate(-5deg);
    transition: transform 0.5s ease;
    border: 1px solid rgba(255,255,255,0.04);
}

.project-card:hover .project-background {
    transform: rotate(0deg) scale(1.05);
}

.project-logo-hover {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 120px;
    max-height: 120px;
}

.mock-logo-text {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent);
}

.project-card:hover .project-logo-hover {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* ============================================================
   Achievements Section
   ============================================================ */
.achievements-section {
    padding: 100px 5%;
}

.achievements-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.achievement-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    display: flex;
    flex-direction: column;
    aspect-ratio: 4 / 3;
    width: 100%;
    margin: 0;
    will-change: transform, box-shadow;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
                box-shadow 0.4s ease,
                border-color 0.4s ease,
                z-index 0s;
}

/* Background image layer — hidden by default */
.ach-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.4;
    transition: opacity 0.45s ease, filter 0.45s ease;
    border-radius: var(--radius-md);
    filter: brightness(0.6);
}

/* Gradient overlay — keeps text readable over the image */
.ach-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(31, 32, 35, 0.95) 0%,
        rgba(31, 32, 35, 0.7) 40%,
        transparent 70%
    );
    border-radius: var(--radius-md);
}

/* Content anchored to the bottom */
.ach-content {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-top: auto;
}

/* ── Hover: smooth popup animation ── */
.achievement-card:hover {
    transform: scale(1.15);
    z-index: 100;
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.8),
        0 0 0 1.5px rgba(241, 196, 15, 0.4);
    border-color: rgba(241, 196, 15, 0.4);
}

.achievement-card:hover .ach-bg {
    opacity: 1;
    filter: brightness(1);
}

.achievement-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    border: 1px solid rgba(241, 196, 15, 0.18);
    border-radius: var(--radius-sm);
    color: var(--accent);
    transition: var(--transition);
}

.achievement-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.achievement-card:hover .achievement-icon {
    background: rgba(241, 196, 15, 0.22);
    border-color: rgba(241, 196, 15, 0.4);
}

.achievement-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
}

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

.achievement-card em {
    color: var(--accent);
    font-style: normal;
    font-weight: 600;
}

/* ============================================================
   Contact Section
   ============================================================ */
.contact-section {
    background: var(--bg-secondary);
    border-top: 1px solid var(--card-border);
    padding: 120px 5%;
}

.contact-inner {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.contact-inner .section-label {
    text-align: center;
}

.contact-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin: 20px auto 40px;
    max-width: 500px;
    line-height: 1.8;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 40px;
    align-items: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.contact-icon {
    font-size: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
}

.contact-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.contact-links {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
    text-align: center;
    padding: 30px 5%;
    color: var(--text-muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--card-border);
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 9, 11, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    width: 100%;
    max-width: 1100px;
    max-height: 88vh;
    border-radius: var(--radius-lg);
    padding: 48px;
    position: relative;
    overflow-y: auto;
    transform: translateY(50px) scale(0.97);
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid var(--card-border);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.close-modal {
    position: absolute;
    top: 24px;
    right: 28px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
    line-height: 1;
    padding: 4px;
    z-index: 10;
}

.close-modal:hover {
    color: var(--accent);
    transform: rotate(90deg);
}

/* Modal Layout Styles */
.modal-layout {
    display: flex;
    gap: 48px;
    align-items: stretch;
}

.modal-left {
    flex: 1.2;
    min-width: 300px;
}

.modal-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    max-width: 450px;
}

.modal-body h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.modal-tags {
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: block;
    letter-spacing: 0.3px;
}

.modal-desc {
    color: var(--text-muted);
    font-size: 1.02rem;
    margin-bottom: 36px;
    line-height: 1.8;
}

.modal-highlights {
    margin-bottom: 36px;
}

.modal-highlights h3 {
    color: var(--text-main);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
    font-weight: 700;
}

.modal-highlights ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-highlights li {
    color: var(--text-muted);
    font-size: 0.92rem;
    padding-left: 20px;
    position: relative;
    line-height: 1.65;
}

.modal-highlights li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

.modal-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Numerical Showcase Styles */
.numerical-showcase {
    display: flex;
    flex-direction: column;
    gap: 28px;
    align-items: center;
    width: 100%;
}

.showcase-image-container {
    position: relative;
    width: 250px;
    aspect-ratio: 9/19.5;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: 0 16px 32px rgba(0,0,0,0.4);
    background: var(--bg-color);
}

.desktop-showcase .showcase-image-container {
    width: 420px;
    aspect-ratio: 16/9;
}

.showcase-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: scale(0.97);
}

.showcase-img.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.showcase-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.showcase-controls-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 28px;
    border-radius: 50px;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.num-btn {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.num-text {
    color: var(--text-muted);
    font-size: 1.15rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: color 0.4s ease, font-weight 0.4s ease;
}

.num-line {
    width: 0;
    height: 2px;
    background: var(--text-main);
    margin-left: 0;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), margin 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    opacity: 0;
}

.num-btn:hover .num-text {
    color: var(--text-main);
}

.num-btn.active .num-text {
    color: var(--text-main);
    font-weight: 700;
}

.num-btn.active .num-line {
    width: 40px;
    margin-left: 14px;
    opacity: 1;
}

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

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

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

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

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
    .about-inner {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .experience-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 28px;
        margin: 60px auto 60px;
    }

    .navbar {
        flex-wrap: wrap;
    }

    nav {
        display: none;
        width: 100%;
        flex-direction: column;
        padding: 16px 0;
        gap: 16px;
    }

    nav.open {
        display: flex;
    }

    nav a {
        margin-left: 0;
    }

    .nav-toggle {
        display: block;
    }

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

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

    .modal-content {
        padding: 36px 24px;
    }

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