:root {
    --bg: #0f1219;
    --bg-raise: #151a24;
    --line: #242c3b;
    --text: #e9ecf3;
    --muted: #8b93a7;
    --main: #e9ecf3;
    --frontend: #ff7a8a;
    --backend: #9d7bff;
    --infra: #3dddd0;
    --lane-w: 26px;
    --rail-w: 130px;
    --mainline: #3a4356;
    --display: 'Clash Display', sans-serif;
    --body: 'Satoshi', sans-serif;
    --mono: 'JetBrains Mono', monospace;
}

/* ── staging environment (light theme) ── */
html[data-env="staging"] {
    --bg: #f1f3f8;
    --bg-raise: #ffffff;
    --line: #d7dce8;
    --text: #1b2233;
    --muted: #5b657d;
    --main: #1b2233;
    --frontend: #e0455c;
    --backend: #6e45e2;
    --infra: #0b9c92;
    --mainline: #b9c1d4;
}

html[data-env="staging"] header {
    background: rgba(241, 243, 248, .85)
}

html[data-env="staging"] ::selection {
    background: var(--backend);
    color: #fff
}

html[data-env="staging"] .btn.primary {
    background: var(--text);
    color: #fff;
    border-color: var(--text)
}

html[data-env="staging"] .btn.primary:hover {
    background: #000
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html {
    scroll-behavior: smooth
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--backend);
    color: #0f1219
}

a {
    color: inherit
}

:focus-visible {
    outline: 2px solid var(--infra);
    outline-offset: 3px;
    border-radius: 2px
}

.wrap {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 28px
}

/* ── header ─────────────────────────────── */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(15, 18, 25, .8);
    border-bottom: 1px solid var(--line);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px
}

.logo {
    font-family: var(--mono);
    font-size: 14px;
    text-decoration: none;
    color: var(--muted)
}

.logo b {
    color: var(--text);
    font-weight: 500
}

.nav-links {
    display: flex;
    gap: 26px;
    list-style: none
}

.nav-links a {
    font-family: var(--mono);
    font-size: 13px;
    text-decoration: none;
    color: var(--muted);
    transition: color .15s;
}

.nav-links a:hover {
    color: var(--text)
}

.nav-links a::before {
    content: './';
    opacity: .45
}

/* ── hero ───────────────────────────────── */
.hero {
    padding: 110px 0 90px;
    position: relative;
    overflow: hidden
}

.term-line {
    font-family: var(--mono);
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 34px;
    min-height: 21px;
}

.term-line .prompt {
    color: var(--infra)
}

.term-line .caret {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--text);
    vertical-align: -2px;
    animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
    50% {
        opacity: 0
    }
}

h1 {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(46px, 8.5vw, 104px);
    line-height: .98;
    letter-spacing: -.02em;
    margin-bottom: 30px;
}

h1 .l1 {
    color: var(--text)
}

h1 .l2 {
    display: block
}

h1 .l2 .w-f {
    color: var(--frontend)
}

h1 .l2 .w-b {
    color: var(--backend)
}

h1 .l2 .w-i {
    color: var(--infra)
}

h1 .l3 {
    display: block;
    color: var(--text)
}

.hero p.sub {
    max-width: 560px;
    color: var(--muted);
    font-size: 19px;
    margin-bottom: 38px
}

.hero p.sub b {
    color: var(--text);
    font-weight: 600
}

.cta-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap
}

.btn {
    font-family: var(--mono);
    font-size: 14px;
    text-decoration: none;
    padding: 13px 22px;
    border-radius: 8px;
    border: 1px solid var(--line);
    transition: transform .15s, border-color .15s, background .15s;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-2px)
}

.btn.primary {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
    font-weight: 700
}

.btn.primary:hover {
    background: #fff
}

.btn.ghost:hover {
    border-color: var(--muted)
}

/* faint background graph doodle */
.hero-doodle {
    position: absolute;
    right: -30px;
    top: 40px;
    width: 300px;
    height: 460px;
    opacity: .5;
    pointer-events: none;
}

@media(max-width:900px) {
    .hero-doodle {
        display: none
    }
}

/* ── section scaffolding ─────────────────── */
section {
    padding: 90px 0;
    border-top: 1px solid var(--line)
}

.sec-head {
    margin-bottom: 48px
}

.sec-eyebrow {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
    display: block;
    margin-bottom: 12px;
}

.sec-eyebrow .prompt {
    color: var(--infra)
}

h2 {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(30px, 4.5vw, 46px);
    letter-spacing: -.01em;
}

