:root {
    color-scheme: dark;
    --page: #ebe9e4;
    --ink: #f2f1ed;
    --surface: #0a0a0b;
    --muted: #76767b;
    --line: #242427;
    --line-hover: #343438;
    --side: clamp(1.5rem, 5.4vw, 5.25rem);
    --product-image-radius: clamp(0.8rem, 1.4vw, 1.15rem);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--page);
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    margin: 0;
    padding: clamp(0.6rem, 1.1vw, 1rem);
    font-family: "Outfit", "Avenir Next", system-ui, sans-serif;
    color: var(--ink);
    background: var(--page);
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

a {
    color: inherit;
}

.site-shell {
    width: min(100%, 118rem);
    min-height: calc(100vh - clamp(1.2rem, 2.2vw, 2rem));
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid #171719;
    border-radius: clamp(1rem, 1.5vw, 1.55rem);
    background: var(--surface);
    box-shadow: 0 6px 18px rgb(0 0 0 / 10%);
}

.site-header,
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: var(--side);
}

.site-header {
    position: relative;
    z-index: 20;
    min-height: clamp(6rem, 9vh, 7.25rem);
    border-bottom: 1px solid var(--line);
}

.brand-lockup {
    display: flex;
    min-width: 0;
    align-items: center;
}

.wordmark {
    border-radius: 0.25rem;
    font-size: clamp(1.25rem, 1.55vw, 1.7rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    text-decoration: none;
}

.app-switcher {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
}

.app-switcher[hidden] {
    display: none;
}

.app-switcher__slash {
    margin: 0 clamp(0.65rem, 1vw, 1rem);
    color: #4e4e53;
    font-size: clamp(1.25rem, 1.55vw, 1.7rem);
    font-weight: 400;
}

.app-switcher__trigger {
    display: inline-flex;
    min-width: 0;
    gap: 0.55rem;
    align-items: center;
    padding: 0;
    border: 0;
    color: #8a898e;
    background: transparent;
    font: inherit;
    font-size: clamp(1.15rem, 1.42vw, 1.5rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    cursor: pointer;
    transition: color 180ms ease;
}

.app-switcher__trigger:hover,
.app-switcher__trigger[aria-expanded="true"] {
    color: var(--ink);
}

.app-switcher__chevron {
    width: 0.42rem;
    height: 0.42rem;
    margin-top: -0.2rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 180ms ease;
}

.app-switcher__trigger[aria-expanded="true"] .app-switcher__chevron {
    margin-top: 0.2rem;
    transform: rotate(225deg);
}

.app-switcher__menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 1rem);
    left: clamp(0.65rem, 1vw, 1rem);
    width: 13rem;
    padding: 0.4rem;
    border: 1px solid #2a2a2e;
    border-radius: 0.65rem;
    background: #111113;
    box-shadow: 0 1rem 2.5rem rgb(0 0 0 / 38%);
}

.app-switcher__menu[hidden] {
    display: none;
}

.app-switcher__menu a {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    padding: 0.7rem 0.75rem;
    border-radius: 0.4rem;
    color: #8a898e;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
}

.app-switcher__menu a:hover,
.app-switcher__menu a:focus-visible {
    color: var(--ink);
    background: #1b1b1e;
}

.app-switcher__menu a[aria-current="page"] {
    color: var(--ink);
}

.app-switcher__menu a[aria-current="page"]::after {
    width: 0.28rem;
    height: 0.28rem;
    margin-left: auto;
    border-radius: 50%;
    background: #69696e;
    content: "";
}

.app-switcher__dot {
    width: 0.42rem;
    height: 0.42rem;
    flex: 0 0 auto;
    border-radius: 50%;
}

