:root {
    --paper: #f7f5ef;
    --ink: #202321;
    --muted: #58616b;
    --accent: #2449bd;
    --rule: #d5d6cf;
    --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
    --display: Georgia, "Times New Roman", serif;
}

.case-study {
    max-width: 760px;
    margin: 64px auto 96px;
    overflow-wrap: anywhere;
}

.case-back { display: inline-block; margin-bottom: 32px; color: var(--accent); }
.case-study h1 { font-size: clamp(32px, 4vw, 58px); line-height: 1.12; margin: 18px 0 32px; }
.case-study h2 { font-family: var(--display); font-size: 30px; line-height: 1.25; margin: 48px 0 20px; }
.walkthrough-layout .case-study .nacara-steps__title { font-family: var(--display); font-size: 22px; line-height: 1.25; margin: 0 0 10px; padding: 0; }
.case-study p, .case-study ul, .case-study ol { margin: 18px 0; }
.case-study li { margin: 12px 0; }
.case-study a { text-decoration: underline; text-underline-offset: 3px; }
.case-study pre { max-width: 100%; overflow-x: auto; padding: 20px; background: #eeeee8; font-size: 13px; line-height: 1.75; tab-size: 4; }
.case-study code { font-family: ui-monospace, Consolas, monospace; }
.case-study :not(pre) > code { background: #eeeee8; padding: 2px 4px; }
.case-study .eyebrow { margin: 0; }
.case-study nacara-tabs, .case-study nacara-tab { display: block; min-width: 0; }
.case-study nacara-tab::before { content: attr(data-label); display: block; font-family: ui-monospace, Consolas, monospace; font-size: 12px; font-weight: 600; color: var(--accent); border-bottom: 1px solid var(--rule); padding: 10px 16px; background: #eeeee8; }
.case-study nacara-tabs { margin: 28px 0; border: 1px solid var(--rule); }
.case-study nacara-tab + nacara-tab { border-top: 1px solid var(--rule); }
.case-study nacara-tab figure, .case-study nacara-tab pre { margin: 0; }
.case-study .nacara-code figcaption { padding: 8px 16px; border-bottom: 1px solid var(--rule); }
.case-study .tok-keyword, .case-study .tok-preprocessor, .case-study .tok-tag { color: #2449bd; }
.case-study .tok-string, .case-study .tok-inserted { color: #346447; }
.case-study .tok-function, .case-study .tok-type, .case-study .tok-namespace { color: #694980; }
.case-study .tok-number, .case-study .tok-constant, .case-study .tok-attribute { color: #825028; }
.case-study .tok-comment { color: #58616b; font-style: italic; }
.case-study .tok-invalid, .case-study .tok-deleted { color: #a52b2b; }
.walkthrough-layout { display: grid; grid-template-columns: minmax(0, 760px) 200px; gap: 64px; max-width: 1024px; margin: 64px auto 96px; align-items: start; }
.walkthrough-layout .case-study { grid-column: 1; grid-row: 1; width: 100%; min-width: 0; margin: 0; line-height: 1.8; }
.case-navigation { grid-column: 2; grid-row: 1; position: sticky; top: 32px; padding: 12px 0 12px 20px; border-left: 1px solid var(--rule); font-size: 12px; }
.case-navigation .eyebrow { color: var(--muted); }
.case-navigation ul { list-style: none; padding: 0; margin: 18px 0 24px; }
.case-navigation li + li { margin-top: 12px; }
.case-navigation a { display: block; }
.case-all-projects { color: var(--accent); border-top: 1px solid var(--rule); padding-top: 16px; }
.case-study h2:not(.nacara-steps__title) { scroll-margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--rule); }
.case-study figure { margin: 20px 0; min-width: 0; }
.case-study .nacara-code figcaption { font-size: 12px; color: var(--muted); }
.case-study .nacara-code__copy { display: none; }
.case-study .nacara-heading-anchor { font-size: 14px; margin-left: 8px; }
.compilation-demo { padding: 24px; border: 1px solid var(--rule); }
.compilation-demo p { margin: 0 0 16px; }
.compilation-demo button { padding: 8px 16px; margin: 0 8px 8px 0; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); }
.compilation-demo button:hover { border-color: var(--accent); color: var(--accent); }

.project-catalog { max-width: 1120px; margin: 64px auto 96px; }
.project-catalog .catalog-heading { margin: 0 0 40px; }
.project-catalog .project-copy { min-width: 0; }
.project-catalog .project-links { flex-wrap: wrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Shared scrollbars for authored code and embedded components. */
:where(.case-study pre, .partas-solid, .partas-solid *) {
    scrollbar-width: thin;
    scrollbar-color: #909690 #eeeee8;
}

@supports selector(::-webkit-scrollbar) {
    :where(.case-study pre, .partas-solid, .partas-solid *) {
        scrollbar-width: auto;
        scrollbar-color: auto;
    }

    :where(.case-study pre, .partas-solid, .partas-solid *)::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    :where(.case-study pre, .partas-solid, .partas-solid *)::-webkit-scrollbar-track,
    :where(.case-study pre, .partas-solid, .partas-solid *)::-webkit-scrollbar-corner {
        background: #eeeee8;
    }

    :where(.case-study pre, .partas-solid, .partas-solid *)::-webkit-scrollbar-thumb {
        background: #909690;
        border: 2px solid #eeeee8;
        border-radius: 0;
        min-width: 28px;
        min-height: 28px;
    }

    :where(.case-study pre, .partas-solid, .partas-solid *)::-webkit-scrollbar-thumb:hover {
        background: #666;
    }

    :where(.case-study pre, .partas-solid, .partas-solid *)::-webkit-scrollbar-thumb:active {
        background: #333;
    }
}

@media (forced-colors: active) {
    :where(.case-study pre, .partas-solid, .partas-solid *) { scrollbar-color: auto; }
    :where(.case-study pre, .partas-solid, .partas-solid *)::-webkit-scrollbar-track,
    :where(.case-study pre, .partas-solid, .partas-solid *)::-webkit-scrollbar-corner { background: Canvas; }
    :where(.case-study pre, .partas-solid, .partas-solid *)::-webkit-scrollbar-thumb { background: CanvasText; border-color: Canvas; }
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
}

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

::selection {
    background: #cdd7f6;
}

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

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

button, summary, a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

button, summary {
    cursor: pointer;
}

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

[hidden] {
    display: none !important;
}

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

.page-shell {
    max-width: 1400px;
    margin: auto;
    padding: 0 64px;
}

.site-header {
    min-height: 112px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    border-bottom: 1px solid var(--rule);
}

.identity {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    font-weight: 550;
}

.identity-mark {
    color: var(--accent);
    font-family: var(--display);
    font-size: 35px;
    font-weight: 700;
    letter-spacing: -3px;
    padding-right: 4px;
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 32px;
    font-size: 13px;
}

.nav-contact {
    margin-left: 16px;
}

.nav-contact span {
    margin-left: 8px;
}

.hero {
    display: grid;
    grid-template-columns: 1fr 340px;
    align-items: center;
    gap: 76px;
    padding: 94px 0 80px;
}

.eyebrow {
    font-family: ui-monospace, "Cascadia Code", monospace;
    font-size: 10px;
    letter-spacing: .11em;
    font-weight: 500;
}

.hero .eyebrow {
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 12px;
}

.small-cross {
    font-size: 20px;
    line-height: 1;
}

h1 {
    font-family: var(--display);
    font-size: clamp(44px, 4.75vw, 68px);
    line-height: 1.08;
    letter-spacing: -.055em;
    font-weight: 400;
    margin: 28px 0;
}

h1 em {
    color: var(--accent);
    font-weight: 400;
}

.hero-rotator { display: inline-grid; overflow: hidden; vertical-align: bottom; padding-block: .08em; }
.hero-word { grid-area: 1 / 1; opacity: 0; white-space: nowrap; }
.hero-word[data-active="true"] { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
    .hero-word { opacity: 0 !important; transform: none !important; }
    .hero-word:first-child { opacity: 1 !important; }
}

.hero-description {
    max-width: 510px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.85;
}

.hero-actions {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-top: 34px;
    font-size: 13px;
}

.hero-contact-paths { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 22px; font-size: 12px; color: var(--muted); }
.hero-contact-paths a { text-decoration: underline; text-underline-offset: 4px; }

.action-primary {
    background: var(--ink);
    color: var(--paper);
    padding: 13px 20px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.action-primary:hover {
    background: var(--accent);
    color: white;
}

.action-text span {
    margin-left: 8px;
}

.hero-note {
    border-top: 1px solid var(--accent);
    border-bottom: 1px solid var(--rule);
    padding: 18px 0;
    color: var(--accent);
}

.note-heading {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.note-heading > span:last-child {
    font-family: ui-monospace, monospace;
    color: var(--muted);
    font-size: 9px;
}

.connection-diagram {
    display: block;
    width: 100%;
    margin: 16px 0 10px;
}

.hero-motion { pointer-events: none; }
.hero-pulse { fill: currentColor; opacity: 0.6; }
.hero-pulse-trail { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.12; }
@media (prefers-reduced-motion: reduce) { .hero-motion { display: none; } }

.connection-diagram text {
    font-family: ui-monospace, monospace;
    font-size: 9px;
    letter-spacing: .08em;
    fill: currentColor;
}

.hero-note > p {
    font-family: var(--display);
    font-size: 24px;
    line-height: 1.45;
    color: var(--ink);
    letter-spacing: -.025em;
}

.hero-note > p span {
    color: var(--muted);
}

.note-foot {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--rule);
    padding-top: 16px;
    margin-top: 22px;
    font-size: 9px;
    letter-spacing: .05em;
    font-family: ui-monospace, monospace;
}

.practice-line {
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 19px 0;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    font-size: 11px;
    color: var(--muted);
}

.practice-line > span:first-child {
    color: var(--ink);
}

.practice-line i {
    font-style: normal;
    margin: 0 14px;
    color: #9a9f9e;
}

.work-section {
    padding: 84px 0 72px;
}

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

.section-heading .eyebrow, .capabilities .eyebrow, .contact-heading .eyebrow {
    color: var(--accent);
    margin-bottom: 15px;
}

h2 {
    font-family: var(--display);
    font-size: clamp(30px, 3vw, 42px);
    line-height: 1.2;
    letter-spacing: -.04em;
    font-weight: 400;
}

.section-heading > p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.75;
}

.work-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.filter {
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    padding: 7px 12px;
    font-size: 11px;
    line-height: 1.3;
}

.filter:hover {
    color: var(--accent);
    border-color: var(--rule);
}

.filter[aria-pressed="true"] {
    color: var(--ink);
    border-color: var(--rule);
    background: #eeeee7;
}

.result-count {
    font-size: 10px;
    color: var(--muted);
    white-space: nowrap;
    font-family: ui-monospace, monospace;
}

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0 0;
}

.carousel-hint {
    font-family: ui-monospace, monospace;
    font-size: 10px;
    color: var(--muted);
}

.carousel-buttons {
    display: flex;
    gap: 8px;
}

.carousel-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid var(--rule);
    background: transparent;
    color: var(--ink);
    font-size: 11px;
}

.carousel-button:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.carousel-button:disabled {
    opacity: .38;
    cursor: default;
}

.project-row {
    display: grid;
    grid-template-columns: 155px 1fr 145px;
    gap: 36px;
    border-top: 1px solid var(--rule);
    padding: 31px 0;
}

.project-list {
    border-bottom: 1px solid var(--rule);
}

#project-window {
    --project-row-height: 200px;
    max-height: calc(var(--project-row-height) * 3);
    overflow-y: auto;
    overflow-anchor: none;
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    border-bottom: 0;
    box-shadow: inset 0 -1px var(--rule);
}

#project-window::-webkit-scrollbar {
    display: none;
}

#project-window .project-row {
    height: var(--project-row-height);
    min-height: 0;
    padding: 18px 0;
    align-content: start;
    scroll-snap-align: start;
}

#project-window .project-copy h3 {
    font-size: 22px;
}

#project-window .project-summary {
    margin-top: 8px;
    line-height: 1.7;
}

#project-window .technologies, #project-window .project-details {
    margin-top: 12px;
}

