/* =========================================================
   MUHAMMAD SHAH KHALID — PROFESSIONAL PORTFOLIO
   Premium responsive design system
   ========================================================= */

/* =========================================================
   01. DESIGN TOKENS
   ========================================================= */

:root {
    --bg-primary: #070b14;
    --bg-secondary: #0b1120;
    --bg-card: #0f172a;
    --bg-card-hover: #131e33;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-secondary: #8b5cf6;
    --success: #34d399;

    --border: rgba(148, 163, 184, 0.14);
    --border-hover: rgba(129, 140, 248, 0.45);

    --container: 1180px;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;

    --shadow-sm: 0 8px 30px rgba(0, 0, 0, 0.18);
    --shadow-lg: 0 25px 70px rgba(0, 0, 0, 0.32);

    --header-height: 78px;
    --section-padding: 120px;

    --transition: 220ms ease;
}


/* =========================================================
   02. RESET / BASE
   ========================================================= */

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;

    background:
        radial-gradient(
            circle at 80% 10%,
            rgba(99, 102, 241, 0.10),
            transparent 28%
        ),
        var(--bg-primary);

    color: var(--text-primary);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

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

button,
input,
textarea,
select {
    font: inherit;
}

button {
    border: 0;
}

ul,
ol {
    margin: 0;
}

::selection {
    background: rgba(99, 102, 241, 0.35);
    color: #fff;
}


/* =========================================================
   03. GLOBAL LAYOUT
   ========================================================= */

.container {
    width: min(calc(100% - 48px), var(--container));
    margin-inline: auto;
}

.section {
    position: relative;
    padding: var(--section-padding) 0;
}

/*
 * Navigation positioning:
 * The section has 120px top padding while the fixed navbar
 * is 78px tall. This makes native #section navigation land
 * on the visible section content instead of leaving a large
 * empty area underneath the navbar.
 */
main section[id] {
    scroll-margin-top: -42px;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 64px;
}

.section-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
}

