/* ============================================================
   mohsin.dev — stylesheet
   Theme: a developer's editor/terminal, not a stock portfolio.
   Structure: fonts → tokens → reset → layout primitives →
   nav → hero/terminal → sections → components → footer →
   motion/a11y → responsive
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ---------- Tokens ---------- */
:root {
    --bg: #08070e;
    --bg-elevated: #100e1c;
    --bg-inset: #0b0a15;
    --bg-hover: #171325;

    --text: #f1eef8;
    --muted: #a099b3;
    --faint: #5e5872;

    --border: #221d33;
    --border-strong: #332c48;

    --blue: #6d8dfd;
    --purple: #c06bfa;
    --blue-btn: #4f6bfd;
    --purple-btn: #9b3ff0;
    --gold: #f2b25c;
    --green: #4ade80;

    --html: #ff8a5c;
    --css: #6d8dfd;
    --js: #f5cf4a;
    --git: #c06bfa;

    --radius-s: 8px;
    --radius-m: 12px;
    --radius-l: 18px;

    --shadow-glow: 0 0 130px rgba(155, 108, 250, 0.18);

    --font-display: "Space Grotesk", sans-serif;
    --font-body: "Inter", sans-serif;
    --font-mono: "JetBrains Mono", monospace;

    --maxw: 1120px;
    --dur: 0.2s;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

body.light {
    --bg: #faf9fc;
    --bg-elevated: #ffffff;
    --bg-inset: #f1eef8;
    --bg-hover: #ede9f6;

    --text: #1c1730;
    --muted: #5c5570;
    --faint: #8b84a0;

    --border: #e5e0f0;
    --border-strong: #cfc7e6;

    --blue: #4361ee;
    --purple: #8338ec;
    --blue-btn: #4361ee;
    --purple-btn: #8338ec;
    --gold: #d68f2c;

    --shadow-glow: 0 0 130px rgba(131, 56, 236, 0.10);
}

/* ---------- Reset ---------- */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
    position: relative;
}

/* faint dot-grid texture, like an editor minimap */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, var(--border-strong) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

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

a {
    color: inherit;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

::selection {
    background: var(--purple);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
    border-radius: 4px;
}

.wrap {
    width: min(var(--maxw), 90%);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip: rect(0 0 0 0);
    overflow: hidden;
    white-space: nowrap;
}

/* ---------- Shared type bits ---------- */
h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.1;
    margin: 0;
    letter-spacing: -0.01em;
}

.mono {
    font-family: var(--font-mono);
}

.file-tab {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
    padding: 7px 14px 7px 11px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.file-tab .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.section-head {
    margin-bottom: 42px;
}

.section-head h2 {
    font-size: clamp(28px, 4vw, 40px);
    border: 1px solid var(--border);
    border-top: none;
    background: var(--bg-elevated);
    padding: 22px 24px 26px;
    border-radius: 0 12px 12px 12px;
}

/* ---------- Nav ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.topbar .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 18px;
    text-decoration: none;
    color: var(--text);
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
}

.logo .cursor {
    display: inline-block;
    width: 9px;
    height: 17px;
    background: var(--green);
    margin-left: 3px;
    animation: blink 1.1s step-end infinite;
}

nav.links {
    display: flex;
    gap: 4px;
}

nav.links a {
    text-decoration: none;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 7px;
    transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

nav.links a:hover {
    color: var(--text);
    background: var(--bg-hover);
}

nav.links a.active {
    color: var(--text);
}

nav.links a.active {
    position: relative;
}

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

.theme-btn,
.menu-btn {
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    border-radius: 9px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.theme-btn:hover,
.menu-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.menu-btn {
    display: none;
}

/* ---------- Hero ---------- */
.hero {
    padding: 96px 0 88px;
}

.hero .wrap {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 56px;
    align-items: center;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--muted);
}

.eyebrow .green-dot {
    color: var(--green);
    margin-right: 6px;
    display: inline-block;
    animation: dotPulse 2.2s ease-in-out infinite;
}

@keyframes dotPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.55;
        transform: scale(1.2);
    }
}