/* ── branches (skills) ───────────────────── */
.branch-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px
}

@media(max-width:840px) {
    .branch-grid {
        grid-template-columns: 1fr
    }
}

.branch-card {
    background: var(--bg-raise);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 26px 24px;
    position: relative;
    transition: transform .2s, border-color .2s;
}

.branch-card:hover {
    transform: translateY(-4px)
}

.branch-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18px;
    bottom: 18px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--bc);
}

.branch-card:hover {
    border-color: color-mix(in srgb, var(--bc) 45%, var(--line))
}

.branch-name {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--bc);
    margin-bottom: 4px;
}

.branch-name::before {
    content: '* ';
    color: var(--muted);
    font-weight: 400
}

.branch-meta {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 18px
}

.branch-card ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.branch-card li {
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 5px 10px;
    background: var(--bg);
}

.branch-blurb {
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 18px
}

/* ── log (the git graph timeline) ────────── */
.log-layout {
    position: relative;
    display: flex
}

.rail {
    position: relative;
    flex: 0 0 var(--rail-w);
}

.rail svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible
}

.rail path {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round
}

.commits {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 34px;
    min-width: 0
}

.commit {
    position: relative
}

.dot {
    position: absolute;
    left: calc(-1 * var(--rail-w) + 14px + var(--lane) * var(--lane-w));
    top: 26px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--dc);
    transform: scale(.3);
    opacity: 0;
    transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), opacity .35s;
    z-index: 2;
}

.commit.seen .dot {
    transform: scale(1);
    opacity: 1
}

.commit.merge-node .dot {
    width: 17px;
    height: 17px;
    background: var(--dc);
    top: 24px
}

.ccard {
    background: var(--bg-raise);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px 24px;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .5s, transform .5s;
}

.commit.seen .ccard {
    opacity: 1;
    transform: none
}

.chash {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.chash .h {
    color: var(--dc)
}

.cmsg {
    font-family: var(--mono);
    font-size: 15.5px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text);
}

.cmsg .scope {
    color: var(--dc)
}

.crole {
    font-family: var(--display);
    font-weight: 600;
    font-size: 21px;
    margin-bottom: 8px
}

.cbody {
    color: var(--muted);
    font-size: 15px;
    max-width: 600px
}

.ctags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px
}

.ctags span {
    font-family: var(--mono);
    font-size: 11.5px;
    padding: 4px 9px;
    border-radius: 5px;
    border: 1px solid var(--line);
    color: var(--muted);
}

.merge-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px
}

.merge-chips span {
    font-family: var(--mono);
    font-size: 11.5px;
    padding: 4px 10px;
    border-radius: 99px;
    border: 1px solid transparent;
    font-weight: 500;
}

.merge-chips .mf {
    color: var(--frontend);
    border-color: color-mix(in srgb, var(--frontend) 40%, transparent)
}

.merge-chips .mb {
    color: var(--backend);
    border-color: color-mix(in srgb, var(--backend) 40%, transparent)
}

.merge-chips .mi {
    color: var(--infra);
    border-color: color-mix(in srgb, var(--infra) 40%, transparent)
}

.head-marker {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
    padding-top: 8px;
}

.head-marker b {
    color: var(--infra);
    font-weight: 700
}

@media(max-width:680px) {
    :root {
        --lane-w: 15px;
        --rail-w: 78px
    }

    .ccard {
        padding: 18px
    }

    .dot {
        top: 22px
    }
}

/* ── merges (projects) ───────────────────── */
.pr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px
}

@media(max-width:900px) {
    .pr-grid {
        grid-template-columns: 1fr
    }
}

.pr {
    background: var(--bg-raise);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform .2s, border-color .2s;
}

.pr:hover {
    transform: translateY(-4px);
    border-color: #36405a
}

.pr-meta {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted)
}

.pr-meta .merged {
    color: var(--backend);
    font-weight: 700;
}

.pr-meta .merged::before {
    content: '⬡ ';
    font-weight: 400
}

.pr h3 {
    font-family: var(--display);
    font-weight: 600;
    font-size: 21px;
    line-height: 1.25
}

.pr p {
    color: var(--muted);
    font-size: 15px;
    flex: 1
}

.pr-stats {
    font-family: var(--mono);
    font-size: 12.5px;
    display: flex;
    gap: 14px
}

.pr-stats .add {
    color: var(--infra)
}

.pr-stats .del {
    color: var(--frontend)
}

