/* 合同会社Greitive。秋葉原の夜に、RPG のウィンドウを置く。 */
@font-face {
  font-family: 'DotGothic16';
  src: url('/assets/fonts/dotgothic16-subset.woff2?v=2') format('woff2');
  font-display: swap;
}

:root {
  --night: #15124f;
  --ink: #14123c;
  --win: #1b2c94;
  --white: #ffffff;
  --lime: #b6f03c;
  --pink: #ff3d81;
  --cyan: #3fe0ff;
  --muted: #c3c8f2;
  --step: 8px;
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 16px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--night);
  color: var(--white);
  font-family: 'DotGothic16', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  font-size: 16px;
  line-height: 2;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

img, canvas { display: block; }
img { max-width: 100%; height: auto; }
h1, h2, h3, p, dl, dd, ul { margin: 0; padding: 0; font-weight: 400; }
ul { list-style: none; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }

.sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 8px; top: -64px; z-index: 10; padding: 8px 16px;
  background: var(--lime); color: var(--ink);
}
.skip:focus { top: 8px; }

/* RPG のウィンドウ。白い枠の角を 1 段欠く */
.win {
  background: var(--win);
  border: 4px solid var(--white);
  clip-path: polygon(
    4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px), 0 4px, 4px 4px
  );
}

.btn {
  display: inline-block;
  padding: 8px 24px;
  background: var(--lime);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 4px 0 #5e8a14;
}
.btn:hover { background: #d4ff6e; }
.btn:active { transform: translateY(4px); box-shadow: none; }

/* ---- ヘッダー ---- */
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 4px 24px; padding: 12px var(--gutter);
  background: var(--ink);
}
.brand { display: block; }
.brand img { width: 212px; height: 36px; }
.top ul { display: flex; flex-wrap: wrap; gap: 0 24px; }
.top nav a { display: block; padding: 4px 0; text-decoration: none; }
.top nav a:hover { color: var(--lime); }
.top nav a:hover::before { content: '▶'; margin-right: 4px; }

/* ---- 筐体 ---- */
.cabinet { background: var(--ink); }
.screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(78vh, 760px);
  overflow: hidden;
  background: #07061f;
}
.screen canvas {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  image-rendering: pixelated;
}
.screen .ui { z-index: 1; }
.screen::after {
  /* 走査線 */
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 2px, rgba(7, 6, 31, 0.1) 2px 4px);
}
.poster { width: 100%; height: 100%; object-fit: cover; }
.screen.no-gl { background: var(--night) url('/assets/img/ogp.png') center / cover no-repeat; }

.panel {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 64px; padding: 8px 88px;
  background: var(--ink);
  border-top: 4px solid #2a2a6e;
}
.start {
  color: var(--lime); text-decoration: none; font-size: 24px; line-height: 1.5; white-space: nowrap;
}
.start:hover { color: var(--white); }
.blink { display: inline-block; font-size: 16px; vertical-align: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.stop {
  position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%);
  padding: 0 12px; border: 2px solid #6f76c4; background: transparent; color: var(--muted);
  font: inherit; cursor: pointer;
}
.stop:hover { color: var(--white); border-color: var(--white); }

/* ---- 社名 ---- */
.name {
  padding: calc(var(--step) * 10) var(--gutter) calc(var(--step) * 6);
  text-align: center;
}
.sum {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center;
  gap: 8px 16px;
  font-size: clamp(16px, 3.2vw, 32px); line-height: 1.5; color: #7f86d6;
}
.sum b { color: var(--white); font-weight: 400; }
.sum i { font-style: normal; color: var(--pink); }
.sum strong { color: var(--lime); font-weight: 400; font-size: 1.5em; letter-spacing: 0.08em; }
.lead { max-width: 40em; margin: 24px auto 0; font-size: 16px; }

/* ---- 共通の見出し ---- */
main section > h2 {
  font-size: 32px; line-height: 1.5; color: var(--lime);
}
.works, .services, .about, .company, .faq, .contact {
  max-width: 1120px; margin: 0 auto;
  padding: calc(var(--step) * 8) var(--gutter);
}

/* ---- 自社コンテンツ。画面の上にウィンドウを重ねる ---- */
.work {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  margin-top: 40px;
}
.work + .work { margin-top: 72px; }
.crt {
  grid-column: 1 / span 9; grid-row: 1;
  display: block;
  padding: 16px 16px 28px;
  background: #d8d3c0;
  border-bottom: 8px solid #a29c84;
  border-radius: 12px 12px 4px 4px;
}
.crt img {
  width: 100%;
  border: 4px solid var(--ink);
  border-radius: 6px;
  background: #000;
}
.work-text {
  grid-column: 8 / span 5; grid-row: 1;
  z-index: 1;
  padding: 20px 24px 24px;
  margin-bottom: -24px;
}
.work.flip .crt { grid-column: 5 / span 8; }
.work.flip .work-text { grid-column: 1 / span 5; }
.work-text h3 { font-size: 32px; line-height: 1.4; }
.catch { color: var(--lime); line-height: 1.6; margin-bottom: 8px; }
.work-text .btn { margin-top: 12px; }

