/* ============================================================
 * 劇用スクリーン — site.css
 * TOPカタログハブ＋起動前ビュー＋設定パネル＋Toast の共通スタイル。
 * 画面別スタイルは css/screens/<slug>.css。
 *
 * デザイントーン（Fable §0-14）: スタジオバックヤード美学
 *   基調 = チャコール #141518 系
 *   差し色 = REC タリーレッド #FF4444
 *   LYブランドグラデ禁止・他4サイト（bracket/iceberg/quadrant/prompt）と非重複
 *
 * UIテク（reference_ui_microinteractions）:
 *   ①text-wrap: balance/pretty ②font-smoothing ③tabular-nums
 *   ④多層 box-shadow ⑤中断可能 transition ⑥stagger ⑦CLS抑制
 * ============================================================ */

/* ── Reset / Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  background: #0f1113;
  color: #d8d8db;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: #ffb1b1; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, h4 { text-wrap: balance; margin: 0 0 .6em; letter-spacing: .01em; }
p { text-wrap: pretty; margin: 0 0 1em; }

/* 数字は必ず tabular-nums */
.num, .tabnum, .sp-num { font-variant-numeric: tabular-nums; }

/* ── サイト共通レイアウト ── */
.sp-container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.sp-header {
  background: linear-gradient(180deg, #141518 0%, #16181b 100%);
  border-bottom: 1px solid #23262b;
  position: sticky; top: 0; z-index: 40;
}
.sp-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  max-width: 1080px; margin: 0 auto;
}
.sp-logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 18px; color: #f2f2f4;
  letter-spacing: .02em;
}
.sp-logo__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #ff4444;
  box-shadow: 0 0 0 3px rgba(255,68,68,.18), 0 0 12px rgba(255,68,68,.45);
  animation: sp-tally-pulse 1.6s ease-in-out infinite;
}
@keyframes sp-tally-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
.sp-nav { display: flex; gap: 16px; align-items: center; }
.sp-nav a, .sp-nav button {
  background: none; border: 0; padding: 6px 10px;
  color: #b8babf; font-size: 14px; cursor: pointer;
  border-radius: 6px;
  transition: background-color .15s ease, color .15s ease;
}
.sp-nav a:hover, .sp-nav button:hover { background: #23262b; color: #fff; text-decoration: none; }
.sp-nav__lang {
  border: 1px solid #33363c;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 12px;
  padding: 4px 8px;
}

/* ── ヒーロー ── */
.sp-hero {
  padding: 56px 20px 40px;
  text-align: center;
  background:
    radial-gradient(ellipse at center top, rgba(255,68,68,.08), transparent 60%),
    linear-gradient(180deg, #141518 0%, #0f1113 100%);
  border-bottom: 1px solid #23262b;
}
.sp-hero__title {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  color: #f6f6f8;
  letter-spacing: .01em;
  margin-bottom: .3em;
}
.sp-hero__sub {
  font-size: clamp(15px, 2vw, 18px);
  color: #b8babf;
  max-width: 640px; margin: 0 auto 1em;
}
.sp-hero__disclaimer {
  display: inline-block;
  font-size: 12px;
  color: #8b8d93;
  background: #1a1c20;
  border: 1px dashed #33363c;
  padding: 6px 12px;
  border-radius: 4px;
  margin-top: 8px;
}
.sp-hero__cta {
  margin-top: 24px;
}

/* ── ボタン ── */
.sp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #23262b;
  color: #f2f2f4;
  border: 1px solid #33363c;
  border-radius: 4px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, transform .12s ease, box-shadow .15s ease;
  min-height: 40px;  /* CLS抑制: サイズ固定 */
}
.sp-btn:hover { background: #2b2f35; }
.sp-btn:active { transform: translateY(1px); }
.sp-btn:focus-visible { outline: 2px solid #ff4444; outline-offset: 2px; }
.sp-btn--primary {
  background: #ff4444;
  border-color: #ff4444;
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 6px 20px -6px rgba(255,68,68,.5);
}
.sp-btn--primary:hover { background: #ff5757; }
.sp-btn--ghost { background: transparent; }
.sp-btn--ghost:hover { background: #1a1c20; }
.sp-btn--danger { background: #7a1e1e; border-color: #a63030; color: #fff; }
.sp-btn--danger:hover { background: #922424; }
.sp-btn--sm { padding: 6px 12px; font-size: 13px; min-height: 32px; }

/* ── セクション ── */
.sp-section { padding: 48px 20px; }
.sp-section__title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: #8b8d93;
  border-left: 3px solid #ff4444;
  padding-left: 10px;
  margin-bottom: 24px;
}

/* ── カタログカード ── */
.sp-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.sp-card {
  background: #16181b;
  border: 1px solid #23262b;
  border-radius: 6px;
  padding: 20px;
  display: flex; flex-direction: column;
  min-height: 220px;  /* CLS抑制 */
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
  position: relative;
  overflow: hidden;
}
.sp-card:hover {
  border-color: #33363c;
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255,255,255,.04) inset,
    0 4px 12px -4px rgba(0,0,0,.6),
    0 12px 32px -12px rgba(255,68,68,.15);
}
.sp-card--soon { opacity: .5; }
.sp-card--soon:hover { transform: none; border-color: #23262b; box-shadow: none; cursor: default; }
.sp-card__cat {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #8b8d93;
  margin-bottom: 6px;
}
.sp-card__title {
  font-size: 17px;
  font-weight: 700;
  color: #f2f2f4;
  margin-bottom: 6px;
  text-wrap: balance;
}
.sp-card__brand {
  font-size: 11px;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  color: #ff4444;
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.sp-card__desc {
  font-size: 13px;
  color: #b0b2b7;
  line-height: 1.55;
  flex-grow: 1;
  text-wrap: pretty;
}
.sp-card__foot {
  margin-top: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.sp-card__badge {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: #8b8d93;
  border: 1px solid #33363c;
  border-radius: 3px;
  padding: 2px 6px;
}
.sp-card__badge--soon { color: #6a6c72; border-color: #2a2d32; }

/* stagger 入場（PRM対応） */
@media (prefers-reduced-motion: no-preference) {
  .sp-card { animation: sp-card-in .5s cubic-bezier(.4,.2,.2,1) both; }
  .sp-card:nth-child(1) { animation-delay: .02s; }
  .sp-card:nth-child(2) { animation-delay: .06s; }
  .sp-card:nth-child(3) { animation-delay: .10s; }
  .sp-card:nth-child(4) { animation-delay: .14s; }
  .sp-card:nth-child(5) { animation-delay: .18s; }
  .sp-card:nth-child(6) { animation-delay: .22s; }
  .sp-card:nth-child(7) { animation-delay: .26s; }
  .sp-card:nth-child(8) { animation-delay: .30s; }
  .sp-card:nth-child(9) { animation-delay: .34s; }
  .sp-card:nth-child(10) { animation-delay: .38s; }
  .sp-card:nth-child(11) { animation-delay: .42s; }
  .sp-card:nth-child(12) { animation-delay: .46s; }
  @keyframes sp-card-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ── FAQ・機材コーナー ── */
.sp-faq__intro, .sp-gear__intro {
  color: #b0b2b7; font-size: 14px; margin-bottom: 20px;
  text-wrap: pretty;
}
.sp-faq details {
  border-bottom: 1px solid #23262b;
  padding: 14px 0;
}
.sp-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: #f2f2f4;
  padding: 4px 0;
  list-style: none;
}
.sp-faq summary::-webkit-details-marker { display: none; }
.sp-faq summary::before { content: "＋ "; color: #ff4444; margin-right: 6px; }
.sp-faq details[open] summary::before { content: "− "; }
.sp-faq details p {
  font-size: 14px; color: #b0b2b7;
  padding: 8px 0 4px 20px;
  border-left: 2px solid #23262b;
  margin: 8px 0 0 0;
}

.sp-gear__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.sp-gear__card {
  display: block;
  padding: 14px 16px;
  background: #16181b;
  border: 1px solid #23262b;
  border-radius: 4px;
  color: #d8d8db;
  font-size: 13px;
  min-height: 52px;  /* CLS抑制 */
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
  text-align: center;
}
.sp-gear__card:hover {
  background: #1e2126;
  border-color: #ff4444;
  color: #f2f2f4;
  text-decoration: none;
}

/* ── AdSense placeholder（CLS抑制のため固定高さ） ── */
.sp-ad {
  display: flex; align-items: center; justify-content: center;
  min-height: 100px;  /* 300×100 相当・ページ幅で自動フィット */
  margin: 28px auto;
  background: #14161a;
  border: 1px dashed #2a2d32;
  border-radius: 4px;
  color: #4a4c52;
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  max-width: 1080px;
}
.sp-ad--mid { min-height: 250px; }  /* 中段はレクタングル相当 */
.sp-ad__label { opacity: .6; }

/* ── 関連画面（画面ページ末尾） ── */
.sp-related {
  max-width: 780px; margin: 40px auto 60px;
  padding: 0 20px;
}
.sp-related__title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: #8b8d93;
  border-left: 3px solid #ff4444;
  padding-left: 10px;
  margin-bottom: 16px;
}
.sp-related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.sp-related__card {
  display: block;
  padding: 12px 14px;
  background: #16181b;
  border: 1px solid #23262b;
  border-radius: 4px;
  color: #d0d2d7;
  font-size: 13px;
  min-height: 60px;  /* CLS抑制 */
  transition: background-color .15s ease, border-color .15s ease;
}
.sp-related__card:hover {
  background: #1e2126;
  border-color: #33363c;
  color: #f2f2f4;
  text-decoration: none;
}
.sp-related__cat {
  display: block;
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: #8b8d93; margin-bottom: 4px;
}

/* ── 画面ページ導入本文（起動前ビュー内・SEO受け皿） ── */
.sp-pre__body {
  margin-top: 20px;
  padding: 16px 18px;
  background: #16181b;
  border: 1px solid #23262b;
  border-radius: 6px;
  color: #c8cacf;
  font-size: 14px;
  line-height: 1.75;
  text-wrap: pretty;
}
.sp-pre__body p { margin: 0 0 .8em; }
.sp-pre__body p:last-child { margin-bottom: 0; }

/* ── how-to ページ ── */
.sp-howto { max-width: 820px; margin: 0 auto; padding: 40px 20px 60px; }
.sp-howto h2 {
  font-size: 18px; color: #f2f2f4; margin-top: 32px;
  border-left: 3px solid #ff4444; padding-left: 10px;
}
.sp-howto h3 { font-size: 15px; color: #d8d8db; margin-top: 20px; }
.sp-howto p, .sp-howto li { color: #c8cacf; font-size: 14px; line-height: 1.8; }
.sp-howto ul, .sp-howto ol { padding-left: 22px; }
.sp-howto code {
  background: #0f1113; border: 1px solid #23262b;
  padding: 1px 6px; border-radius: 3px;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 12px; color: #ff9999;
}

/* ── contact form ── */
.sp-form { display: grid; gap: 14px; max-width: 560px; }
.sp-form__row { display: flex; flex-direction: column; gap: 4px; }
.sp-form__row span { font-size: 12px; color: #8b8d93; }
.sp-form__row input, .sp-form__row textarea {
  background: #0f1113; color: #f2f2f4;
  border: 1px solid #33363c; border-radius: 4px;
  padding: 8px 10px; font-size: 14px;
  font-family: inherit;
  min-height: 38px;
}
.sp-form__row textarea { min-height: 160px; resize: vertical; }
.sp-form__row input:focus, .sp-form__row textarea:focus {
  outline: none; border-color: #ff4444;
  box-shadow: 0 0 0 2px rgba(255,68,68,.2);
}
.sp-form__actions { margin-top: 10px; }
.sp-form__status {
  min-height: 20px;  /* CLS抑制 */
  font-size: 13px;
  padding: 4px 0;
}
.sp-form__status--ok { color: #4dd18a; }
.sp-form__status--err { color: #ff6b6b; }
.cf-turnstile { min-height: 65px; }  /* CLS抑制（Turnstile widget 領域） */

/* ── フッター ── */
.sp-footer {
  border-top: 1px solid #23262b;
  padding: 32px 20px 24px;
  background: #101215;
  color: #8b8d93;
  font-size: 12px;
}
.sp-footer__notice {
  background: #16181b;
  border: 1px dashed #33363c;
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 16px;
  color: #b0b2b7;
  text-wrap: pretty;
}
.sp-footer__pr {
  font-size: 11px; color: #6a6c72; margin-bottom: 10px;
}
.sp-footer__links {
  display: flex; flex-wrap: wrap; gap: 14px;
  justify-content: center;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid #23262b;
}
.sp-footer__links a { color: #8b8d93; font-size: 12px; }
.sp-footer__copyright { text-align: center; font-size: 11px; color: #6a6c72; margin-top: 8px; }
.sp-footer__contact-line { text-align: center; font-size: 10px; color: #4a4c52; margin-top: 6px; }
.sp-footer__contact-line a { color: #4a4c52; }

/* ── 起動前ビュー ── */
.sp-pre {
  max-width: 780px; margin: 0 auto;
  padding: 40px 20px 60px;
}
.sp-pre__title { font-size: clamp(24px, 4vw, 32px); color: #f6f6f8; }
.sp-pre__brand {
  font-size: 13px;
  color: #b0b2b7;
  margin-bottom: 14px;
}
.sp-pre__brand strong {
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  color: #ff4444; letter-spacing: .05em; font-weight: 600;
  margin-left: 6px;
}
.sp-pre__short {
  font-size: 15px; color: #d0d2d7;
  margin-bottom: 12px;
  text-wrap: pretty;
}
.sp-pre__hint {
  font-size: 13px; color: #8b8d93;
  background: #16181b; border-left: 3px solid #33363c;
  padding: 10px 14px; border-radius: 0 4px 4px 0;
}
.sp-pre__custom {
  margin: 32px 0;
  padding: 20px;
  background: #16181b;
  border: 1px solid #23262b;
  border-radius: 6px;
}
.sp-pre__custom h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .15em;
  color: #8b8d93; margin-bottom: 14px;
  border-left: 3px solid #ff4444; padding-left: 10px;
}
.sp-custom-form {
  display: grid; gap: 14px;
}
.sp-field { display: flex; flex-direction: column; gap: 4px; }
.sp-field__label { font-size: 12px; color: #8b8d93; letter-spacing: .04em; }
.sp-input {
  background: #0f1113;
  color: #f2f2f4;
  border: 1px solid #33363c;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s ease;
  min-height: 38px;  /* CLS抑制 */
}
.sp-input:focus {
  outline: none;
  border-color: #ff4444;
  box-shadow: 0 0 0 2px rgba(255,68,68,.2);
}
.sp-input--multi { min-height: 120px; resize: vertical; font-family: "SF Mono", "Menlo", "Consolas", monospace; font-size: 13px; }
.sp-pre__actions-inline {
  margin-top: 14px;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.sp-pre__launch {
  margin-top: 30px;
  text-align: center;
}
.sp-pre__launch .sp-btn {
  padding: 14px 32px;
  font-size: 16px;
  min-width: 200px;
}

/* ── 全画面ステージ ── */
.sp-stage {
  position: fixed; inset: 0;
  z-index: 9998;
  background: #000;
  overflow: hidden;
  display: block;
}
.sp-stage__canvas {
  position: absolute; inset: 0;
  overflow: hidden;
}

/* L-1 架空ブランドマーク（常時表示・全画面中も消えない） */
.sp-brandmark {
  position: fixed;
  right: 14px; bottom: 12px;
  z-index: 10000;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 11px;
  letter-spacing: .06em;
  color: rgba(255,255,255,.55);
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.1);
  padding: 4px 8px;
  border-radius: 3px;
  pointer-events: none;  /* 演出を邪魔しない */
  user-select: none;
}
.sp-brandmark__mark { color: #ff4444; }
.sp-brandmark__text { color: rgba(255,255,255,.7); }

/* ⚙ ハンドル */
.sp-panel__handle {
  position: fixed;
  top: 14px; right: 14px;
  z-index: 10001;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.55);
  cursor: pointer;
  opacity: .35;
  transition: opacity .18s ease, background-color .18s ease;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.sp-panel__handle:hover { opacity: 1; background: rgba(0,0,0,.6); color: #fff; }

/* 設定パネル */
.sp-panel {
  position: fixed;
  top: 60px; right: 14px;
  z-index: 10002;
  width: 320px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: rgba(20, 21, 24, .96);
  border: 1px solid #33363c;
  border-radius: 6px;
  padding: 16px;
  transform: translateX(120%);
  transition: transform .2s cubic-bezier(.4,.2,.2,1), opacity .18s ease;
  opacity: 0;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,.8), 0 4px 12px rgba(0,0,0,.5);
}
.sp-panel.is-open {
  transform: translateX(0);
  opacity: 1;
}
.sp-panel[aria-hidden="true"] { pointer-events: none; }
.sp-panel[aria-hidden="false"] { pointer-events: auto; }
.sp-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #23262b;
  color: #f2f2f4;
  font-size: 13px;
}
.sp-panel__x {
  background: none; border: 0; color: #b0b2b7; cursor: pointer;
  font-size: 20px; line-height: 1; padding: 0 6px;
}
.sp-panel__x:hover { color: #fff; }
.sp-panel__actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #23262b;
  display: flex; flex-direction: column; gap: 8px;
}

/* ── Toast ── */
.sp-toast {
  position: fixed;
  left: 50%; bottom: 40px;
  transform: translate(-50%, 20px);
  z-index: 10010;
  background: rgba(0,0,0,.85);
  color: #fff;
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .2s cubic-bezier(.4,.2,.2,1);
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.6);
}
.sp-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── 疑似フルスクリーン（Fullscreen API 拒否時） ── */
body.sp-pseudo-fullscreen { overflow: hidden; }
body.sp-pseudo-fullscreen .sp-header,
body.sp-pseudo-fullscreen .sp-footer { display: none; }

/* ── モバイル ── */
@media (max-width: 600px) {
  .sp-hero { padding: 40px 16px 32px; }
  .sp-catalog { grid-template-columns: 1fr; }
  .sp-panel { width: calc(100vw - 28px); }
  .sp-panel__handle { top: 10px; right: 10px; }
  .sp-brandmark { right: 10px; bottom: 8px; font-size: 10px; }
  .sp-pre { padding: 24px 16px 40px; }
}

/* PRM: transition/animation 停止 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .sp-logo__dot { animation: none; }
}
