:root {
    --paper: #f5f7f4;
    --paper-soft: #e9eee6;
    --ink: #111411;
    --ink-muted: #4c554d;
    --ink-faint: #8a928a;
    --line: rgba(17, 20, 17, 0.16);
    --line-strong: rgba(17, 20, 17, 0.34);
    --night: #101410;
    --night-soft: #1d241d;
    --hot: #ff5a3d;
    --moss: #5f7f48;
    --acid: #d8ff5f;
    --radius: 8px;
    --shadow: 0 22px 70px rgba(17, 20, 17, 0.11);
    --font-sans: "Inter", system-ui, sans-serif;
    --font-display: "Space Grotesk", var(--font-sans);
    --font-mono: "IBM Plex Mono", monospace;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(17, 20, 17, 0.035) 1px, transparent 1px) 0 0 / 54px 54px,
        linear-gradient(rgba(17, 20, 17, 0.028) 1px, transparent 1px) 0 0 / 54px 54px,
        var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 8% 18%, rgba(255, 90, 61, 0.13), transparent 24vw),
        radial-gradient(circle at 92% 88%, rgba(216, 255, 95, 0.16), transparent 26vw);
    mix-blend-mode: multiply;
    z-index: -2;
}

a {
    color: inherit;
}

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

::selection {
    background: var(--acid);
    color: var(--ink);
}

#signal-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    opacity: 0.44;
    z-index: -1;
}

.site-nav {
    position: fixed;
    top: 16px;
    left: 50%;
    z-index: 20;
    width: min(1180px, calc(100% - 32px));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 14px 12px 18px;
    border: 1px solid var(--line);
    background: rgba(245, 247, 244, 0.78);
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 40px rgba(17, 20, 17, 0.06);
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 12px;
    text-decoration: none;
}

.brand span {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
}

.brand small {
    color: var(--ink-faint);
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.nav-panel {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link,
.resume-link {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    border: 1px solid transparent;
    padding: 0 12px;
    color: var(--ink-muted);
    font-size: 0.86rem;
    font-weight: 650;
    text-decoration: none;
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--ink);
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.42);
}

.resume-link {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper);
}

.resume-link:hover {
    background: var(--hot);
    border-color: var(--hot);
    color: white;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 38px;
    border: 1px solid var(--line);
    background: transparent;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 5px auto;
    background: var(--ink);
    transition: transform 220ms ease, opacity 220ms ease;
}

.menu-toggle.active span:first-child {
    transform: translateY(3.5px) rotate(45deg);
}

.menu-toggle.active span:last-child {
    transform: translateY(-3.5px) rotate(-45deg);
}

.hero,
.section,
.contact-section {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 112px 0 64px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: clamp(28px, 6vw, 86px);
    align-items: center;
    width: 100%;
}

.kicker,
.eyebrow,
.section-label,
.item-meta,
.panel-topline,
.route-map,
.project-index {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0;
}

.kicker {
    margin: 0 0 22px;
    color: var(--moss);
    font-size: 0.86rem;
    font-weight: 600;
}

.hero h1 {
    max-width: 920px;
    margin: 0;
    font-family: var(--font-display);
    font-size: 7rem;
    line-height: 0.9;
    letter-spacing: 0;
    text-wrap: balance;
}

.hero-summary {
    max-width: 640px;
    margin: 28px 0 0;
    color: var(--ink-muted);
    font-size: 1.12rem;
}

.hero-actions,
.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.primary-action,
.quiet-action,
.panel-link,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid var(--ink);
    font-weight: 750;
    text-decoration: none;
    transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.primary-action {
    background: var(--ink);
    color: var(--paper);
}

.primary-action:hover,
.resume-link:hover {
    transform: translateY(-2px);
}

.quiet-action {
    background: transparent;
    color: var(--ink);
}

.quiet-action:hover,
.text-link:hover,
.panel-link:hover {
    background: var(--acid);
    color: var(--ink);
    transform: translateY(-2px);
}

.build-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    background: var(--night);
    color: #eff5ed;
    padding: clamp(22px, 4vw, 32px);
    box-shadow: var(--shadow);
}

.build-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, transparent 0 54%, rgba(216, 255, 95, 0.14) 54.2% 54.8%, transparent 55%),
        radial-gradient(circle at 80% 12%, rgba(255, 90, 61, 0.26), transparent 18rem);
    pointer-events: none;
}

