:root {
    --ink-950: #07080d;
    --ink-900: #0b0d14;
    --ink-850: #11141c;
    --ink-800: #1a1e28;
    --text: #eef0f5;
    --text-2: #a3a9b8;
    --text-3: #7a8296;
    --line: rgba(238, 240, 245, 0.09);
    --line-strong: rgba(238, 240, 245, 0.16);
    --accent: #d6a15f;
    --accent-ink: #1b140c;
    --font: "IBM Plex Sans", system-ui, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, monospace;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --radius-control: 8px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--ink-950);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
}

button {
    font: inherit;
}

h1,
h2,
h3,
p,
figure {
    margin: 0;
}

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

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--ink-950);
    border-bottom: 1px solid var(--line);
}

.scroll-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(var(--scroll, 0));
    transform-origin: left;
    opacity: 0.85;
    pointer-events: none;
}

.nav-shell {
    max-width: 1200px;
    height: 64px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.brand-name {
    font-size: 17px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

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

.nav-links a {
    position: relative;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 140ms var(--ease);
}

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

.nav-links a[href^="#"]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -7px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 180ms var(--ease);
}

.nav-links a[href^="#"].is-active::after {
    transform: scaleX(1);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease), transform 120ms var(--ease);
}

.button:active {
    transform: translateY(1px);
}

.button-primary {
    background: var(--text);
    color: var(--ink-950);
}

.button-primary:hover {
    background: #ffffff;
}

.button-secondary {
    background: var(--ink-850);
    border-color: var(--line);
    color: var(--text);
}

.button-secondary:hover {
    background: var(--ink-800);
    border-color: var(--line-strong);
}

.button-nav {
    min-height: 34px;
    padding: 0 16px;
    font-size: 13px;
    background: transparent;
    border-color: var(--line);
    color: var(--text);
}

.button-nav:hover {
    background: var(--ink-850);
    border-color: var(--line-strong);
}

.nav-toggle {
    display: none;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
}

.hero {
    position: relative;
    min-height: 680px;
    height: calc(100svh - 64px);
    max-height: 860px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: var(--ink-950);
}

.hero-media {
    position: absolute;
    inset: 0;
    background: var(--ink-900);
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
    animation: hero-image-in 1200ms var(--ease) both;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(7, 8, 13, 0.97) 0%, rgba(7, 8, 13, 0.91) 30%, rgba(7, 8, 13, 0.58) 44%, rgba(7, 8, 13, 0.17) 57%, rgba(7, 8, 13, 0.02) 70%, rgba(7, 8, 13, 0) 100%),
        linear-gradient(0deg, rgba(7, 8, 13, 0.55) 0%, rgba(7, 8, 13, 0) 38%);
}

.hero-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 96px 32px 144px;
}

.hero-copy {
    max-width: 600px;
}

.hero-copy > .kicker,
.hero-copy > h1,
.hero-copy > .hero-lede,
.hero-copy > .hero-actions,
.hero-copy > .hero-meta {
    animation: hero-rise 700ms var(--ease) both;
}

.hero-copy > h1 {
    animation-delay: 60ms;
}

.hero-copy > .hero-lede {
    animation-delay: 120ms;
}

.hero-copy > .hero-actions {
    animation-delay: 180ms;
}

.hero-copy > .hero-meta {
    animation-delay: 240ms;
}

.kicker {
    margin-bottom: 16px;
    color: var(--text-3);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

h1 {
    max-width: 17ch;
    font-size: clamp(42px, 4.4vw, 64px);
    font-weight: 500;
    line-height: 1.04;
    letter-spacing: -0.025em;
}

.hero-lede {
    max-width: 36rem;
    margin-top: 20px;
    color: var(--text-2);
    font-size: 18px;
    line-height: 1.55;
}

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

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 20px;
    color: var(--text-3);
    font-family: var(--mono);
    font-size: 12px;
}

.hero-frame {
    position: absolute;
    inset: 20px;
    z-index: 1;
    pointer-events: none;
}

.frame-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: var(--accent);
    border-style: solid;
    opacity: 0.8;
}

.frame-corner-tl {
    top: 0;
    left: 0;
    border-width: 1px 0 0 1px;
}

.frame-corner-tr {
    top: 0;
    right: 0;
    border-width: 1px 1px 0 0;
}

.frame-corner-bl {
    bottom: 0;
    left: 0;
    border-width: 0 0 1px 1px;
}

.frame-corner-br {
    bottom: 0;
    right: 0;
    border-width: 0 1px 1px 0;
}

.section {
    padding: 96px 0;
    scroll-margin-top: 80px;
}

.projects,
.approach,
.community {
    border-top: 1px solid var(--line);
}

.section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 48px;
    margin-bottom: 48px;
}

.section-head .kicker {
    margin-bottom: 12px;
}

h2 {
    font-size: 32px;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.015em;
}