/* ---- コマンド選択 ---- */
.command {
  display: grid; grid-template-columns: minmax(240px, 4fr) 8fr; gap: 16px;
  margin-top: 32px; align-items: stretch;
}
.command-list { padding: 12px 8px; }
.command-list button {
  display: block; width: 100%; padding: 6px 8px 6px 32px;
  position: relative;
  background: none; border: 0; color: var(--white);
  font: inherit; text-align: left; cursor: pointer;
}
.command-list button[aria-selected='true'] { color: var(--lime); }
.command-list button[aria-selected='true']::before {
  content: '▶'; position: absolute; left: 10px; top: 6px;
  animation: blink 1s steps(1) infinite;
}
.command-body { padding: 24px; min-height: 272px; }
.job[hidden] { display: none; }
html:not(.js) .job + .job { margin-top: 32px; }
.job h3 { font-size: 24px; line-height: 1.5; margin: 12px 0 8px; }
.glyph { display: block; width: 72px; }
.glyph canvas { width: 72px; height: 60px; image-rendering: pixelated; }

/* ---- 想像と創造 ---- */
.about p { max-width: 40em; }
.about h2 + p { margin-top: 24px; }
.about p + p { margin-top: 8px; }

/* ---- 会社情報。ステータス画面 ---- */
.status { margin-top: 32px; padding: 16px 24px; }
.status > div {
  display: grid; grid-template-columns: 9em 1fr; gap: 0 16px;
  padding: 8px 0; border-bottom: 2px dotted #5564c8;
}
.status > div:last-child { border-bottom: 0; }
.status dt { color: var(--lime); }
.status a { color: var(--cyan); }

/* ---- よくある質問 ---- */
.faq details { margin-top: 16px; padding: 8px 24px; }
.faq h2 + details { margin-top: 32px; }
.faq summary { cursor: pointer; }
.faq summary:hover { color: var(--lime); }
.faq details p { padding: 4px 0 8px; color: var(--muted); }

/* ---- お問い合わせ ---- */
.contact { text-align: center; padding-bottom: calc(var(--step) * 12); }
.continue { font-size: 48px; line-height: 1.4; color: var(--pink); }
.continue span { display: inline-block; min-width: 1em; color: var(--white); }
.contact h2 { margin-top: 16px; }
.contact p:not(.continue) { margin-top: 8px; }
.contact .btn { margin-top: 24px; }
.btn.big { font-size: 24px; line-height: 1.5; padding: 16px 32px; overflow-wrap: anywhere; }

/* ---- お問い合わせフォーム ---- */
.inquiry, .sent { max-width: 40em; margin: 24px auto 0; padding: 24px; text-align: left; }
.field { margin-bottom: 16px; }
.field label, .otp label { display: block; line-height: 1.6; }
.req { color: var(--lime); font-size: 14px; }
.inquiry input, .inquiry textarea, .otp input {
  display: block; width: 100%; margin-top: 4px; padding: 8px 12px;
  background: var(--ink); color: var(--white);
  border: 2px solid #6f7bd8; border-radius: 0;
  font: inherit; line-height: 1.6;
}
.inquiry textarea { resize: vertical; min-height: 9em; }
.inquiry input:focus, .inquiry textarea:focus, .otp input:focus { border-color: var(--lime); outline: none; box-shadow: 0 0 0 2px var(--lime); }
[aria-invalid='true'] { border-color: #ff8fb4 !important; }
.field-error, .form-error, .otp-msg.bad { color: #ffb3cb; line-height: 1.6; }
.field-error { margin-top: 4px; font-size: 14px; }
.form-error { margin-top: 12px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.note { color: var(--muted); font-size: 14px; line-height: 1.8; }
.inquiry .btn { display: block; width: 100%; margin-top: 16px; border: 0; cursor: pointer; font-family: inherit; }
.sent-title { font-size: 24px; line-height: 1.5; color: var(--lime); }
.sent:focus { outline: none; }

/* 認証のウィンドウ */
.otp { width: min(26em, calc(100vw - 32px)); padding: 20px 24px; color: var(--white); margin: auto; }
.otp::backdrop { background: rgba(7, 6, 31, 0.72); }
.otp h3 { font-size: 24px; line-height: 1.5; color: var(--lime); margin-bottom: 12px; }
.otp .btn { display: block; width: 100%; margin-top: 12px; border: 0; cursor: pointer; font-family: inherit; font-size: 16px; }
.otp-msg { min-height: 2em; margin-top: 8px; line-height: 1.6; font-size: 14px; }
.link { display: block; margin: 4px auto 0; padding: 4px 8px; background: none; border: 0; color: var(--cyan); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }

/* ---- フッター ---- */
.end { padding: 16px var(--gutter); background: var(--ink); text-align: center; color: var(--muted); }

/* ---- 狭い画面 ---- */
@media (max-width: 760px) {
  main section > h2 { font-size: 24px; }
  .top { padding-top: 8px; padding-bottom: 8px; }
  .top ul { gap: 0 16px; font-size: 14px; }
  .panel { padding: 8px 72px 8px 16px; justify-content: flex-start; }
  .start { font-size: 16px; }
  .work { display: block; }
  .crt { padding: 8px 8px 16px; border-bottom-width: 6px; }
  .work-text { margin: -16px 8px 0; position: relative; padding: 16px; }
  .work-text h3 { font-size: 24px; }
  .work + .work { margin-top: 48px; }
  .command { grid-template-columns: 1fr; }
  .command-body { padding: 16px; min-height: 300px; }
  .status { padding: 8px 16px; }
  .status > div { grid-template-columns: 1fr; }
  .continue { font-size: 32px; }
  .btn.big { font-size: 16px; padding: 12px 16px; }
  .inquiry, .sent { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blink, .command-list button[aria-selected='true']::before { animation: none; }
}