.build-panel > * {
    position: relative;
}

.panel-topline {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: rgba(239, 245, 237, 0.62);
    font-size: 0.72rem;
}

.build-panel h2 {
    margin: 84px 0 16px;
    font-family: var(--font-display);
    font-size: 2.8rem;
    line-height: 0.96;
    letter-spacing: 0;
}

.build-panel p {
    margin: 0;
    color: rgba(239, 245, 237, 0.78);
}

.route-map {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 28px 0;
    overflow-x: auto;
    color: var(--acid);
    font-size: 0.72rem;
}

.route-map span {
    white-space: nowrap;
}

.route-map i {
    width: 30px;
    height: 1px;
    flex: 0 0 30px;
    background: rgba(216, 255, 95, 0.54);
}

.panel-link {
    border-color: rgba(239, 245, 237, 0.34);
    color: #eff5ed;
    gap: 9px;
}

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

.section-label {
    margin-bottom: 34px;
    color: var(--hot);
    font-size: 0.78rem;
    font-weight: 700;
}

.profile-layout {
    display: grid;
    grid-template-columns: 0.72fr 1fr;
    gap: 28px;
    align-items: stretch;
}

.portrait-wrap {
    min-height: 440px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    background: var(--paper-soft);
}

.portrait-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(0.2) contrast(1.04) saturate(0.86);
}

.profile-copy {
    display: flex;
    flex-direction: column;
    justify-content: end;
    padding: clamp(4px, 2vw, 22px) 0;
}

.lead {
    margin: 0 0 24px;
    font-family: var(--font-display);
    font-size: 3.2rem;
    line-height: 1;
    letter-spacing: 0;
}

.profile-copy p:not(.lead) {
    max-width: 680px;
    margin: 0;
    color: var(--ink-muted);
    font-size: 1rem;
}

.metric-strip {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line);
}

.metric-strip div {
    min-height: 136px;
    padding: 22px 20px;
    border-right: 1px solid var(--line);
}

.metric-strip div:last-child {
    border-right: 0;
}

.metric-strip strong {
    display: block;
    font-family: var(--font-display);
    font-size: 3.7rem;
    line-height: 1;
    letter-spacing: 0;
}

.metric-strip span {
    color: var(--ink-muted);
    font-weight: 700;
}

.experience-item,
.project-row,
.stack-block,
.proof-list,
.contact-inner {
    border-top: 1px solid var(--line-strong);
}

.experience-item {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 54px;
    padding-top: 28px;
}

.item-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--ink-faint);
    font-size: 0.76rem;
    font-weight: 600;
}

.item-main {
    max-width: 780px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--moss);
    font-size: 0.73rem;
    font-weight: 700;
}

.item-main h2,
.project-row h2,
.contact-inner h2 {
    margin: 0;
    font-family: var(--font-display);
    line-height: 1;
    letter-spacing: 0;
}

.item-main h2 {
    max-width: 720px;
    font-size: 4.3rem;
}

.item-main p:not(.eyebrow) {
    color: var(--ink-muted);
    font-size: 1rem;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 26px 0;
}

.tag-row span,
.stack-block h3 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

.tag-row span {
    border: 1px solid var(--line);
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.28);
}

.text-link {
    min-height: 40px;
    gap: 10px;
    padding: 0 14px;
}

.work-list {
    border-bottom: 1px solid var(--line);
}

.project-row {
    display: grid;
    grid-template-columns: 74px minmax(230px, 0.72fr) minmax(280px, 1fr) 52px;
    gap: 22px;
    align-items: center;
    padding: 26px 0;
}

.project-index {
    color: var(--hot);
    font-size: 0.82rem;
    font-weight: 700;
}

.project-row h2 {
    font-size: 2.9rem;
}

.project-row p:not(.eyebrow) {
    margin: 0;
    color: var(--ink-muted);
}

.project-row a {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid var(--line);
    font-size: 1.25rem;
    text-decoration: none;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.project-row:hover a {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
    transform: translateX(4px);
}

.stack-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--line);
}

.stack-block {
    min-height: 182px;
    padding: 22px;
    border-right: 1px solid var(--line);
}

.stack-block:nth-child(3n) {
    border-right: 0;
}

.stack-block h3 {
    margin: 0 0 46px;
    color: var(--hot);
}

