:root {
    --bg: #0b0f14;
    --surface: #121820;
    --surface-alt: #0f151c;
    --text: #eef3f7;
    --muted: #9eabb7;
    --dim: #748391;
    --border: rgba(190, 211, 226, .16);
    --accent: #58b7e8;
    --accent-soft: #19384b;
    --steel: #7894a8;
    --header-height: 76px;
    --max-width: 1180px;
    --radius: 14px;
    --shadow: 0 18px 50px rgba(0, 0, 0, .22);
    --font-heading: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
    --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px)
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden
}

body::selection {
    background: var(--accent);
    color: var(--bg)
}

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

button {
    font: inherit;
    color: inherit
}

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

.binary-texture {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    color: #9bd5ee;
    font: 700 clamp(1.1rem, 2.8vw, 2.8rem)/2.4 "SFMono-Regular", Consolas, monospace;
    letter-spacing: .12em;
    opacity: .022;
    transform: rotate(-8deg) scale(1.18);
    white-space: pre-wrap;
    word-spacing: 1.6rem;
    padding: 4vh 0
}

.site-header {
    position: fixed;
    z-index: 20;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(11, 15, 20, .94);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px)
}

.nav-wrap {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 30px
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: .94rem;
    font-weight: 700;
    letter-spacing: -.02em;
    white-space: nowrap
}

.brand img {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    object-fit: cover
}

.brand-dot {
    color: var(--accent)
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 26px;
    margin-left: auto
}

.nav-link,
.footer-links a {
    color: var(--muted);
    font-size: .83rem;
    font-weight: 600
}

.nav-link {
    position: relative;
    padding: 28px 0
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 17px;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .2s ease
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--text)
}

.nav-link.is-active::after {
    transform: scaleX(1)
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px
}

.icon-link {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    opacity: .75;
    transition: opacity .2s, background .2s
}

.icon-link:hover {
    opacity: 1;
    background: var(--surface)
}

.icon-link img {
    width: 16px;
    height: 16px;
    object-fit: contain
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--accent);
    color: #071017;
    border: 1px solid var(--accent);
    padding: 12px 18px;
    border-radius: 7px;
    font-weight: 750;
    font-size: .85rem;
    transition: transform .2s, background .2s, box-shadow .2s
}

.button:hover {
    background: #82d2f3;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(88, 183, 232, .17)
}

.button-small {
    padding: 9px 13px;
    font-size: .76rem
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 7px 11px;
    font-size: .8rem
}

.section-anchor {
    scroll-margin-top: calc(var(--header-height) + 20px)
}

.hero {
    padding: calc(var(--header-height) + 86px) 0 0;
    min-height: 760px;
    display: flex;
    flex-direction: column
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .72fr);
    gap: 80px;
    align-items: center;
    flex: 1
}

.status {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase
}

.status-dot {
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(88, 183, 232, .1)
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0
}

h1,
h2,
h3,
h4 {
    line-height: 1.06;
    letter-spacing: -.04em
}

h1 {
    font-size: clamp(3.7rem, 7vw, 6.9rem);
    max-width: 800px;
    margin: 24px 0 28px;
    font-weight: 700
}

h1 em {
    font-style: normal;
    color: var(--accent)
}

.hero-lede {
    max-width: 620px;
    color: var(--muted);
    font-size: clamp(1.02rem, 1.5vw, 1.22rem);
    line-height: 1.65
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 32px
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    font-size: .85rem;
    font-weight: 700;
    border-bottom: 1px solid var(--steel);
    padding-bottom: 4px;
    transition: color .2s, border-color .2s
}

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

.proof-row {
    display: flex;
    gap: 34px;
    margin: 76px 0 0;
    padding: 18px 0 0;
    border-top: 1px solid var(--border);
    max-width: 680px
}

.proof-row div {
    min-width: 0
}

.proof-row dt {
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: -.02em
}

.proof-row dd {
    margin: 4px 0 0;
    color: var(--dim);
    font-size: .73rem
}

.hero-aside {
    align-self: center
}

.eyebrow {
    color: var(--accent);
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 15px
}

.signal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 21px;
    box-shadow: var(--shadow)
}

.signal-top,
.signal-line {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--dim);
    font: 600 .65rem/1.4 "SFMono-Regular", Consolas, monospace;
    letter-spacing: .08em
}

.signal-mark {
    font-size: 6rem;
    line-height: 1;
    margin: 45px 0 42px;
    font-weight: 750;
    letter-spacing: -.12em;
    color: var(--text)
}

.signal-mark span {
    font-size: 2rem;
    color: var(--accent);
    vertical-align: top;
    letter-spacing: 0
}

