/* Hallmark · genre: playful · macrostructure: Ecosystem Index · theme: Hum (restrained)
 * tone: playful/かわいい · anchor hue: coral 28 · nav: N1b · footer: Ft5
 * pre-emit critique: P5 H4 E4 S4 R5 V4
 * らっこアプリ — iOSアプリ一覧ホームページ
 */

/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-behavior: smooth; }
body { margin: 0; overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:where(h1,h2,h3,h4,p,ul,ol,figure) { margin: 0; }
ul { list-style: none; padding: 0; }
/* display:flex 等を指定した要素でも hidden 属性を確実に効かせる（絞り込み/検索で使用） */
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ============ Base ============ */
body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-body);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.18;
  color: var(--color-ink);
  letter-spacing: 0.005em;
  /* 日本語は語中で折れると読みにくい。長い英単語のはみ出しだけを防ぐ */
  overflow-wrap: break-word;
  min-width: 0;
}
strong { font-weight: 700; color: var(--color-ink); }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2.5rem); }
.section { padding-block: clamp(2.75rem, 6vw, var(--space-3xl)); }
.section--tint { background: var(--color-paper-2); }

/* Section head (stacked; no hanging label) */
.section__head { margin-bottom: var(--space-xl); max-width: 46ch; }
.section__eyebrow {
  display: inline-flex; align-items: center; gap: 0.45em;
  font-size: var(--text-sm); font-weight: 500; color: var(--color-accent-ink);
  letter-spacing: 0.02em; margin-bottom: var(--space-xs);
}
.section__eyebrow::before {
  content: ""; width: 0.5rem; height: 0.5rem; border-radius: 3px;
  background: var(--color-accent); display: inline-block;
}
.section__title { font-size: var(--text-2xl); }
.section__lede { margin-top: var(--space-sm); font-size: var(--text-md); color: var(--color-muted); line-height: 1.6; }

/* Skip link */
.skip {
  position: absolute; left: 0.75rem; top: -3rem; z-index: 100;
  background: var(--color-ink); color: var(--color-paper);
  padding: 0.5rem 0.9rem; border-radius: var(--radius-sm);
  transition: top var(--dur) var(--ease-out);
}
.skip:focus { top: 0.75rem; }

/* Focus ring — instant, high contrast */
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; border-radius: 4px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm);
  padding: 0.7em 1.25em; border-radius: var(--radius-pill);
  border: 1.5px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform var(--dur) var(--ease-spring), background var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.btn--primary { background: var(--color-accent-strong); color: var(--color-on-accent); box-shadow: var(--shadow-card); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost { background: var(--color-card); color: var(--color-ink); border-color: var(--color-rule-strong); }
.btn--ghost:hover { border-color: var(--color-accent); color: var(--color-accent-ink); transform: translateY(-2px); }
.btn--ghost:active { transform: translateY(0); }

/* ============ Nav (N1b) ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--color-paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--color-rule);
}
.nav__inner { display: flex; align-items: center; gap: var(--space-md); min-height: 4rem; }
.wordmark { display: inline-flex; align-items: center; gap: 0.5em; font-family: var(--font-display); font-weight: 700; font-size: var(--text-md); color: var(--color-ink); letter-spacing: 0.01em; }
.wordmark__mark {
  width: 2rem; height: 2rem; border-radius: 10px; flex: none;
  object-fit: cover; box-shadow: var(--shadow-card);
}
.nav__links { display: flex; align-items: center; gap: clamp(0.5rem, 1.5vw, 1.5rem); margin-left: auto; }
.nav__link { font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); padding: 0.4rem 0.2rem; transition: color var(--dur) var(--ease-out); white-space: nowrap; }
.nav__link:hover { color: var(--color-ink); }
.nav__cta { margin-left: 0.25rem; }
@media (max-width: 720px) {
  .nav__links .nav__link { display: none; }
  .nav__links .nav__cta { display: inline-flex; }
}

/* ============ Hero ============ */
.hero { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 4vw, 2.5rem); position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(46% 40% at 88% -8%, var(--color-accent-soft), transparent 70%),
    radial-gradient(40% 38% at 6% 4%, var(--color-sky-soft), transparent 72%);
}
.hero__badge {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-size: var(--text-sm); font-weight: 500; color: var(--color-accent-ink);
  background: var(--color-accent-soft); border: 1px solid color-mix(in oklab, var(--color-accent) 22%, transparent);
  padding: 0.35em 0.85em; border-radius: var(--radius-pill); margin-bottom: var(--space-md);
}
.hero__badge b { font-weight: 700; }
.badge__icon { width: 1.25rem; height: 1.25rem; border-radius: 5px; flex: none; object-fit: cover; }
.hero h1 { font-size: var(--text-display); max-width: 14em; letter-spacing: 0.005em; line-height: 1.32; }
.hero h1 .accent { color: var(--color-accent); }
/* 見出しは「意味のまとまり」単位で折り返す。語中では折らない（keep-all）が、
   どうしても収まらない時だけ break-word で救済してはみ出しを防ぐ。 */
