:root {
  --paper: #f4efe6;
  --ink: #141414;
  --red: #ff4b2b;
  --blue: #2b59ff;
  --yellow: #ffc82b;
  --green: #19b37a;
  --muted: #6d675e;
  --display: "Dela Gothic One", "Zen Kaku Gothic New", sans-serif;
  --body: "Zen Kaku Gothic New", "Space Grotesk", sans-serif;
  --mono: "Space Grotesk", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
/* 斜めの帯がはみ出してスマホで横にずれないよう、横方向だけ切る */
html, body { overflow-x: clip; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.8;
  overflow-x: hidden;
}
/* うっすら方眼紙 */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(20,20,20,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,20,20,.05) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: -1;
}
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ===== cursor ===== */
.cursor {
  position: fixed; top: 0; left: 0;
  width: 28px; height: 28px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  transform: translate(-50%, -50%);
  transition: width .2s, height .2s, background .2s;
  mix-blend-mode: difference;
  border-color: #fff;
}
.cursor.is-hover { width: 64px; height: 64px; background: #fff; }
@media (hover: none) { .cursor { display: none; } }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 999; }

/* ===== nav ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px clamp(16px, 4vw, 48px);
  z-index: 50;
  mix-blend-mode: difference;
  color: #fff;
}
.nav__logo { font-family: var(--display); font-size: 24px; text-decoration: none; }
.nav__logo span { color: var(--red); }
.nav nav { display: flex; gap: clamp(12px, 3vw, 32px); font-family: var(--mono); font-weight: 700; }
.nav nav a { text-decoration: none; }
.nav nav a:hover { text-decoration: line-through; }
.nav nav { align-items: center; }
/* 言語切り替え */
.lang {
  display: inline-flex; gap: 2px;
  border: 2px solid currentColor; border-radius: 999px;
  background: none; padding: 2px; cursor: pointer;
  font-family: var(--mono); font-weight: 700; font-size: 13px;
}
.lang span { padding: 2px 9px; border-radius: 999px; }
html[lang="ja"] .lang [data-lang="ja"],
html[lang="en"] .lang [data-lang="en"] { background: #fff; color: #000; }
/* Home / Games のページ切り替え */
.nav__pages { display: inline-flex; gap: 4px; padding-left: clamp(8px, 2vw, 20px); border-left: 2px solid currentColor; }
.nav nav .nav__page { padding: 2px 10px; border-radius: 999px; }
.nav nav .nav__page[aria-current="page"] { background: #fff; color: #000; }
.nav nav .nav__page[aria-current="page"]:hover { text-decoration: none; }
/* 実績・効果音ボタン */
.icon-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 2px solid currentColor; border-radius: 999px;
  background: none; padding: 2px 10px; cursor: pointer;
  font-family: var(--mono); font-weight: 700; font-size: 13px; line-height: 1.6;
}
.icon-btn:hover { background: rgba(255,255,255,.15); }

/* ===== 実績パネル ===== */
.ach {
  margin: auto; width: min(560px, calc(100% - 32px)); max-height: min(720px, calc(100% - 32px));
  border: 2px solid var(--ink); border-radius: 16px;
  background: var(--paper); color: var(--ink);
  padding: 24px; box-shadow: 10px 10px 0 var(--ink);
  font-family: var(--body);
}
.ach[open] { animation: pop .35s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.ach::backdrop { background: rgba(20,20,20,.55); }
.ach__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.ach__head h2 { font-family: var(--display); font-weight: 400; font-size: 32px; }
.ach__head span { font-family: var(--mono); font-weight: 700; }
.ach__list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 20px; }
.ach__item {
  display: flex; gap: 12px; align-items: center;
  border: 2px dashed #b9b2a6; border-radius: 12px; padding: 10px 12px;
  color: var(--muted);
}
.ach__item.is-done { border: 2px solid var(--ink); background: var(--yellow); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.ach__icon { font-size: 26px; filter: grayscale(1); opacity: .5; }
.ach__item.is-done .ach__icon { filter: none; opacity: 1; }
.ach__item b { display: block; font-size: 14px; }
.ach__item small { display: block; font-size: 12px; line-height: 1.4; }

/* ===== hero ===== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 100px clamp(16px, 5vw, 64px) 80px;
  overflow: hidden;
}
.hero__hello { font-weight: 700; font-size: clamp(16px, 2vw, 22px); }
.hero__name {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(40px, 11.5vw, 190px);
  line-height: .95;
  letter-spacing: -.02em;
  margin: 12px 0 24px;
  user-select: none;
}
.hero__name .word { display: block; white-space: nowrap; }
.char {
  display: inline-block;
  cursor: grab;
  will-change: transform;
  transition: color .3s;
}
.char:nth-child(4n+1):hover { color: var(--red); }
.char:nth-child(4n+2):hover { color: var(--blue); }
.char:nth-child(4n+3):hover { color: var(--yellow); }
.char:nth-child(4n):hover   { color: var(--green); }
.char.spin { animation: spin .7s cubic-bezier(.3,1.6,.5,1); }
@keyframes spin { to { rotate: 360deg; } }

.hero__kana { font-family: var(--display); font-size: clamp(20px, 3vw, 36px); line-height: 1.2; margin: -8px 0 20px; }
.hero__kana span { font-family: var(--body); font-weight: 700; font-size: .55em; color: var(--muted); }
.hero__role { font-size: clamp(18px, 2.6vw, 32px); font-weight: 700; }
.hero__prefix { color: var(--muted); margin-right: .4em; }
.typed { background: var(--yellow); padding: 0 .2em; }
.caret { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero__tools { display: flex; align-items: center; gap: 16px; margin-top: 32px; flex-wrap: wrap; }
.pill {
  border: 2px solid var(--ink);
  background: var(--paper);
  border-radius: 999px;
  padding: 8px 20px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.pill:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.pill:active { transform: translate(4px,4px); box-shadow: 0 0 0 var(--ink); }
.pill.on { background: var(--ink); color: var(--paper); }
.hint { font-family: var(--mono); color: var(--muted); font-size: 14px; }
.hero__scroll {
  position: absolute; bottom: 24px; right: clamp(16px, 5vw, 64px);
  font-family: var(--mono); font-weight: 700; font-size: 12px;
  writing-mode: vertical-rl;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(8px); } }

/* ===== marquee ===== */
.marquee {
  background: var(--ink); color: var(--paper);
  overflow: hidden; white-space: nowrap;
  padding: 14px 0;
  rotate: -2deg; margin: 0 -20px;
  font-family: var(--display); font-size: clamp(20px, 3vw, 36px);
}
.marquee__track { display: inline-flex; animation: marquee 14s linear infinite; will-change: transform; backface-visibility: hidden; }
.marquee__track span { padding-right: 1ch; }
@keyframes marquee { from { transform: translate3d(0,0,0); } to { transform: translate3d(-50%,0,0); } }

/* ===== section ===== */
.section {
  padding: clamp(80px, 12vw, 160px) clamp(16px, 5vw, 64px);
  max-width: 1200px; margin: 0 auto;
}
.section__title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(40px, 8vw, 96px);
  line-height: 1;
  display: flex; align-items: flex-start; gap: 16px;
}
.section__title span {
  font-family: var(--mono); font-size: 16px;
  border: 2px solid var(--ink); border-radius: 999px;
  padding: 2px 10px; margin-top: 8px;
}
.section__lead { margin: 16px 0 48px; color: var(--muted); font-weight: 700; }
.muted { color: var(--muted); font-size: 14px; }
.block { display: block; }

/* ===== now ===== */
.now { list-style: none; border-top: 2px solid var(--ink); }
.now__item {
  display: grid; grid-template-columns: 7em 1fr; gap: 16px; align-items: baseline;
  padding: 20px 4px; border-bottom: 2px solid var(--ink);
  transition: background .2s, padding .2s;
}
.now__item:hover { background: var(--yellow); padding-left: 16px; }
.now__item time { font-family: var(--mono); font-weight: 700; color: var(--muted); }
.now__item p { font-size: clamp(16px, 2vw, 20px); font-weight: 700; }
@media (max-width: 560px) { .now__item { grid-template-columns: 1fr; gap: 2px; } }

.reveal { opacity: 0; transform: translateY(40px); transition: opacity .8s, transform .8s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ===== 名刺 ===== */
.bizcard {
  width: min(520px, 100%);
  aspect-ratio: 91 / 55;
  perspective: 1400px;
  margin: 0 auto;
  cursor: pointer;
  outline: none;
}
.bizcard__inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.3,1.4,.5,1);
}
.bizcard.flipped .bizcard__inner { transform: rotateY(180deg); }
.bizcard__face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 10px 10px 0 var(--ink);
  padding: 7%;
  display: flex; flex-direction: column; justify-content: center;
}
/* 中身（写真のマスクや z-index）が別レイヤーになって裏に透けないよう、子要素も裏面を隠す */
.bizcard__face * { -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.bizcard__front { transform: rotateY(0deg); }
.bizcard:focus-visible .bizcard__face { outline: 3px solid var(--blue); outline-offset: 4px; }
.bizcard__corner { position: absolute; top: 6%; left: 7%; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.bizcard__name { font-family: var(--display); font-size: clamp(26px, 6vw, 44px); line-height: 1.15; }
.bizcard__roman { font-family: var(--mono); font-weight: 700; letter-spacing: .1em; margin-top: 8px; }
.bizcard__role { font-size: 13px; color: var(--muted); }
.bizcard__front > :not(.bizcard__photo, .bizcard__stamp, .bizcard__corner) { position: relative; z-index: 1; }
.bizcard__photo {
  position: absolute; right: 4%; bottom: 0;
  height: 96%; width: auto;
  pointer-events: none;
  /* 元写真で切れている肩・胸元のフチを下に向かってぼかす */
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 92%);
          mask-image: linear-gradient(to bottom, #000 55%, transparent 92%);
}
.bizcard__stamp {
  position: absolute; right: 36%; bottom: 10%; z-index: 2;
  width: 56px; height: 56px;
  border: 3px solid var(--red); color: var(--red);
  border-radius: 8px;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 26px;
  rotate: -12deg; opacity: .85;
}
.bizcard__back {
  transform: rotateY(180deg);
  background: var(--red); color: #fff;
  align-items: center; text-align: center;
}
.bizcard__msg { font-family: var(--display); font-size: clamp(18px, 4vw, 28px); line-height: 1.4; }
.bizcard__msg small { font-family: var(--body); font-size: 14px; }
.flipcount { text-align: center; margin-top: 40px; font-family: var(--mono); color: var(--muted); }
.flipcount b { color: var(--ink); font-size: 1.4em; }

/* ===== about ===== */
.about { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; margin-top: 48px; align-items: start; }
.about__text p { font-size: clamp(17px, 2vw, 22px); margin-bottom: 20px; font-weight: 700; }
.about__text p.muted { font-size: 14px; font-weight: 400; }
.status {
  background: var(--ink); color: var(--paper);
  border-radius: 12px; padding: 24px;
  font-family: var(--mono);
  box-shadow: 8px 8px 0 var(--blue);
}
.status__head { display: flex; justify-content: space-between; font-weight: 700; border-bottom: 1px dashed #555; padding-bottom: 12px; margin-bottom: 16px; }
.status__list { list-style: none; display: grid; gap: 14px; }
.about__big { font-family: var(--display); font-size: clamp(80px, 14vw, 160px) !important; line-height: 1; margin-bottom: 8px !important; }
.about__big small { font-size: .3em; margin-left: .1em; }
.status__list li { display: grid; grid-template-columns: 7.5em 1fr 2em; align-items: center; gap: 12px; font-family: var(--body); font-weight: 700; font-size: 14px; }
.status__list i {
  height: 12px; border-radius: 3px; background: #333; position: relative; overflow: hidden;
}
.status__list i::after {
  content: ""; position: absolute; inset: 0;
  width: calc(var(--v) * 1%);
  background: repeating-linear-gradient(90deg, var(--green) 0 8px, #0f8a5c 8px 10px);
  transform: scaleX(0); transform-origin: left;
  transition: transform 1.4s cubic-bezier(.2,.8,.2,1);
}
.status.in .status__list i::after { transform: scaleX(1); }
.status__list b { font-family: var(--mono); text-align: right; }
.status__note { font-size: 11px; color: #999; margin-top: 16px; }

/* ===== works ===== */
.works { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.work {
  cursor: pointer;
  aspect-ratio: 4 / 5;
  border: 2px solid var(--ink); border-radius: 14px;
  background: var(--c);
  padding: 20px;
  display: flex; flex-direction: column; justify-content: flex-end;
  transition: transform .2s ease-out, box-shadow .2s;
  box-shadow: 6px 6px 0 var(--ink);
  transform-style: preserve-3d;
}
.work--red    { --c: var(--red); }
.work--blue   { --c: var(--blue); }
.work--yellow { --c: var(--yellow); }
.work--green  { --c: var(--green); }
.work__no { font-family: var(--display); font-size: 72px; line-height: 1; margin-bottom: auto; opacity: .9; }
.work h3 { font-family: var(--display); font-weight: 400; font-size: 24px; }
.work p { font-size: 13px; }

/* ===== contact ===== */
.contact__big { font-family: var(--display); font-size: clamp(64px, 16vw, 200px); line-height: .95; margin: 40px 0; }
.contact__hi { color: var(--red); display: inline-block; cursor: pointer; }
.contact__hi.wave { animation: wave .8s; }
@keyframes wave { 20%{rotate:-14deg} 40%{rotate:12deg} 60%{rotate:-8deg} 80%{rotate:5deg} }
.links { list-style: none; display: flex; flex-wrap: wrap; gap: 16px; }
.link {
  display: inline-block; text-decoration: none;
  font-family: var(--mono); font-weight: 700; font-size: 18px;
  border: 2px solid var(--ink); border-radius: 999px;
  padding: 10px 24px;
  background: var(--paper);
  transition: background .2s, color .2s;
}
.link:hover { background: var(--ink); color: var(--paper); }

/* ===== footer ===== */
.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 32px clamp(16px, 5vw, 64px);
  border-top: 2px solid var(--ink);
  font-family: var(--mono); font-size: 13px;
}
.footer__cta {
  flex-basis: 100%;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 360px)); gap: 16px;
  margin-bottom: 24px;
}
.cta {
  display: flex; flex-direction: column; gap: 2px;
  text-decoration: none; font-family: var(--body);
  border: 2px solid var(--ink); border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.cta small { font-weight: 700; font-size: 13px; opacity: .85; }
.cta b { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 3vw, 32px); line-height: 1.2; }
.cta[href]:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.cta[href]:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.cta--x { background: var(--ink); color: var(--paper); box-shadow: 6px 6px 0 var(--blue); }
.cta.is-soon { opacity: .5; cursor: default; }
.secret { color: transparent; transition: color .3s; }
.secret:hover { color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 32px;
  transform: translate(-50%, 120px);
  background: var(--ink); color: var(--paper);
  padding: 12px 24px; border-radius: 999px;
  font-weight: 700; z-index: 1001;
  transition: transform .4s cubic-bezier(.3,1.6,.5,1);
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

/* ===== party mode (隠しコマンド) ===== */
body.party { animation: hue 3s linear infinite; }
@keyframes hue { to { filter: hue-rotate(360deg); } }

@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; }
  .nav__anchor { display: none; }
  .nav nav { gap: 8px; }
  .nav__pages { border-left: 0; padding-left: 0; }
}
/* スマホ：ナビが1行に収まるよう詰める */
@media (max-width: 480px) {
  .nav { padding: 14px 12px; }
  .nav__logo { font-size: 20px; }
  .nav nav { gap: 5px; font-size: 13px; }
  .nav nav .nav__page { padding: 2px 7px; }
  .icon-btn { padding: 1px 7px; font-size: 12px; }
  .lang span { padding: 1px 6px; }
  #achCount { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  /* 流れる帯だけは動きを減らす設定の人にも常に流す */
  .marquee__track { animation: marquee 14s linear infinite !important; }
}

/* ===== Games ページ ===== */
.games-hero {
  min-height: 70svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 120px clamp(16px, 5vw, 64px) 60px;
}
.games-hero__sub { font-family: var(--mono); font-weight: 700; color: var(--red); animation: blink 1s steps(1) infinite; }
.games-hero__title { font-family: var(--display); font-weight: 400; font-size: clamp(72px, 20vw, 260px); line-height: .9; letter-spacing: -.02em; }
.games-hero__lead { font-weight: 700; font-size: clamp(16px, 2vw, 22px); margin-top: 16px; }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
.game {
  position: relative; aspect-ratio: 1;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 2px;
  border: 2px solid var(--ink); border-radius: 14px;
  background: var(--c); padding: 20px; text-align: left; cursor: pointer;
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.game:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--ink); }
.game:active { transform: translate(6px, 6px); box-shadow: 0 0 0 var(--ink); }
.game__icon { position: absolute; top: 16px; left: 18px; font-size: 48px; }
.game__no { font-family: var(--mono); font-weight: 700; font-size: 13px; }
.game b { font-family: var(--display); font-weight: 400; font-size: 24px; }
.game.is-soon::after {
  content: "SOON"; position: absolute; top: 16px; right: 16px;
  font-family: var(--mono); font-weight: 700; font-size: 11px;
  background: var(--ink); color: var(--paper); padding: 2px 8px; border-radius: 999px;
}
.game.shake, .work.shake { animation: shake .4s; }
@keyframes shake { 20%{translate:-8px 0} 40%{translate:7px 0} 60%{translate:-5px 0} 80%{translate:3px 0} }