.signal-line {
    padding: 12px 0;
    border-top: 1px solid var(--border)
}

.signal-line strong {
    color: var(--accent);
    font-weight: 600
}

.aside-note {
    color: var(--muted);
    font-size: .82rem;
    margin: 20px 0 0
}

.marquee-block {
    padding: 56px 0 26px
}

.marquee-label {
    display: flex;
    justify-content: space-between;
    color: var(--dim);
    font: 600 .67rem/1.3 "SFMono-Regular", Consolas, monospace;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 13px
}

.marquee {
    position: relative;
    overflow: hidden
}

.marquee::before,
.marquee::after {
    content: "";
    position: absolute;
    z-index: 2;
    top: 0;
    bottom: 0;
    width: 70px;
    pointer-events: none
}

.marquee::before {
    left: 0;
    background: linear-gradient(90deg, var(--bg), transparent)
}

.marquee::after {
    right: 0;
    background: linear-gradient(270deg, var(--bg), transparent)
}

.section-alt .marquee::before {
    background: linear-gradient(90deg, var(--surface-alt), transparent)
}

.section-alt .marquee::after {
    background: linear-gradient(270deg, var(--surface-alt), transparent)
}

.marquee-track {
    display: flex;
    width: max-content;
    gap: 12px;
    animation: marquee 46s linear infinite
}

.marquee:hover .marquee-track {
    animation-play-state: paused
}

.marquee img {
    width: 156px;
    height: 78px;
    object-fit: contain;
    background: #fff;
    border-radius: 7px;
    padding: 10px
}

.section {
    padding: 32px 0
}

.section-alt {
    background: var(--surface-alt);
    border-top: 1px solid rgba(190, 211, 226, .08);
    border-bottom: 1px solid rgba(190, 211, 226, .08)
}

.section-intro {
    max-width: 680px;
    margin-bottom: 52px
}

.section-intro.compact {
    margin: 0 0 34px
}

.section-intro h2 {
    font-size: clamp(2.6rem, 5vw, 4.5rem);
    margin: 0 0 20px
}

.section-intro h3 {
    font-size: 2rem;
    margin: 0
}

.section-intro>p:last-child {
    color: var(--muted);
    max-width: 570px
}

.work-scroller {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 5px 2px 24px;
    scroll-snap-type: x mandatory;
    scrollbar-color: var(--steel) transparent
}

.work-card {
    flex: 0 0 min(380px, calc(100vw - 80px));
    min-height: 440px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 27px;
    scroll-snap-align: start;
    transition: border-color .2s, transform .2s
}

.work-card:hover {
    border-color: rgba(88, 183, 232, .5);
    transform: translateY(-4px)
}

.card-meta {
    display: flex;
    justify-content: space-between;
    color: var(--accent);
    font: 600 .68rem "SFMono-Regular", Consolas, monospace;
    text-transform: uppercase;
    letter-spacing: .06em
}

.work-card h3 {
    font-size: 1.8rem;
    margin: 50px 0 8px
}

.role {
    color: var(--steel);
    font-size: .82rem;
    margin-bottom: 22px
}

.work-card>p:not(.role) {
    color: var(--muted);
    font-size: .9rem
}

.work-card ul {
    padding-left: 16px;
    color: var(--muted);
    font-size: .82rem
}

.work-card li {
    margin: 6px 0
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 20px
}

.tags span {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 9px;
    color: var(--muted);
    font: 600 .68rem/1.2 "SFMono-Regular", Consolas, monospace
}

.carousel-controls {
    display: flex;
    gap: 8px;
    margin: 0 0 92px
}

.carousel-controls button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 6px;
    cursor: pointer;
    color: var(--muted)
}

.carousel-controls button:hover {
    color: var(--text);
    border-color: var(--accent)
}

.timeline-wrap {
}

.timeline {
    border-left: 1px solid var(--steel);
    margin-left: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 18px;
    scroll-snap-type: y proximity;
    overscroll-behavior: auto;
    scrollbar-color: var(--steel) transparent
}

.timeline-item {
    display: grid;
    grid-template-columns: 155px 1fr;
    gap: 42px;
    padding: 0 0 48px 52px;
    position: relative;
    scroll-snap-align: start
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 7px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent)
}

.timeline-date {
    color: var(--accent);
    font: 600 .72rem "SFMono-Regular", Consolas, monospace;
    padding-top: 8px
}

.timeline-item h4 {
    font-size: 1.1rem;
    margin-bottom: 8px
}

.timeline-item h4 span {
    color: var(--steel);
    font-weight: 500
}

.timeline-item p {
    color: var(--muted);
    font-size: .85rem;
    margin-bottom: 0
}

