/* PicoPiLab — 共通スタイル
   ブランドの紫と「Pico＝いちばん小さな単位（ドット）」を軸にする。
   重さの目安: この CSS と app.js を合わせて 30KB 未満。大きなライブラリは使わない（hp 担当の「軽量最優先」ルール）。
   色の組み合わせはすべて WCAG AA（本文 4.5:1 以上）を満たす値にしてある。変えるときは tools/check_site.js で確認する。 */

:root {
  --bg: #0f0d1a;
  --bg-2: #15122a;
  --surface: #1b1832;
  --surface-2: #231f3d;
  --line: rgba(236, 232, 255, .1);
  --line-strong: rgba(236, 232, 255, .2);
  --text: #f4f2ff;
  --muted: #b4b0d2;
  --faint: #8d88b3;
  --brand: #6352e0;       /* ボタンの地。白文字で 5.5:1 */
  --brand-hover: #5443cf; /* 乗せると少し沈む。白文字で 6.7:1 */
  --brand-hi: #ab9fff;    /* 濃い背景の上の文字・リンク・フォーカス */
  --accent: var(--brand-hi);
  --ink: #120f1f;         /* 明るい地の上の文字 */
  --radius: 18px;
  --radius-sm: 10px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1200px;
  --display: "Unbounded", "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", system-ui, sans-serif;
  --body: "Hiragino Sans", "Yu Gothic UI", "Segoe UI", "Noto Sans JP", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

/* ---- 基本 ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, picture, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--brand-hi); text-underline-offset: .2em; }
p { margin: 0; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; text-wrap: balance; word-break: auto-phrase; }
ul, ol, dl, dd { margin: 0; padding: 0; }
::selection { background: var(--brand); color: #fff; }
:focus-visible { outline: 3px solid var(--brand-hi); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* 日本語・英語の出し分け（JS が無いときは日本語） */
:root:not([data-lang="en"]) [lang="en"]:not(html),
:root[data-lang="en"] [lang="ja"]:not(html) { display: none !important; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--text); color: var(--ink); padding: 10px 16px; border-radius: 10px; font-weight: 700; text-decoration: none; transition: top .2s; }
.skip:focus { top: 12px; }

.eyebrow { font-family: var(--display); font-size: .75rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); display: flex; gap: .7em; align-items: center; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent); flex: none; }
.eyebrow .count, .eyebrow .num { color: var(--accent); }

/* ---- ヘッダー ---- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(15, 13, 26, .72); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.site-header.scrolled { border-bottom-color: var(--line); }
.bar { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; margin-right: auto; }
.logo-mark { width: 34px; height: 34px; transition: transform .5s var(--ease); }
.brand:hover .logo-mark { transform: rotate(-8deg) scale(1.06); }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.brand-name b { color: var(--brand-hi); font-weight: 700; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 600; padding: 8px 12px; border-radius: 999px; transition: color .2s, background .2s; }
.nav a:hover { color: var(--text); background: var(--surface); }
.lang { display: inline-flex; align-items: center; gap: 2px; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--faint); font: 600 .78rem var(--display); letter-spacing: .06em; cursor: pointer; transition: border-color .2s; }
.lang:hover { border-color: var(--brand-hi); }
.lang-sep { opacity: .5; padding: 0 2px; }
:root:not([data-lang="en"]) .lang-opt[data-l="ja"], :root[data-lang="en"] .lang-opt[data-l="en"] { color: var(--text); }
@media (max-width: 560px) { .nav a:not(:last-child) { display: none; } .bar { gap: 8px; } }

/* ---- ボタン ---- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { --bg: transparent; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55em; min-height: 46px; padding: 10px 22px; border-radius: 999px; font-weight: 700; font-size: .95rem; line-height: 1.2; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .25s var(--ease), background .25s, border-color .25s, color .25s, box-shadow .25s; }
.btn:active { transform: scale(.97); }
.btn-lg { min-height: 54px; padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 28px -10px rgba(99, 82, 224, .8); }
.btn-primary:hover { background: var(--brand-hover); transform: translateY(-2px); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); background: rgba(255, 255, 255, .04); }
/* ゲームごとの色のボタン（明るい地に濃い文字） */
.game .btn-primary, .game-page .btn-primary { background: var(--accent); color: var(--ink); box-shadow: 0 10px 30px -12px var(--accent); }
.game .btn-primary:hover, .game-page .btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, #fff); }