h1.hero-name {
    font-size: clamp(46px, 7vw, 84px);
    margin: 14px 0 18px;
    background: linear-gradient(120deg, var(--text) 15%, var(--blue) 55%, var(--purple) 90%, var(--gold) 120%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-tagline {
    font-size: clamp(19px, 2.4vw, 23px);
    color: var(--text);
    max-width: 46ch;
    line-height: 1.5;
    margin: 0 0 18px;
}

.hero-desc {
    color: var(--muted);
    max-width: 52ch;
    line-height: 1.75;
    font-size: 16px;
    margin: 0 0 34px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 38px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 20px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14.5px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.btn-primary {
    background: linear-gradient(120deg, var(--blue-btn), var(--purple-btn) 70%, var(--gold) 145%);
    color: #fff;
    box-shadow: 0 6px 22px -8px rgba(155, 63, 240, 0.55);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px -6px rgba(155, 63, 240, 0.65);
}

.btn-ghost {
    background: var(--bg-elevated);
    color: var(--text);
    border-color: var(--border);
}

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

.hero-meta {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}

.hero-meta .stat {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--faint);
}

.hero-meta .stat b {
    color: var(--text);
    font-weight: 600;
}

/* ---------- Terminal ---------- */
.terminal {
    background: var(--bg-inset);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-m);
    overflow: hidden;
    box-shadow: var(--shadow-glow), 0 30px 60px rgba(0, 0, 0, 0.35);
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.terminal-bar .tdot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.terminal-bar .tdot.r {
    background: #ff5f57;
}

.terminal-bar .tdot.y {
    background: #febc2e;
}

.terminal-bar .tdot.g {
    background: #28c840;
}

.terminal-title {
    margin-left: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--faint);
}

.terminal-body {
    padding: 26px 24px 30px;
    font-family: var(--font-mono);
    font-size: 14.5px;
    line-height: 1.9;
    min-height: 220px;
}

.terminal-body .line {
    white-space: pre-wrap;
    word-break: break-word;
}

.terminal-body .prompt::before {
    content: "$ ";
    color: var(--green);
}

.terminal-body .out {
    color: var(--muted);
}

.terminal-body .status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    margin-right: 9px;
    box-shadow: 0 0 8px var(--green);
    animation: dotPulse 2.2s ease-in-out infinite;
}

.cursor-block {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--text);
    vertical-align: -3px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ---------- Section base ---------- */
.section {
    padding: 90px 0;
    border-top: 1px solid var(--border);
}

.section>.wrap>p.lede {
    color: var(--muted);
    line-height: 1.8;
    max-width: 62ch;
    font-size: 16px;
}

/* ---------- About ---------- */
.about-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 50px;
    align-items: start;
}

.about-text p {
    color: var(--muted);
    line-height: 1.85;
    font-size: 16.5px;
    max-width: 60ch;
}

.about-text p+p {
    margin-top: 18px;
}

.about-panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    padding: 22px 24px;
}

.about-panel .row {
    display: flex;
    justify-content: space-between;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.about-panel .row:last-child {
    border-bottom: none;
}

.about-panel .row span:first-child {
    color: var(--faint);
}

.about-panel .row span:last-child {
    font-family: var(--font-mono);
    color: var(--text);
    font-weight: 500;
}

/* ---------- Skills list ---------- */
.skills-list {
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.skill-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 22px;
    align-items: baseline;
    padding: 20px 4px;
    border-bottom: 1px solid var(--border);
}

.skill-row .name {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-row .name .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skill-row .desc {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

/* ---------- Projects ---------- */
.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.project {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent, var(--blue));
    border-radius: var(--radius-m);
    padding: 24px 24px 22px;
    transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.project:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    border-left-color: var(--accent, var(--blue));
    box-shadow: 0 16px 36px -18px var(--accent, var(--blue));
}

.project-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.project-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--bg-inset);
    color: var(--accent, var(--blue));
    font-size: 16px;
}

.project h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.project p {
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.7;
    margin: 0 0 16px;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 18px;
}

