/* ============================================================
   株式会社42 コーポレートサイト 2026 リニューアル
   コンセプト: 「答えは、ドットからできている」
   ピクセルロゴ(9x6グリッド)を唯一のシグネチャとして扱い、
   他の装飾は抑制する。
   ============================================================ */

:root {
  --ink: #15191d;
  --ink-2: #4a5258;
  --paper: #ffffff;
  --mist: #f2f5f5;
  --teal: #12808c;
  --teal-deep: #0a5e68;
  --teal-tint: #e3eff0;
  --red: #c4342d;
  --line: #e2e8e9;
  --42ws-theme: #12808c;
  --font-body: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-dot: "DotGothic16", monospace;
  --w-content: 1200px;
  --header-h: 68px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.9;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-deep); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

.wrap { max-width: var(--w-content); margin: 0 auto; padding: 0 24px; }

/* ---------------- ヘッダー ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand svg { width: 42px; height: 28px; color: var(--ink); transition: color 0.25s; }
.brand:hover svg { color: var(--teal); }
.brand .brand-name { font-weight: 700; font-size: 1.02rem; letter-spacing: 0.04em; color: var(--ink); }

.gnav { display: flex; align-items: center; gap: 26px; }
.gnav a.nav-link {
  color: var(--ink); font-size: 0.9rem; font-weight: 500;
  padding: 4px 0; position: relative;
}
.gnav a.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 3px; background: var(--teal);
  transition: width 0.2s steps(4);
}
.gnav a.nav-link:hover::after, .gnav a.nav-link[aria-current="page"]::after { width: 100%; }

.btn {
  display: inline-block;
  background: var(--teal); color: #fff;
  font-weight: 700; font-size: 0.92rem;
  padding: 11px 26px; border: none; border-radius: 2px;
  box-shadow: 3px 3px 0 rgba(21, 25, 29, 0.18);
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:hover {
  background: var(--teal-deep); color: #fff;
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 rgba(21, 25, 29, 0.22);
}
.btn:active { transform: translate(0, 0); box-shadow: 2px 2px 0 rgba(21, 25, 29, 0.2); }
.btn.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 rgba(21, 25, 29, 0.12);
}
.btn.btn-ghost:hover { background: var(--ink); color: #fff; }

/* モバイルメニュー */
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 44px; height: 44px; position: relative; z-index: 130;
}
.nav-toggle .bar {
  display: block; width: 22px; height: 2.5px; background: var(--ink);
  margin: 5px auto; transition: transform 0.25s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .gnav {
    position: fixed; inset: 0; z-index: 120;
    flex-direction: column; justify-content: center; gap: 30px;
    background: var(--paper);
    opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0.25s;
  }
  .gnav.open { opacity: 1; visibility: visible; }
  .gnav a.nav-link { font-size: 1.15rem; font-weight: 700; }
}

/* ---------------- 共通セクション ---------------- */
.section { padding: 96px 0; }
.section.alt { background: var(--mist); }

.eyebrow {
  font-family: var(--font-dot);
  font-size: 0.82rem; letter-spacing: 0.22em;
  color: var(--teal);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: ""; width: 10px; height: 10px; background: var(--teal);
  box-shadow: 12px 0 0 var(--teal-tint);
  flex: none;
}

.section-title {
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  font-weight: 900; letter-spacing: 0.02em; line-height: 1.4;
  margin-bottom: 28px;
}
.section-lede { max-width: 800px; color: var(--ink-2); margin-bottom: 44px; }

