:root {
  --bg: #0e0d12;
  --bg-2: #17151d;
  --line: #2a2733;
  --text: #f3f0f7;
  --muted: #a7a1b3;
  --pink: #ff5a7a;
  --gold: #f2c14e;
  --radius: 14px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Zen Kaku Gothic New", system-ui, sans-serif;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 900; text-decoration: none; letter-spacing: .08em; }
.nav nav { display: flex; gap: clamp(14px, 3vw, 28px); }
.nav nav a { font-family: Inter, sans-serif; font-size: 14px; text-decoration: none; color: var(--muted); }
.nav nav a:hover { color: var(--text); }

/* hero */
.hero { position: relative; overflow: hidden; min-height: 78vh; display: grid; place-items: center start; }
.hero-bg { position: absolute; inset: 0; background: #000; }
.hero-media {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: brightness(.55);
}
/* 黒いドット柄＋文字側と下端を暗くするグラデーション */
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle, rgba(0,0,0,.75) 1.1px, transparent 1.6px) 0 0 / 4px 4px,
    linear-gradient(90deg, rgba(14,13,18,.85) 15%, rgba(14,13,18,.35) 60%, rgba(14,13,18,.15)),
    linear-gradient(0deg, var(--bg) 0%, transparent 35%);
}
.hero-inner { position: relative; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.eyebrow { font-family: Inter, sans-serif; color: var(--pink); letter-spacing: .12em; font-size: 14px; margin: 0; }
.hero h1 { font-size: clamp(56px, 12vw, 132px); line-height: 1.05; margin: .1em 0 .2em; font-weight: 900; letter-spacing: .02em; }
.message {
  font-size: clamp(24px, 4.2vw, 44px); font-weight: 900; line-height: 1.4; margin: 0 0 16px;
  letter-spacing: .02em; text-shadow: 0 2px 16px rgba(0,0,0,.6);
}
.lead { max-width: 34em; color: var(--muted); font-size: clamp(15px, 1.8vw, 18px); margin: 0 0 28px; white-space: pre-line; }
.links { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  font-family: Inter, sans-serif; font-weight: 800; font-size: 14px; text-decoration: none;
  padding: 10px 22px; border-radius: 999px; border: 1px solid var(--text);
  transition: background .2s, color .2s;
}
.btn:first-child { background: var(--text); color: var(--bg); }
.btn:hover { background: var(--pink); border-color: var(--pink); color: #fff; }

/* sections */
.section { max-width: var(--max); margin: 0 auto; padding: 96px clamp(16px, 4vw, 40px) 24px; }
.section-title { font-size: 15px; color: var(--muted); font-weight: 700; margin: 0 0 40px; display: flex; align-items: baseline; gap: 14px; }
.section-title span { font-family: Inter, sans-serif; font-weight: 800; font-size: clamp(36px, 6vw, 56px); color: var(--text); letter-spacing: -.01em; }
.section-title small { font-size: inherit; }
.works-note { margin: -28px 0 32px; font-size: 13px; color: var(--muted); }

/* 多言語：訳した題名の下に添える日本語の原題 */
.orig { display: block; margin-top: 2px; font-size: .78em; font-weight: 400; line-height: 1.5; color: var(--muted); }
.work-title .orig { font-size: 14px; font-weight: 700; margin-top: 6px; }
.short figcaption .orig { font-size: 11px; opacity: .8; }
/* 日本語以外のときは、その言語の文字が出るフォントを優先（原題は日本語のフォント） */
.orig:lang(ja) { font-family: "Zen Kaku Gothic New", system-ui, sans-serif; }
html:lang(ko) body { font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif; }
html:lang(zh-Hans) body { font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif; }
html:lang(zh-Hant) body { font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif; }

/* 言語の切り替え（地球のアイコン + 短い表記。上に透明な select を重ねる） */
.lang {
  position: relative; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font: 700 13px/1.4 Inter, sans-serif; cursor: pointer;
}
.lang:hover, .lang:focus-within { color: var(--text); border-color: var(--muted); }
.lang svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.lang select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.lang:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.nav nav { align-items: center; }

/* works */
.work { padding: 40px 0 56px; border-top: 1px solid var(--line); }
.work-head { display: flex; gap: 20px; align-items: flex-end; margin-bottom: 24px; }
.work-no { font-family: Inter, sans-serif; font-weight: 800; font-size: 48px; line-height: 1; color: var(--accent); margin: 0; }
.work-kind { margin: 0; font-size: 13px; color: var(--muted); }
.work-title { margin: 0; font-size: clamp(24px, 3.6vw, 36px); line-height: 1.3; font-weight: 900; }
.work-body { display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; align-items: start; }
.cap { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; margin: 10px 2px 0; }
.synopsis { margin: 0 0 18px; }
.tags { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-family: Inter, sans-serif; font-size: 12px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); }
.more-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.more { color: var(--accent, var(--pink)); text-decoration: none; font-weight: 700; font-size: 14px; }
.more:hover { text-decoration: underline; }

.shorts-label { font-family: Inter, sans-serif; font-weight: 800; font-size: 13px; letter-spacing: .1em; color: var(--muted); margin: 36px 0 12px; }
.shorts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.short { margin: 0; scroll-snap-align: start; }
.short figcaption { font-size: 12px; line-height: 1.5; color: var(--muted); margin-top: 8px; }

/* 自作アプリ */
.app-video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); background: #000; }
/* 機能一覧（左）と画面写真（右） */
.app-detail { display: grid; grid-template-columns: 1fr 1.15fr; gap: 24px; align-items: start; }
.app-detail .features { grid-template-columns: 1fr 1fr; }
.app-fig { margin: 0; }
.app-shot {
  display: block; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.app-shot img { width: 100%; height: auto; transition: transform .4s; }
.app-shot:hover img { transform: scale(1.01); }
.features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.features li { padding: 18px 20px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); }
.features h4 { margin: 0 0 6px; font-size: 15px; color: var(--accent); }
.features p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--muted); }