.stack-block p {
    margin: 0;
    color: var(--ink-muted);
}

.proof-section {
    padding-bottom: 72px;
}

.proof-list {
    padding-top: 26px;
    columns: 3 260px;
    column-gap: 38px;
}

.proof-list p {
    break-inside: avoid;
    margin: 0 0 18px;
    color: var(--ink-muted);
}

.proof-list strong {
    color: var(--ink);
}

.contact-section {
    padding: 86px 0 106px;
}

.contact-inner {
    padding-top: 36px;
}

.contact-inner h2 {
    max-width: 920px;
    font-size: 6.2rem;
}

.site-footer {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid var(--line);
    padding: 24px 0 36px;
    color: var(--ink-muted);
}

.site-footer p {
    margin: 0;
}

.site-footer div {
    display: flex;
    gap: 14px;
}

.site-footer a {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--line);
    text-decoration: none;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.site-footer a:hover {
    background: var(--ink);
    color: var(--paper);
    transform: translateY(-2px);
}

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 680ms ease, transform 680ms ease;
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 980px) {
    .menu-toggle {
        display: block;
    }

    .nav-panel {
        position: fixed;
        top: calc(100% + 10px);
        right: 0;
        left: 0;
        display: grid;
        gap: 0;
        border: 1px solid var(--line);
        background: rgba(245, 247, 244, 0.96);
        box-shadow: var(--shadow);
        padding: 8px;
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease, transform 180ms ease;
    }

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

    .nav-link,
    .resume-link {
        justify-content: space-between;
        min-height: 48px;
    }

    .hero-grid,
    .profile-layout,
    .experience-item {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 5.6rem;
    }

    .lead {
        font-size: 2.7rem;
    }

    .item-main h2 {
        font-size: 3.4rem;
    }

    .project-row h2 {
        font-size: 2.3rem;
    }

    .contact-inner h2 {
        font-size: 4.8rem;
    }

    .build-panel h2 {
        margin-top: 54px;
    }

    .portrait-wrap {
        min-height: 360px;
        max-height: 560px;
    }

    .experience-item {
        gap: 22px;
    }

    .project-row {
        grid-template-columns: 48px minmax(0, 1fr) 46px;
    }

    .project-row p:not(.eyebrow) {
        grid-column: 2 / -1;
    }

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

    .stack-block:nth-child(3n) {
        border-right: 1px solid var(--line);
    }

    .stack-block:nth-child(2n) {
        border-right: 0;
    }
}

@media (max-width: 640px) {
    body {
        background-size: 38px 38px;
    }

    .site-nav {
        top: 10px;
        width: calc(100% - 20px);
        padding-left: 12px;
    }

    .brand {
        gap: 0;
        flex-direction: column;
    }

    .brand small {
        display: none;
    }

    .hero,
    .section,
    .contact-section,
    .site-footer {
        width: min(100% - 24px, 1180px);
    }

    .hero {
        padding-top: 100px;
        min-height: auto;
    }

    .hero h1 { font-size: 4.25rem; }

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

    .build-panel h2 { font-size: 2.2rem; }

    .hero-actions,
    .contact-actions {
        display: grid;
    }

    .primary-action,
    .quiet-action {
        width: 100%;
    }

    .section {
        padding: 72px 0;
    }

    .lead { font-size: 2.05rem; }

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

    .metric-strip div:nth-child(2n) {
        border-right: 0;
    }

    .metric-strip div:nth-child(-n + 2) {
        border-bottom: 1px solid var(--line);
    }

    .metric-strip strong { font-size: 2.7rem; }

    .item-main h2 { font-size: 2.65rem; }

    .project-row {
        grid-template-columns: 1fr 46px;
        gap: 12px;
    }

    .project-index {
        grid-column: 1 / -1;
    }

    .project-row p:not(.eyebrow) {
        grid-column: 1 / -1;
    }

    .project-row a {
        grid-row: 2;
        grid-column: 2;
    }

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

    .stack-block,
    .stack-block:nth-child(2n),
    .stack-block:nth-child(3n) {
        border-right: 0;
    }

    .stack-block h3 {
        margin-bottom: 26px;
    }

    .contact-inner h2 { font-size: 3.5rem; }

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

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        scroll-behavior: auto !important;
        transition-duration: 1ms !important;
    }
}
