/* ==========================================================================
   Thunder Apps Studio — site.css
   One stylesheet for every page. Modelled on the App Store: system type,
   squircle icons, "Get" pills, horizontal shelves, hairline sections.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
    --bg: #ffffff;
    --bg-grouped: #f5f5f7;
    --card: #ffffff;
    --fill: rgba(118, 118, 128, .12);      /* Get button, chips */
    --fill-strong: rgba(118, 118, 128, .2);
    --ink: #1d1d1f;
    --ink-2: #6e6e73;
    --ink-3: #8e8e93;
    --sep: rgba(60, 60, 67, .18);
    --blue: #0071e3;
    --link: #0066cc;
    --bolt: #ffcc00;
    --nav-bg: rgba(255, 255, 255, .78);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 28px rgba(0, 0, 0, .07);

    --r-icon: 22.5%;
    --r-lg: 22px;
    --r-md: 16px;
    --r-sm: 12px;

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Helvetica Neue", Arial, sans-serif;
    --wrap: 1120px;
    --gutter: 24px;
    --nav-h: 52px;

    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --bg-grouped: #0f0f10;
        --card: #1c1c1e;
        --fill: rgba(118, 118, 128, .24);
        --fill-strong: rgba(118, 118, 128, .36);
        --ink: #f5f5f7;
        --ink-2: #a1a1a6;
        --ink-3: #8e8e93;
        --sep: rgba(84, 84, 88, .55);
        --blue: #0a84ff;
        --link: #2997ff;
        --nav-bg: rgba(22, 22, 23, .78);
        --shadow-card: 0 0 0 1px rgba(255, 255, 255, .06);
    }
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 17px/1.47 var(--font);
    letter-spacing: -.022em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* short pages keep the footer at the bottom of the window */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
body > main { flex: 1 0 auto; }

img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4, p, ul, ol, dl, figure { margin: 0; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.1; letter-spacing: -.028em; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent);
    outline-offset: 2px;
    border-radius: 8px;
}

::selection { background: color-mix(in srgb, var(--blue) 25%, transparent); }

.wrap {
    width: min(var(--wrap), 100% - 2 * var(--gutter));
    margin-inline: auto;
}

[hidden] { display: none !important; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: 12px; top: -48px;
    z-index: 100;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}
.skip-link:focus { top: 8px; }