#project-window .project-details p {
    margin-top: 8px;
    line-height: 1.6;
}

#project-window .project-row:has(.project-details[open]) .project-summary,
#project-window .project-row:has(.project-details[open]) .technologies {
    display: none;
}

.project-index {
    font-family: ui-monospace, monospace;
    font-size: 10px;
    color: var(--muted);
    padding-top: 7px;
}

.project-illustration {
    display: block;
    width: 140px;
    max-width: 100%;
    height: auto;
    margin-top: 14px;
}

.project-copy h3 {
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -.045em;
    line-height: 1.3;
}

.project-summary {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
    margin-top: 10px;
    max-width: 560px;
}

.technologies {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 17px;
    font-size: 9px;
    font-family: ui-monospace, monospace;
    color: var(--muted);
}

.technologies span + span::before {
    content: "·";
    margin-right: 14px;
    color: #969d9a;
}

.project-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    padding-top: 8px;
    font-size: 11px;
}

.project-links a:first-child {
    color: var(--accent);
}

.project-details {
    margin-top: 18px;
    font-size: 11px;
    color: var(--muted);
}

.project-details summary {
    width: fit-content;
    color: var(--ink);
}

.project-details p {
    font-size: 12px;
    line-height: 1.8;
    margin-top: 12px;
    max-width: 550px;
}