/* lite YouTube */
.yt {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  border: 0; padding: 0; margin: 0; cursor: pointer; overflow: hidden;
  border-radius: var(--radius); background: #000;
}
.yt-v { aspect-ratio: 9 / 16; }
.yt img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s, opacity .3s; opacity: .92; }
.yt:hover img { transform: scale(1.03); opacity: 1; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; translate: -50% -50%;
  border-radius: 50%; background: color-mix(in srgb, var(--accent, var(--pink)) 90%, transparent);
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
.yt-v .play { width: 48px; height: 48px; }
.play::after {
  content: ""; position: absolute; left: 54%; top: 50%; translate: -50% -50%;
  border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent #fff;
}
.yt:focus-visible { outline: 3px solid var(--accent, var(--pink)); outline-offset: 3px; }

/* X */
.xgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

/* about */
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.about h3 { margin: 0 0 8px; font-size: 18px; }
.about p { margin: 0; color: var(--muted); }

/* contact */
.contact-lead { color: var(--muted); margin: -20px 0 28px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; max-width: 760px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
.form .wide { grid-column: 1 / -1; }
.form input, .form select, .form textarea {
  font: inherit; font-weight: 400; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--pink); outline-offset: 1px; border-color: transparent; }
.form-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form .turnstile { min-height: 65px; }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { margin: 0; color: var(--muted); font-size: 13px; }
.btn-solid { cursor: pointer; background: var(--pink); border-color: var(--pink); color: #fff; }
.btn-solid:disabled { cursor: not-allowed; opacity: .45; }

/* ミニゲーム「鳩とばし」：ヒーローの映像と文字のあいだに重ねる */
.game { position: absolute; inset: 0; z-index: 1; pointer-events: none; user-select: none; -webkit-user-select: none; }
.game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.hero-inner { z-index: 2; pointer-events: none; transition: opacity .4s, visibility .4s; }
.hero-inner a, .hero-inner button { pointer-events: auto; }
.hero.is-playing .hero-inner { opacity: 0; visibility: hidden; }
/* 鳩の上に置く透明なつかみ手（ここだけ触れる。ほかの場所ではページを普通にスクロールできる） */
.game-grab {
  position: absolute; z-index: 3; pointer-events: auto; touch-action: none; cursor: grab;
  padding: 0; border: 0; border-radius: 50%; background: transparent;
}
.game-grab:active { cursor: grabbing; }
.game-grab:focus-visible { outline: 2px dashed var(--gold); outline-offset: 2px; }
.game-hint {
  position: absolute; z-index: 3; margin: 0; translate: 0 -50%; padding: 4px 12px; white-space: nowrap;
  font-size: 13px; font-weight: 700; line-height: 1.5; text-align: left; color: var(--text);
  background: rgba(14,13,18,.7); border: 1px solid rgba(242,193,78,.6); border-radius: 999px;
  opacity: 0; transition: opacity .3s; animation: hato-bob 1.4s ease-in-out infinite;
}
.game.is-ready .game-hint { opacity: 1; }
.game-best { display: block; font-family: Inter, sans-serif; font-size: 11px; color: var(--gold); }
.game-best:empty { display: none; }
@keyframes hato-bob { 50% { transform: translateY(-4px); } }
.game-dist {
  position: absolute; z-index: 3; top: 16px; left: 50%; translate: -50% 0; margin: 0;
  font-family: Inter, monospace; font-weight: 800; font-size: clamp(26px, 4vw, 40px); text-shadow: 0 2px 0 #000; text-align: center;
  opacity: 0; transition: opacity .3s;
}
.game.is-playing .game-dist { opacity: 1; }
/* 飛んでいるあいだはヒーロー全体でタップを受けてジャンプ（スクロールはそのままできる） */
.game.is-playing { pointer-events: auto; cursor: pointer; }
/* 「タップで 1 回ジャンプ」のアイコン。鳩の右上についていく（位置は game.js が毎フレーム決める） */
.game-jump {
  position: absolute; z-index: 3; left: 0; top: 0; display: flex; align-items: center; gap: 12px;
  pointer-events: none; transform-origin: 20px 50%; transition: opacity .25s, scale .25s; will-change: transform;
}
.game-jump-icon {
  position: relative; flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(14,13,18,.82); border: 2px solid var(--gold); box-shadow: 0 2px 0 #000;
}
.game-jump-label {
  padding: 3px 10px; white-space: nowrap; font-size: 12px; font-weight: 700; line-height: 1.5; color: var(--text);
  background: rgba(14,13,18,.82); border: 1px solid rgba(242,193,78,.6); border-radius: 999px; box-shadow: 0 2px 0 #000;
}
.game-jump svg { width: 22px; height: 24px; image-rendering: pixelated; animation: hato-tap .8s ease-in-out infinite; }
/* 押しているように見える波紋 */
.game-jump-icon::before {
  content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--gold);
  animation: hato-ripple .8s ease-out infinite;
}
/* 残り回数 */
.game-jump-icon::after {
  content: "×1"; position: absolute; right: -10px; bottom: -6px; padding: 0 4px;
  font: 800 11px/1.4 Inter, sans-serif; color: #000; background: var(--gold); border-radius: 999px;
}
@keyframes hato-tap { 50% { transform: translateY(3px) scale(.92); } }
@keyframes hato-ripple { from { opacity: .9; scale: 1; } to { opacity: 0; scale: 1.6; } }
.game.is-jumped .game-jump, .game:not(.is-flying) .game-jump { opacity: 0; scale: .6; }
@media (prefers-reduced-motion: reduce) { .game-jump svg, .game-jump-icon::before { animation: none; } }
.game-result {
  position: absolute; z-index: 3; left: 50%; top: 50%; translate: -50% -50%; width: min(320px, calc(100% - 32px));
  padding: 20px 20px 22px; text-align: center; pointer-events: auto;
  background: rgba(14,13,18,.92); border: 3px solid var(--gold); border-radius: 6px; box-shadow: 0 6px 0 #000;
}
.game-result[hidden] { display: none; }
.game-result p { margin: 0; }
.game-result-img { width: 49px; height: 56px; margin: -44px auto 4px; image-rendering: pixelated; }
.game-result-label { font-size: 13px; color: var(--muted); letter-spacing: .2em; }
.game-result-total { font-family: Inter, sans-serif; font-weight: 800; font-size: 48px; line-height: 1.1; }
.game-result-total small { font-size: 20px; }
.game-result-break { font-size: 13px; color: var(--muted); margin-top: 4px !important; }
.game-result-best { margin: 8px 0 14px !important; font-weight: 900; color: var(--gold); }
.game-result-best.is-best { color: var(--pink); animation: hato-blink .6s steps(2) 4; }
@keyframes hato-blink { 50% { opacity: .55; } }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 80px 16px 40px; }

@media (max-width: 820px) {
  .work-body, .about-grid, .form { grid-template-columns: 1fr; }
  .shorts { grid-auto-columns: 42%; }
  .features, .app-detail, .app-detail .features { grid-template-columns: 1fr; }
  .hero { min-height: 70vh; }
  .hero-inner { padding-bottom: 120px; } /* 中央下の鳩とボタンが重ならないように */
  .hero-bg::after {
    background:
      radial-gradient(circle, rgba(0,0,0,.75) 1.1px, transparent 1.6px) 0 0 / 4px 4px,
      linear-gradient(0deg, var(--bg) 8%, rgba(14,13,18,.6) 55%, rgba(14,13,18,.35));
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .yt img { transition: none; }
  .game-hint, .game-result-best.is-best { animation: none; }
  .hero-inner { transition: none; }
}