.tech-marquee {
    padding-top: 0;
    margin-bottom: 32px
}

.section-alt .marquee-block {
    padding-top: 0
}

.expertise-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border)
}

.expertise-card {
    min-height: 250px;
    padding: 25px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    position: relative
}

.card-index {
    color: var(--accent);
    font: 600 .7rem "SFMono-Regular", Consolas, monospace
}

.expertise-card h3 {
    font-size: 1.4rem;
    margin: 44px 0 12px
}

.expertise-card p {
    font-size: .82rem;
    color: var(--muted);
    max-width: 280px
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    min-height: 470px;
    display: flex;
    flex-direction: column
}

.project-featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    min-height: 450px
}

.project-image {
    display: grid;
    place-items: center;
    background: #fff;
    min-height: 190px;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: contain
}

.project-content {
    display: flex;
    flex-direction: column;
    padding: 28px
}

.project-content h3 {
    font-size: 1.8rem;
    margin-bottom: 13px
}

.project-content p:not(.eyebrow) {
    font-size: .86rem;
    color: var(--muted)
}

.project-challenge {
    border-top: 1px solid var(--border);
    margin-top: 24px;
    padding-top: 14px
}

.project-challenge span {
    display: block;
    color: var(--dim);
    font: 600 .67rem "SFMono-Regular", Consolas, monospace;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 6px
}

.project-challenge strong {
    font-size: .88rem;
    font-weight: 600
}

.project-footer {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-top: auto
}

.project-footer .tags {
    padding: 0
}

.project-card>.project-content>.text-link {
    margin-top: auto;
    width: max-content;
    align-self: flex-end
}

.project-footer .text-link {
    margin-left: auto
}

.project-card:not(.project-featured) .project-content > .tags {
    margin-top: 0;
    padding-top: 20px;
    height: 76px;
    flex-wrap: wrap;
    align-content: flex-start;
    overflow: hidden
}

.project-card:not(.project-featured) .project-content > .text-link {
    margin-top: 0;
    align-self: end;
    justify-self: end
}

.project-card:not(.project-featured) .project-content {
    display: grid;
    grid-template-rows: auto auto 1fr 76px 32px
}

.project-card:not(.project-featured) {
    display: grid;
    grid-template-rows: 190px minmax(0, 1fr)
}

.project-card:not(.project-featured) .project-image {
    height: 190px
}

.project-featured .project-footer {
    display: grid;
    grid-template-rows: 76px 32px;
    gap: 14px;
    align-items: stretch;
    margin-top: auto
}

.project-featured .project-footer .tags {
    flex-wrap: wrap;
    margin-top: 0;
    height: 76px;
    align-content: flex-start;
    overflow: hidden
}

.project-featured .project-footer .text-link {
    align-self: end;
    justify-self: end;
    margin-top: 0
}

.contact {
    padding: 100px 0;
    background: var(--accent);
    color: #071017
}

.contact-inner {
    display: grid;
    grid-template-columns: 1.6fr auto;
    align-items: end;
    gap: 30px
}

.contact .eyebrow {
    color: #285572
}

.contact h2 {
    font-size: clamp(2.8rem, 6vw, 5.8rem);
    max-width: 700px;
    margin: 0 0 18px
}

.contact p:not(.eyebrow) {
    max-width: 540px;
    color: #31566c
}

.button-light {
    background: #071017;
    color: var(--text);
    border-color: #071017
}

.button-light:hover {
    background: #1d3542
}

.contact-links {
    grid-column: 1/-1;
    display: flex;
    gap: 26px;
    padding-top: 26px;
    border-top: 1px solid rgba(7, 16, 23, .2);
    font-size: .8rem;
    font-weight: 700
}

.site-footer {
    padding: 25px 0;
    background: #080c10;
    color: var(--dim);
    font-size: .72rem
}

.footer-inner {
    display: flex;
    align-items: center;
    gap: 24px
}

.footer-links {
    display: flex;
    gap: 18px;
    margin-left: auto
}

.footer-links a:hover,
.contact-links a:hover {
    color: var(--text)
}

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

@keyframes marquee {
    to {
        transform: translateX(-50%)
    }
}

