body.r-app-intro {
    color-scheme: light;
    line-height: normal;
    --paper: var(--rh-paper);
    --ink: var(--rh-ink);
    --muted: var(--rh-muted);
    --line: var(--rh-line);
    --gutter: clamp(1.25rem, 4vw, 3rem);
    --card-width: min(76vw, clamp(220px, calc((100svh - 230px) * 0.4622), 340px));
    background: var(--paper);
    font-family: var(--rh-sans);
    scrollbar-gutter: stable;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--muted);
    outline-offset: 4px;
}
[hidden] { display: none !important; }
::selection { background: #d7d0c3; }
.app-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.app-skip { position: fixed; top: 0.5rem; left: 1rem; z-index: 100; padding: 1rem; background: var(--paper); transform: translateY(-150%); }
.app-skip:focus { transform: none; }
.r-app-intro > main { max-width: none; width: 100%; margin: 0; padding: 0.35rem 0 0; flex: none; }
.r-app-intro h1 {
    font-family: var(--rh-sans);
    color: var(--ink);
    margin: 0 0 0.8rem;
    padding-inline: var(--gutter);
    text-align: center;
    font-size: clamp(1.8rem, 3.6vw, 3rem);
    font-weight: 500;
    letter-spacing: -0.055em;
    line-height: 1.1;
}
.app-gallery {
    position: relative;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: var(--card-width);
    align-items: start;
    gap: clamp(0.75rem, 2vw, 1.75rem);
    padding: 0.5rem calc((100% - var(--card-width)) / 2) 1.1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    animation: app-enter 500ms ease both;
}
.app-gallery::-webkit-scrollbar { display: none; }
.app-gallery-item { margin: 0; min-width: 0; scroll-snap-align: center; }
.app-preview {
    display: block;
    border-radius: 3px;
    text-decoration: none;
    cursor: zoom-in;
    transform-origin: center center;
}
.app-gallery.is-enhanced .app-preview {
    transform: translateY(calc(var(--distance, 0) * 12px)) scale(calc(1 - var(--distance, 0) * 0.08));
    opacity: calc(1 - var(--distance, 0) * 0.42);
    will-change: transform, opacity;
}
.app-gallery.is-enhanced .app-gallery-item:not(.is-current) .app-preview { cursor: pointer; }
.app-image {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1284 / 2778;
    overflow: hidden;
    isolation: isolate;
    background: #e6e2d9;
    border-radius: 3px;
}
.app-image img { position: relative; z-index: 1; display: block; width: 100%; height: auto; transition: opacity 450ms ease; }
.app-image.is-loading img, .app-image.is-error img { opacity: 0; }
.app-image.is-loading::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 25%, rgba(255,255,255,0.4) 50%, transparent 75%);
    transform: translateX(-100%);
    animation: app-shimmer 1.8s ease-in-out 4;
}
.app-image-fallback { display: none; position: absolute; inset: 0; place-items: center; padding: 1rem; font-size: 0.8rem; color: var(--muted); text-align: center; }
.app-image.is-error .app-image-fallback { display: grid; }
.app-gallery-controls { display: flex; justify-content: center; align-items: center; gap: 1rem; padding: 0 1rem; }
.app-gallery-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    font-size: 1.2rem;
    cursor: pointer;
}
.app-gallery-controls button:hover:not(:disabled) { background: #e5e0d7; }
.app-gallery-controls button:disabled { opacity: 0.25; cursor: default; }
.app-gallery-dots { display: flex; }
.app-gallery-dots button { width: 28px; border-radius: 3px; }
.app-gallery-dots span { width: 4px; height: 4px; border-radius: 99px; background: #b8b2a8; transition: width 220ms ease, background-color 220ms ease; }
.app-gallery-dots [aria-current="true"] span { width: 16px; background: var(--ink); }
.app-footer { background: transparent; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.35rem var(--gutter) max(0.5rem, env(safe-area-inset-bottom)); color: var(--muted); font-size: 0.65rem; }
.app-footer nav { display: flex; gap: 1.2rem; }
.app-footer a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.app-footer a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.app-lightbox {
    max-width: 100vw;
    max-height: 100dvh;
    width: 100%;
    height: 100%;
    padding: 4.5rem 1.5rem 1.5rem;
    border: 0;
    background: var(--paper);
    background: color-mix(in srgb, var(--paper) 98%, transparent);
    color: var(--ink);
    overscroll-behavior: contain;
}
.app-lightbox[open] { display: grid; place-items: center; animation: app-enter 220ms ease both; }
.app-lightbox::backdrop { background: rgba(39,38,34,0.6); }
.app-lightbox .app-image { width: min(100%, calc((100dvh - 6rem) * 1284 / 2778)); }
.app-lightbox-close { position: absolute; top: 1rem; right: var(--gutter); display: flex; align-items: center; gap: 1rem; min-height: 44px; padding: 0.5rem 1rem; border: 1px solid var(--line); background: transparent; color: inherit; border-radius: 4px; font-size: 0.8rem; cursor: pointer; }
.app-lightbox-close span { font-size: 1.5rem; }
html.app-preview-open { overflow: hidden; }
@keyframes app-shimmer { to { transform: translateX(100%); } }
@keyframes app-enter { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
@media (max-width: 700px) {
    .r-app-intro > main { padding-top: 0; }
    .r-app-intro h1 { margin-bottom: 0.5rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .app-gallery.is-enhanced .app-preview { transform: none; }
}