.hero__title { word-break: keep-all; }
.hero__title .ln { display: inline-block; }
.hero__title .ln--sp { margin-right: 0.16em; }
.hero__lede { margin-top: var(--space-md); max-width: 40ch; font-size: var(--text-md); color: var(--color-body); line-height: 1.7; }
.hero__actions { margin-top: var(--space-lg); display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.hero__stats { margin-top: var(--space-xl); display: flex; flex-wrap: wrap; gap: var(--space-lg) var(--space-2xl); }
.stat__num { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); color: var(--color-ink); font-variant-numeric: tabular-nums; line-height: 1; }
.stat__label { font-size: var(--text-sm); color: var(--color-muted); margin-top: 0.25rem; }

/* ============ Search + filter toolbar ============ */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.search {
  display: flex; align-items: center; gap: 0.5rem; flex: 1 1 15rem; min-width: 0;
  background: var(--color-card); border: 1.5px solid var(--color-rule-strong);
  border-radius: var(--radius-pill); padding: 0.55rem 1rem;
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.search:focus-within { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.search svg { flex: none; color: var(--color-muted); }
.search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: var(--text-sm); }
.search input::placeholder { color: var(--color-muted); }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font-size: var(--text-sm); font-weight: 500; color: var(--color-body);
  background: var(--color-card); border: 1.5px solid var(--color-rule);
  padding: 0.45rem 0.9rem; border-radius: var(--radius-pill); cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.45em;
  transition: background var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.chip:hover { border-color: var(--color-accent); transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: var(--color-accent-soft); border-color: var(--color-accent); color: var(--color-accent-ink); }
.chip__count { font-size: var(--text-xs); color: var(--color-muted); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .chip__count { color: var(--color-accent-ink); }

/* ============ App grid + cards ============ */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); gap: var(--space-md); }
.app-card {
  position: relative; display: flex; gap: var(--space-md);
  background: var(--color-card); border: 1.5px solid var(--color-rule);
  border-radius: var(--radius-lg); padding: var(--space-md);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.app-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: color-mix(in oklab, var(--color-accent) 40%, var(--color-rule)); }
.app-card:focus-within { border-color: var(--color-accent); }
.app-card__icon { flex: none; width: 72px; height: 72px; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-card); background: var(--color-paper-3); }
.app-card__icon img { width: 100%; height: 100%; object-fit: cover; }
.app-card__body { min-width: 0; display: flex; flex-direction: column; }
.app-card__name { font-family: var(--font-display); font-weight: 700; font-size: var(--text-md); color: var(--color-ink); line-height: 1.25; }
.app-card__name a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.app-card__name a:hover { color: var(--color-accent-ink); }
.app-card__desc { margin-top: 0.3rem; font-size: var(--text-sm); color: var(--color-muted); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-card__meta { margin-top: auto; padding-top: var(--space-sm); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 0.4em; font-size: var(--text-xs); font-weight: 500; color: var(--color-body); }
.tag__dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; flex: none; background: var(--tag-hue, var(--color-muted)); }
.app-card__go { pointer-events: none; margin-left: auto; font-size: var(--text-xs); font-weight: 700; font-family: var(--font-display); color: var(--color-accent-ink); display: inline-flex; align-items: center; gap: 0.3em; }
.app-card__go svg { transition: transform var(--dur) var(--ease-out); }
.app-card:hover .app-card__go svg { transform: translateX(3px); }
.badge-featured {
  position: absolute; top: -0.6rem; right: 0.9rem; z-index: 2;
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-xs); color: var(--color-on-accent);
  background: var(--color-accent-strong); padding: 0.2rem 0.6rem; border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
}

/* Featured rail — larger cards */
.featured-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr)); gap: var(--space-md); }
.featured-grid .app-card { flex-direction: column; text-align: left; }
.featured-grid .app-card__icon { width: 84px; height: 84px; }

/* Empty state for search */
.empty { display: none; padding: var(--space-2xl) var(--space-md); text-align: center; color: var(--color-muted); }
.empty.is-shown { display: block; }
.empty__icon { width: 76px; height: 76px; border-radius: 20px; object-fit: cover; margin: 0 auto var(--space-sm); box-shadow: var(--shadow-card); }

.result-count { font-size: var(--text-sm); color: var(--color-muted); margin-bottom: var(--space-md); }
.result-count b { color: var(--color-ink); font-variant-numeric: tabular-nums; }