.section-lede {
    max-width: 34rem;
    color: var(--text-2);
    font-size: 15px;
    line-height: 1.6;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 48px;
}

.project {
    min-width: 0;
    padding-top: 24px;
    border-top: 1px solid var(--line-strong);
}

.project-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.project-index {
    color: var(--accent);
    font-family: var(--mono);
    font-size: 12px;
}

.project-lang {
    color: var(--text-3);
    font-family: var(--mono);
    font-size: 12px;
}

.project h3 {
    font-size: 26px;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.015em;
}

.project h3 a {
    text-decoration: none;
}

.project h3 a:hover {
    color: var(--accent);
}

.project p {
    max-width: 46ch;
    margin-top: 12px;
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.6;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 24px;
}

.project-links a {
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--line-strong);
    transition: color 140ms var(--ease), border-color 140ms var(--ease);
}

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

.principle-list {
    display: grid;
    gap: 0;
}

.principle {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 16px;
    padding: 28px 0;
    border-top: 1px solid var(--line);
}

.principle:last-child {
    border-bottom: 1px solid var(--line);
}

.principle-index {
    padding-top: 4px;
    color: var(--text-3);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.5;
}

.principle h3 {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
}

.principle p {
    max-width: 68ch;
    margin-top: 8px;
    color: var(--text-2);
    font-size: 15px;
    line-height: 1.6;
}

.community-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 32px 64px;
    align-items: end;
}

.community-copy h2 {
    margin-bottom: 12px;
}

.community-copy p {
    max-width: 48rem;
    color: var(--text-2);
    font-size: 15px;
    line-height: 1.6;
}

.community-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 8px;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 48px 0;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px 48px;
    align-items: start;
}

.footer-brand p {
    max-width: 28rem;
    margin-top: 12px;
    color: var(--text-2);
    font-size: 14px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
}

.footer-links a {
    color: var(--text-2);
    font-size: 13px;
    text-decoration: none;
}

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

.footer-meta {
    grid-column: 1 / -1;
    max-width: 70ch;
    color: var(--text-3);
    font-size: 12px;
    line-height: 1.6;
}

.js .reveal.scrub {
    --reveal: 0;
    opacity: calc(0.15 + var(--reveal) * 0.85);
    transform: translate3d(0, calc((1 - var(--reveal)) * 24px), 0);
    transition: none;
    will-change: opacity, transform;
}

@keyframes hero-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hero-image-in {
    from {
        opacity: 0.65;
        transform: scale(1.03);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 1100px) {
    .hero-copy {
        max-width: 520px;
    }
}

@media (max-width: 960px) {
    .section-head {
        display: block;
    }

    .section-lede {
        margin-top: 16px;
    }

    .community-panel {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }

    .community-actions {
        padding-bottom: 0;
    }

    .hero-copy {
        max-width: 560px;
    }
}

@media (max-width: 760px) {
    .nav-shell {
        height: 60px;
        padding: 0 20px;
    }

    .js .nav-toggle {
        display: inline-flex;
    }

    .nav-shell {
        flex-wrap: wrap;
        height: auto;
        min-height: 60px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        gap: 8px 20px;
        padding-top: 8px;
    }

    .js .nav-shell {
        height: 60px;
        min-height: 0;
        flex-wrap: nowrap;
        padding-top: 0;
        padding-bottom: 0;
    }

    .js .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: auto;
        gap: 4px;
        padding: 16px 20px 24px;
        background: var(--ink-950);
        border-bottom: 1px solid var(--line);
    }

    .js .nav-links.is-open {
        display: flex;
        animation: menu-in 180ms var(--ease);
    }

    .nav-links a {
        min-height: 40px;
        display: flex;
        align-items: center;
    }

    .nav-links .button-nav {
        margin-top: 8px;
        justify-content: center;
    }

    .hero {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        min-height: 0;
    }

    .hero::after {
        display: none;
    }

    .hero-inner {
        order: 1;
        padding: 56px 20px;
    }

    .hero-media {
        position: relative;
        inset: auto;
        order: 2;
        height: 300px;
    }

    .hero-media img {
        object-position: 60% 40%;
    }

    h1 {
        max-width: 20ch;
        font-size: 38px;
    }

    .hero-lede {
        font-size: 16px;
    }

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

    .hero-frame {
        inset: 12px;
    }

    .frame-corner {
        width: 14px;
        height: 14px;
    }

    .section {
        padding: 64px 0;
    }

    .section-inner,
    .footer-inner {
        padding: 0 20px;
    }

    h2 {
        font-size: 28px;
    }

    .project h3 {
        font-size: 24px;
    }

    .principle {
        grid-template-columns: 32px minmax(0, 1fr);
        column-gap: 12px;
    }

    .footer-inner {
        grid-template-columns: minmax(0, 1fr);
    }
}

@keyframes menu-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-copy > *,
    .hero-media img {
        animation: none !important;
    }
}
