:root {
    color-scheme: dark;
    --background: #111827;
    --surface: #1a2435;
    --border: #344156;
    --text: #f5f5f7;
    --muted: #bac4d4;
    --accent: #ff91a3;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; }
body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", sans-serif;
    line-height: 1.65;
}
a { color: inherit; }
a, select { -webkit-tap-highlight-color: transparent; }
a:focus-visible, select:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 5px;
}
.container { max-width: 1240px; margin: 0 auto; padding: 0 40px; }
.skip-link {
    position: absolute; top: 8px; left: 16px; z-index: 10;
    padding: 10px 20px; background: var(--text); color: var(--background);
    transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }
.site-header { padding: 28px 0 40px; }
.header-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.wordmark { text-decoration: none; font-size: 14px; font-weight: 650; letter-spacing: .03em; }
.wordmark span { color: var(--accent); margin-left: 8px; }
select {
    max-width: 50%; min-height: 44px; padding: 8px 12px;
    background: var(--surface); color: var(--text); border: 1px solid var(--border);
    border-radius: 8px; font: inherit; font-size: 14px; cursor: pointer;
}
h1 { margin: 36px 0 8px; }
.site-logo { width: 280px; max-width: 100%; height: auto; display: block; }
.subtitle { margin: 8px 0 0; font-size: clamp(22px, 3vw, 34px); font-weight: 650; letter-spacing: -.035em; }
.new-apps {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
    padding: 20px 24px; border: 1px solid #58404e; border-radius: 12px;
    background: #241e2b;
}
.new-apps h2 { flex-basis: 100%; margin: 0 0 4px; color: var(--accent); font-size: 13px; font-weight: 600; }
.new-apps a { display: inline-flex; align-items: center; min-height: 36px; text-decoration: none; font-size: 15px; }
.new-apps a:hover { color: var(--accent); }
.category-nav { display: flex; flex-wrap: wrap; gap: 10px; padding: 28px 0 0; }
.category-nav a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px;
    border: 1px solid var(--border); border-radius: 8px; text-decoration: none;
    font-size: 14px; color: var(--muted);
}
.category-nav a:hover { background: var(--surface); color: var(--text); border-color: var(--muted); }
.app-section { margin-top: 56px; }
.section-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.section-heading::after { content: ""; height: 1px; background: var(--border); flex: 1; }
.section-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.025em; }
.section-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.apps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.app-card {
    min-width: 0; display: flex; flex-direction: column; padding: 24px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    scroll-margin-top: 28px; transition: border-color .2s ease;
}
.app-card:hover { border-color: #66758b; }
.app-card:target { border-color: var(--accent); }
.app-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.app-icon, .app-icon-placeholder {
    flex-shrink: 0; width: 64px; height: 64px; border-radius: 14px; object-fit: cover;
    box-shadow: 0 4px 14px #0003;
}
.app-icon-placeholder { display: grid; place-items: center; font-size: 30px; }
.piano-icon { background: #f0ede6; color: #1c2430; font-family: Georgia, serif; }
.app-info { min-width: 0; align-self: center; }
.app-info h3 { margin: 0 0 5px; font-size: 19px; line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
.app-category { margin: 0; font-size: 12px; color: var(--muted); }
.app-description { margin: 0 0 24px; font-size: 14px; line-height: 1.8; color: var(--muted); }
.app-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.app-link {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 44px; padding: 9px 13px; border-radius: 7px; text-decoration: none;
    font-size: 13px; font-weight: 600; border: 1px solid var(--border);
}
.app-link svg { flex-shrink: 0; }
.app-link.primary { background: #eceff5; color: #172033; border-color: #eceff5; }
.app-link.primary:hover { background: #fff; border-color: #fff; }
.app-link.secondary:hover { background: #2b3850; }
.app-badge {
    display: inline-block; vertical-align: middle; margin: 4px 0 0 6px; padding: 3px 7px;
    border-radius: 4px; background: #334155; color: #e2e8f0; font-size: 9px;
    font-weight: 600; letter-spacing: .04em; white-space: nowrap;
}
.badge-beta { background: #523829; color: #ffcf9b; }
.badge-new { background: #1e4944; color: #a3e8d4; }
#experiments { padding-top: 12px; }
#experiments .apps-grid { grid-template-columns: 1fr; }
#experiments .app-card { background: transparent; }
#experiments .app-description { max-width: 800px; }
.cooking-store-banner {
    display: block; margin-top: 16px; padding: 18px 24px; border: 1px solid var(--border);
    border-radius: 10px; text-decoration: none; color: var(--muted); font-size: 14px;
}
.cooking-store-banner strong { color: var(--text); margin-right: 8px; }
.cooking-store-banner .arrow { margin-left: 8px; }
.cooking-store-banner:hover { background: var(--surface); }
footer { padding: 48px 0 32px; margin-top: 56px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
footer p { margin: 12px 0 0; }
footer a { text-decoration: none; }
footer a:hover { color: var(--accent); }
.back-top { display: inline-block; padding: 10px 0; font-size: 14px; }
@media (max-width: 1050px) {
    .apps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
    .container { padding: 0 20px; }
    .site-header { padding-top: 16px; padding-bottom: 28px; }
    h1 { margin-top: 28px; }
    .site-logo { width: 220px; }
    .new-apps { padding: 16px 18px; gap: 4px 16px; }
    .new-apps a { font-size: 14px; }
    .category-nav { gap: 8px; padding-top: 20px; }
    .category-nav a { padding: 8px 12px; font-size: 12px; }
    .app-section { margin-top: 36px; }
    .section-heading h2 { font-size: 21px; }
    .apps-grid { grid-template-columns: 1fr; gap: 14px; }
    .app-card { padding: 22px; }
    footer { margin-top: 36px; padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .app-card { transition: none; }
}