/* スクロール出現 */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------------- ヒーロー ---------------- */
.hero { padding: 72px 0 90px; overflow: hidden; }
.hero .wrap {
  display: grid; grid-template-columns: 1.15fr 1fr;
  gap: 48px; align-items: center;
}
.hero-title {
  font-size: clamp(2.2rem, 4.6vw, 3.3rem);
  font-weight: 900; line-height: 1.35; letter-spacing: 0.02em;
  margin: 6px 0 22px;
}
.hero-title .accent { color: var(--teal); }
.hero-lede { color: var(--ink-2); max-width: 560px; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* ピクセルロゴ (9x6) — 唯一のシグネチャ */
.px42-stage { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.px42 {
  --px: 56px;
  display: grid;
  grid-template-columns: repeat(9, var(--px));
  grid-auto-rows: var(--px);
}
.px42 .c { width: var(--px); height: var(--px); }
.px42 .on {
  background: var(--ink);
  animation: pxin 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
  animation-delay: var(--d);
  position: relative;
}
/* hover時のみ、セルの中に隠れた画像が等倍で見える */
.px42 .on::after {
  content: ""; position: absolute; inset: 0;
  background: var(--img) center / cover no-repeat, #fff;
  opacity: 0; transition: opacity 0.18s;
  pointer-events: none;
}
.px42 .on:hover::after { opacity: 1; }
@keyframes pxin {
  from { opacity: 0; transform: translateY(-14px) scale(0.4); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 860px) {
  .hero { padding: 40px 0 64px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .px42-stage { order: -1; }
  .px42 { --px: clamp(22px, 7.4vw, 34px); }
}

/* ---------------- 特徴 (ABOUT) ---------------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 40px; }
.feature {
  background: var(--paper); border: 1px solid var(--line); border-radius: 3px;
  padding: 28px 26px;
}
.section.alt .feature { border-color: transparent; }
.feature h4 { font-size: 1.06rem; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 9px; }
.feature h4::before { content: ""; width: 9px; height: 9px; background: var(--teal); flex: none; }
.feature p { font-size: 0.92rem; color: var(--ink-2); }
@media (max-width: 860px) { .feature-grid { grid-template-columns: 1fr; } }

.vision-block {
  border-left: 4px solid var(--teal);
  background: var(--teal-tint);
  padding: 30px 34px; margin-top: 48px; border-radius: 0 3px 3px 0;
}
.vision-block .vision-label { font-family: var(--font-dot); font-size: 0.78rem; letter-spacing: 0.2em; color: var(--teal-deep); margin-bottom: 8px; }
.vision-block .vision-copy { font-size: clamp(1.2rem, 2.4vw, 1.55rem); font-weight: 900; }
.vision-block p.vision-sub { margin-top: 12px; font-size: 0.94rem; color: var(--ink-2); }

/* ---------------- サービス ---------------- */
.service-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.service-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 3px;
  padding: 30px 28px;
}
.service-card .service-no { font-family: var(--font-dot); font-size: 0.75rem; color: var(--teal); letter-spacing: 0.15em; margin-bottom: 10px; }
.service-card .service-icon { width: 92px; height: 92px; image-rendering: pixelated; margin-bottom: 14px; }
.service-card h4 { font-size: 1.12rem; font-weight: 700; margin-bottom: 10px; }
.service-card p { font-size: 0.92rem; color: var(--ink-2); }
@media (max-width: 860px) { .service-grid { grid-template-columns: 1fr; } }

/* ---------------- 製品 ---------------- */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
@media (max-width: 860px) { .product-grid { grid-template-columns: 1fr; } }

.product-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px;
  overflow: hidden; display: flex; flex-direction: column;
}

.shot { position: relative; border-bottom: 1px solid var(--line); }
.shot-bar {
  display: flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  background: var(--mist); border-bottom: 1px solid var(--line);
}
.shot-bar i { width: 8px; height: 8px; border-radius: 50%; background: #d3dadb; }
.shot-bar .shot-url {
  font-family: var(--font-dot); font-size: 0.68rem; color: var(--ink-2);
  margin-left: 8px; letter-spacing: 0.05em;
}
.shot img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top; width: 100%; }

.product-body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.product-name { font-size: 1.15rem; font-weight: 900; margin-bottom: 2px; }
.product-tagline { font-size: 0.88rem; font-weight: 700; color: var(--teal); margin-bottom: 10px; }
.product-desc { font-size: 0.9rem; color: var(--ink-2); flex: 1; }
.product-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; gap: 10px; flex-wrap: wrap; }
.product-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.product-tags span {
  font-size: 0.72rem; color: var(--ink-2);
  background: var(--mist); padding: 3px 9px; border-radius: 2px;
}
.product-link { font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.product-link::after { content: " →"; }

/* ボードゲーム */
.bg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
@media (max-width: 860px) { .bg-grid { grid-template-columns: 1fr; } }
.bg-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
  display: flex; flex-direction: column;
}
.bg-card img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; border-bottom: 1px solid var(--line); }
.bg-card .product-body { flex: 1; }