.all-work {
    display: flex;
    justify-content: center;
    padding: 24px 0 0;
    font-size: 11px;
}

.capabilities {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 100px;
    padding: 70px 0 90px;
    border-top: 1px solid var(--rule);
}

.section-description {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.9;
    max-width: 370px;
    margin-top: 22px;
}

.capability-list > div {
    position: relative;
    padding: 22px 0 22px 40px;
    border-top: 1px solid var(--rule);
}

.capability-list > div:first-child {
    padding-top: 0;
    border-top: 0;
}

.capability-list > div > span {
    position: absolute;
    left: 0;
    top: 25px;
    color: var(--accent);
    font-size: 10px;
    font-family: ui-monospace, monospace;
}

.capability-list > div:first-child > span {
    top: 3px;
}

.capability-list h3 {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -.015em;
}

.capability-list p {
    color: var(--muted);
    font-size: 12px;
    margin-top: 8px;
    line-height: 1.8;
}

.contact-section {
    background: #edeee7;
    margin: 0 -64px;
    padding: 66px 64px;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

.contact-heading {
    text-align: center;
}

.contact-heading > p:last-child {
    font-size: 12px;
    margin-top: 15px;
    color: var(--muted);
}

.contact-paths {
    display: grid;
    grid-template-columns: 1fr 1fr;
  gap: 70px;
    margin: 46px auto 0;
    max-width: 820px;
}

.contact-paths article + article {
    border-left: 1px solid #cccec4;
    padding-left: 70px;
    margin-left: -35px;
}

.contact-paths .eyebrow {
    color: var(--muted);
    font-size: 9px;
}

.contact-paths h3 {
    font-family: var(--display);
    font-size: 25px;
    font-weight: 400;
    letter-spacing: -.025em;
    margin-top: 12px;
}

.contact-paths article > p:not(.eyebrow) {
    font-size: 12px;
    line-height: 1.8;
    color: var(--muted);
    margin-top: 12px;
}

.contact-placeholder {
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: 12px;
    margin-top: 48px;
    color: var(--accent);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 34px 0;
    font-size: 10px;
}

.footer-muted {
    color: var(--muted);
}

.site-footer > span:first-child .footer-muted {
    margin-left: 10px;
}

.skip-link {
    position: fixed;
    left: 20px;
    top: -100px;
    background: var(--ink);
    color: white;
    padding: 10px 20px;
    z-index: 10;
}

.skip-link:focus {
    top: 12px;
}

.partas-solid--inline {
    min-height: 0;
}

@media (min-width: 1450px) {
    .hero {
        padding-top: 110px;
        padding-bottom: 96px;
    }
}

@media (max-width: 1050px) {
    .walkthrough-layout { gap: 32px; grid-template-columns: minmax(0, 1fr) 180px; }
    .page-shell {
        padding: 0 36px;
    }

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

    h1 {
        font-size: 52px;
    }

    .project-row {
        grid-template-columns: 110px 1fr 125px;
        gap: 24px;
    }

    .capabilities {
        gap: 50px;
    }

    .contact-section {
        margin: 0 -36px;
        padding: 56px 36px;
    }
}

@media (max-width: 760px) {
    .walkthrough-layout { display: flex; flex-direction: column; gap: 32px; margin: 40px auto 64px; }
    .case-navigation { position: static; width: 100%; border-left: 0; border-bottom: 1px solid var(--rule); padding: 0 0 20px; }
    .case-navigation ul { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 14px 0 18px; }
    .case-navigation li + li { margin-top: 0; }
    .case-study h1 { font-size: clamp(32px, 7vw, 44px); }
    .case-study h2 { font-size: 27px; }
    .case-study pre { padding: 16px; font-size: 12px; }
    .hero-actions { flex-wrap: wrap; gap: 16px 24px; }
    .carousel-controls { flex-wrap: wrap; gap: 12px; }
    .page-shell {
        padding: 0 24px;
    }

    .site-header {
        min-height: 95px;
        gap: 16px;
        flex-wrap: wrap;
        padding: 18px 0;
    }

    .site-header nav {
        gap: 18px;
        font-size: 11px;
    }

    .nav-contact {
        margin-left: 0;
    }

    .identity {
        font-size: 12px;
        gap: 10px;
    }

    .identity-mark {
        font-size: 28px;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 42px;
        padding: 55px 0 40px;
    }

    h1 {
        font-size: clamp(38px, 7.6vw, 58px);
    }

    .hero-rotator { font-size: clamp(28px, 7.6vw, 58px); }

    .hero-description {
        font-size: 14px;
    }

    .hero-note {
        max-width: 420px;
        width: 100%;
    }

    .connection-diagram {
        height: 160px;
    }

    .hero-note > p {
        font-size: 22px;
    }

    .practice-line {
        flex-direction: column;
        gap: 6px;
        font-size: 10px;
    }

    .practice-line i {
        margin: 0 8px;
    }

    .work-section {
        padding: 52px 0;
    }

    .section-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .section-heading > p br {
        display: none;
    }

    .work-controls {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .filter {
        padding: 9px 10px;
    }

    .carousel-hint {
        font-size: 9px;
    }

    .carousel-button {
        min-height: 44px;
        padding: 9px 12px;
    }

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

    #project-window {
        --project-row-height: 300px;
    }

    #project-window .project-row {
        gap: 8px;
    }

    #project-window .project-illustration {
        width: 88px;
    }

    #project-window .project-links {
        padding-top: 0;
    }

    .project-index {
        padding-top: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
    }

    .project-illustration {
        width: 112px;
        margin-top: 0;
        flex-shrink: 0;
    }

    .project-copy h3 {
        font-size: 23px;
    }

    .project-links {
        flex-direction: row;
        align-items: flex-start;
        gap: 24px;
    }

    .capabilities {
        grid-template-columns: 1fr;
        gap: 35px;
        padding: 48px 0;
    }

    .contact-section {
        margin: 0 -24px;
        padding: 48px 24px;
    }

    .contact-paths {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .contact-paths article + article {
        border-left: 0;
        border-top: 1px solid var(--rule);
        padding: 28px 0 0;
      margin: unset;
    }

    .contact-heading {
        text-align: left;
    }

    .site-footer {
        flex-wrap: wrap;
        gap: 16px;
    }

    .site-footer > span:last-child {
        flex-basis: 100%;
    }
}

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