/* ── contact ─────────────────────────────── */
.contact-box {
    background: var(--bg-raise);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    background-image: radial-gradient(600px 200px at 80% -20%, rgba(157, 123, 255, .12), transparent);
}

.contact-box .check {
    font-family: var(--mono);
    font-size: 13.5px;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.contact-box .check .ok::before {
    content: '✓ ';
    color: var(--infra);
    font-weight: 700
}

.contact-box h2 {
    font-size: clamp(26px, 4vw, 38px)
}

.links-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap
}

/* ── footer ──────────────────────────────── */
footer {
    border-top: 1px solid var(--line);
    padding: 34px 0 44px
}

.foot {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--muted);
}

.uptime b {
    color: var(--infra);
    font-weight: 500;
    font-variant-numeric: tabular-nums
}

/* ── toast (easter egg) ──────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 80px);
    background: var(--bg-raise);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 13px 20px;
    font-family: var(--mono);
    font-size: 13px;
    transition: transform .35s cubic-bezier(.34, 1.3, .64, 1);
    z-index: 99;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}

.toast.show {
    transform: translate(-50%, 0)
}

.toast .ok {
    color: var(--infra)
}

/* ── achievements ────────────────────────── */
.ach-stack {
    position: fixed;
    top: 74px;
    right: 18px;
    z-index: 95;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.ach {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--bg-raise);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 16px;
    min-width: 260px;
    max-width: 320px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
    transform: translateX(120%);
    transition: transform .4s cubic-bezier(.34, 1.3, .64, 1);
}

html[data-env="staging"] .ach {
    box-shadow: 0 12px 40px rgba(27, 34, 51, .25)
}

.ach.in {
    transform: none
}

.ach .ico {
    font-size: 20px
}

.ach .t1 {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--muted);
    letter-spacing: .08em;
    text-transform: uppercase
}

.ach .t2 {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--text)
}

.ach .t3 {
    font-size: 12.5px;
    color: var(--muted)
}

@media(max-width:680px) {
    .ach-stack {
        right: 10px;
        left: 10px
    }

    .ach {
        max-width: none
    }
}

/* ── nav buttons (env + terminal) ───────── */
.navbtn {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
    background: none;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 6px 12px;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}

.navbtn:hover {
    color: var(--text);
    border-color: var(--muted)
}

.navbtn.env b {
    color: var(--infra);
    font-weight: 700
}

html[data-env="staging"] .navbtn.env b {
    color: #c77400
}

/* ── staging ribbon ─────────────────────── */
.ribbon {
    display: none;
    position: fixed;
    top: 74px;
    right: -46px;
    z-index: 60;
    transform: rotate(38deg);
    background: repeating-linear-gradient(45deg, #ffd34d, #ffd34d 12px, #1b2233 12px, #1b2233 24px);
    padding: 3px;
    pointer-events: none;
}

.ribbon span {
    display: block;
    background: #ffd34d;
    color: #1b2233;
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .12em;
    padding: 5px 56px;
    white-space: nowrap;
}

html[data-env="staging"] .ribbon {
    display: block
}

/* ── terminal ───────────────────────────── */
.term {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 90;
    width: min(620px, calc(100vw - 32px));
    height: 420px;
    background: #0c0f15;
    border: 1px solid #2a3242;
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.55;
}

.term.open {
    display: flex
}

html[data-env="staging"] .term {
    box-shadow: 0 24px 80px rgba(27, 34, 51, .35)
}

.term-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #11151d;
    border-bottom: 1px solid #232b3a;
    cursor: default;
    user-select: none;
}

.term-bar .dot-r,
.term-bar .dot-y,
.term-bar .dot-g {
    width: 11px;
    height: 11px;
    border-radius: 50%
}

.dot-r {
    background: #ff5f57
}

.dot-y {
    background: #febc2e
}

.dot-g {
    background: #28c840
}

.term-bar .ttl {
    flex: 1;
    text-align: center;
    color: #8b93a7;
    font-size: 12px
}

.term-bar button {
    background: none;
    border: 0;
    color: #8b93a7;
    cursor: pointer;
    font-family: var(--mono);
    font-size: 14px;
    padding: 0 4px;
}

.term-bar button:hover {
    color: #fff
}

.term-out {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    color: #cdd3e0
}

.term-out .ln {
    white-space: pre-wrap;
    word-break: break-word
}

.term-out .c-p {
    color: #3dddd0
}

.term-out .c-f {
    color: #ff7a8a
}

.term-out .c-b {
    color: #9d7bff
}

.term-out .c-m {
    color: #7c869c
}