@media(max-width:800px) {
    :root {
        --header-height: 64px
    }

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

    .site-header {
        backdrop-filter: none
    }

    .nav-wrap {
        gap: 14px
    }

    .brand {
        margin-right: auto
    }

    .menu-toggle {
        display: block
    }

    .site-nav {
        display: none;
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        right: 0;
        padding: 8px 16px 16px;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        gap: 0
    }

    .site-nav.is-open {
        display: flex
    }

    .nav-link {
        padding: 12px 0
    }

    .nav-link::after {
        bottom: 4px
    }

    .nav-actions {
        gap: 6px
    }

    .nav-actions .icon-link {
        display: none
    }

    .nav-actions .button {
        font-size: .7rem;
        padding: 8px 10px
    }

    .hero {
        padding-top: calc(var(--header-height) + 52px);
        min-height: auto
    }

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

    .hero-aside {
        max-width: 440px
    }

    .signal-mark {
        margin: 35px 0
    }

    .proof-row {
        gap: 16px;
        margin-top: 48px
    }

    .proof-row dt {
        font-size: .86rem
    }

    .proof-row dd {
        font-size: .65rem
    }

    .hero .marquee-block {
        margin-top: 72px
    }

    .section {
        padding: 92px 0
    }

    .section-intro {
        margin-bottom: 36px
    }

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

    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .project-featured {
        grid-column: span 2
    }

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

    .project-featured .project-image {
        min-height: 250px
    }

    .contact-inner {
        grid-template-columns: 1fr;
        align-items: start
    }

    .contact-links {
        grid-column: auto
    }

    .footer-inner {
        flex-wrap: wrap
    }

    .footer-inner>span {
        order: 3;
        width: 100%
    }

    .footer-links {
        margin-left: 0
    }
}

@media(max-width:520px) {
    h1 {
        font-size: clamp(3.2rem, 16vw, 5rem)
    }

    .hero-lede {
        font-size: .98rem
    }

    .hero-actions {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px
    }

    .proof-row {
        flex-wrap: wrap
    }

    .proof-row div {
        flex: 1 1 30%
    }

    .marquee img {
        width: 132px;
        height: 66px
    }

    .section-intro h2 {
        font-size: 2.8rem
    }

    .work-card {
        min-height: 420px
    }

    .timeline-item {
        display: block;
        padding-left: 22px
    }

    .timeline-date {
        margin-bottom: 10px
    }

    .timeline-item h4 {
        font-size: 1rem
    }

    .expertise-grid {
        grid-template-columns: 1fr
    }

    .expertise-card {
        min-height: 220px
    }

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

    .project-featured {
        grid-column: auto
    }

    .project-card {
        min-height: 420px
    }

    .project-footer {
        align-items: flex-start;
        flex-direction: column
    }

    .contact-links {
        flex-direction: column;
        gap: 10px
    }

    .footer-links {
        gap: 12px
    }

    .binary-texture {
        font-size: 1.1rem
    }
}

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

    .marquee-track {
        animation: none
    }

    .button,
    .work-card,
    .icon-link {
        transition: none
    }
}

.site-header .brand img {
    width: 42px;
    height: 42px
}

.site-header .icon-link {
    width: 36px;
    height: 36px
}

.site-header .icon-link img {
    width: 36px;
    height: 36px
}

.site-header .icon-link[aria-label="GitHub"] img {
    filter: invert(1) brightness(1.15)
}

.contact .eyebrow {
    color: #16415a
}

.contact p:not(.eyebrow) {
    color: #0d2c3d
}

.button:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, .24)
}

@media (max-width: 520px) {
    .timeline {
        max-height: 560px;
        padding-right: 12px
    }

    .timeline-item {
        padding-left: 44px
    }
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading)
}

.eyebrow,
.signal-top,
.signal-line,
.marquee-label,
.card-meta,
.tags span,
.timeline-date,
.card-index,
.project-challenge span {
    font-family: var(--font-mono)
}

/* Final visual balance pass */
.signal-card {
    padding: 26px
}

.signal-top,
.signal-line {
    font-size: .72rem
}

.signal-mark {
    font-size: 6.5rem
}

.work-card {
    padding: 32px
}

.work-card h3 {
    font-size: 1.95rem
}

.timeline-wrap {
    margin-top: 20px
}

.timeline-wrap .section-intro.compact {
    margin-bottom: 42px
}

.timeline-wrap .section-intro h3 {
    font-size: 2.25rem
}

.marquee img {
    filter: brightness(.92)
}

@media (min-width: 801px) {
    .project-featured {
        min-height: 520px
    }

    .project-featured .project-image {
        min-height: 280px
    }
}

/* Cookie consent */
.cookie-consent {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    max-width: 340px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow)
}

.cookie-consent[hidden] {
    display: none
}

.cookie-consent-text {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted)
}

.cookie-consent-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end
}

.cookie-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text)
}

.cookie-btn:hover {
    border-color: var(--accent);
    color: var(--accent)
}

.cookie-btn-accept,
.cookie-btn-accept:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg)
}

@media (max-width: 480px) {
    .cookie-consent {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: none
    }
}
