/* =========================================================
   ILLGRIND. — 共通スタイル
   色・書体はここのトークンだけを変えれば全ページに反映されます
   ========================================================= */
:root {
  --navy: #0B1220;      /* 信頼 */
  --navy-2: #1C2740;
  --navy-line: #222D42;
  --bone: #F4F1EA;      /* 余白 */
  --paper: #FAF8F3;
  --sand: #E8E3D8;
  --grid-line: #E6E1D6;
  --orange: #FF5A1F;    /* 火花：ポイントにだけ使う */
  --orange-text: #B5400F; /* 白地の上でオレンジ文字を使うとき */
  --muted: #4A5262;
  --muted-on-dark: #9AA3B2;
  --body-on-dark: #C4CAD4;
  --wash: #1E8FD6;      /* WashMeet. 用 */
  --wash-bg: #EAF5FB;

  --font-display: "Archivo Black", "Noto Sans JP", sans-serif;
  --font-mono: "Space Mono", "Noto Sans JP", monospace;
  --font-jp: "Noto Sans JP", sans-serif;

  --line: 3px;
  --shadow: 5px 5px 0 var(--navy);
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sand);
  color: var(--navy);
  font-family: var(--font-jp);
  font-weight: 500;
  line-height: 1.8;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.dot { color: var(--orange); }
.mono { font-family: var(--font-mono); }
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy);
  border-bottom: var(--line) solid var(--navy);
}
.site-header .inner {
  max-width: var(--max); margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.box-logo {
  display: inline-block; text-decoration: none;
  background: var(--bone); color: var(--navy);
  font-family: var(--font-display); font-size: 18px; line-height: 1;
  padding: 8px 12px 6px;
}
.box-logo.on-light { background: var(--navy); color: var(--bone); }
.nav { display: flex; align-items: center; gap: 24px; }
.nav a {
  font-family: var(--font-mono); font-weight: 700; font-size: 13px; letter-spacing: 0.08em;
  color: var(--bone); text-decoration: none;
  min-height: 44px; display: inline-flex; align-items: center;
}
.nav a[aria-current="page"] { color: var(--orange); }
.nav .btn, .nav .btn[aria-current="page"] { color: var(--navy); }
.menu-toggle {
  display: none; background: none; border: 2px solid var(--bone); color: var(--bone);
  font-family: var(--font-mono); font-weight: 700; font-size: 13px;
  min-height: 44px; min-width: 44px; padding: 0 12px; cursor: pointer;
}
@media (max-width: 820px) {
  .menu-toggle { display: inline-flex; align-items: center; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--navy); flex-direction: column; align-items: stretch;
    gap: 0; padding: 8px 16px 20px; border-bottom: var(--line) solid var(--orange);
  }
  .nav.is-open { display: flex; }
  .nav a { border-bottom: 1px solid var(--navy-line); }
  .nav .btn { margin-top: 12px; justify-content: center; border-bottom: var(--line) solid var(--bone); }
}

