/* ============================================================
   Obscura — common.css（全画面共通）
   コンセプト: camera obscura（暗い部屋に像を投影する光学装置）。
   暗い「チャンバー」と、投影される真鍮色の光。技術ラベルは等幅で。
   全画面で読み込む土台: トークン / リセット / ユーティリティ /
   ボタン / ブランド / ヘッダー / フッター / 進捗部品。
   ============================================================ */

:root {
  --ink: #181722;          /* 暗室（チャンバー） */
  --ink-2: #211f2d;        /* ヒーロー内の段差 */
  --paper: #f7f5f0;        /* 明るい面 */
  --paper-2: #efeae1;      /* 交互セクション */
  --line: #ddd7cb;         /* 紙面上のヘアライン */
  --line-inv: rgba(255, 255, 255, 0.12);

  --lens: #c8993f;         /* 真鍮＝投影される光（唯一のアクセント） */
  --lens-soft: #e4c98a;

  --danger: #b4453a;       /* エラー文字 */
  --danger-bg: rgba(180, 69, 58, 0.08);
  --danger-line: rgba(180, 69, 58, 0.35);

  --text: #1d1c24;         /* 紙面上の文字 */
  --text-mute: #6c6757;
  --text-inv: #f2f0ea;     /* 暗室上の文字 */
  --text-inv-mute: #a39fae;

  --maxw: 1140px;
  --radius: 14px;
  --radius-sm: 10px;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--paper);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; letter-spacing: -0.01em; margin: 0; font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
strong { font-weight: 600; color: var(--lens); }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
.wrap--narrow { max-width: 760px; }
.mono { font-family: var(--font-mono); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--text-inv);
  padding: 10px 16px; border-radius: 8px; transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--lens); outline-offset: 3px; border-radius: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 500; font-size: 0.95rem;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform 0.18s var(--ease), background 0.18s, color 0.18s, border-color 0.18s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--lg { padding: 14px 28px; font-size: 1rem; }
.btn--block { width: 100%; }
.btn--primary { background: var(--lens); color: #211a08; }
.btn--primary:hover { background: var(--lens-soft); }
.btn--ghost { background: transparent; color: var(--text-inv); }
.btn--ghost:hover { background: var(--line-inv); }
.btn--line { background: transparent; color: var(--text-inv); border-color: var(--line-inv); }
.btn--line:hover { border-color: var(--lens); color: var(--lens-soft); }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text-inv); }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.18rem; letter-spacing: 0.02em; }
.brand__mark { color: var(--lens); }
.brand--inv { color: var(--text-inv); }

/* ============================================================
   HEADER（全ページ共通・暗いチャンバー帯）
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(24, 23, 34, 0.86);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line-inv);
}
.site-header__inner { display: flex; align-items: center; gap: 24px; height: 66px; }
.nav { display: flex; gap: 26px; margin-left: 14px; }
.nav a { color: var(--text-inv-mute); font-size: 0.92rem; transition: color 0.18s; }
.nav a:hover { color: var(--text-inv); }
.site-header__actions { display: flex; gap: 10px; margin-left: auto; }

.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text-inv); margin: 4px 0; transition: 0.25s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-drawer {
  display: none; flex-direction: column; gap: 4px; padding: 12px 24px 24px;
  background: var(--ink); border-bottom: 1px solid var(--line-inv); border-left: 1px solid var(--line-inv);
  box-sizing: border-box;
  /* 下のコンテンツを押し下げず、上に重ねて表示する（ヘッダー直下・約2/3幅・右寄せ）。
     ヘッダーが position:sticky なので、それを基準に絶対配置する。 */
  position: absolute; top: 100%; right: 0; width: 66%; z-index: 50;
  max-height: calc(100vh - 66px); overflow-y: auto;
  box-shadow: -8px 10px 26px rgba(0, 0, 0, 0.4);
}
/* 通常のナビリンクだけ淡色＋区切り線。ボタン(.btn)は自前の配色を保つ（除外しないと金地の文字が読めなくなる） */
.nav-drawer a:not(.btn) { color: var(--text-inv-mute); padding: 12px 4px; border-bottom: 1px solid var(--line-inv); }
.nav-drawer a:not(.btn):last-child { border: 0; }
.nav-drawer .btn { margin-top: 8px; }
.nav-drawer[data-open] { display: flex; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--ink); color: var(--text-inv-mute); padding-top: 64px; border-top: 1px solid var(--line-inv); }
.site-footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 48px; }
.site-footer__tagline { margin-top: 16px; font-size: 0.9rem; line-height: 1.7; }
.site-footer__head { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-inv); margin: 0 0 16px; }
.site-footer__col { display: flex; flex-direction: column; gap: 10px; }
.site-footer__col a { font-size: 0.92rem; transition: color 0.18s; }
.site-footer__col a:hover { color: var(--lens-soft); }
.site-footer__bottom { display: flex; justify-content: space-between; align-items: center; padding-block: 22px; border-top: 1px solid var(--line-inv); font-size: 0.8rem; }
.site-footer__bottom .mono { letter-spacing: 0.08em; color: var(--lens); }