.chip {
    font-family: var(--font-mono);
    font-size: 11.5px;
    padding: 4px 9px;
    border-radius: 6px;
    background: var(--bg-inset);
    color: var(--muted);
    border: 1px solid var(--border);
}

.project-links {
    display: flex;
    gap: 18px;
}

.project-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text);
    transition: color var(--dur) var(--ease);
}

.project-links a:hover {
    color: var(--blue);
}

.project-links a i {
    font-size: 12px;
    color: var(--muted);
}

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

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

.contact .prompt-line {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 18px;
}

.contact .prompt-line::before {
    content: "$ ";
    color: var(--green);
}

.contact h2 {
    font-size: clamp(28px, 4vw, 40px);
    margin-bottom: 14px;
    border: none;
    background: none;
    padding: 0;
}

.contact p.lede {
    margin: 0 auto 30px;
}

/* ---------- Footer / status bar ---------- */
footer.statusbar {
    border-top: 1px solid var(--border);
    padding: 14px 0;
}

footer.statusbar .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--faint);
}

footer.statusbar .branch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

footer.statusbar .branch .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
}

footer.statusbar .items {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

/* ---------- Panda companion ----------
   A small easter egg that wanders across the bottom of the screen
   once you've scrolled past the hero — a bit of warmth against all
   the terminal chrome. Purely decorative: aria-hidden + pointer-events:none. */
.panda-stage {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    overflow: hidden;
    pointer-events: none;
    z-index: 40;
    opacity: 0;
    transition: opacity 0.6s var(--ease);
}

.panda-stage.show {
    opacity: 1;
}

.panda-track {
    position: absolute;
    bottom: 4px;
    width: 58px;
    animation: pandaCross 24s linear infinite;
}

@keyframes pandaCross {
    from {
        transform: translateX(-14vw);
    }

    to {
        transform: translateX(114vw);
    }
}

.panda-bob {
    display: block;
    transform-origin: 50% 100%;
    animation: pandaBob 0.6s ease-in-out infinite;
}

@keyframes pandaBob {

    0%,
    100% {
        transform: rotate(-3deg) translateY(0);
    }

    50% {
        transform: rotate(3deg) translateY(-2px);
    }
}

.panda-leg-l {
    animation: pandaLegL 0.6s ease-in-out infinite;
}

.panda-leg-r {
    animation: pandaLegR 0.6s ease-in-out infinite;
}

@keyframes pandaLegL {

    0%,
    100% {
        transform: translateY(-2px);
    }

    50% {
        transform: translateY(0);
    }
}

@keyframes pandaLegR {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

.panda-arm-l {
    animation: pandaArm 0.6s ease-in-out infinite;
}

.panda-arm-r {
    animation: pandaArm 0.6s ease-in-out infinite reverse;
}

@keyframes pandaArm {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

.panda-shadow {
    display: block;
    margin: 0 auto;
    animation: pandaShadow 0.6s ease-in-out infinite;
    transform-origin: center;
}

@keyframes pandaShadow {

    0%,
    100% {
        transform: scaleX(1);
        opacity: 0.16;
    }

    50% {
        transform: scaleX(0.82);
        opacity: 0.1;
    }
}

@media (max-width: 560px) {
    .panda-stage {
        height: 46px;
    }

    .panda-track {
        width: 42px;
    }
}

/* ---------- Mobile menu ---------- */
@media (max-width: 860px) {
    .hero .wrap {
        grid-template-columns: 1fr;
        gap: 44px;
    }

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

@media (max-width: 700px) {
    .menu-btn {
        display: inline-flex;
    }

    nav.links {
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-elevated);
        border-bottom: 1px solid var(--border);
        padding: 8px 5%;
        gap: 2px;
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
    }

    nav.links.open {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    nav.links a {
        padding: 13px 6px;
        border-radius: 0;
        border-bottom: 1px solid var(--border);
    }

    nav.links a:last-child {
        border-bottom: none;
    }

    .hero {
        padding: 56px 0 60px;
    }

    .section {
        padding: 60px 0;
    }

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

    .skill-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

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

    .about-panel .row {
        font-size: 13px;
    }
}