/* ============ About / CTA ============ */
.about__card {
  background: var(--color-card); border: 1.5px solid var(--color-rule);
  border-radius: var(--radius-xl); padding: clamp(1.5rem, 4vw, var(--space-2xl));
  display: grid; gap: var(--space-lg); grid-template-columns: 1.4fr 1fr; align-items: center;
}
.about__title { font-size: var(--text-xl); }
.about__text { margin-top: var(--space-sm); color: var(--color-body); max-width: 48ch; }
.about__list { margin-top: var(--space-md); display: grid; gap: 0.5rem; }
.about__list li { display: flex; gap: 0.6em; align-items: flex-start; font-size: var(--text-sm); color: var(--color-body); }
.about__list li::before {
  content: ""; flex: none; width: 1.15rem; height: 1.15rem; margin-top: 0.15em;
  border-radius: 5px; background: url("/assets/brand/icon-48.png") center/cover no-repeat;
}
.about__aside { background: var(--color-paper-2); border-radius: var(--radius-lg); padding: var(--space-lg); }
.about__aside h3 { font-size: var(--text-md); margin-bottom: var(--space-xs); }
.about__aside a { color: var(--color-accent-ink); font-weight: 700; }
.about__aside a:hover { text-decoration: underline; }
@media (max-width: 760px) { .about__card { grid-template-columns: 1fr; } }

/* ============ Footer (Ft5 Statement) ============ */
.footer { border-top: 1px solid var(--color-rule); background: var(--color-paper-2); padding-block: var(--space-2xl); }
.footer__statement { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); color: var(--color-ink); max-width: 24ch; }
.footer__row { margin-top: var(--space-lg); display: flex; flex-wrap: wrap; gap: var(--space-md) var(--space-xl); align-items: center; justify-content: space-between; }
.footer__links { display: flex; flex-wrap: wrap; gap: var(--space-md); }
.footer__links a { font-size: var(--text-sm); color: var(--color-muted); }
.footer__links a:hover { color: var(--color-accent-ink); }
.footer__copy { font-size: var(--text-xs); color: var(--color-muted); }

/* ============ App detail page ============ */
.btn--lg { font-size: var(--text-md); padding: 0.85em 1.5em; }
#main > .wrap { padding-top: clamp(1.25rem, 4vw, 2.25rem); }

.breadcrumb { font-size: var(--text-sm); color: var(--color-muted); display: flex; flex-wrap: wrap; gap: 0.4em; align-items: center; margin-bottom: var(--space-lg); }
.breadcrumb a { color: var(--color-muted); }
.breadcrumb a:hover { color: var(--color-accent-ink); text-decoration: underline; }
.breadcrumb span[aria-current] { color: var(--color-ink); font-weight: 500; }

.detail-hero { display: flex; gap: clamp(1.25rem, 4vw, var(--space-xl)); align-items: flex-start; padding-bottom: var(--space-xl); border-bottom: 1px solid var(--color-rule); }
.detail-hero__icon { flex: none; width: clamp(96px, 22vw, 132px); }
.detail-hero__icon img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 26px; box-shadow: var(--shadow-lift); }
.detail-hero__body { min-width: 0; }
.detail-hero__cat { margin-bottom: var(--space-sm); }
.detail-hero h1 { font-size: clamp(1.75rem, 4.5vw + 0.5rem, var(--text-2xl)); }
.detail-hero__lead { margin-top: var(--space-sm); font-size: var(--text-md); color: var(--color-body); max-width: 46ch; line-height: 1.7; }
.detail-cta { margin-top: var(--space-lg); display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.detail-cta__note { margin-top: var(--space-sm); font-size: var(--text-sm); color: var(--color-muted); }

.detail-body { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(1.5rem, 5vw, var(--space-2xl)); padding-block: var(--space-xl); align-items: start; }
.detail-prose h2 { font-size: var(--text-lg); margin-bottom: var(--space-sm); }
.detail-prose p { color: var(--color-body); max-width: 62ch; line-height: 1.8; }
.detail-facts { background: var(--color-paper-2); border: 1px solid var(--color-rule); border-radius: var(--radius-lg); padding: var(--space-lg); }
.detail-facts dl { display: grid; gap: 0.85rem; margin: 0; }
.detail-facts dl > div { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 0.85rem; border-bottom: 1px solid var(--color-rule); }
.detail-facts dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.detail-facts dt { color: var(--color-muted); font-size: var(--text-sm); }
.detail-facts dd { margin: 0; font-weight: 500; color: var(--color-ink); font-size: var(--text-sm); }
.detail-facts dd a { color: var(--color-accent-ink); font-weight: 700; }
.detail-facts dd a:hover { text-decoration: underline; }
.detail-back { padding-block: var(--space-md) var(--space-2xl); }
.detail-back a { color: var(--color-accent-ink); font-weight: 700; font-size: var(--text-sm); }
.detail-back a:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .detail-body { grid-template-columns: 1fr; }
  .detail-cta .btn { width: 100%; }
}
/* スマホではアイコンを上に積み、長いアプリ名にも全幅を使わせる */
@media (max-width: 560px) {
  .detail-hero { flex-direction: column; gap: var(--space-md); }
  .detail-hero__icon { width: 88px; }
  .detail-hero__lead { max-width: none; }
}

/* ============ Reveal animation ============ */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ============ Responsive ============ */
@media (max-width: 520px) {
  .hero__stats { gap: var(--space-md) var(--space-xl); }
  .app-card { padding: var(--space-sm) var(--space-md); }
  .app-card__icon { width: 60px; height: 60px; border-radius: 15px; }
}
