/* Standalone directory styles. Product pages do not inherit this layout. */
:root {
    color-scheme: light;
    --paper: #f6f7f2;
    --ink: #203e31;
    --muted: #5a6c61;
    --green: #28593f;
    --line: #dce4d9;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: linear-gradient(180deg, #edf4ed 0, var(--paper) 400px);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 3px solid #9a6a22; outline-offset: 5px; border-radius: 5px; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
.page-width { width: min(1080px, calc(100% - 48px)); margin-inline: auto; }
.skip-link { position: absolute; top: 10px; left: 20px; z-index: 3; padding: 10px 18px; background: white; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.site-header { display: flex; align-items: center; justify-content: flex-end; min-height: 64px; }
.lang-switch { display: flex; align-items: center; gap: 12px; }
.lang-switch a { display: inline-flex; align-items: center; min-height: 44px; padding: 7px 4px; color: var(--muted); font-size: .79rem; }
.lang-switch a:hover { color: var(--green); text-decoration: underline; text-underline-offset: 5px; }
.lang-switch a[aria-current] { color: var(--ink); font-weight: 650; text-decoration: underline; text-underline-offset: 5px; }

.directory-hero { padding-block: 14px 42px; text-align: center; }
.directory-hero h1 { font-size: 2rem; line-height: 1.4; font-weight: 650; letter-spacing: -.02em; }
.hero-lead { max-width: 680px; margin: 14px auto 0; color: var(--muted); font-size: .94rem; line-height: 1.9; text-wrap: balance; }

.catalog-section { margin-bottom: 44px; scroll-margin-top: 24px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { font-size: 1.2rem; line-height: 1.5; font-weight: 600; }
.app-count { flex-shrink: 0; color: var(--muted); font-size: .78rem; }
.app-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.app-card { display: flex; flex-direction: column; min-width: 0; padding: 24px 20px 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.app-card:hover, .app-card:focus-within { border-color: #abc5b0; transform: translateY(-4px); box-shadow: 0 8px 20px #263f2f14; }
.app-card-heading { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 14px; text-align: center; }
.app-card-heading > div { min-width: 0; }
.app-icon { width: 72px; height: 72px; flex: 0 0 72px; object-fit: cover; border-radius: 17px; box-shadow: 0 3px 9px #162f2520; }
.app-category { color: var(--muted); font-size: .7rem; margin-top: 4px; }
.app-title { font-size: 1.15rem; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
.app-desc { flex: 1; color: var(--muted); font-size: .86rem; line-height: 1.85; }
.app-card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 16px; margin-top: 18px; border-top: 1px solid #edf0e9; }
.app-detail-link { position: relative; display: block; padding-block: 9px; font-size: .75rem; font-weight: 650; }
.app-detail-link > span[aria-hidden] { margin-left: 5px; }
.app-detail-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.app-language-note { display: block; color: var(--muted); font-size: .62rem; font-weight: 400; }
.app-store-cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 12px; border: 1px solid #cbdccc; border-radius: 6px; background: #f5f8f2; color: #244b35; font-size: .73rem; font-weight: 600; line-height: 1.4; white-space: nowrap; transition: background-color .18s, border-color .18s, color .18s; }
.app-store-cta:hover { background: var(--green); border-color: var(--green); color: white; }

.preview-section { padding-top: 28px; border-top: 1px solid var(--line); }
.preview-section .app-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.preview-section .app-card { background: #f0f4ed; }
.preview-section .app-card-actions { border-color: #dce3d7; }
.section-description { margin: -8px 0 26px; color: var(--muted); font-size: .85rem; }
.app-status { display: inline-flex; align-items: center; gap: 7px; color: #596e50; font-size: .73rem; }
.app-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #8aa276; }

.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding-block: 32px 42px; border-top: 1px solid var(--line); }
.footer-brand { font-size: .94rem; font-weight: 600; }
.site-footer p { margin-top: 5px; color: var(--muted); font-size: .75rem; }
.site-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; color: var(--muted); font-size: .72rem; }
.site-footer nav a { padding-block: 10px; }
.site-footer nav a:hover { color: var(--green); text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 980px) {
    .app-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .page-width { width: calc(100% - 36px); }
    .site-header { min-height: 56px; }
    .directory-hero { padding-block: 14px 32px; }
    .directory-hero h1 { font-size: 1.8rem; }
    .hero-lead { font-size: .88rem; }
    .catalog-section { margin-bottom: 36px; }
    .section-heading { gap: 12px; margin-bottom: 20px; }
    .section-heading h2 { font-size: 1.1rem; }
    .app-count { font-size: .7rem; }
    .app-list, .preview-section .app-list { grid-template-columns: 1fr; gap: 16px; }
    .app-card { padding: 24px 20px 20px; }
    .app-title { font-size: 1.13rem; }
    .site-footer { padding-bottom: 28px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; }
    .app-card:hover, .app-card:focus-within { transform: none; }
}
