/* ==========================================================================
   あそびシステムデザイン トップページ
   コンセプト: 方眼紙に描いた一枚の機械図面（ライト=方眼紙／ダーク=青焼き図面）
   ========================================================================== */

/* ---------- リセット ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body, h1, h2, h3, p, figure, figcaption, table, dl, dd, ul {
  margin: 0;
  padding: 0;
}

ul { list-style: none; }

img, svg { display: block; max-width: 100%; }

/* ---------- デザイントークン ---------- */
:root {
  --paper: #FAFBF9;
  --ink: #1C2B33;
  --grid-minor: rgba(28, 43, 51, .055);
  --grid-major: rgba(28, 43, 51, .10);
  --pencil: #5A6A70;
  --blueprint: #2E5E7E;
  --shu: #C33D2E;
  --card-bg: rgba(255, 255, 255, .6);

  --font-sans: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic Medium", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
  --font-serif: "Hiragino Mincho ProN", "Yu Mincho", serif;

  --section-space: clamp(72px, 10vw, 128px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #142A3D;
    --ink: #E9F1F4;
    --grid-minor: rgba(233, 241, 244, .06);
    --grid-major: rgba(233, 241, 244, .11);
    --pencil: #9FB4BE;
    --blueprint: #8FC3E8;
    --shu: #E05A47;
    --card-bg: rgba(233, 241, 244, .05);
  }
}

/* ---------- ベース ---------- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.95;
  color: var(--ink);
  overflow-x: clip;
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, var(--grid-major) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-major) 1px, transparent 1px),
    linear-gradient(to right, var(--grid-minor) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-minor) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
}

h1 {
  font-size: clamp(1.55rem, 6.5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1.35;
}

.nobr { white-space: nowrap; }

/* 狭幅では nobr を解除（見出しが列幅を押し広げて横溢れするのを防ぐ） */
@media (max-width: 700px) {
  .nobr { white-space: normal; }
}

h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  letter-spacing: .08em;
}

h3 {
  font-weight: 700;
}

a {
  color: var(--blueprint);
  text-decoration-line: underline;
  text-underline-offset: .15em;
}

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

.mono {
  font-family: var(--font-mono);
}

/* ---------- ユーティリティ ---------- */
.container {
  max-width: 1040px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 48px);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 8px;
  z-index: 200;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 10px 16px;
  transition: top .2s ease;
}

.skip-link:focus {
  top: 8px;
}

main > section {
  padding-block: var(--section-space);
  scroll-margin-top: 96px;
}

/* ---------- 図面枠（.sheet） ---------- */
.sheet {
  position: relative;
  margin: 16px;
  border: 2px solid var(--ink);
}

.sheet::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid var(--ink);
  pointer-events: none;
}

.center-mark {
  position: absolute;
  background: var(--ink);
}

.center-mark--top,
.center-mark--bottom {
  width: 1px;
  height: 12px;
  left: 50%;
  transform: translateX(-50%);
}

.center-mark--top { top: -12px; }
.center-mark--bottom { bottom: -12px; }

.center-mark--left,
.center-mark--right {
  width: 12px;
  height: 1px;
  top: 50%;
  transform: translateY(-50%);
}

.center-mark--left { left: -12px; }
.center-mark--right { right: -12px; }

@media (max-width: 639px) {
  .sheet { margin: 8px; }
  .center-mark { display: none; }
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--ink);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 8px;
  padding-block: 14px;
}

.logo {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
}

.logo-main {
  font-weight: 700;
  font-size: 1.05rem;
}

.logo-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--pencil);
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--blueprint);
}

.nav-cta {
  border: 1px solid var(--ink);
  padding: 8px 18px;
}

@media (max-width: 639px) {
  .nav-link-item { display: none; }
}

/* 極小画面（〜400px）でヘッダーと余白を詰め、横はみ出しを防ぐ */
@media (max-width: 400px) {
  .container { padding-inline: 16px; }
  .logo-main { font-size: .9rem; }
  .nav-cta { padding: 6px 12px; font-size: 12px; }
}

/* ---------- ボタン ---------- */
.btn-primary {
  display: inline-block;
  background: var(--shu);
  border: 2px solid var(--shu);
  color: #fff;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 2px;
  text-decoration: none;
  transition: transform .15s ease;
}

.btn-primary:hover {
  transform: translateY(2px);
}

.btn-ghost {
  display: inline-block;
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 14px 28px;
  border-radius: 2px;
  text-decoration: none;
}

/* ---------- hero ---------- */
.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--pencil);
  margin-bottom: 16px;
}

.hero-lead {
  margin-block: 24px;
  max-width: 46em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.hero-play {
  text-align: center;
}

.play-dimension {
  color: var(--pencil);
  max-width: 260px;
  margin-inline: auto;
  position: relative;
}

.dimension-line {
  width: 100%;
  height: auto;
}

.dimension-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--shu);
  text-align: center;
  margin-bottom: 2px;
}

.play-clearance {
  display: inline-block;
  border: 1px dashed var(--pencil);
  padding: var(--play, 16px);
  margin-top: 8px;
}

.asobi-word {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: clamp(72px, 12vw, 150px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform: translate(0, 0);
  transition: none;
}

@supports not (-webkit-text-stroke: 2px black) {
  .asobi-word {
    color: var(--ink);
  }
}

.asobi-word:active {
  cursor: grabbing;
}

.asobi-word.is-returning,
.asobi-word.is-settling {
  transition: transform .55s cubic-bezier(.2, 1.8, .3, 1);
}

.hero-play figcaption {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--pencil);
  margin-top: 20px;
}