.section-label {
    display: inline-block;
    margin-bottom: 16px;

    color: var(--accent-light);

    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.section-heading h2 {
    margin: 0;

    color: var(--text-primary);

    font-size: clamp(2.3rem, 5vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.section-heading > p {
    max-width: 650px;
    margin-top: 22px;

    color: var(--text-muted);
    font-size: 1.05rem;
}

.gradient-text {
    color: var(--accent-light);

    background: linear-gradient(
        110deg,
        #818cf8,
        #a78bfa
    );

    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    color: var(--accent-light);

    font-size: 0.85rem;
    font-weight: 600;

    transition:
        gap var(--transition),
        color var(--transition);
}

.text-link:hover {
    gap: 12px;
    color: var(--text-primary);
}


/* =========================================================
   04. HEADER / NAVIGATION
   ========================================================= */

.site-header {
    position: fixed;
    z-index: 1000;

    top: 0;
    left: 0;
    right: 0;

    background: rgba(7, 11, 20, 0.72);
    border-bottom: 1px solid transparent;

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    transition:
        background var(--transition),
        border-color var(--transition);
}

.site-header.scrolled {
    background: rgba(7, 11, 20, 0.92);
    border-color: var(--border);
}

.navbar {
    min-height: var(--header-height);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.nav-brand,
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;

    color: var(--text-primary);
    font-weight: 700;
}

.brand-mark {
    width: 40px;
    height: 40px;

    display: grid;
    place-items: center;

    border: 1px solid var(--border);
    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            rgba(99, 102, 241, 0.20),
            rgba(139, 92, 246, 0.12)
        );

    color: var(--text-primary);

    font-size: 0.72rem;
    letter-spacing: 0.06em;

    transition:
        transform var(--transition),
        border-color var(--transition),
        background var(--transition);
}

.nav-brand:hover .brand-mark,
.brand:hover .brand-mark {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    background:
        linear-gradient(
            135deg,
            rgba(99, 102, 241, 0.28),
            rgba(139, 92, 246, 0.18)
        );
}

.brand-name {
    color: var(--text-primary);
    font-size: 0.96rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-link {
    position: relative;

    color: var(--text-muted);

    font-size: 0.9rem;
    font-weight: 500;

    transition: color var(--transition);
}

/* Deliberately no underline/active bar. */
.nav-link:hover {
    color: var(--text-primary);
}

.nav-cta {
    padding: 10px 17px;

    border: 1px solid rgba(129, 140, 248, 0.4);
    border-radius: 10px;

    background: rgba(99, 102, 241, 0.10);
    color: var(--text-primary);

    font-size: 0.86rem;
    font-weight: 600;

    transition:
        transform var(--transition),
        background var(--transition),
        border-color var(--transition);
}

.nav-cta:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(129, 140, 248, 0.65);
    transform: translateY(-2px);
}

.menu-toggle {
    display: none;

    width: 44px;
    height: 44px;
    padding: 10px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--bg-card);
    color: var(--text-primary);

    cursor: pointer;
}

.menu-toggle span {
    display: block;

    width: 100%;
    height: 2px;

    margin: 5px 0;

    background: var(--text-primary);

    transition: transform var(--transition);
}


/* =========================================================
   05. HERO
   ========================================================= */

.hero {
    min-height: 100vh;

    display: flex;
    align-items: center;

    padding-top: 150px;
    padding-bottom: 100px;

    overflow: hidden;
}

.hero::before {
    content: "";

    position: absolute;

    width: 520px;
    height: 520px;

    left: -260px;
    top: 25%;

    border-radius: 50%;

    background: rgba(99, 102, 241, 0.06);

    filter: blur(90px);

    pointer-events: none;
}

.hero-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.15fr)
        minmax(380px, 0.85fr);

    align-items: center;
    gap: 80px;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    margin-bottom: 24px;

    color: var(--text-secondary);

    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.status-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--success);

    box-shadow:
        0 0 0 5px rgba(52, 211, 153, 0.10),
        0 0 18px rgba(52, 211, 153, 0.5);
}

.hero h1 {
    max-width: 850px;
    margin-bottom: 25px;

    color: var(--text-primary);

    font-size: clamp(3.4rem, 7vw, 6.6rem);
    line-height: 0.98;
    letter-spacing: -0.065em;
}

.hero-role {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;

    margin-bottom: 24px;

    color: var(--accent-light);

    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 600;
}

.hero-role span {
    color: var(--text-muted);
}

.hero-description {
    max-width: 650px;
    margin-bottom: 34px;

    color: var(--text-muted);

    font-size: 1.08rem;
    line-height: 1.8;
}

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

    margin-bottom: 30px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-height: 50px;
    padding: 0 22px;

    border-radius: 11px;

    font-size: 0.9rem;
    font-weight: 650;

    transition:
        transform var(--transition),
        background var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

.btn-primary {
    background: var(--accent);
    color: white;

    box-shadow:
        0 10px 35px rgba(99, 102, 241, 0.20);
}

.btn-primary:hover {
    background: #5558df;
    transform: translateY(-3px);

    box-shadow:
        0 16px 45px rgba(99, 102, 241, 0.30);
}

.btn-secondary {
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.65);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-3px);
}

.hero-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;

    color: var(--text-muted);
    font-size: 0.86rem;
}

.hero-links a {
    transition: color var(--transition);
}

.hero-links a:hover {
    color: var(--text-primary);
}

.hero-visual {
    position: relative;

    display: flex;
    justify-content: center;
    align-items: center;

    min-height: 550px;
}

.hero-glow {
    position: absolute;

    width: 330px;
    height: 330px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(99, 102, 241, 0.20),
            transparent 70%
        );

    filter: blur(12px);
}