/* ============================================================
   FORM PRIMITIVES（共通部品：ログイン / 新規登録 / 会員情報で共用）
   ============================================================ */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-family: var(--font-display); font-weight: 500; font-size: 0.86rem; color: var(--text); }
.field__req { color: var(--danger); font-size: 0.78rem; margin-left: 4px; }
.field__opt { color: var(--text-mute); font-size: 0.74rem; margin-left: 6px; font-weight: 400; }
.input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); font: inherit; font-size: 0.98rem;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.input::placeholder { color: #a8a295; }
.input:focus { outline: none; border-color: var(--lens); box-shadow: 0 0 0 3px rgba(200, 153, 63, 0.18); }
.input:disabled { background: var(--paper-2); cursor: not-allowed; }
.field__hint { font-size: 0.78rem; color: var(--text-mute); }
.field__error { font-size: 0.8rem; color: var(--danger); }

/* パスワード欄（表示切替ボタン付き） */
.field--password { position: relative; }
.field--password .input { padding-right: 56px; }
.input-toggle {
  position: absolute; right: 6px; bottom: 6px;
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.04em;
  color: var(--text-mute); padding: 7px 9px; border-radius: 8px;
}
.input-toggle:hover { color: var(--lens); background: rgba(200, 153, 63, 0.08); }

/* フォーム全体のエラー（認証失敗など） */
.form-error {
  background: var(--danger-bg); border: 1px solid var(--danger-line);
  color: var(--danger); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 0.88rem; line-height: 1.6;
}

/* ============================================================
   PROGRESS（共通部品：TOPのアップロード進捗 / finishの処理中で共用）
   ============================================================ */
.progress { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.progress__bar { display: block; height: 100%; width: 35%; border-radius: 999px; background: var(--lens); animation: indeterminate 1.6s var(--ease) infinite; }
@keyframes indeterminate { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .progress__bar { animation: none; width: 12%; margin-left: 0; } }

/* ============================================================
   RESPONSIVE（共通：ヘッダー / フッター）
   ============================================================ */
@media (max-width: 920px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav, .site-header__actions { display: none; }
  .nav-toggle { display: block; }
}
@media (max-width: 480px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__bottom { flex-direction: column; gap: 8px; }
}
/* ============================================================
   言語切替（日本語 / English）。ヘッダーは暗色背景のため inv 系配色。
   ============================================================ */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 999px; padding: 2px; background: rgba(255, 255, 255, 0.05); }
/* 明るめの文字色を明示指定（キャッシュ差異や継承で暗くならないよう固定値で担保） */
.lang-switch a { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1; text-decoration: none; color: #d8d5e0; }
.lang-switch a:hover { color: #ffffff; }
.lang-switch a.is-active { background: #6d63f2; color: #ffffff; }
/* ドロワー内：a:not(.btn) の区切り線・縦paddingを打ち消してピル形状を保つ */
.nav-drawer .lang-switch { align-self: flex-start; margin-bottom: 8px; }
.nav-drawer .lang-switch a:not(.btn) { border: 0; padding: 5px 9px; }

/* ============================================================
   Cookie同意バナー（アクセス解析）
   ============================================================ */
.consent-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200;
  max-width: 720px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
  padding: 16px 20px; border-radius: 14px;
  background: var(--ink); color: var(--text-inv);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4);
}
.consent-banner[hidden] { display: none; }
.consent-banner__text { margin: 0; flex: 1 1 260px; font-size: 13px; line-height: 1.65; color: var(--text-inv-mute); }
.consent-banner__text a { color: var(--text-inv); text-decoration: underline; }
.consent-banner__actions { display: flex; gap: 10px; margin-left: auto; }
.consent-banner__actions .btn { padding: 8px 18px; font-size: 13px; }
@media (max-width: 560px) {
  .consent-banner { flex-direction: column; align-items: stretch; }
  .consent-banner__actions { margin-left: 0; }
  .consent-banner__actions .btn { flex: 1; }
}

/* ---- 処理サンプル（before/after 比較・fragments/demo :: player） ----
   トップと各ランディングで共通に使うため common.css に置く。
   顔ぼかしは「本当に隠れるのか」が最大の関心事なので、実物を並べて見せる。
   読み込み前後で高さが変わるとレイアウトがガタつく（CLS悪化）ため、
   枠側で aspect-ratio を固定しておく。 */
.demo { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.demo__item { margin: 0; }
.demo__frame {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line); border-radius: 14px;
  background: #0d0c14;
}
.demo__video { display: block; width: 100%; height: 100%; object-fit: cover; }
.demo__badge {
  position: absolute; left: 12px; top: 12px;
  padding: 5px 12px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em;
  background: rgba(0, 0, 0, 0.62); color: #fff;
}
.demo__badge--after { background: var(--lens); color: #211a08; }
.demo__cap { margin-top: 10px; font-size: 0.9rem; line-height: 1.7; color: var(--text-mute); }
.demo__note { margin-top: 22px; font-size: 0.85rem; color: var(--text-mute); }
.demo__note a { color: var(--lens); }

@media (max-width: 760px) {
  .demo { grid-template-columns: 1fr; gap: 20px; }
}