.term-out .c-y {
    color: #ffd34d
}

.term-out a {
    color: #3dddd0
}

.term-in {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 16px;
    border-top: 1px solid #232b3a;
    background: #0c0f15;
}

.term-in .pr {
    color: #3dddd0;
    white-space: nowrap
}

.term-in input {
    flex: 1;
    background: none;
    border: 0;
    outline: none;
    color: #e9ecf3;
    font-family: var(--mono);
    font-size: 13px;
    caret-color: #3dddd0;
}

@media(max-width:680px) {
    .term {
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 62vh;
        border-radius: 14px 14px 0 0
    }
}

/* terminal launcher pulse hint */
.term-hint {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 80;
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--muted);
    background: var(--bg-raise);
    border: 1px solid var(--line);
    border-radius: 99px;
    padding: 9px 16px;
    cursor: pointer;
    display: flex;
    gap: 8px;
    align-items: center;
    transition: transform .15s, border-color .15s;
}

.term-hint:hover {
    transform: translateY(-2px);
    border-color: var(--muted)
}

.term-hint .blip {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--infra);
    animation: blip 2s ease-in-out infinite;
}

@keyframes blip {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .25
    }
}

.term.open~.term-hint {
    display: none
}

/* ── recruiter mode (the serious version) ── */
.resume {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    overflow-y: auto;
    background: #eef0f4;
}

.resume.on {
    display: block
}

body.resume-open {
    overflow: hidden
}

.resume-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 22px;
    background: #1b2233;
    color: #fff;
    font-family: var(--mono);
    font-size: 12.5px;
    flex-wrap: wrap;
}

.resume-bar .note {
    opacity: .75
}

.resume-bar .acts {
    display: flex;
    gap: 10px
}

.resume-bar button {
    font-family: var(--mono);
    font-size: 12.5px;
    cursor: pointer;
    border-radius: 7px;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, .3);
    background: none;
    color: #fff;
}

.resume-bar button:hover {
    background: rgba(255, 255, 255, .12)
}

.resume-bar button.solid {
    background: #fff;
    color: #1b2233;
    font-weight: 700;
    border-color: #fff
}

.resume-page {
    max-width: 760px;
    margin: 34px auto 60px;
    background: #fff;
    color: #1c2230;
    padding: 54px 58px;
    border-radius: 4px;
    box-shadow: 0 14px 50px rgba(20, 26, 40, .18);
    font-family: var(--body);
    font-size: 14.5px;
    line-height: 1.55;
}

.resume-page h1 {
    font-family: var(--body);
    font-weight: 700;
    font-size: 27px;
    letter-spacing: 0;
    line-height: 1.2;
    margin-bottom: 2px;
    color: #10141f;
}

.resume-page .rtitle {
    font-size: 15px;
    color: #3c465c;
    margin-bottom: 4px
}

.resume-page .rcontact {
    font-size: 12.5px;
    color: #5b657d;
    margin-bottom: 26px
}

.resume-page .rcontact a {
    color: #5b657d
}

.resume-page h2 {
    font-family: var(--body);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #10141f;
    border-bottom: 1.5px solid #10141f;
    padding-bottom: 5px;
    margin: 24px 0 12px;
}

.rjob {
    margin-bottom: 15px
}

.rjob .rrow {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap
}

.rjob .rrole {
    font-weight: 700;
    color: #10141f
}

.rjob .rwhen {
    font-size: 12.5px;
    color: #5b657d;
    white-space: nowrap
}

.rjob .rco {
    font-size: 13px;
    color: #3c465c;
    margin-bottom: 3px
}

.rjob p {
    color: #39435a;
    font-size: 13.5px
}

.rskills {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 4px 14px;
    font-size: 13.5px
}

.rskills b {
    color: #10141f;
    font-weight: 700
}

.rskills span {
    color: #39435a
}

@media(max-width:680px) {
    .resume-page {
        padding: 32px 24px;
        margin: 18px 12px 40px
    }
}

@media print {
    body>* {
        display: none !important
    }

    .resume {
        display: block !important;
        position: static;
        background: #fff;
        overflow: visible
    }

    .resume-bar {
        display: none !important
    }

    .resume-page {
        box-shadow: none;
        margin: 0;
        max-width: none;
        border-radius: 0;
        padding: 10mm 6mm
    }
}

@media (prefers-reduced-motion:reduce) {
    html {
        scroll-behavior: auto
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important
    }

    .commit .dot,
    .commit .ccard {
        opacity: 1;
        transform: none
    }
}