.profile-frame {
    position: relative;
    z-index: 2;

    width: min(430px, 100%);
    aspect-ratio: 0.88;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 32px;

    background:
        linear-gradient(
            145deg,
            rgba(15, 23, 42, 0.94),
            rgba(11, 17, 32, 0.70)
        );

    box-shadow: var(--shadow-lg);

    transform: rotate(1.5deg);
}

.profile-frame::before {
    content: "";

    position: absolute;
    inset: 12px;

    border: 1px solid rgba(129, 140, 248, 0.12);
    border-radius: 25px;

    pointer-events: none;
}

.profile-image-wrapper {
    width: 72%;
    aspect-ratio: 1;

    overflow: hidden;

    border: 7px solid rgba(255, 255, 255, 0.06);
    border-radius: 50%;

    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.35);
}

.profile-image {
    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;
}

.profile-badge {
    position: absolute;
    z-index: 4;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 12px 15px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: rgba(15, 23, 42, 0.90);

    box-shadow: var(--shadow-sm);

    backdrop-filter: blur(15px);

    transform: rotate(-1.5deg);
}

.profile-badge-top {
    top: 12%;
    right: -8%;
}

.profile-badge-bottom {
    bottom: 12%;
    left: -8%;
}

.badge-icon {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-light);

    font-size: 0.72rem;
    font-weight: 800;
}

.profile-badge strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.76rem;
}

.profile-badge small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.67rem;
}


/* =========================================================
   06. ABOUT
   ========================================================= */

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

    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.about-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.2fr)
        minmax(300px, 0.8fr);

    gap: 80px;
    align-items: start;
}

.about-main {
    max-width: 720px;
}

.about-main p {
    margin-bottom: 24px;
    color: var(--text-muted);
    font-size: 1.03rem;
}