/* ---- ヒーロー ---- */
.hero { position: relative; min-height: min(92svh, 860px); display: grid; align-items: center; padding: 72px 0 96px; isolation: isolate; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; touch-action: pan-y; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(60% 70% at 18% 45%, rgba(15, 13, 26, .9), rgba(15, 13, 26, 0) 70%); }
.hero-inner { display: grid; gap: 26px; }
.hero-title { font-family: var(--display); font-weight: 700; font-size: clamp(2.6rem, 4.9vw, 5.2rem); line-height: 1.02; letter-spacing: -.035em; }
:root:not([data-lang="en"]) .hero-title { font-size: clamp(2.5rem, 4.8vw, 4.8rem); letter-spacing: -.02em; line-height: 1.14; }
/* 広い画面は右にロジック盤、狭い画面は下にロジック盤を置くので、文字の幅と余白をそれに合わせる */
@media (min-width: 900px) { .hero-inner > * { max-width: 56%; } }
@media (max-width: 899px) { .hero { min-height: 0; padding: 48px 0 330px; align-items: start; } }
.hero-title .line { display: block; }
.hero-title .line:last-child { background: linear-gradient(92deg, #c7bfff 0%, #8f7fff 45%, #ff9a7a 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 34em; }
.hero-hint { display: flex; align-items: center; gap: .6em; font-size: .8rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.hint-dot { width: 8px; height: 8px; border-radius: 2px; background: #ff9a7a; animation: blink 1.6s steps(2, end) infinite; }
@keyframes blink { 50% { opacity: .2; } }
@media (hover: none) { .hero-hint { display: none; } }

/* ---- 流れる帯 ---- */
.marquee { border-block: 1px solid var(--line); overflow: hidden; background: var(--bg-2); }
.marquee-track { display: flex; width: max-content; list-style: none; align-items: center; gap: 28px; padding: 16px 14px; font-family: var(--display); font-weight: 500; font-size: clamp(.9rem, 1.6vw, 1.15rem); letter-spacing: .02em; color: var(--muted); animation: marquee 38s linear infinite; }
.marquee-track .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--brand-hi); }
.marquee-track .dot:nth-child(4n) { background: #ff9a7a; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---- セクション ---- */
.section { padding: clamp(72px, 11vw, 140px) 0; }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-title { font-family: var(--display); font-size: clamp(1.8rem, 4.4vw, 3.4rem); letter-spacing: -.03em; line-height: 1.12; }
:root:not([data-lang="en"]) .section-title { letter-spacing: -.01em; line-height: 1.3; }

/* ---- ゲーム一覧 ---- */
.games { display: grid; gap: clamp(56px, 9vw, 120px); }
.game { display: grid; gap: clamp(20px, 3vw, 40px); align-items: center; }
@media (min-width: 860px) {
  .game { grid-template-columns: 1.25fr 1fr; }
  .game:nth-child(even) .game-media { order: 2; }
}
.game-media { position: relative; display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); aspect-ratio: 16 / 9; isolation: isolate; }
.game-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease), filter .6s; }
.game-media::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(var(--bg) 1px, transparent 1px), linear-gradient(90deg, var(--bg) 1px, transparent 1px); background-size: 8px 8px; opacity: 0; transition: opacity .5s; mix-blend-mode: multiply; }
.game-play-chip { position: absolute; left: 16px; bottom: 16px; padding: 8px 14px; border-radius: 999px; background: var(--accent); color: var(--ink); font-weight: 700; font-size: .85rem; transform: translateY(12px); opacity: 0; transition: transform .45s var(--ease), opacity .3s; }
.game:hover .game-media img, .game:focus-within .game-media img { transform: scale(1.045); }
.game:hover .game-media::after { opacity: .35; }
.game:hover .game-play-chip, .game:focus-within .game-play-chip { transform: none; opacity: 1; }
.game:hover .game-media { border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 30px 80px -40px var(--accent); }
.game-body { display: grid; gap: 14px; justify-items: start; }
.game-index { display: flex; align-items: baseline; gap: 14px; font-size: .82rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.game-index .num { font-family: var(--display); font-size: 1rem; color: var(--accent); }
.game-title { font-family: var(--display); font-size: clamp(1.9rem, 3.8vw, 3rem); letter-spacing: -.03em; }
.game-title a { color: var(--text); text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 3px no-repeat; transition: background-size .5s var(--ease); }
.game-title a:hover { background-size: 100% 3px; }
.game-sub { color: var(--accent); font-weight: 700; font-size: .95rem; margin-top: -6px; }
.game-tagline { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--text); max-width: 26em; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: .8rem; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 12px; }
.game .actions { margin-top: 6px; }