.subhead { font-size: 1.3rem; font-weight: 900; margin: 72px 0 26px; display: flex; align-items: center; gap: 12px; }
.subhead::before { content: ""; width: 11px; height: 11px; background: var(--ink); flex: none; }

/* ---------------- ニュース ---------------- */
.news-list { border-top: 1px solid var(--line); }
.news-item {
  display: grid; grid-template-columns: 130px 1fr; gap: 18px;
  padding: 22px 6px; border-bottom: 1px solid var(--line);
  color: var(--ink); align-items: baseline;
}
a.news-item:hover .news-item-title { color: var(--teal); }
.news-date { font-family: var(--font-dot); font-size: 0.8rem; color: var(--ink-2); letter-spacing: 0.08em; }
.news-item-title { font-weight: 700; transition: color 0.15s; }
@media (max-width: 640px) { .news-item { grid-template-columns: 1fr; gap: 4px; } }

.more-link { display: inline-block; margin-top: 26px; font-weight: 700; font-size: 0.92rem; }
.more-link::after { content: " →"; }

/* ---------------- CTAバンド ---------------- */
.cta-band {
  background:
    linear-gradient(rgba(11, 15, 25, 0.66), rgba(11, 15, 25, 0.66)),
    url(/img/space-teal.jpg) center / cover no-repeat;
  color: #fff; padding: 84px 0; position: relative; overflow: hidden;
}
/* ライフゲームのグライダー(本物のシミュレーション。site.js参照) */
.cta-glider {
  position: absolute; right: 26px; top: 26px;
  width: 112px; height: 112px;
  image-rendering: pixelated;
  opacity: 0.9;
}
.cta-band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 34px; flex-wrap: wrap; }
.cta-band h3 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); font-weight: 900; line-height: 1.6; }
.cta-band p { color: #b9c2c6; font-size: 0.94rem; margin-top: 10px; max-width: 560px; }

/* ---------------- フッター ---------------- */
.site-footer { background: var(--ink); color: #cfd6d9; border-top: 1px solid #262c31; }
.footer-main {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 40px;
  padding: 64px 0 48px;
}
.footer-brand svg { width: 54px; height: 36px; color: #fff; }
.footer-brand .f-name { font-weight: 700; color: #fff; margin: 14px 0 6px; }
.footer-brand address { font-style: normal; font-size: 0.85rem; line-height: 1.8; }
.footer-col h5 {
  font-family: var(--font-dot); font-size: 0.75rem; letter-spacing: 0.2em;
  color: #8b969b; margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: #cfd6d9; font-size: 0.9rem; }
.footer-col a:hover { color: #fff; }
.footer-sns { display: flex; gap: 14px; margin-top: 18px; }
.footer-sns a { color: #cfd6d9; font-size: 0.85rem; border: 1px solid #3a4248; padding: 6px 14px; border-radius: 2px; }
.footer-sns a:hover { color: #fff; border-color: #fff; }
.footer-bottom {
  border-top: 1px solid #262c31; padding: 20px 0;
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
}
.footer-bottom p { font-family: var(--font-dot); font-size: 0.72rem; letter-spacing: 0.1em; color: #8b969b; }
@media (max-width: 860px) { .footer-main { grid-template-columns: 1fr; gap: 36px; } }

/* ---------------- 下層ページ共通 ---------------- */
.page-hero { padding: 76px 0 56px; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 900; letter-spacing: 0.02em; }
.page-hero .page-lede { color: var(--ink-2); margin-top: 14px; max-width: 640px; }

.prose { max-width: 880px; }
.prose h3 { font-size: 1.3rem; font-weight: 900; margin: 48px 0 16px; }
.prose h4 { font-size: 1.05rem; font-weight: 700; margin: 32px 0 10px; }
.prose p { margin-bottom: 16px; }
.prose ul { margin: 0 0 16px 1.4em; }
.prose li { margin-bottom: 6px; }

/* 会社概要テーブル */
.company-table { width: 100%; border-collapse: collapse; max-width: 880px; }
.company-table th, .company-table td { text-align: left; padding: 18px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.company-table th { width: 130px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.company-table td { color: var(--ink-2); }

/* 代表挨拶 */
.greeting { display: grid; grid-template-columns: 1fr; gap: 26px; max-width: 880px; }
.greeting .sign { text-align: right; font-weight: 700; margin-top: 8px; }
.greeting .sign .sign-title { font-size: 0.85rem; color: var(--ink-2); font-weight: 500; }

/* ---------------- フォーム ---------------- */
.form-wrap { max-width: 720px; }
.form-field { margin-bottom: 26px; }
.form-field > label {
  display: block; font-weight: 700; font-size: 0.94rem; margin-bottom: 8px;
}
.form-field .req {
  font-family: var(--font-dot); font-size: 0.68rem; color: var(--red);
  margin-left: 8px; letter-spacing: 0.1em;
}
.form-field input[type="text"],
.form-field input[type="email"],
.form-field select,
.form-field textarea {
  width: 100%; padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: 2px;
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: var(--paper);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-field textarea { min-height: 160px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 3px 3px 0 var(--teal-tint);
}
.form-consent { font-size: 0.9rem; margin: 30px 0; }
.form-consent label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.form-consent input { margin-top: 5px; accent-color: var(--teal); }
.form-error { color: var(--red); font-weight: 700; margin-top: 18px; }

/* ---------------- ボードゲーム詳細 ---------------- */
.story-lead { font-size: 1.02rem; max-width: 720px; }
.video-embed { margin: 40px 0; max-width: 800px; }
.video-embed iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 1px solid var(--line); border-radius: 4px; }
.photo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 40px 0; max-width: 880px; }
@media (max-width: 640px) { .photo-row { grid-template-columns: 1fr; } }
.photo-row img { border: 1px solid var(--line); border-radius: 4px; }

/* ---------------- 動きの抑制 ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .px42 .on { animation: none !important; opacity: 1; }
  .px42 .on::after { transition: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}

/* ブログ一覧の抜粋 */
.news-item-blog { align-items: flex-start; }
.news-excerpt {
  display: block; font-size: 0.86rem; color: var(--ink-2);
  font-weight: 400; margin-top: 4px;
}

/* ブログ一覧のサムネイル */
.news-item-blog { grid-template-columns: 170px 110px 1fr; }
.news-thumb {
  width: 170px; aspect-ratio: 16 / 10; object-fit: cover; object-position: top;
  border: 1px solid var(--line); border-radius: 3px;
}
@media (max-width: 640px) {
  .news-item-blog { grid-template-columns: 1fr; }
  .news-thumb { width: 100%; }
}

/* コードブロック (ブログ記事用) */
.prose pre {
  background: var(--ink); color: #d8dee2;
  padding: 20px 22px; border-radius: 4px;
  overflow-x: auto; font-size: 0.8rem; line-height: 1.7;
  margin: 0 0 16px;
}
.prose pre code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: none; padding: 0; color: inherit; font-size: inherit; }
.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--mist); padding: 2px 6px; border-radius: 2px;
  font-size: 0.85em;
}
