/* Nine Lives Code – "App Shelf" theme. Light first, night mode via [data-theme="night"]. */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url(/fonts/bricolage-grotesque-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

:root {
  color-scheme: light;
  --bg: #fbfbf9;
  --surface: #f1f3ef;
  --ink: #14181d;
  --muted: #59616a;
  --line: #e1e4de;
  --accent: #0a7279;
  --cta: #14181d;
  --cta-ink: #fbfbf9;
  --f-display: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --f-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  --f-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #13171c;
  --surface: #1b2027;
  --ink: #eef0ec;
  --muted: #a0a8b1;
  --line: #2a3139;
  --accent: #5fd3d8;
  --cta: #eef0ec;
  --cta-ink: #13171c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #13171c; --surface: #1b2027; --ink: #eef0ec; --muted: #a0a8b1;
    --line: #2a3139; --accent: #5fd3d8; --cta: #eef0ec; --cta-ink: #13171c;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--f-body); }
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.12; letter-spacing: -.02em; text-wrap: balance; margin: 0; }
[lang="ja"] h1, [lang="ja"] h2, [lang="ja"] h3 { letter-spacing: 0; line-height: 1.35; }

.wrap { max-width: 920px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }

/* Header */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-block: 18px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font: 800 17px var(--f-display); text-decoration: none; white-space: nowrap; }
.brand img { width: 28px; height: 28px; image-rendering: pixelated; }
.nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.theme-toggle { min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }

/* Home */
.hero { padding-block: 40px 30px; }
.hero h1 { max-width: 16em; font-size: clamp(32px, 5.4vw, 50px); font-weight: 800; }
[lang="ja"] .hero h1 { font-size: clamp(26px, 4.4vw, 40px); }
.hero p { max-width: 46ch; margin: 14px 0 0; color: var(--muted); font-size: 18px; }
.section { padding-block: 26px; }
.section > h2 { font-size: 22px; margin-bottom: 8px; }
.app-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.app-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding-block: 18px; border-bottom: 1px solid var(--line); }
.app-row img { width: 72px; height: 72px; border-radius: 17px; }
.app-row h3 { font-size: 19px; font-weight: 700; }
.app-row h3 a { color: var(--ink); text-decoration: none; }
.app-row h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.app-row p { margin: 2px 0 7px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 1px 9px; border-radius: 99px; background: var(--surface); color: var(--muted); font-size: 12px; }
.get { display: inline-flex; align-items: center; min-height: 36px; padding: 0 18px; border-radius: 99px; background: var(--cta); color: var(--cta-ink); font-size: 14px; font-weight: 700; text-decoration: none; }
.get:hover { opacity: .88; }
.about p { max-width: 64ch; margin: 0; color: var(--muted); }
.about p + p { margin-top: 12px; }

/* Breadcrumb */
.crumbs { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; }
.crumbs a { color: var(--muted); }

/* App detail */
.app-head { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 24px; align-items: center; padding-block: 26px 10px; }
.app-head > img { width: 128px; height: 128px; border-radius: 28px; }
.eyebrow { margin-bottom: 6px; color: var(--accent); font: 700 12px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; }
.app-head h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 800; }
.app-head p { margin: 8px 0 0; color: var(--muted); font-size: 17px; max-width: 52ch; }
.store-links { display: flex; flex-wrap: wrap; gap: 10px; padding-block: 18px 8px; }
.store-link { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 12px; background: var(--cta); color: var(--cta-ink); font-size: 14px; font-weight: 700; text-decoration: none; }
.store-link + .store-link { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.store-link:hover { opacity: .88; }
.store-link svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.content { display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; padding-block: 26px 10px; }
.content > * { min-width: 0; }
.content h2 { font-size: 22px; margin-bottom: 10px; }
.content p { margin: 0; max-width: 66ch; }
.content p + p { margin-top: 12px; }
.features { margin: 0; padding-left: 20px; max-width: 66ch; }
.features li + li { margin-top: 6px; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; margin: 0; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.faq { margin: 0; display: grid; gap: 16px; max-width: 66ch; }
.faq dt { font-weight: 700; }
.faq dd { margin: 4px 0 0; color: var(--muted); }
.shots { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.shots img { width: 220px; height: auto; aspect-ratio: 540 / 960; border-radius: 14px; scroll-snap-align: start; flex: none; background: var(--surface); }
.video { position: relative; width: 100%; max-width: 300px; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: var(--surface); }
.video button { all: unset; position: absolute; inset: 0; cursor: pointer; display: grid; place-items: center; }
.video button img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video button span { position: relative; width: 64px; height: 64px; border-radius: 50%; background: rgba(0, 0, 0, .72); color: #fff; display: grid; place-items: center; font-size: 24px; }
.video button:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.card > * + * { margin-top: 12px; }
.card audio { display: block; width: 100%; }
.card pre { margin: 12px 0 0; white-space: pre-wrap; font: 13px/1.55 var(--f-mono); }
.btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; }
.help { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; }
.more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.more a { display: flex; align-items: center; gap: 12px; height: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; line-height: 1.3; }
.more a:hover { border-color: var(--muted); }
.more img { width: 44px; height: 44px; border-radius: 11px; flex: none; }

/* Long-form pages (support, privacy, terms) */
.prose { max-width: 720px; padding-block: 28px 20px; }
.prose h1 { font-size: clamp(30px, 5vw, 42px); font-weight: 800; margin-bottom: 8px; }
.prose h2 { font-size: 21px; margin: 36px 0 12px; }
.prose h3 { font-size: 17px; margin: 22px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 4px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.prose code { font: 14px var(--f-mono); }
.prose .subtitle { color: var(--muted); font-size: 18px; }
.prose .meta-info { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.prose .meta-info p { margin: 0; }
.prose .contact-section, .prose .highlight-box, .prose .warning-box, .prose .faq-item { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin: 0 0 12px; }
.prose .warning-box { border-color: var(--accent); }
.prose .contact-section > :last-child, .prose .highlight-box > :last-child, .prose .warning-box > :last-child, .prose .faq-item > :last-child { margin-bottom: 0; }
.prose .contact-item + .contact-item { margin-top: 14px; }
.prose .contact-item strong { display: block; }
.prose .contact-item p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.prose .faq-question { font-weight: 700; margin-bottom: 6px; }
.prose .faq-answer ul { margin: 6px 0 0; }
.prose .button { display: inline-flex; align-items: center; min-height: 42px; margin: 4px 8px 4px 0; padding: 0 16px; border-radius: 10px; background: var(--cta); color: var(--cta-ink); font-weight: 700; text-decoration: none; }

/* Footer */
.site-footer { margin-top: 40px; padding-block: 24px 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 10px; padding: 0; list-style: none; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer p { margin: 0; }

@media (max-width: 640px) {
  .hero { padding-block: 26px 18px; }
  .hero p { font-size: 16px; }
  .app-row { grid-template-columns: 56px minmax(0, 1fr); gap: 14px; }
  .app-row img { width: 56px; height: 56px; border-radius: 13px; }
  .app-row .get { grid-column: 2; justify-self: start; }
  .app-head { grid-template-columns: 84px minmax(0, 1fr); gap: 16px; }
  .app-head > img { width: 84px; height: 84px; border-radius: 19px; }
  .app-head p { font-size: 15px; }
  .more { grid-template-columns: 1fr; }
  .shots img { width: 180px; }
  .store-link { flex: 1 1 220px; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
