/* Homepage "sticky split" layout. Loaded after site.css; only layout overrides live here. */

.split-name {
    font-size: var(--step-4);
    margin-bottom: var(--space-2);
}

.split-name a {
    color: var(--text);
    text-decoration: none;
}

.split-name .dud {
    color: var(--accent);
}

.split-about-title {
    font-size: var(--step-3);
    margin-bottom: var(--space-4);
}

/* ---------- Below 1024px: single column, normal top bar ---------- */
.split {
    width: 100%;
    max-width: calc(var(--measure) + 2 * var(--space-4));
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.split-nav,
.split-theme {
    display: none;
}

.split-side {
    padding-bottom: 0;
}

.split-about {
    padding-top: var(--space-6);
}

.split-content .site-footer .footer-row {
    padding: 0;
}

/* ---------- 1024px and up: pinned left column ---------- */
@media (min-width: 1024px) {
    html {
        scroll-padding-top: var(--space-6);
    }

    .split-topbar {
        display: none;
    }

    .split {
        max-width: calc(75rem + 2 * var(--space-6));
        padding: 0 var(--space-6);
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
        gap: var(--space-8);
        align-items: start;
    }

    .split-side {
        position: sticky;
        top: 0;
        height: 100vh;
        padding: var(--space-8) 0 var(--space-6);
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        scrollbar-width: none;
    }

    .split-side::-webkit-scrollbar {
        display: none;
    }

    .split-nav {
        display: block;
        margin-top: var(--space-6);
    }

    .split-nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .split-nav li {
        margin: 0;
    }

    .split-nav a {
        display: inline-flex;
        align-items: center;
        gap: var(--space-4);
        padding: var(--space-2) 0;
        color: var(--muted);
        font-size: var(--step--1);
        font-weight: 500;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        text-decoration: none;
    }

    /* The line that grows on the active / hovered item */
    .split-nav a::before {
        content: "";
        display: block;
        width: 2rem;
        height: 1px;
        background: var(--border-strong);
        transition: width 0.25s ease, background 0.25s ease;
    }

    .split-nav a:hover,
    .split-nav a:focus-visible,
    .split-nav a[aria-current="true"] {
        color: var(--text);
    }

    .split-nav a:hover::before,
    .split-nav a:focus-visible::before,
    .split-nav a[aria-current="true"]::before {
        width: 4rem;
        background: var(--text);
    }

    .split-nav a[aria-current="true"]::before {
        background: var(--accent);
    }

    .split-foot {
        margin-top: auto;
        padding-top: var(--space-6);
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-3);
    }

    .split-foot .link-row {
        margin: 0;
        gap: var(--space-2);
    }

    .split-theme {
        display: inline-grid;
    }

    .split-content {
        padding-top: var(--space-8);
        min-width: 0;
    }

    .split-about {
        padding-top: 0;
    }

    /* The left column already holds name, photo and links */
    .split-content .site-footer {
        margin-top: var(--space-8);
    }
}

/* Short laptop screens: tighten the pinned column so it fits */
@media (min-width: 1024px) and (max-height: 760px) {
    .split-side {
        padding-top: var(--space-6);
    }

    .split-side .intro-photo {
        width: 72px;
        height: 72px;
        margin-bottom: var(--space-4);
    }

    .split-name {
        font-size: var(--step-3);
    }

    .split-nav {
        margin-top: var(--space-4);
    }
}

/* ---------- Vision / LLM filter ----------
   Two copies of the control: in the pinned left column (1024px+) and under the
   "What I've been building" heading (below 1024px). Both stay hidden without JS. */
.focus-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
}

.focus-filter[hidden],
.focus-filter--side {
    display: none;
}

.focus-filter--inline {
    margin: calc(-1 * var(--space-2)) 0 var(--space-6);
}

.focus-label {
    color: var(--muted);
    font-size: 0.78rem;
}

.focus-options {
    position: relative;
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
}

.focus-filter--side .focus-options {
    view-transition-name: focus-side;
}

.focus-filter--inline .focus-options {
    view-transition-name: focus-inline;
}

/* The pill that slides under the selected option (positioned by filter.js) */
.focus-indicator {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    border-radius: 999px;
    background: var(--text);
    transition: translate 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), width 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.focus-option {
    position: relative;
    z-index: 1;
    padding: 0.4rem 0.85rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: var(--step--1);
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.25s;
}

.focus-option:hover {
    color: var(--text);
}

.focus-option[aria-pressed="true"] {
    color: var(--bg);
}

/* Before the pill is positioned (or if it can't be), the selected option paints itself */
.focus-options:not(.has-indicator) .focus-option[aria-pressed="true"] {
    background: var(--text);
}

.focus-option:focus-visible {
    outline-offset: 1px;
}

/* Filtered-out items */
[data-areas][hidden] {
    display: none !important;
}

/* The first project still showing loses the divider above it */
.work.is-first-visible {
    border-top: 0;
    padding-top: 0;
}

@media (min-width: 1024px) {
    .focus-filter--inline {
        display: none !important;
    }

    .focus-filter--side:not([hidden]) {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
        margin-top: var(--space-6);
    }
}

@media (min-width: 1024px) and (max-height: 760px) {
    .focus-filter--side:not([hidden]) {
        margin-top: var(--space-4);
    }
}

/* Items coming in move forward from the back; items leaving sink away.
   (Browsers without view transitions get the same feel from filter.js.) */
::view-transition-group(*.focus-item) {
    animation-duration: 0.45s;
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
}

::view-transition-new(*.focus-item):only-child {
    animation: focus-come-forward 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

::view-transition-old(*.focus-item):only-child {
    animation: focus-sink 0.28s ease both;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.3s;
}

@keyframes focus-come-forward {
    from {
        opacity: 0;
        transform: perspective(1000px) translate3d(0, 24px, -160px);
    }
}

@keyframes focus-sink {
    to {
        opacity: 0;
        transform: perspective(1000px) translate3d(0, -12px, -160px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .focus-indicator {
        transition: none;
    }
}