/* ---------- 事業内容 ---------- */
.section-note {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--pencil);
  margin-top: 8px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.card {
  position: relative;
  border: 1px solid var(--ink);
  background: var(--card-bg);
  padding: 28px;
}

.card::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  width: 14px;
  height: 14px;
  border-top: 2px solid var(--ink);
  border-left: 2px solid var(--ink);
}

.card-code {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--pencil);
  margin-bottom: 12px;
}

.card h3 {
  margin-bottom: 12px;
}

.card-tools {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--pencil);
  margin-top: 16px;
}

@media (max-width: 899px) {
  .hero-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
}

/* ---------- 自社プロダクト ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 40px;
  margin-top: 40px;
}

.product {
  border-top: 2px solid var(--ink);
  padding-top: 16px;
}

.product-code {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--pencil);
  margin-bottom: 8px;
}

.product h3 {
  margin-bottom: 8px;
}

.product p {
  margin-bottom: 8px;
}

.product-soon {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--pencil);
  border: 1px solid var(--pencil);
  padding: 2px 10px;
}

.product-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

@media (max-width: 899px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 599px) {
  .product-grid { grid-template-columns: 1fr; }
}

/* ---------- 実績（検査成績書） ---------- */
.inspection {
  width: 100%;
  border-collapse: collapse;
  margin-top: 32px;
}

.inspection th,
.inspection td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
}

.inspection td {
  font-family: var(--font-mono);
}

.verdict {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  font-family: var(--font-mono);
}

.verdict-label {
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--pencil);
}

.verdict-stamp {
  display: inline-block;
  border: 2px solid var(--shu);
  color: var(--shu);
  font-weight: 700;
  padding: 4px 14px;
  transform: rotate(-2deg);
}

/* ---------- CTA ---------- */
.cta-band {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  text-align: center;
}

.cta-band .container {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* ---------- 問い合わせフォーム ---------- */
.contact-form {
  width: 100%;
  max-width: 680px;
  margin-inline: auto;
  text-align: left;
  margin-top: clamp(28px, 4vw, 44px);
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--pencil);
  margin-bottom: 8px;
}

.field .req {
  color: var(--shu);
}

.field .opt {
  color: var(--pencil);
  opacity: .8;
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--card-bg);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 12px 14px;
}

.field textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.7;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--blueprint);
  outline-offset: 2px;
}

.field .err {
  min-height: 1em;
  margin-top: 6px;
  font-size: 13px;
  color: var(--shu);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--pencil);
}

.form-status {
  margin-top: 12px;
  font-size: 14px;
  color: var(--blueprint);
}

.form-status.is-error {
  color: var(--shu);
}

.mail-alt {
  margin-top: clamp(32px, 5vw, 52px);
  font-size: 12px;
  color: var(--pencil);
  text-align: center;
}

.contact-form .btn-primary {
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

/* ---------- メールアドレス画像 ---------- */
.email-img {
  display: inline-block;
  line-height: 0;
}

.email-img img {
  height: 34px;
  width: auto;
  max-width: 100%;
  vertical-align: middle;
}

.email-img--sm img {
  height: 32px;
}

/* ---------- 会社概要（表題欄） ---------- */
.about-heading {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--pencil);
}

.titleblock {
  display: grid;
  grid-template-columns: 1fr 180px;
  border: 1px solid var(--ink);
  max-width: 680px;
  margin-left: auto;
  margin-top: 32px;
}

.titleblock-rows {
  display: grid;
  grid-template-columns: 140px 1fr;
}

.tb-row {
  display: contents;
}

.titleblock-rows dt,
.titleblock-rows dd {
  border-bottom: 1px solid var(--ink);
  padding: 10px 14px;
}

.titleblock-rows dt {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--pencil);
  border-right: 1px solid var(--ink);
}

.titleblock-rows dd {
  margin: 0;
  line-height: 1;
}

.tb-row:last-child dt,
.tb-row:last-child dd {
  border-bottom: none;
}

.titleblock-meta {
  border-left: 1px solid var(--ink);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.titleblock-meta p {
  margin-bottom: 10px;
}

.hanko {
  width: 44px;
  height: 44px;
  border: 2px solid var(--shu);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  color: var(--shu);
  font-size: 11px;
  line-height: 1.15;
  writing-mode: vertical-rl;
  transform: rotate(-3deg);
  margin-top: 6px;
}

@media (max-width: 639px) {
  .titleblock {
    grid-template-columns: 1fr;
  }
  .titleblock-rows {
    grid-template-columns: 100px 1fr;
  }
  .titleblock-meta {
    border-left: none;
    border-top: 1px solid var(--ink);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
  }
}

/* ---------- footer ---------- */
.site-footer {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--pencil);
  text-align: center;
  padding-block: 32px;
}

/* ---------- お知らせトースト（画面右上・手動で閉じるまで表示） ---------- */
.toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  position: relative;
  pointer-events: auto;
  padding: 14px 42px 14px 16px;
  border: 1px solid var(--blueprint);
  border-left-width: 4px;
  border-radius: 2px;
  background-color: var(--paper);
  box-shadow: 0 6px 24px rgba(28, 43, 51, .16);
  animation: toast-in .28s ease-out both;
}

.toast--error {
  border-color: var(--shu);
}

.toast-title {
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--blueprint);
}

.toast--error .toast-title {
  color: var(--shu);
}

.toast-body {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink);
}

.toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: var(--pencil);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.toast-close:hover {
  color: var(--ink);
  background-color: var(--grid-major);
}

.toast-close:focus-visible {
  outline: 2px solid var(--blueprint);
  outline-offset: 2px;
}

.toast.is-leaving {
  animation: toast-out .2s ease-in both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