.app-switcher__dot--flyby { background: #168fd4; }
.app-switcher__dot--bitbuddy { background: #21a28d; }
.app-switcher__dot--quicklink { background: #7a9b37; }
.app-switcher__dot--cribbo { background: #e24455; }
.app-switcher__dot--moneyminder { background: #e5ac28; }
.app-switcher__dot--sparrow { background: #a58a5b; }

.primary-nav,
.social-nav {
    display: flex;
    align-items: center;
    gap: clamp(1.7rem, 3.1vw, 3.5rem);
}

.primary-nav a,
.social-nav a {
    color: var(--muted);
    font-size: clamp(1rem, 1.32vw, 1.35rem);
    font-weight: 500;
    text-decoration: none;
    transition: color 180ms ease;
}

.primary-nav a:hover,
.social-nav a:hover {
    color: var(--ink);
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: clamp(19rem, 31vh, 22rem);
    padding: clamp(2.75rem, 5vh, 4rem) var(--side);
    border-bottom: 1px solid var(--line);
}

.hero-feature {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    width: min(100%, 48rem);
    gap: clamp(0.75rem, 1.5vw, 1.35rem);
    margin: 0 0 clamp(1.5rem, 3vh, 2.3rem);
    padding: 0 0 0.9rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
    transition: border-color 180ms ease;
}

.hero-feature[hidden] {
    display: none;
}

.hero-feature:hover {
    border-color: #45454a;
}

.hero-feature__label {
    color: #85858a;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: clamp(0.68rem, 0.78vw, 0.78rem);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-feature__title {
    overflow: hidden;
    font-size: clamp(0.95rem, 1.1vw, 1.08rem);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-feature__arrow {
    color: #85858a;
    font-size: 1rem;
    transition: color 180ms ease, transform 180ms ease;
}

.hero-feature:hover .hero-feature__arrow {
    color: var(--ink);
    transform: translate(0.12rem, -0.12rem);
}

.hero h1 {
    margin: 0;
    font-size: clamp(3.7rem, 4.9vw, 5.5rem);
    font-weight: 650;
    letter-spacing: -0.06em;
    line-height: 0.98;
    white-space: nowrap;
}

.hero-copy {
    max-width: 42rem;
    margin: clamp(1.5rem, 3vh, 2.3rem) 0 0;
    color: var(--muted);
    font-size: clamp(1.08rem, 1.3vw, 1.3rem);
    font-weight: 500;
    line-height: 1.45;
}

.work {
    display: block;
}

.project {
    --accent: #238dde;
    position: relative;
    display: grid;
    grid-template-columns: 3.2rem minmax(10rem, auto) minmax(15rem, 1fr) auto 2.5rem;
    gap: clamp(1.2rem, 2.4vw, 3rem);
    align-items: center;
    min-height: clamp(6.25rem, 9.5vh, 7rem);
    padding: 1.25rem var(--side);
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    isolation: isolate;
    transition: border-color 180ms ease;
}

.project::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 48%);
    opacity: 0;
    transform: translateX(-1rem);
    transition: opacity 220ms ease, transform 220ms ease;
}

.project:hover,
.project:focus-visible {
    border-color: var(--line-hover);
}

.project:hover::before,
.project:focus-visible::before {
    opacity: 1;
    transform: translateX(0);
}

.project-number,
.project-status {
    font-family: "DM Mono", ui-monospace, monospace;
    color: #66666b;
    font-size: clamp(0.78rem, 1.02vw, 1rem);
    white-space: nowrap;
}

.project-name {
    font-size: clamp(1.8rem, 2.35vw, 2.55rem);
    font-weight: 650;
    letter-spacing: -0.045em;
    white-space: nowrap;
}

.project-description {
    color: var(--muted);
    font-size: clamp(0.95rem, 1.22vw, 1.2rem);
    font-weight: 500;
}

.project-status {
    justify-self: end;
}

.project-icon {
    display: block;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 23%;
    box-shadow: 0 0 0 1px rgb(255 255 255 / 7%) inset;
    object-fit: cover;
    transition: transform 180ms ease;
}

.project-arrow {
    position: absolute;
    right: calc(var(--side) + 3.45rem);
    color: var(--ink);
    font-size: 1.45rem;
    opacity: 0;
    transform: translate(-0.5rem, 0.35rem);
    transition: opacity 180ms ease, transform 180ms ease;
}

.project:hover .project-icon,
.project:focus-visible .project-icon {
    transform: scale(1.06);
}

.project:hover .project-arrow,
.project:focus-visible .project-arrow {
    opacity: 1;
    transform: translate(0, 0);
}

.project--bitbuddy {
    --accent: #21a28d;
}

.project--quicklink {
    --accent: #7a9b37;
}

.project--cribbo {
    --accent: #e24455;
}

.project--moneyminder {
    --accent: #e5ac28;
}

.site-footer {
    min-height: clamp(6rem, 9vh, 7rem);
}

.site-footer p {
    margin: 0;
    color: var(--muted);
    font-size: clamp(0.92rem, 1.22vw, 1.15rem);
    font-weight: 500;
}

.social-nav a {
    font-size: clamp(0.92rem, 1.22vw, 1.15rem);
}

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

@media (max-width: 800px) {
    :root {
        --side: clamp(1.35rem, 6vw, 2.5rem);
    }

    body {
        padding: 0.5rem;
    }

    .site-shell {
        min-height: calc(100vh - 1rem);
        border-radius: 1rem;
    }

    .site-header {
        min-height: 6.2rem;
    }

    .primary-nav {
        gap: 1.1rem;
    }

    .primary-nav a {
        font-size: 0.92rem;
    }

    .hero {
        min-height: auto;
        padding-block: clamp(3.5rem, 14vw, 5rem) clamp(3rem, 11vw, 4rem);
    }

    .hero h1 {
        font-size: clamp(2.2rem, 9.4vw, 3.4rem);
        white-space: normal;
    }

    .hero-feature {
        grid-template-columns: 1fr auto;
        margin-bottom: 1.5rem;
        gap: 0.45rem 0.75rem;
        padding-bottom: 0.85rem;
    }

    .hero-feature__label {
        grid-column: 1 / -1;
    }

    .hero-feature__title {
        white-space: normal;
    }

    .hero-copy {
        max-width: 26rem;
        margin-top: 1.5rem;
        font-size: clamp(1.05rem, 4.5vw, 1.3rem);
    }

    .project {
        grid-template-columns: 2.1rem minmax(0, 1fr) auto 2rem;
        grid-template-areas:
            "number name status mark"
            ". description description description";
        gap: 0.4rem 0.85rem;
        min-height: 8.6rem;
        padding-block: 1.7rem;
    }

    .project-number {
        grid-area: number;
    }

    .project-name {
        grid-area: name;
        overflow: hidden;
        font-size: clamp(1.5rem, 7vw, 2.1rem);
        text-overflow: ellipsis;
    }

    .project-description {
        grid-area: description;
        font-size: 1rem;
    }

    .project-status {
        grid-area: status;
        font-size: 0.68rem;
    }

    .project-icon {
        grid-area: mark;
        width: 2rem;
        height: 2rem;
    }

    .project-arrow {
        display: none;
    }

    .site-footer {
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 1.15rem;
        padding-block: 2rem;
    }

    .social-nav {
        gap: 1.4rem;
    }
}

@media (max-width: 480px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 0.65rem;
    }

    .brand-lockup {
        width: 100%;
    }

    .app-switcher__menu {
        left: 0;
    }

    .project {
        grid-template-columns: 1.7rem minmax(0, 1fr) 2rem;
        grid-template-areas:
            "number name mark"
            ". description description"
            ". status status";
    }

    .project-status {
        justify-self: start;
    }
}

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

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