/* ---------- Navigation (frosted bar) ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--nav-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.nav.is-scrolled { border-bottom-color: var(--sep); }

.nav-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: var(--nav-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.02em;
    white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 22.5%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .10), 0 4px 12px rgba(10, 40, 90, .14);
}
@media (prefers-color-scheme: dark) {
    .brand-mark { box-shadow: 0 0 0 .5px rgba(255, 255, 255, .18), 0 4px 14px rgba(0, 0, 0, .5); }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 0 auto;
    padding: 0;
    list-style: none;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--ink-2);
    font: inherit;
    font-size: 14px;
    letter-spacing: -.01em;
    cursor: pointer;
}
.nav-link:hover { color: var(--ink); text-decoration: none; }
.nav-link.is-active { color: var(--ink); font-weight: 600; }
.nav-link .chev { width: 10px; height: 10px; transition: transform .2s; }

.nav-dropdown { position: relative; }
.nav-dropdown.is-open .chev { transform: rotate(180deg); }

.nav-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    min-width: 200px;
    margin: 0;
    padding: 6px;
    list-style: none;
    border-radius: 14px;
    background: var(--card);
    box-shadow: 0 0 0 1px var(--sep), 0 18px 40px rgba(0, 0, 0, .16);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -4px);
    transition: opacity .16s, transform .16s, visibility .16s;
}
.nav-dropdown.is-open .nav-menu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}
.nav-menu a {
    display: block;
    padding: 9px 12px;
    border-radius: 9px;
    color: var(--ink);
    font-size: 14px;
}
.nav-menu a:hover { background: var(--fill); text-decoration: none; }
.nav-menu a.is-active { color: var(--blue); font-weight: 600; }

.nav-call { margin-left: 8px; }

.nav-toggle {
    display: none;
    margin-left: auto;
    width: 40px; height: 40px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--ink);
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 18px; height: 1.5px;
    margin: 5px auto;
    border-radius: 2px;
    background: currentColor;
    transition: transform .25s, opacity .2s;
}
.nav.is-open .nav-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .nav .nav-call { display: none; }
    .nav-links {
        position: absolute;
        inset: var(--nav-h) 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        max-height: calc(100vh - var(--nav-h));
        overflow-y: auto;
        padding: 8px var(--gutter) 24px;
        background: var(--bg);
        border-bottom: 1px solid var(--sep);
        display: none;
    }
    .nav.is-open .nav-links { display: flex; }
    .nav-links > li { border-bottom: 1px solid var(--sep); }
    .nav-link {
        width: 100%;
        justify-content: space-between;
        padding: 14px 0;
        border-radius: 0;
        font-size: 17px;
        color: var(--ink);
    }
    .nav-menu {
        position: static;
        min-width: 0;
        padding: 0 0 10px 14px;
        box-shadow: none;
        background: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
    }
    .nav-dropdown.is-open .nav-menu { display: block; transform: none; }
    .nav-menu a { padding: 10px 0; font-size: 16px; color: var(--ink-2); }
    .nav-menu a:hover { background: none; }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -.015em;
    cursor: pointer;
    transition: background-color .15s, transform .1s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--blue) 88%, #000); }
.btn-tinted { background: var(--fill); color: var(--blue); }
.btn-tinted:hover { background: var(--fill-strong); }
.btn-sm { min-height: 32px; padding: 0 16px; font-size: 14px; }

/* App Store "Get" pill */
.get {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    height: 30px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--fill);
    color: var(--blue);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.01em;
    flex: none;
    transition: background-color .15s;
}
.get:hover { background: var(--fill-strong); text-decoration: none; }
.get-lg { height: 36px; min-width: 92px; font-size: 17px; background: var(--blue); color: #fff; }
.get-lg:hover { background: color-mix(in srgb, var(--blue) 88%, #000); }

.link-more {
    font-size: 17px;
    font-weight: 400;
    white-space: nowrap;
}

/* "Download on the App Store" badge, drawn in CSS so it never depends on a remote image */
.store-badge {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 48px;
    padding: 0 18px 0 14px;
    border-radius: 11px;
    background: #000;
    color: #fff;
    box-shadow: inset 0 0 0 1px #a6a6a6;
    line-height: 1;
    white-space: nowrap;
}
.store-badge:hover { color: #fff; text-decoration: none; opacity: .88; }
.store-badge i { font-size: 26px; }
.store-badge span { display: flex; flex-direction: column; font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.store-badge small { font-size: 10px; font-weight: 500; letter-spacing: 0; margin-bottom: 2px; }

/* ---------- App icon ---------- */
.app-icon {
    border-radius: var(--r-icon);
    background: var(--fill);
    box-shadow: 0 0 0 .5px var(--sep);
    object-fit: cover;
    flex: none;
}

/* ---------- Sections ---------- */
.section { padding-block: 56px; }
.section-tight { padding-block: 32px; }
.section.ruled > .wrap { border-top: 1px solid var(--sep); padding-top: 32px; }
.section.ruled { padding-top: 0; }
.section-grouped { background: var(--bg-grouped); }

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.section-title { font-size: clamp(24px, 3vw, 30px); }
.section-lead { max-width: 62ch; margin-top: 8px; color: var(--ink-2); font-size: 19px; line-height: 1.42; letter-spacing: -.02em; }

.prose { max-width: 68ch; }
.prose p { margin-bottom: 1em; color: var(--ink); }
.prose p:last-child { margin-bottom: 0; }
.muted { color: var(--ink-2); }

/* ---------- Page header (iOS large title) ---------- */
.page-head { padding: 40px 0 8px; }
.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
    color: var(--ink-2);
    font-size: 14px;
}
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--ink-3); }
.crumbs a { color: var(--ink-2); }
.crumbs a:hover { color: var(--ink); }
.page-title { font-size: clamp(36px, 6vw, 56px); letter-spacing: -.035em; }
.page-lead { max-width: 60ch; margin-top: 12px; color: var(--ink-2); font-size: clamp(19px, 2.2vw, 22px); line-height: 1.36; letter-spacing: -.02em; }

/* ---------- Home: Today hero ---------- */
.today-head { padding: 56px 0 32px; }
.today-title {
    max-width: 15ch;
    font-size: clamp(44px, 8vw, 88px);
    line-height: 1.02;
    letter-spacing: -.045em;
}
.today-sub {
    margin-top: 18px;
    color: var(--ink-2);
    font-size: clamp(19px, 2.4vw, 24px);
    letter-spacing: -.02em;
}
.today-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.today-cards {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 24px;
    padding-bottom: 8px;
}

.story {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 480px;
    overflow: hidden;
    border-radius: var(--r-lg);
    color: #fff;
    isolation: isolate;
    box-shadow: var(--shadow-card);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
}
a.story:hover, .story:has(.story-link:hover) { transform: scale(.985); }
.story-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.story-text { position: relative; padding: 24px 26px 0; max-width: 30ch; pointer-events: none; }
.story-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    opacity: .72;
}
.story-title { font-size: clamp(26px, 3vw, 34px); line-height: 1.08; letter-spacing: -.032em; }
.story-body { margin-top: 10px; font-size: 16px; line-height: 1.4; opacity: .82; }

/* App of the Day: accent colour, fanned screenshots, frosted app bar */
.story-feature {
    background:
        radial-gradient(120% 90% at 85% 10%, color-mix(in srgb, var(--app-accent) 70%, #fff) 0%, transparent 55%),
        linear-gradient(160deg, var(--app-accent), color-mix(in srgb, var(--app-accent) 45%, #000));
}
.story-shots {
    position: absolute;
    right: -2%;
    bottom: -18%;
    z-index: -1;
    display: flex;
    align-items: flex-end;
    width: 64%;
    pointer-events: none;
}
.story-shots img {
    width: 36%;
    border-radius: 18px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, .35);
    background: rgba(255, 255, 255, .1);
}
.story-shots img:nth-child(1) { transform: rotate(-8deg) translate(18%, 4%); }
.story-shots img:nth-child(2) { position: relative; z-index: 1; width: 40%; transform: translateY(-10%); }
.story-shots img:nth-child(3) { transform: rotate(8deg) translate(-18%, 4%); }

.story-bar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding: 14px 18px;
    background: color-mix(in srgb, var(--app-accent) 35%, rgba(0, 0, 0, .62));
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    backdrop-filter: blur(24px) saturate(160%);
    pointer-events: none;
}
.story-bar .get { pointer-events: auto; background: rgba(255, 255, 255, .22); color: #fff; }
.story-bar .get:hover { background: rgba(255, 255, 255, .32); }
.story-bar-text { min-width: 0; flex: 1; }
.story-bar-text strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.2; }
.story-bar-text span { display: block; overflow: hidden; font-size: 13px; opacity: .75; white-space: nowrap; text-overflow: ellipsis; }

/* Coming soon */
.story-soon {
    background: linear-gradient(170deg, #e3f6f2 0%, #bfe9e1 100%);
    color: #0b3d52;
}
.story-soon .story-label { opacity: .8; }
.story-soon img {
    position: absolute;
    right: -3%;
    bottom: -5%;
    z-index: -1;
    width: 60%;
    max-width: 280px;
    pointer-events: none;
}
.story-soon .story-title { font-size: clamp(24px, 2.4vw, 28px); }
@media (prefers-color-scheme: dark) {
    .story-soon { background: linear-gradient(170deg, #0f4a5f 0%, #0b3d52 100%); color: #f8faf7; }
}

@media (max-width: 860px) {
    .today-cards {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: min(86%, 420px);
        gap: 14px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        margin-inline: calc(-1 * var(--gutter));
        padding: 4px var(--gutter) 16px;
        scroll-padding-inline: var(--gutter);
        scrollbar-width: none;
    }
    .today-cards::-webkit-scrollbar { display: none; }
    .story { min-height: 440px; scroll-snap-align: start; }
    .story-shots { width: 92%; right: -8%; bottom: -22%; }
}

/* Hero entrance — the one orchestrated motion on the site */
@media (prefers-reduced-motion: no-preference) {
    .rise { animation: rise .8s cubic-bezier(.2, .8, .2, 1) both; }
    .rise-2 { animation-delay: .08s; }
    .rise-3 { animation-delay: .16s; }
    .rise-4 { animation-delay: .28s; }
    @keyframes rise { from { opacity: 0; transform: translateY(18px); } }
}

/* ---------- Info strip (App Store stats row) ---------- */
.info-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 0;
    padding: 18px 0;
    border-block: 1px solid var(--sep);
    text-align: center;
}
.info-strip > div { padding: 2px 12px; }
.info-strip > div + div { border-left: 1px solid var(--sep); }
.info-strip dt {
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.info-strip dd { margin: 4px 0 0; }
.info-value { display: block; color: var(--ink-2); font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.info-sub { display: block; margin-top: 2px; color: var(--ink-3); font-size: 13px; letter-spacing: -.01em; }
.stars { color: var(--ink-2); font-size: 12px; letter-spacing: 2px; }

@media (max-width: 700px) {
    .info-strip {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        margin-inline: calc(-1 * var(--gutter));
        padding-inline: var(--gutter);
    }
    .info-strip::-webkit-scrollbar { display: none; }
    .info-strip > div { flex: 0 0 38%; scroll-snap-align: start; }
}

/* ---------- App list rows (App Store list) ---------- */
.app-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 40px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.app-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
}
.app-row .app-icon { width: 64px; height: 64px; margin-block: 12px; }
/* iOS inset separator: it starts after the icon and runs under the Get button */
.app-row-body {
    flex: 1;
    min-width: 0;
    align-self: stretch;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--sep);
}
.app-list > li:nth-child(-n+2) .app-row-body { border-top-color: transparent; }
.app-row-text { flex: 1; min-width: 0; }
.app-row-name { overflow: hidden; color: var(--ink); font-size: 17px; font-weight: 500; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; letter-spacing: -.022em; }
.app-row-name a { color: inherit; }
.app-row-name a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.app-row-name a:hover { text-decoration: none; }
.app-row-sub { overflow: hidden; color: var(--ink-2); font-size: 14px; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; }
.app-row-cat { color: var(--ink-3); font-size: 13px; line-height: 1.3; }

@media (max-width: 700px) {
    .app-list { grid-template-columns: minmax(0, 1fr); }
    .app-list > li:nth-child(2) .app-row-body { border-top-color: var(--sep); }
}

/* ---------- Two-column feature (about on home) ---------- */
.split {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 56px;
    align-items: center;
}
.split .prose p { color: var(--ink-2); font-size: 19px; line-height: 1.5; letter-spacing: -.02em; }
.split .section-title { margin-bottom: 18px; }
.split-actions { margin-top: 24px; }

.icon-mosaic {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 150px));
    gap: 22px;
    justify-content: center;
}
.icon-mosaic a { display: block; }
.icon-mosaic .app-icon {
    width: 100%;
    aspect-ratio: 1;
    box-shadow: 0 0 0 .5px var(--sep), 0 18px 36px rgba(0, 0, 0, .12);
    transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.icon-mosaic a:hover .app-icon { transform: translateY(-4px); }
.icon-mosaic a:nth-child(2) { transform: translateY(28px); }
.icon-mosaic a:nth-child(4) { transform: translateY(28px); }

@media (max-width: 860px) {
    .split { grid-template-columns: 1fr; gap: 40px; }
    .icon-mosaic { grid-template-columns: repeat(4, minmax(0, 96px)); gap: 14px; justify-content: start; }
    .icon-mosaic a:nth-child(2), .icon-mosaic a:nth-child(4) { transform: none; }
}

/* ---------- Tiles (services, app features) ---------- */
.tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.tiles-4 { grid-template-columns: repeat(4, 1fr); }
.tile {
    padding: 24px;
    border-radius: var(--r-lg);
    background: var(--bg-grouped);
}
.section-grouped .tile { background: var(--card); }
.tile h3 { margin: 16px 0 8px; font-size: 19px; line-height: 1.2; letter-spacing: -.022em; }
.tile p { color: var(--ink-2); font-size: 15px; line-height: 1.47; letter-spacing: -.012em; }

/* iOS Settings–style glyph tile */
.glyph {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: var(--glyph, var(--blue));
    color: #fff;
    font-size: 19px;
}
.glyph-blue { --glyph: #0a84ff; }
.glyph-indigo { --glyph: #5e5ce6; }
.glyph-pink { --glyph: #ff375f; }
.glyph-orange { --glyph: #ff9f0a; }
.glyph-green { --glyph: #30d158; }
.glyph-teal { --glyph: #40c8e0; }
.glyph-purple { --glyph: #bf5af2; }
.glyph-gray { --glyph: #8e8e93; }
.glyph-accent { --glyph: var(--app-accent, var(--blue)); }

@media (max-width: 960px) {
    .tiles, .tiles-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .tiles, .tiles-4 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .tile {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr);
        column-gap: 14px;
        align-items: start;
        padding: 18px;
    }
    .tile .glyph { grid-row: span 2; width: 40px; height: 40px; border-radius: 10px; font-size: 17px; }
    .tile h3 { margin: 0 0 4px; font-size: 17px; }
    .tiles > .person { display: flex; }
}

/* ---------- Shelves (horizontal scroll rows) ---------- */
.shelf-nav { display: flex; gap: 8px; }
.shelf-btn {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--fill);
    color: var(--ink);
    cursor: pointer;
    transition: background-color .15s, opacity .15s;
}
.shelf-btn:hover { background: var(--fill-strong); }
.shelf-btn:disabled { opacity: .35; cursor: default; }
.shelf-btn svg { width: 14px; height: 14px; }

.shelf {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 2 * 20px) / 3);
    gap: 20px;
    margin: 0 calc(-1 * var(--gutter));
    padding: 4px var(--gutter) 20px;
    overflow-x: auto;
    list-style: none;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}
.shelf::-webkit-scrollbar { display: none; }
.shelf > * { scroll-snap-align: start; min-width: 0; }
.shelf-4 { grid-auto-columns: calc((100% - 3 * 20px) / 4); }

@media (max-width: 960px) {
    .shelf, .shelf-4 { grid-auto-columns: calc((100% - 20px) / 2.15); }
}
@media (max-width: 600px) {
    .shelf, .shelf-4 { grid-auto-columns: 80%; gap: 14px; }
    .shelf-nav { display: none; }
}

/* Screenshot shelf on product pages */
.shots {
    grid-auto-columns: 240px;
    gap: 16px;
}
.shots img {
    width: 100%;
    aspect-ratio: 600 / 1300;
    border-radius: 26px;
    background: var(--fill);
    box-shadow: 0 0 0 1px var(--sep);
    object-fit: cover;
}
@media (max-width: 600px) { .shots { grid-auto-columns: 62%; } }

/* ---------- Team card ---------- */
.person {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding: 32px 20px 24px;
    border-radius: var(--r-lg);
    background: var(--bg-grouped);
    text-align: center;
}
.section-grouped .person { background: var(--card); }
.person img {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1px var(--sep);
}
.person h3 { margin-top: 18px; font-size: 19px; letter-spacing: -.022em; }
.person p { margin-top: 4px; color: var(--ink-2); font-size: 15px; }
.socials { display: flex; gap: 8px; margin-top: 16px; }
.socials a {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: var(--fill);
    color: var(--ink-2);
    font-size: 14px;
}
.socials a:hover { background: var(--fill-strong); color: var(--ink); text-decoration: none; }

/* ---------- Ratings & reviews ---------- */
.ratings {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
}
.ratings-score { font-size: 64px; font-weight: 700; line-height: .9; letter-spacing: -.04em; }
.ratings-of { padding-bottom: 4px; color: var(--ink-2); font-size: 15px; font-weight: 600; }
.ratings-meta { margin-left: auto; padding-bottom: 4px; color: var(--ink-2); font-size: 15px; text-align: right; }

.review {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    border-radius: var(--r-md);
    background: var(--bg-grouped);
}
.section-grouped .review { background: var(--card); }
.review-head { display: flex; align-items: center; gap: 12px; }
.review-head img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.review-head strong { display: block; font-size: 16px; line-height: 1.25; }
.review-head span { display: block; color: var(--ink-2); font-size: 13px; line-height: 1.3; }
.review .stars { margin-top: 14px; color: #ff9f0a; font-size: 13px; }
.review p { margin-top: 8px; color: var(--ink); font-size: 15px; line-height: 1.47; letter-spacing: -.012em; }

/* ---------- Inside our apps ---------- */
.inside-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 22px 22px;
    border-radius: var(--r-lg);
    background: color-mix(in srgb, var(--app-accent) 8%, var(--bg-grouped));
}
.inside-app {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 600;
}
.inside-app:hover { color: var(--ink); text-decoration: none; }
.inside-app .app-icon { width: 28px; height: 28px; }
.inside-card h3 { margin-top: 18px; font-size: 21px; line-height: 1.18; letter-spacing: -.025em; }
.inside-card p { margin: 8px 0 18px; color: var(--ink-2); font-size: 15px; line-height: 1.47; letter-spacing: -.012em; }
.inside-stat {
    align-self: flex-start;
    margin-top: auto;
    padding: 5px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--app-accent) 14%, transparent);
    color: color-mix(in srgb, var(--app-accent) 80%, var(--ink));
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -.01em;
}
@media (prefers-color-scheme: dark) {
    .inside-card { background: color-mix(in srgb, var(--app-accent) 16%, var(--card)); }
    .inside-stat { background: color-mix(in srgb, var(--app-accent) 30%, transparent); color: #fff; }
}

/* ---------- Grouped list (iOS Settings) ---------- */
.grouped {
    margin: 0;
    padding: 0;
    list-style: none;
    overflow: hidden;
    border-radius: var(--r-md);
    background: var(--bg-grouped);
}
.section-grouped .grouped { background: var(--card); }
.grouped a, .grouped .grouped-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--ink);
}
.grouped a:hover { background: var(--fill); text-decoration: none; }
.grouped li + li .grouped-text { box-shadow: 0 -1px 0 var(--sep); }
.grouped .glyph { width: 32px; height: 32px; border-radius: 8px; font-size: 15px; }
.grouped-text {
    flex: 1;
    min-width: 0;
    margin-block: -12px;
    padding-block: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.grouped-text strong { font-size: 17px; font-weight: 400; }
.grouped-text span { overflow: hidden; margin-left: auto; color: var(--ink-2); font-size: 17px; white-space: nowrap; text-overflow: ellipsis; }
.grouped-text::after {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    margin-left: 2px;
    border-top: 2px solid var(--ink-3);
    border-right: 2px solid var(--ink-3);
    transform: rotate(45deg);
    opacity: .6;
}
.grouped-row .grouped-text::after { display: none; }

@media (max-width: 600px) {
    .grouped-text { flex-direction: column; align-items: flex-start; gap: 0; padding-right: 20px; }
    .grouped-text span { margin-left: 0; max-width: 100%; }
    .grouped-text::after { position: absolute; right: 18px; top: 50%; margin-top: -4px; }
    .grouped-text span { font-size: 15px; }
}

/* ---------- Contact ---------- */
.contact-list { max-width: 640px; }

/* ---------- Apps page (search-result style cards) ---------- */
.app-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
.app-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-radius: var(--r-lg);
    background: var(--card);
    box-shadow: var(--shadow-card);
}
.app-card .app-row-body { border-top: 0; }
.app-card .app-row .app-icon { margin-block: 0; }
.app-card-summary { margin: 14px 0 16px; color: var(--ink-2); font-size: 15px; line-height: 1.47; letter-spacing: -.012em; }
.app-card-shots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: auto;
}
.app-card-shots img {
    width: 100%;
    aspect-ratio: 600 / 1300;
    border-radius: 14px;
    background: var(--fill);
    box-shadow: 0 0 0 1px var(--sep);
    object-fit: cover;
}
@media (max-width: 860px) { .app-cards { grid-template-columns: 1fr; } }

/* ---------- Product page ---------- */
.product-head {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 28px;
    align-items: start;
    padding: 36px 0 28px;
}
.product-head .app-icon { width: 168px; height: 168px; box-shadow: 0 0 0 .5px var(--sep), 0 14px 34px rgba(0, 0, 0, .14); }
.product-title { font-size: clamp(28px, 4.2vw, 44px); letter-spacing: -.035em; }
.product-sub { margin-top: 6px; color: var(--ink-2); font-size: clamp(17px, 2vw, 21px); letter-spacing: -.02em; }
.product-dev { display: inline-block; margin-top: 8px; font-size: 15px; }
.product-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 20px; }
.product-price { color: var(--ink-3); font-size: 13px; line-height: 1.3; }

@media (max-width: 600px) {
    .product-head { grid-template-columns: auto 1fr; gap: 16px; padding-top: 24px; }
    .product-head .app-icon { width: 108px; height: 108px; }
    .product-actions { margin-top: 12px; }
}

.desc {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 48px;
}
.desc .prose p { font-size: 17px; }
.checks { margin: 0; padding: 0; list-style: none; }
.checks li {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--sep);
    font-size: 16px;
}
.checks li:first-child { padding-top: 0; }
.checks i { margin-top: 3px; color: var(--app-accent, var(--blue)); }
@media (max-width: 860px) { .desc { grid-template-columns: 1fr; gap: 28px; } }

.info-table {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 40px;
    margin: 0;
}
.info-table > div { padding: 12px 0; border-bottom: 1px solid var(--sep); }
.info-table dt { color: var(--ink-2); font-size: 13px; }
.info-table dd { margin: 2px 0 0; font-size: 16px; }
@media (max-width: 700px) {
    .info-table { grid-template-columns: 1fr; }
    .info-table > div { display: flex; justify-content: space-between; gap: 16px; }
    .info-table dd { margin: 0; text-align: right; }
}

.note { margin-top: 18px; color: var(--ink-3); font-size: 13px; }

.cta {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    border-radius: var(--r-lg);
    background: color-mix(in srgb, var(--app-accent, var(--blue)) 9%, var(--bg));
}
.cta .app-icon { width: 72px; height: 72px; }
.cta h2 { font-size: 22px; letter-spacing: -.025em; }
.cta p { margin-top: 2px; color: var(--ink-2); font-size: 15px; }
.cta .store-badge { margin-left: auto; }
@media (max-width: 600px) {
    .cta { flex-wrap: wrap; }
    .cta .store-badge { margin-left: 0; }
}

/* ---------- Legal / long-form ---------- */
.legal { max-width: 72ch; padding-bottom: 72px; }
.legal-updated { margin-bottom: 28px; color: var(--ink-2); font-size: 15px; }
.legal h2 { margin: 48px 0 12px; font-size: 26px; letter-spacing: -.028em; }
.legal h3 { margin: 32px 0 10px; font-size: 20px; letter-spacing: -.022em; }
.legal h4 { margin: 24px 0 8px; font-size: 17px; letter-spacing: -.02em; }
.legal p { margin: 0 0 14px; line-height: 1.6; }
.legal ul, .legal ol { margin: 0 0 16px; padding-left: 22px; }
.legal li { margin-bottom: 6px; line-height: 1.55; }
.legal li p { margin: 0; }
.legal strong { font-weight: 600; }
.legal a { word-break: break-word; }
.legal-summary {
    margin: 0 0 40px;
    padding: 22px 24px 8px;
    border-radius: var(--r-lg);
    background: var(--bg-grouped);
}
.legal-summary h2 { margin: 0 0 12px; font-size: 20px; }
.legal-summary ul { padding-left: 20px; }

/* ---------- 404 ---------- */
.lost {
    display: grid;
    place-items: center;
    min-height: calc(100vh - var(--nav-h) - 280px);
    padding: 72px 0;
    text-align: center;
}
.lost-code {
    font-size: clamp(96px, 20vw, 200px);
    font-weight: 800;
    line-height: .9;
    letter-spacing: -.06em;
    background: linear-gradient(180deg, var(--ink) 30%, var(--ink-3));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.lost h1 { margin-top: 12px; font-size: clamp(28px, 4vw, 40px); }
.lost p { max-width: 44ch; margin: 12px auto 28px; color: var(--ink-2); font-size: 19px; }

/* ---------- Gallery (projects / blog leftovers) ---------- */
.media-card {
    overflow: hidden;
    height: 100%;
    border-radius: var(--r-lg);
    background: var(--bg-grouped);
}
.media-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.media-card div { padding: 18px 20px 22px; }
.media-card h3 { font-size: 19px; letter-spacing: -.022em; }
.media-card p { margin-top: 6px; color: var(--ink-2); font-size: 15px; }
.media-card .meta { margin-top: 10px; color: var(--ink-3); font-size: 13px; }

/* ---------- Footer ---------- */
.footer {
    margin-top: 24px;
    padding: 40px 0 28px;
    background: var(--bg-grouped);
    color: var(--ink-2);
    font-size: 13px;
    line-height: 1.45;
    letter-spacing: -.01em;
}
.footer-top {
    display: grid;
    grid-template-columns: 1.4fr repeat(4, 1fr);
    gap: 32px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--sep);
}
.footer .brand { color: var(--ink); font-size: 15px; }
.footer .brand-mark { width: 30px; height: 30px; }
.footer-about { max-width: 34ch; margin-top: 12px; }
.footer h2 { margin-bottom: 10px; color: var(--ink); font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.footer ul { margin: 0; padding: 0; list-style: none; }
.footer li { margin-bottom: 8px; }
.footer a { color: var(--ink-2); }
.footer a:hover { color: var(--ink); text-decoration: underline; }
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding-top: 18px;
    color: var(--ink-3);
}
@media (max-width: 960px) {
    .footer-top { grid-template-columns: repeat(2, 1fr); }
    .footer-brand { grid-column: 1 / -1; }
}

/* ---------- Back to top ---------- */
.to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 40;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: var(--nav-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 0 0 1px var(--sep), 0 8px 24px rgba(0, 0, 0, .12);
    color: var(--ink);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .25s, transform .25s, visibility .25s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top svg { width: 16px; height: 16px; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (max-width: 600px) {
    :root { --gutter: 16px; }
    body { font-size: 16px; }
    .section { padding-block: 40px; }
    .section.ruled > .wrap { padding-top: 24px; }
    .today-head { padding-top: 32px; }
}
