:root {
    --bg: #fafafa;
    --fg: #0a0a0a;
    --muted: #525252;
    --border: #e5e5e5;
    --surface: #ffffff;
    /* Same vertical rhythm: header→title, title→photo, photo→apps, apps→footer */
    --stack-gap: clamp(0.7rem, 2.25svh + 0.22rem, 1.05rem);
}

[data-theme="dark"] {
    --bg: #0a0a0a;
    --fg: #f5f5f5;
    --muted: #a3a3a3;
    --border: #262626;
    --surface: #141414;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    color-scheme: light dark;
    block-size: 100svh;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    min-block-size: 100%;
    block-size: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
    overflow-y: auto;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    transition: background-color 0.25s ease, color 0.25s ease;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    position: fixed;
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    z-index: 1000;
}

.site-header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.4rem, 1.25svh, 0.65rem) 1rem;
    padding-top: max(0.4rem, env(safe-area-inset-top));
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.brand {
    font-size: clamp(1rem, 2svmin + 0.25rem, 1.125rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.brand-badge {
    font-size: clamp(1.05rem, 3.65svmin, 1.32rem);
    line-height: 1;
}

main {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
    margin: 0 auto;
    padding: var(--stack-gap) 1rem var(--stack-gap);
    display: flex;
    flex-direction: column;
    /* Center hero + apps as one block between header and footer */
    justify-content: center;
    row-gap: var(--stack-gap);
}

@supports (justify-content: safe center) {
    main {
        justify-content: safe center;
    }
}

.hero {
    flex: 0 1 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    gap: var(--stack-gap);
}

.hero-main {
    flex-shrink: 0;
    font-size: clamp(1.5rem, 4.8svmin + 0.4rem, 2.875rem);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: clamp(-2px, -0.06em, -1px);
    margin: 0;
    font-family: "Inter", "Poppins", "Montserrat", Arial, sans-serif;
}

.hero-photo-slot {
    flex: 0 1 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
}

.hero-photo-wrap {
    align-self: center;
    aspect-ratio: 1024 / 682;
    width: min(700px, 100%);
    max-height: none;
    height: auto;
    overflow: hidden;
    border-radius: clamp(14px, 3vmin + 6px, 36px);
    box-shadow:
        0 2px 4px rgb(0 0 0 / 0.04),
        0 20px 48px rgb(0 0 0 / 0.12);
}

.hero-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

[data-theme="dark"] .hero-photo-wrap {
    box-shadow:
        0 2px 4px rgb(0 0 0 / 0.25),
        0 22px 50px rgb(0 0 0 / 0.45);
}

.shipped-apps {
    flex-shrink: 0;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 0;
    text-align: center;
}

.app-icon-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: clamp(0.85rem, 3.75vmin, 1.85rem);
}

.app-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.35rem, 1.35svmin, 0.55rem);
    min-width: 4.65rem;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    padding: 0.25rem;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

a.app-icon-item:hover {
    opacity: 0.92;
    transform: translateY(-2px);
}

a.app-icon-item:focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: 4px;
}

.app-icon-thumb {
    display: block;
    width: clamp(3.15rem, 12.5svmin + 1.25vw, 4.95rem);
    height: clamp(3.15rem, 12.5svmin + 1.25vw, 4.95rem);
    border-radius: 22%;
    overflow: hidden;
    box-shadow:
        0 1px 2px rgb(0 0 0 / 0.06),
        0 6px 16px rgb(0 0 0 / 0.08);
    background: var(--surface);
}

[data-theme="dark"] .app-icon-thumb {
    box-shadow:
        0 0 0 1px rgb(255 255 255 / 0.088),
        0 1px 2px rgb(0 0 0 / 0.22),
        0 8px 20px rgb(0 0 0 / 0.38);
}

.app-icon-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.app-icon-asset-dark {
    display: none;
}

[data-theme="dark"] .app-icon-thumb .app-icon-asset-light {
    display: none;
}

[data-theme="dark"] .app-icon-thumb .app-icon-asset-dark {
    display: block;
}

.app-icon-name {
    font-size: clamp(0.68rem, 2.65svmin, 0.8rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
    max-width: 7.5rem;
    text-align: center;
}

.site-footer {
    flex-shrink: 0;
    padding: var(--stack-gap) 1rem max(var(--stack-gap), env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
}

.site-footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem 1rem;
    max-width: 700px;
    margin: 0 auto;
}

.site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.45rem 1.1rem;
}

.site-footer-nav a {
    color: var(--muted);
    font-size: clamp(0.75rem, 2.4svmin, 0.84rem);
    font-weight: 500;
    text-decoration: none;
}

.site-footer-nav a:hover {
    color: var(--fg);
}

.site-footer-nav a:focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: 3px;
    border-radius: 4px;
}

.site-footer-copyright {
    font-size: clamp(0.75rem, 2.4svmin, 0.84rem);
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap;
}

@media (min-width: 641px) {
    main {
        padding: var(--stack-gap) 1rem var(--stack-gap);
        row-gap: var(--stack-gap);
    }

    .hero {
        flex: 0 1 auto;
        min-height: 0;
    }

    .hero-photo-slot {
        flex: 0 1 auto;
        min-height: 0;
        align-items: flex-start;
        padding: 0;
    }

    .hero-photo-wrap {
        max-height: min(54svh, 100%);
    }

    .shipped-apps {
        padding: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
