:root {
    color-scheme: light dark;
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
    --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    --bg: #ffffff;
    --sidebar: #f5f5f7;
    --fill: #efeff4;
    --fill-hover: #e5e5ea;
    --selected: #e3e3e8;
    --text: #1d1d1f;
    --text-2: #6e6e73;
    --text-3: #8e8e93;
    --sep: #d8d8dd;
    --link: #0066cc;
    --bar: #f5f5f7cc;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1e1e1e;
        --sidebar: #282828;
        --fill: #353537;
        --fill-hover: #414144;
        --selected: #3a3a3c;
        --text: #f5f5f7;
        --text-2: #a1a1a6;
        --text-3: #86868b;
        --sep: #3a3a3c;
        --link: #4da3ff;
        --bar: #282828d9;
    }
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 6px; }
h1, h2, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
img { display: block; }
.skip-link {
    position: fixed; top: .75rem; left: .75rem; z-index: 30;
    padding: .5rem .9rem; border-radius: 8px;
    background: var(--text); color: var(--bg);
    transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- Frame ---------- */

.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
    position: sticky; top: 0;
    display: flex; flex-direction: column;
    height: 100vh;
    padding: 18px 10px 14px;
    background: var(--sidebar);
    border-right: 1px solid var(--sep);
}
.brand { display: flex; align-items: center; gap: 9px; padding: 0 8px; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.brand img { width: 28px; height: 28px; }
.nav { display: grid; gap: 1px; margin-top: 22px; }
.nav a {
    display: flex; align-items: center; gap: 9px;
    height: 32px; padding: 0 8px;
    border-radius: 7px;
    font-size: 14px;
}
.nav a:hover { background: var(--fill); }
.nav a.active { background: var(--selected); font-weight: 600; }
.nav svg { width: 16px; height: 16px; flex: none; fill: currentColor; opacity: .75; }
.nav a.active svg { opacity: 1; }
.account {
    display: flex; align-items: center; gap: 9px;
    margin-top: auto;
    padding: 8px;
    border-radius: 8px;
}
.account:hover { background: var(--fill); }
.account img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.account span { display: grid; line-height: 1.25; }
.account strong { font-size: 13px; font-weight: 600; }
.account small { font-size: 12px; color: var(--text-2); }

.main { min-width: 0; padding: 28px 40px 56px; }
.view { max-width: 1040px; }

/* ---------- Shelves ---------- */

.shelf + .shelf { margin-top: 40px; }
.shelf-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.shelf-head h2 { font-size: 21px; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; }
.arrows { display: flex; gap: 6px; }
.arrows[hidden] { display: none; }
.arrows button {
    display: grid; place-items: center;
    width: 28px; height: 28px;
    padding: 0; border: 0; border-radius: 50%;
    background: var(--fill);
    cursor: pointer;
}
.arrows button:hover:not(:disabled) { background: var(--fill-hover); }
.arrows button:disabled { opacity: .4; cursor: default; }
.arrows svg, .back svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.carousel {
    display: grid;
    grid-auto-flow: column;
    gap: 20px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel > li { min-width: 0; scroll-snap-align: start; }

/* Featured cards: caption above, artwork below, as in the Mac App Store. */
.editorial { grid-auto-columns: calc((100% - 20px) / 2); }
.feature { display: block; }
.kicker { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.feature-title { margin-top: 2px; font-size: 20px; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
.feature-sub { color: var(--text-2); font-size: 15px; }
.feature-art {
    position: relative;
    aspect-ratio: 16 / 10;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--bg);
}
.feature-art img {
    position: absolute;
    left: 50%; top: var(--top);
    width: var(--w); height: auto;
    transform: translateX(-50%);
    border-radius: 8px;
    box-shadow: 0 10px 30px #00000059;
}
.feature:hover .feature-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* Lockups: icon, name, subtitle, Get. Three per page, hairline on top. */
.lockups { grid-auto-columns: calc((100% - 40px) / 3); }
.lockup {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--sep);
}
.app-icon { flex: none; width: 64px; height: 64px; }
.lockup-text { display: grid; flex: 1; min-width: 0; }
.lockup-name { font-size: 15px; font-weight: 600; line-height: 1.3; }
.lockup-sub { font-size: 13px; color: var(--text-2); line-height: 1.3; }

.get {
    display: inline-flex; align-items: center; justify-content: center;
    flex: none;
    min-width: 66px; height: 28px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--fill);
    font-size: 13px; font-weight: 700; letter-spacing: .01em; text-transform: uppercase;
    transition: background .12s ease;
}
.lockup:hover .get, .get:hover { background: var(--fill-hover); }
.get-fill { min-width: 76px; background: var(--text); color: var(--bg); }
.get-fill:hover { background: var(--text); opacity: .85; }

.store-foot { margin-top: 48px; padding-top: 14px; border-top: 1px solid var(--sep); color: var(--text-3); font-size: 12px; }
.noscript { margin-top: 32px; display: grid; gap: 6px; }
.noscript a { color: var(--link); }

/* ---------- Product page ---------- */

.product { max-width: 880px; }
.product-bar { margin-bottom: 18px; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-left: -4px; padding: 4px; color: var(--link); font-size: 14px; }
.back:hover { text-decoration: underline; }

.product-head { display: flex; align-items: center; gap: 24px; }
.product-icon { width: 128px; height: 128px; }
.product-title h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.product-sub { margin-top: 2px; color: var(--text-2); font-size: 17px; }
.product-dev { display: inline-block; margin-top: 4px; color: var(--link); font-size: 14px; }
.product-dev:hover { text-decoration: underline; }
.product-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.text-button { color: var(--link); font-size: 14px; }
.text-button:hover { text-decoration: underline; }

.info-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(92px, 1fr);
    margin-top: 26px;
    padding: 12px 0;
    border-block: 1px solid var(--sep);
    overflow-x: auto;
    scrollbar-width: none;
}
.info-strip::-webkit-scrollbar { display: none; }
.info-strip > div { display: grid; justify-items: center; gap: 3px; padding: 0 8px; text-align: center; }
.info-strip > div + div { border-left: 1px solid var(--sep); }
.info-strip dt { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.info-strip dd { display: grid; gap: 1px; }
.info-strip b { font-size: 17px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.info-strip span { font-size: 12px; color: var(--text-3); white-space: nowrap; }

.block { margin-top: 30px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.block-head h2 { font-size: 21px; font-weight: 700; letter-spacing: -.015em; }
.block-head span { color: var(--text-2); font-size: 13px; }
.prose { max-width: 68ch; }
.prose + .prose { margin-top: 10px; }
.prose a { color: var(--link); }
.prose a:hover { text-decoration: underline; }
.muted { color: var(--text-2); font-size: 14px; }
code { font-family: var(--mono); font-size: .88em; overflow-wrap: anywhere; }

.shots { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.shots::-webkit-scrollbar { display: none; }
.shots li { flex: none; scroll-snap-align: start; }
.shots img { width: auto; height: 300px; border-radius: 10px; border: 1px solid var(--sep); }
.shots li.tall img { height: 420px; border: 0; }

.notes { display: grid; gap: 6px; padding-left: 18px; list-style: disc; }
.notes li { max-width: 68ch; }
.notes li::marker { color: var(--text-3); }

.command {
    display: flex; align-items: center; gap: 10px;
    max-width: 640px;
    margin-bottom: 10px;
    padding: 6px 6px 6px 14px;
    border-radius: 10px;
    background: var(--fill);
}
.command code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; overflow-wrap: normal; font-size: 13px; scrollbar-width: none; }
.copy {
    flex: none;
    padding: 5px 12px;
    border: 0; border-radius: 7px;
    background: var(--bg);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    box-shadow: 0 1px 2px #0000001a;
}
.copy:hover { color: var(--link); }

.details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; }
.details div { padding-top: 10px; border-top: 1px solid var(--sep); }
.details dt { font-size: 13px; color: var(--text-2); }
.details dd { margin-top: 2px; font-size: 14px; overflow-wrap: anywhere; }
.details a { color: var(--link); }
.details a:hover { text-decoration: underline; }

/* ---------- Narrow ---------- */

@media (max-width: 1000px) {
    .main { padding: 24px 28px 48px; }
    .lockups { grid-auto-columns: calc((100% - 20px) / 2); }
}

@media (max-width: 720px) {
    .app { display: block; }
    .sidebar {
        position: sticky; top: 0; z-index: 10;
        flex-direction: row; align-items: center;
        height: auto;
        padding: 10px 16px;
        padding-top: max(10px, env(safe-area-inset-top));
        background: var(--bar);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        border-right: 0;
        border-bottom: 1px solid var(--sep);
    }
    .brand { padding: 0; }
    .account { margin: 0 0 0 auto; padding: 0; }
    .account:hover { background: none; }
    .account span { display: none; }
    .account img { width: 30px; height: 30px; }

    /* The section nav becomes an iOS-style tab bar. */
    .nav {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
        display: grid; grid-template-columns: repeat(4, 1fr);
        margin: 0;
        padding: 6px 8px max(6px, env(safe-area-inset-bottom));
        background: var(--bar);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        border-top: 1px solid var(--sep);
    }
    .nav a {
        flex-direction: column; justify-content: center; gap: 3px;
        height: 46px;
        color: var(--text-3);
        font-size: 10px; font-weight: 500;
    }
    .nav a:hover, .nav a.active { background: none; }
    .nav a.active { color: var(--text); font-weight: 600; }
    .nav svg { width: 22px; height: 22px; opacity: 1; }

    .main { padding: 18px 16px calc(84px + env(safe-area-inset-bottom)); }
    .page-title { font-size: 30px; }
    #mac, #windows, #web { scroll-margin-top: 64px; }

    .carousel { gap: 14px; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
    .editorial { grid-auto-columns: 86%; }
    .lockups { grid-auto-columns: 86%; }
    .shelf + .shelf { margin-top: 32px; }

    .product-bar { margin-bottom: 12px; }
    .product-head { align-items: flex-start; gap: 16px; }
    .product-icon { width: 104px; height: 104px; }
    .product-title h1 { font-size: 22px; }
    .product-sub { font-size: 15px; }
    .info-strip { grid-auto-columns: 100px; margin-inline: -16px; padding-inline: 8px; }
    .shots { margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
    .shots img { height: 200px; }
    .shots li.tall img { height: 360px; }
    .details { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}

button.text-button { padding: 0; border: 0; background: none; cursor: pointer; }