.about-main .lead {
    color: var(--text-secondary);
    font-size: 1.25rem;
    line-height: 1.75;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.stat-card {
    min-height: 150px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 25px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: rgba(15, 23, 42, 0.60);

    transition:
        transform var(--transition),
        border-color var(--transition),
        background var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.stat-number {
    margin-bottom: 10px;

    color: var(--accent-light);

    font-size: 1.55rem;
    font-weight: 750;
    letter-spacing: -0.04em;
}

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


/* =========================================================
   07. SKILLS
   ========================================================= */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.skill-category {
    min-height: 250px;
    padding: 30px;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    background:
        linear-gradient(
            145deg,
            rgba(15, 23, 42, 0.82),
            rgba(11, 17, 32, 0.72)
        );

    transition:
        transform var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

.skill-category:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.skill-category-icon {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    margin-bottom: 24px;

    border: 1px solid var(--border);
    border-radius: 11px;

    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-light);

    font-size: 0.72rem;
    font-weight: 700;
}

.skill-category h3 {
    margin-bottom: 22px;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.skill-list span,
.project-tags span {
    display: inline-flex;
    align-items: center;

    padding: 7px 11px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: rgba(255, 255, 255, 0.025);
    color: var(--text-secondary);

    font-size: 0.75rem;

    transition:
        border-color var(--transition),
        background var(--transition),
        color var(--transition);
}

.skill-list span:hover,
.project-tags span:hover {
    border-color: var(--border-hover);
    background: rgba(99, 102, 241, 0.07);
    color: var(--text-primary);
}


/* =========================================================
   08. EXPERIENCE
   ========================================================= */

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

    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.timeline {
    position: relative;

    max-width: 1000px;

    margin-left: 10px;
    padding-left: 42px;
}

.timeline::before {
    content: "";

    position: absolute;

    top: 8px;
    bottom: 8px;
    left: 7px;

    width: 1px;

    background:
        linear-gradient(
            to bottom,
            var(--accent),
            rgba(99, 102, 241, 0.05)
        );
}

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

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

.timeline-marker {
    position: absolute;

    left: -42px;
    top: 5px;

    width: 16px;
    height: 16px;

    border: 4px solid var(--bg-secondary);
    border-radius: 50%;

    background: var(--accent);

    box-shadow:
        0 0 0 1px rgba(129, 140, 248, 0.30),
        0 0 20px rgba(99, 102, 241, 0.25);
}

.timeline-content {
    padding: 30px;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    background: rgba(15, 23, 42, 0.65);

    transition:
        border-color var(--transition),
        transform var(--transition),
        box-shadow var(--transition);
}

.timeline-content:hover {
    transform: translateX(5px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.experience-header {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 25px;
}

.experience-type {
    display: block;
    margin-bottom: 8px;

    color: var(--accent-light);

    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.13em;
}

.experience-header h3 {
    margin-bottom: 5px;
    color: var(--text-primary);
    font-size: 1.45rem;
}

.experience-header h4 {
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 500;
}

.experience-date {
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.experience-list {
    padding-left: 18px;
}

.experience-list li {
    margin-bottom: 11px;
    color: var(--text-muted);
    font-size: 0.91rem;
}

.experience-list li:last-child {
    margin-bottom: 0;
}

/* =========================================================
   09 PROJECTS — PREMIUM TWO-COLUMN CARD SYSTEM
   ========================================================= */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}


/* =========================================================
   INDIVIDUAL PROJECT CARD
   ========================================================= */

.projects-grid .project-card,
.projects-grid .project-featured,
.projects-grid .project-featured-secondary {
    grid-column: auto !important;

    position: relative;

    width: 100%;
    min-width: 0;
    min-height: 330px;

    display: flex;
    flex-direction: column;

    padding: 30px;

    background:
        linear-gradient(
            145deg,
            rgba(15, 23, 42, 0.98),
            rgba(13, 20, 36, 0.98)
        );

    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;

    overflow: hidden;

    transition:
        background 280ms ease,
        border-color 280ms ease,
        box-shadow 280ms ease,
        transform 280ms ease;
}


/* =========================================================
   SUBTLE BACKGROUND GLOW
   ========================================================= */

.projects-grid .project-card::before,
.projects-grid .project-featured::before,
.projects-grid .project-featured-secondary::before {
    content: "";

    position: absolute;

    width: 180px;
    height: 180px;

    right: -90px;
    bottom: -100px;

    border-radius: 50%;

    background: rgba(99, 102, 241, 0.08);

    filter: blur(35px);

    opacity: 0;

    transition: opacity 300ms ease;

    pointer-events: none;
}


/* =========================================================
   HOVER EFFECT
   ========================================================= */

.projects-grid .project-card:hover,
.projects-grid .project-featured:hover,
.projects-grid .project-featured-secondary:hover {

    background:
        linear-gradient(
            145deg,
            rgba(22, 31, 56, 0.98),
            rgba(15, 23, 42, 0.98)
        );

    border-color: rgba(99, 102, 241, 0.55);

    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(99, 102, 241, 0.08),
        0 0 35px rgba(99, 102, 241, 0.08);

    transform: translateY(-4px);
}


.projects-grid .project-card:hover::before,
.projects-grid .project-featured:hover::before,
.projects-grid .project-featured-secondary:hover::before {
    opacity: 1;
}


/* =========================================================
   PROJECT CONTENT
   ========================================================= */

.projects-grid .project-content {
    position: relative;
    z-index: 2;

    display: flex;
    flex-direction: column;

    height: 100%;
}


/* =========================================================
   PROJECT NUMBER
   ========================================================= */

.projects-grid .project-number {
    position: absolute;

    top: 28px;
    right: 28px;

    font-size: 11px;
    font-weight: 600;

    letter-spacing: 0.12em;

    color: rgba(148, 163, 184, 0.45);

    transition:
        color 250ms ease;
}

.projects-grid .project-card:hover .project-number {
    color: rgba(129, 140, 248, 0.9);
}


/* =========================================================
   PROJECT CATEGORY
   ========================================================= */

.projects-grid .project-category {
    display: inline-block;

    margin-bottom: 12px;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.16em;
    text-transform: uppercase;

    color: #818cf8;
}


/* =========================================================
   PROJECT TITLE
   ========================================================= */

.projects-grid .project-content h3 {
    max-width: 90%;

    margin: 0 0 14px;

    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;

    color: #f8fafc;

    transition: color 250ms ease;
}

.projects-grid .project-card:hover .project-content h3 {
    color: #ffffff;
}


/* =========================================================
   PROJECT DESCRIPTION
   ========================================================= */

.projects-grid .project-content p {
    margin: 0 0 22px;

    max-width: 680px;

    font-size: 14px;
    line-height: 1.8;

    color: #94a3b8;
}


/* =========================================================
   PROJECT TAGS
   ========================================================= */

.projects-grid .project-tags {
    display: flex;
    flex-wrap: wrap;

    gap: 7px;

    margin-bottom: 24px;
}

.projects-grid .project-tags span {
    display: inline-flex;
    align-items: center;

    padding: 6px 10px;

    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 7px;

    background: rgba(15, 23, 42, 0.65);

    color: #aab6c8;

    font-size: 11px;
    font-weight: 500;

    transition:
        background 200ms ease,
        border-color 200ms ease,
        color 200ms ease;
}

.projects-grid .project-card:hover .project-tags span {
    border-color: rgba(99, 102, 241, 0.25);

    background: rgba(99, 102, 241, 0.08);

    color: #c7d2fe;
}


/* =========================================================
   PROJECT LINK
   ========================================================= */

.projects-grid .project-link {
    position: relative;
    z-index: 3;

    display: inline-flex;
    align-items: center;

    width: fit-content;

    margin-top: auto;

    color: #e2e8f0;

    font-size: 13px;
    font-weight: 600;

    text-decoration: none;

    transition:
        color 200ms ease,
        transform 200ms ease;
}

.projects-grid .project-link span {
    margin-left: 7px;

    transition: transform 200ms ease;
}

.projects-grid .project-link:hover {
    color: #a5b4fc;

    transform: translateX(2px);
}

.projects-grid .project-link:hover span {
    transform: translateX(4px);
}


/* =========================================================
   PROJECT FLOW
   ========================================================= */

.projects-grid .project-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 8px;

    margin: 0 0 22px;

    color: #94a3b8;

    font-size: 11px;
}

.projects-grid .project-flow span {
    padding: 5px 9px;

    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 6px;

    background: rgba(15, 23, 42, 0.55);
}

.projects-grid .project-flow i {
    color: #6366f1;

    font-style: normal;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .projects-grid {
        gap: 20px;
    }

    .projects-grid .project-card,
    .projects-grid .project-featured,
    .projects-grid .project-featured-secondary {
        min-height: 320px;
        padding: 26px;
    }

    .projects-grid .project-content h3 {
        font-size: 21px;
    }
}


/* =========================================================
   MOBILE — ONE CARD PER ROW
   ========================================================= */

@media (max-width: 700px) {

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

    .projects-grid .project-card,
    .projects-grid .project-featured,
    .projects-grid .project-featured-secondary {
        min-height: 0;
        padding: 24px;
    }

    .projects-grid .project-content h3 {
        font-size: 20px;
        max-width: 88%;
    }

    .projects-grid .project-number {
        top: 23px;
        right: 23px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .projects-grid .project-card,
    .projects-grid .project-featured,
    .projects-grid .project-featured-secondary {
        transition: none;
    }

    .projects-grid .project-link,
    .projects-grid .project-link span {
        transition: none;
    }
}


/* =========================================================
   10. EDUCATION
   ========================================================= */

.education-card {
    display: grid;

    grid-template-columns: 180px 1fr;

    gap: 50px;

    padding: 38px;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    background: rgba(15, 23, 42, 0.65);

    transition:
        border-color var(--transition),
        transform var(--transition),
        box-shadow var(--transition);
}

.education-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.education-year {
    color: var(--accent-light);
    font-size: 0.85rem;
    font-weight: 650;
}

.education-type {
    display: block;
    margin-bottom: 10px;

    color: var(--accent-light);

    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.13em;
}

.education-content h3 {
    margin-bottom: 7px;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.education-content h4 {
    margin-bottom: 20px;

    color: var(--text-secondary);

    font-size: 0.95rem;
    font-weight: 500;
}

.education-content p {
    max-width: 850px;
    color: var(--text-muted);
    font-size: 0.9rem;
}


/* =========================================================
   11. CERTIFICATIONS
   ========================================================= */

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

.certification-card {
    min-height: 190px;

    display: flex;
    flex-direction: column;

    padding: 25px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: rgba(15, 23, 42, 0.60);

    transition:
        transform var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

.certification-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.certification-card > span {
    margin-bottom: 25px;
    color: var(--accent-light);
    font-size: 0.72rem;
    font-weight: 700;
}

.certification-card h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.4;
}

.certification-card p {
    margin-top: auto;
    color: var(--text-muted);
    font-size: 0.78rem;
}


/* =========================================================
   12. CONTACT
   ========================================================= */

.contact-section {
    padding-bottom: 140px;
}

.contact-card {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(300px, 0.7fr);

    gap: 70px;

    padding: 60px;

    border: 1px solid rgba(129, 140, 248, 0.18);
    border-radius: 30px;

    background:
        radial-gradient(
            circle at 10% 0%,
            rgba(99, 102, 241, 0.14),
            transparent 38%
        ),
        rgba(15, 23, 42, 0.75);

    box-shadow: var(--shadow-lg);
}

.contact-content h2 {
    max-width: 700px;
    margin-bottom: 20px;

    color: var(--text-primary);

    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.contact-content p {
    max-width: 580px;
    color: var(--text-muted);
    font-size: 1rem;
}

.contact-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 15px;

    border: 1px solid var(--border);
    border-radius: 13px;

    background: rgba(7, 11, 20, 0.30);

    transition:
        transform var(--transition),
        border-color var(--transition),
        background var(--transition);
}

.contact-item:hover {
    transform: translateX(4px);
    border-color: var(--border-hover);
    background: rgba(99, 102, 241, 0.06);
}

.contact-icon {
    width: 40px;
    height: 40px;

    flex: 0 0 40px;

    display: grid;
    place-items: center;

    border-radius: 10px;

    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-light);

    font-size: 0.75rem;
    font-weight: 800;
}

.contact-item small {
    display: block;
    margin-bottom: 2px;
    color: var(--text-muted);
    font-size: 0.67rem;
}

.contact-item strong {
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
}


/* =========================================================
   13. FOOTER
   ========================================================= */

.site-footer {
    border-top: 1px solid var(--border);
    background: #050811;
}

.footer-inner {
    min-height: 100px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;
}

.footer-inner strong {
    display: block;
    margin-bottom: 3px;

    color: var(--text-primary);
    font-size: 0.86rem;
}

.footer-inner span,
.footer-inner p {
    color: var(--text-muted);
    font-size: 0.72rem;
}


/* =========================================================
   14. SCROLL TO TOP
   ========================================================= */

.scroll-top {
    position: fixed;
    z-index: 900;

    right: 25px;
    bottom: 25px;

    width: 44px;
    height: 44px;

    display: grid;
    place-items: center;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: rgba(15, 23, 42, 0.90);
    color: var(--text-primary);

    font-size: 1.1rem;

    cursor: pointer;

    opacity: 0;
    visibility: hidden;

    transform: translateY(10px);

    transition:
        opacity var(--transition),
        visibility var(--transition),
        transform var(--transition),
        background var(--transition);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    background: var(--accent);
}


/* =========================================================
   15. ACCESSIBILITY / FOCUS
   ========================================================= */

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-light);
    outline-offset: 4px;
}

.keyboard-user a:focus,
.keyboard-user button:focus {
    outline: 2px solid var(--accent-light);
    outline-offset: 4px;
}


/* =========================================================
   16. REVEAL ANIMATIONS
   ========================================================= */

.reveal {
    opacity: 0;
    transform: translateY(24px);

    transition:
        opacity 650ms ease,
        transform 650ms ease;
}

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


/* =========================================================
   17. RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 1000px) {

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .hero-content {
        max-width: 780px;
    }

    .hero-visual {
        min-height: 450px;
    }

    .profile-frame {
        width: min(390px, 80%);
    }

    .profile-badge-top {
        right: 5%;
    }

    .profile-badge-bottom {
        left: 5%;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 45px;
    }

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

    .certifications-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* =========================================================
   18. RESPONSIVE — MOBILE NAVIGATION
   ========================================================= */

@media (max-width: 850px) {

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        position: absolute;

        top: calc(100% + 10px);
        left: 24px;
        right: 24px;

        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 4px;
        padding: 12px;

        border: 1px solid var(--border);
        border-radius: 16px;

        background: rgba(11, 17, 32, 0.98);
        box-shadow: var(--shadow-lg);

        opacity: 0;
        visibility: hidden;

        transform: translateY(-8px);

        transition:
            opacity var(--transition),
            visibility var(--transition),
            transform var(--transition);
    }

    .nav-menu.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-link {
        padding: 12px 10px;
        border-radius: 8px;
    }

    .nav-link:hover {
        background: rgba(99, 102, 241, 0.08);
    }

    .nav-cta {
        margin-top: 5px;
        text-align: center;
    }

    .hero {
        padding-top: 125px;
    }

    .section {
        --section-padding: 90px;
    }

    main section[id] {
        scroll-margin-top: -20px;
    }

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

    .project-featured,
    .project-featured-secondary {
        grid-column: span 1;
    }
}


/* =========================================================
   19. RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 650px) {

    .container {
        width: min(
            calc(100% - 32px),
            var(--container)
        );
    }

    .navbar {
        min-height: 70px;
    }

    .brand-name {
        font-size: 0.88rem;
    }

    .brand-mark {
        width: 36px;
        height: 36px;
    }

    .hero {
        min-height: auto;

        padding-top: 115px;
        padding-bottom: 75px;
    }

    .hero h1 {
        font-size: clamp(3rem, 15vw, 4.4rem);
    }

    .hero-role {
        font-size: 1rem;
    }

    .hero-description {
        font-size: 0.96rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .hero-links {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero-visual {
        min-height: 370px;
    }

    .profile-frame {
        width: min(320px, 88%);
    }

    .profile-badge {
        padding: 9px 11px;
    }

    .profile-badge-top {
        right: -2%;
    }

    .profile-badge-bottom {
        left: -2%;
    }

    .about-stats {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card {
        min-height: 125px;
        padding: 18px;
    }

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

    .experience-header {
        flex-direction: column;
        gap: 12px;
    }

    .experience-date {
        white-space: normal;
    }

    .timeline {
        padding-left: 27px;
    }

    .timeline-marker {
        left: -27px;
    }

    .timeline-content {
        padding: 23px;
    }

    .project-card {
        min-height: auto;
        padding: 27px;
    }

    .project-featured,
    .project-featured-secondary {
        min-height: auto;
    }

    .project-flow {
        gap: 6px;
    }

    .project-flow i {
        display: none;
    }

    .education-card {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 27px;
    }

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

    .contact-card {
        padding: 32px 24px;
    }

    .footer-inner {
        min-height: 130px;

        flex-direction: column;
        justify-content: center;

        text-align: center;
    }

    .scroll-top {
        right: 16px;
        bottom: 16px;
    }
}


/* =========================================================
   20. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