/* ---------- ボックス型レイアウト ---------- */
.page { padding: 24px 16px 48px; }
.frame {
  max-width: var(--max); margin: 0 auto;
  background: var(--navy); border: var(--line) solid var(--navy);
  display: flex; flex-direction: column; gap: var(--line);
}
.row { display: flex; flex-wrap: wrap; gap: var(--line); }
.cell { background: #fff; padding: 36px 32px; min-width: 0; }
.cell.bone { background: var(--bone); }
.cell.paper { background: var(--paper); }
.cell.dark { background: var(--navy); color: var(--bone); }
.cell.orange { background: var(--orange); }
.cell.wash { background: var(--wash-bg); }
.grid-bg {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
}
.grid-bg.dark {
  background-color: var(--navy);
  background-image:
    linear-gradient(#1A2336 1px, transparent 1px),
    linear-gradient(90deg, #1A2336 1px, transparent 1px);
}
.grow { flex: 999 1 560px; }
.side { flex: 1 1 320px; }
.label-cell {
  flex: 1 1 200px; background: var(--navy); color: var(--bone);
  padding: 24px 28px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
}
.label-cell .display { font-size: 22px; }
@media (max-width: 600px) { .cell { padding: 28px 20px; } }

/* ---------- テキスト ---------- */
.eyebrow {
  font-family: var(--font-mono); font-weight: 700; font-size: 12px; letter-spacing: 0.2em;
  color: var(--muted);
}
.dark .eyebrow { color: var(--muted-on-dark); }
.h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(42px, 6vw, 80px); line-height: 0.95; letter-spacing: -0.01em; }
.h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; }
.h2-jp { font-weight: 900; font-size: clamp(24px, 3vw, 38px); line-height: 1.4; }
.lead { font-size: 15px; line-height: 1.9; max-width: 520px; }
.dark .lead, .dark p { color: var(--body-on-dark); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.cluster { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.between { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }

/* ---------- ボタン・タグ ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 10px 20px;
  font-family: var(--font-mono); font-weight: 700; font-size: 14px; letter-spacing: 0.06em;
  text-decoration: none; color: var(--navy); background: #fff;
  border: var(--line) solid var(--navy); box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease; cursor: pointer;
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--navy); }
.btn.primary { background: var(--orange); }
.dark .btn { border-color: var(--bone); box-shadow: 5px 5px 0 var(--bone); }
.dark .btn:hover { box-shadow: 3px 3px 0 var(--bone); }
.tag {
  display: inline-block; font-family: var(--font-mono); font-weight: 700; font-size: 11px;
  border: 2px solid var(--navy); padding: 1px 8px; line-height: 1.6;
}
.tag.hot { background: var(--orange); }
.tag.ghost { border-style: dashed; color: var(--muted); border-color: var(--muted); }
.badge {
  display: inline-block; transform: rotate(-5deg);
  background: var(--orange); color: var(--navy);
  border: 4px solid var(--navy); box-shadow: 6px 6px 0 var(--navy);
  font-family: var(--font-display); font-size: 20px; line-height: 1; padding: 10px 16px 8px;
}

/* ---------- カード ---------- */
.card { background: #fff; border: var(--line) solid var(--navy); box-shadow: var(--shadow); }
.card-pad { padding: 20px 22px; }
.card.dark-card { background: var(--navy); color: var(--bone); box-shadow: 5px 5px 0 var(--orange); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 20px; }
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--line); background: var(--navy); }
.service-grid > * { background: #fff; padding: 22px 24px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.service-grid > a:hover { background: var(--paper); }
.service-name { font-family: var(--font-display); font-size: 22px; line-height: 1.1; }

.code-card {
  background: var(--bone); color: var(--navy); border: var(--line) solid var(--bone);
  box-shadow: 5px 5px 0 var(--orange); padding: 14px 16px;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.7;
}
.code-card .k { color: var(--orange-text); }
.code-card .indent { padding-left: 18px; }

.window { border: var(--line) solid var(--navy); box-shadow: 6px 6px 0 var(--navy); background: #fff; }
.window-top { background: var(--navy); color: var(--bone); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.window-dots { display: flex; gap: 6px; }
.window-dots span { width: 10px; height: 10px; border-radius: 50%; background: #4A5670; }
.window-dots span:first-child { background: var(--orange); }
.kv { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--navy-line); padding-bottom: 8px; font-family: var(--font-mono); font-size: 13px; }
.kv:last-child { border-bottom: 0; padding-bottom: 0; }
.kv .on { color: var(--orange); font-weight: 700; }

.steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 20px; }
.step-num { font-family: var(--font-display); font-size: 40px; line-height: 1; color: var(--orange); }

/* ---------- GRIN. ---------- */
.grin-hero { width: min(210px, 60%); height: auto; }
.grin-peek {
  position: absolute; right: -14px; bottom: -40px; width: 110px; transform: rotate(-12deg);
  pointer-events: none;
}
.rel { position: relative; overflow: hidden; }

/* ---------- テーブル・フォーム ---------- */
.info { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 28px; row-gap: 0; margin: 0; }
.info dt, .info dd { margin: 0; padding: 14px 0; border-bottom: 2px solid var(--navy); font-size: 15px; }
.info dt { font-family: var(--font-mono); font-weight: 700; font-size: 13px; }
@media (max-width: 560px) {
  .info { grid-template-columns: 1fr; }
  .info dt { border-bottom: 0; padding-bottom: 0; }
}
.form { display: grid; gap: 18px; max-width: 640px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--font-mono); font-weight: 700; font-size: 13px; }
.field .req { color: var(--orange-text); margin-left: 6px; font-size: 11px; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 16px; color: var(--navy); background: #fff;
  border: var(--line) solid var(--navy); padding: 10px 12px; min-height: 48px; border-radius: 0;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; box-shadow: 4px 4px 0 var(--orange); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 20px; height: 20px; margin-top: 4px; accent-color: var(--orange); }
.form-note { font-size: 13px; color: var(--muted); }

/* ---------- フッター ---------- */
.foot { font-family: var(--font-mono); font-weight: 700; font-size: 12px; }
.foot > * { padding: 14px 20px; background: #fff; display: flex; align-items: center; }
.foot .foot-mid { flex: 999 1 300px; justify-content: center; text-align: center; }
.foot .foot-left { background: var(--orange); }
.foot nav { display: flex; flex-wrap: wrap; gap: 16px; }
.foot nav a { text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.foot nav a:hover { text-decoration: underline; }

/* =========================================================
   遊び心（GRIN. の動き・火花・I'LL GRIND）
   動きを減らす設定の人には、すべて止めます
   ========================================================= */

/* ---------- ロゴ：ホバーで ILLGRIND. → I'LL GRIND. ---------- */
.box-logo .apos, .box-logo .gap {
  display: inline-block; overflow: hidden; vertical-align: top;
  max-width: 0; transition: max-width .25s ease, transform .25s ease;
}
.box-logo .apos { color: var(--orange); transform: translateY(-8px); }
.box-logo:hover .apos, .box-logo:focus-visible .apos { max-width: .4em; transform: none; }
.box-logo .gap { width: 0; transition: width .25s ease; }
.box-logo:hover .gap, .box-logo:focus-visible .gap { width: .3em; max-width: .3em; }

/* ---------- ヒーロー ---------- */
.hero { padding: 56px 40px; }
.hero-grin {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 40px 32px;
}
.hero-grin-cap { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--muted-on-dark); }
.grin-live { width: min(230px, 70%); height: auto; overflow: visible; animation: grin-float 4s ease-in-out infinite; }
.grin-live .grin-eyes { transition: transform .15s ease-out; }
.grin-live .grin-eyes path { transform-box: fill-box; transform-origin: center; animation: grin-blink 5s infinite; }
.grin-live .grin-mouth { transition: d .3s ease, stroke-width .3s ease; }
@keyframes grin-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes grin-blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }

/* ---------- GRIND − D = GRIN. ---------- */
.grin-play-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 32px; }
.grin-small { width: 130px; animation-duration: 3s; }
.grin-word { font-size: clamp(48px, 7vw, 80px); line-height: 1; }
.grin-d {
  font: inherit; color: #9AA3B2; background: none; border: 0; padding: 0; cursor: pointer;
  display: inline-block; transition: color .15s ease;
}
.grin-d:hover { color: var(--orange-text); }
.grin-d.is-gone { animation: d-drop .7s cubic-bezier(.5, 0, .9, .6) forwards; pointer-events: none; }
@keyframes d-drop {
  0% { transform: none; opacity: 1; }
  30% { transform: translate(6px, -14px) rotate(10deg); }
  100% { transform: translate(40px, 140px) rotate(120deg); opacity: 0; }
}
.grin-eq { font-size: 14px; font-weight: 700; min-height: 1.6em; }
.grin-eq .done { display: none; color: var(--orange-text); }
.grin-play.is-grin .grin-eq .hint { display: none; }
.grin-play.is-grin .grin-eq .done { display: inline; }
.grin-play.is-grin .grin-small { animation: grin-hop .5s ease 1; }
.grin-play.is-grin .grin-mouth { d: path("M86,150 Q130,152 146,118"); stroke-width: 15; }
@keyframes grin-hop { 0%, 100% { transform: none; } 40% { transform: translateY(-18px) rotate(-4deg); } }

/* ---------- 端からのぞく GRIN. ---------- */
.grin-peek { transition: transform .3s ease; }
.rel:hover .grin-peek { transform: translateY(-16px) rotate(-6deg); }

/* ---------- 火花 ---------- */
.spark {
  position: fixed; z-index: 100; width: 6px; height: 6px; background: var(--orange);
  pointer-events: none; left: 0; top: 0;
}

/* ---------- 404：かくれんぼ ---------- */
.hide-seek {
  position: relative; overflow: hidden; min-height: 300px; border: 0; cursor: pointer;
  font: inherit; color: var(--bone); text-align: center;
}
.hide-seek img {
  position: absolute; left: 50%; bottom: 0; width: 170px;
  transform: translate(-50%, 78%); transition: transform .4s cubic-bezier(.3, 1.4, .6, 1);
}
.hide-seek-q, .hide-seek-a { position: absolute; left: 0; right: 0; top: 40px; font-size: 14px; font-weight: 700; letter-spacing: .1em; }
.hide-seek-a { opacity: 0; color: var(--orange); }
.hide-seek:hover img, .hide-seek:focus-visible img, .hide-seek.is-found img { transform: translate(-50%, 8%); }
.hide-seek.is-found .hide-seek-q { opacity: 0; }
.hide-seek.is-found .hide-seek-a { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .grin-d.is-gone { opacity: 0; }
}
@media (max-width: 600px) {
  .hero { padding: 40px 20px; }
  .hero-grin { padding: 28px 20px; }
  .hero-grin .grin-live { width: 140px; }
}