/* ---- スタジオ ---- */
.studio { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%); border-top: 1px solid var(--line); }
.studio-grid { display: grid; gap: clamp(40px, 6vw, 80px); }
@media (min-width: 900px) { .studio-grid { grid-template-columns: 1fr 1.1fr; align-items: start; } }
.studio-lead { color: var(--muted); font-size: 1.05rem; margin-top: 22px; max-width: 32em; }
.principles { list-style: none; display: grid; gap: 14px; }
.principles li { position: relative; padding: 26px 26px 26px 88px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color .3s, transform .4s var(--ease); }
.principles li:hover { border-color: var(--line-strong); transform: translateX(4px); }
.principles h3 { font-size: 1.12rem; margin-bottom: 6px; }
.principles p { color: var(--muted); font-size: .95rem; }
.p-num { position: absolute; left: 26px; top: 26px; font-family: var(--display); font-weight: 700; color: var(--brand-hi); font-size: 1.05rem; }

/* ---- フッター ---- */
.site-footer { border-top: 1px solid var(--line); padding: clamp(64px, 9vw, 120px) 0 36px; background: var(--bg-2); }
.foot-cta { display: grid; gap: 16px; margin-bottom: clamp(56px, 8vw, 96px); }
.foot-big { font-family: var(--display); font-weight: 700; font-size: clamp(2.2rem, 9vw, 7.2rem); letter-spacing: -.045em; line-height: 1; color: var(--text); text-decoration: none; display: inline-flex; align-items: flex-start; gap: .1em; width: fit-content; transition: color .3s; }
.foot-big .arrow { font-size: .45em; color: var(--brand-hi); transition: transform .45s var(--ease); }
.foot-big:hover { color: var(--brand-hi); }
.foot-big:hover .arrow { transform: translate(6px, -6px); }
.foot-sub { color: var(--muted); }
.foot-row { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; padding-top: 24px; border-top: 1px solid var(--line); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot-links a { color: var(--text); text-decoration: none; font-weight: 600; font-size: .92rem; }
.foot-links a:hover { color: var(--brand-hi); }
.foot-copy { color: var(--faint); font-size: .82rem; }

/* ---- 紹介ページ ---- */
.crumb { padding-top: 20px; font-size: .82rem; }
.crumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; color: var(--faint); }
.crumb li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--text); text-decoration: underline; }
.gp-hero { display: grid; gap: clamp(28px, 4vw, 56px); padding-top: clamp(28px, 5vw, 64px); padding-bottom: clamp(40px, 6vw, 80px); align-items: center; }
@media (min-width: 960px) { .gp-hero { grid-template-columns: .9fr 1.2fr; } }
.gp-head { display: grid; gap: 16px; justify-items: start; }
.gp-title { font-family: var(--display); font-size: clamp(2.4rem, 6vw, 4.6rem); letter-spacing: -.04em; line-height: 1; }
.gp-sub { color: var(--accent); font-weight: 700; font-size: 1.05rem; margin-top: -4px; }
.gp-tagline { font-size: clamp(1.1rem, 1.8vw, 1.35rem); max-width: 22em; }
.gp-head .actions { margin-top: 8px; }
.gp-cover { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: 0 40px 120px -60px var(--accent); }
.gp-cover img { width: 100%; }
.gp-body { display: grid; gap: clamp(40px, 6vw, 72px); padding-bottom: clamp(56px, 8vw, 96px); }
@media (min-width: 960px) { .gp-body { grid-template-columns: 1.5fr 1fr; align-items: start; } .gp-side { position: sticky; top: 92px; } }
.gp-lead { font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.9; }
.h-small { font-family: var(--display); font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 44px 0 16px; font-weight: 500; }
:root:not([data-lang="en"]) .h-small { letter-spacing: .08em; font-size: .9rem; }
.feature-list { list-style: none; display: grid; gap: 12px; }
.feature-list li { position: relative; padding-left: 26px; color: var(--muted); }
.feature-list li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 9px; height: 9px; border-radius: 2px; background: var(--accent); }
.controls { display: grid; gap: 10px; }
.controls div { display: grid; grid-template-columns: 7em 1fr; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.controls dt { font-weight: 700; }
.controls dd { color: var(--muted); }
kbd { display: inline-block; min-width: 1.8em; padding: 1px 6px; margin: 0 2px; border-radius: 6px; border: 1px solid var(--line-strong); border-bottom-width: 3px; background: var(--surface-2); color: var(--text); font: 600 .8em/1.6 var(--display); text-align: center; }
.gp-side { display: grid; gap: 18px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.facts { display: grid; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--faint); font-size: .88rem; }
.facts dd { font-weight: 600; text-align: right; font-size: .92rem; }
.side-note, .side-tip { color: var(--muted); font-size: .86rem; }
.side-tip { padding-top: 14px; border-top: 1px dashed var(--line-strong); }
@media (max-width: 520px) { .controls div { grid-template-columns: 1fr; gap: 4px; } }

.pager { display: grid; gap: 12px; padding-bottom: clamp(64px, 9vw, 120px); }
@media (min-width: 720px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager-link { display: grid; gap: 6px; padding: 24px 26px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); background: var(--surface); transition: border-color .3s, transform .4s var(--ease); }
.pager-link.next { text-align: right; }
.pager-link:hover { border-color: var(--accent); transform: translateY(-3px); }
.pager-dir { font-size: .82rem; color: var(--faint); }
.pager-title { font-family: var(--display); font-weight: 700; font-size: clamp(1.2rem, 2.4vw, 1.6rem); letter-spacing: -.02em; }
.pager-link:hover .pager-title { color: var(--accent); }

/* ---- 404 ---- */
.nf { padding-top: clamp(64px, 12vw, 140px); padding-bottom: clamp(64px, 10vw, 120px); display: grid; gap: 22px; justify-items: start; }
.nf-code { font-family: var(--display); font-weight: 700; font-size: clamp(5rem, 22vw, 14rem); line-height: .9; letter-spacing: -.06em; background: repeating-linear-gradient(90deg, var(--brand-hi) 0 14px, transparent 14px 18px), repeating-linear-gradient(0deg, transparent 0 14px, var(--bg) 14px 18px); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nf p { color: var(--muted); max-width: 34em; }

/* ---- 出てくる動き（JS があるときだけ。動きを減らす設定では出さない） ---- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* ページ間の切り替え（対応ブラウザだけ。カバー画像が一覧から紹介ページへつながる） */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
  @view-transition { navigation: none; }
}
