/* styles.css */ :root {
  --bg: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --brand: #0ea5e9;
  --brand-ink: #0b77a8;
  --surface: #f8fafc;
  --card: #ffffff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08);
  --shadow-md: 0 6px 14px rgba(0, 0, 0, .08);
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --fs-0: 12px;
  --fs-1: 14px;
  --fs-2: 16px;
  --fs-3: 20px;
  --fs-4: 24px;
  --fs-5: 32px;
  --fs-6: 40px;
  --line: 1.7;
  --container: 1120px;
  --focus: 3px solid #1d4ed8;
  --flip-perspective: 1000px;
  /* ラインナップ画像の実比率（638×468） */
  --img-ratio: 638/468;
}
/* Base */
* {
  box-sizing: border-box
}
html, body {
  height: 100%
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: var(--line);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img {
  display: block;
  max-width: 100%;
  height: auto
}
a {
  color: inherit
}
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding: 0 var(--space-3)
}
.visually-hidden {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  overflow: hidden;
  white-space: nowrap
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden
}
.skip-link:focus {
  left: var(--space-3);
  top: var(--space-3);
  width: auto;
  height: auto;
  padding: var(--space-2);
  background: #fff;
  border: var(--focus);
  z-index: 999
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: .6rem 1rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform .05s ease, box-shadow .2s ease, background .2s ease;
  min-height: 44px;
}
.btn:active {
  transform: translateY(1px)
}
.btn-primary {
  background: var(--brand);
  color: #fff
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--brand-ink);
  outline: var(--focus)
}
.btn-secondary {
  background: #fff;
  color: var(--brand-ink);
  border-color: #cfe9f5
}
.btn-secondary:hover, .btn-secondary:focus {
  outline: var(--focus)
}
/* Hero（←前の配置に戻す：2カラムは600px〜） */
.hero {
  display: flex;
  justify-content: space-between;
  gap: var(--space-5);
  align-items: center;
  /*padding: calc(var(--space-6) + env(safe-area-inset-top)) 0 var(--space-5);*/
}
@media (max-width:767px) {
  .hero {
    flex-direction: column;
	margin-top: 20px;
  }
}

.hero-content h1 {
  font-size: var(--fs-6);
  margin: 0 0 var(--space-2)
}
@media (max-width:359px) {
  .hero-content h1 {
    font-size: 28px;
    line-height: 1.25
  }
}
.subcopy {
  color: var(--muted);
  margin: 0 0 var(--space-4)
}
.subcopy .em {
  font-weight: 700
}
.hero-cta {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-3)
}
.countdown {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600
}
.countdown .countdown-label {
  color: var(--muted)
}
.hero-visual {
  justify-self: center
}

/* QRフロー（元の調整はそのまま） */
.qr-flow {
  display: flex;
  align-items: center;
  gap: var(--space-4)
}
.qr-flow .arrow {
  font-size: var(--fs-5);
  color: #9ca3af
}
@media (max-width: 420px) {
  .qr-flow {
    gap: 16px;
  }
  .qr-flow img:first-child {
    width: 80px;
    height: auto;
  }
  .qr-flow img:last-child {
    width: calc(100% - 80px - 16px);
    max-width: 240px;
    height: auto;
  }
}
@media (max-width: 360px) {
  .qr-flow {
    flex-wrap: wrap;
  }
  .qr-flow img:last-child {
    width: 100%;
    max-width: 100%;
  }
}
/* About */
.about {
  padding: var(--space-4) 0
}
.about-list {
  margin: 0 0 var(--space-3);
  padding-left: 1.2em
}
.about-cta {
  margin-top: var(--space-3)
}
/* Features */
.features {
  padding: var(--space-4) 0
}
.feature-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  padding: 0;
  margin: 0;
  list-style: none
}
.card {
  background: var(--card);
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm)
}
.card h3 {
  margin-top: 0;
  margin-bottom: .25rem
}
.card p {
  margin: 0;
  color: var(--muted)
}
/* Lineup（←前のCSSに戻す） */
.lineup {
  padding: var(--space-4) 0
}
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4)
}
.lineup.container {
  width: auto;
}
@media (min-width:600px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr)
  }
}
@media (min-width:960px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr)
  }
}
/* タップヒント（スマホのみ表示） */
.tap-hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  padding: .35rem .6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  user-select: none;
  opacity: .95;
  transition: opacity .2s;
  z-index: 5;
}
.flip[aria-pressed="true"] .tap-hint {
  opacity: 0;
}
/* デバイス別カーソル */
@media (hover: none) {
  .flip {
    cursor: pointer;
  }
}
@media (hover: hover) and (pointer: fine) {
  .flip {
    cursor: default;
  }
}
.product-card {
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  background: var(--card);
  overflow: hidden;
  box-shadow: var(--shadow-sm)
}
.product-media {
  position: relative;
  padding: var(--space-3);
  background: var(--surface)
}
.product-body {
  padding: var(--space-4)
}
.product-title {
  font-size: var(--fs-3);
  margin: 0 0 .25rem
}
.product-desc {
  color: var(--muted);
  margin: 0
}
/* =========================================================
   Flip cards（親は回さず面だけ回す）
   ========================================================= */
.flip {
  perspective: var(--flip-perspective);
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
  position: relative;
}
.flip-inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: var(--img-ratio); /* 638/468 */
}
.flip::before {
  content: "";
  display: block;
  padding-top: calc(100% * (468 / 638)); /* ≒73.35% */
}
.flip > .flip-inner {
  position: absolute;
  inset: 0;
}
.flip-face {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  transition: transform .6s, opacity .2s linear;
}
.flip-face.front {
  transform: rotateY(0deg);
  opacity: 1;
  z-index: 2;
}
.flip-face.back {
  transform: rotateY(180deg);
  opacity: 0;
  z-index: 1;
}
.flip[aria-pressed="true"] .flip-face.front {
  transform: rotateY(180deg);
  opacity: 0;
  z-index: 1;
}
.flip[aria-pressed="true"] .flip-face.back {
  transform: rotateY(0deg);
  opacity: 1;
  z-index: 2;
}
@media (hover: hover) and (pointer: fine) {
  .flip:hover .flip-face.front, .flip:focus-within .flip-face.front {
    transform: rotateY(180deg);
    opacity: 0;
    z-index: 1;
  }
  .flip:hover .flip-face.back, .flip:focus-within .flip-face.back {
    transform: rotateY(0deg);
    opacity: 1;
    z-index: 2;
  }
}

/* A11y / Robustness */ :focus {
  outline: var(--focus);
  outline-offset: 2px
}
button, [role="button"], .btn {
  outline-offset: 2px
}
body {
  overflow-wrap: anywhere;
  overflow-x: hidden
}
@media (prefers-reduced-motion: reduce) {
  .flip-face {
    transition: none
  }
}
/* Hero key visual (1枚画像版：元のまま) */
.hero-kv {
  display: block;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  width: 100%;
  height: auto;
  max-width: 500px;
  margin-inline: auto;
}

/* === 特徴：QR→アプリ 並列デモ（矢印は“間”、PCは実寸比でキー=スマホの1/2） === */
/* 見出し直下の説明 */
.feature-blurb {
  margin: 8px 0 16px;
  color: var(--muted);
  font-weight: 600;
}
/* 5トラック構成：左=キーホルダー / スペーサ / 矢印 / スペーサ / 右=スマホ */
.scan-row {
  --arrow-col: 28px; /* 矢印の幅 */
  --spacer-col: 14px; /* 矢印左右のスペーサ */
  display: grid;
  grid-template-columns:
    minmax(0, 0.88fr) /* 1: キーホルダー列 */
    var(--spacer-col) /* 2: スペーサ */
    var(--arrow-col) /* 3: 矢印 */
    var(--spacer-col) /* 4: スペーサ */
    minmax(0, 1.12fr); /* 5: スマホ列 */
  gap: 0; /* 間隔はスペーサ列で制御 */
  align-items: center;
  overflow: hidden;
  width: fit-content;
  margin: 0 auto;
}
/* それぞれの配置を明示（自動配置のブレを排除） */
.keyface-wrap {
  grid-column: 1;
  margin: 0;
}
.scan-arrow {
  grid-column: 3;
}
.scan-img.phone {
  grid-column: 5;
}
/* 画像の基本：幅基準はスマホ幅まで、比率は aspect-ratio で固定 */
.scan-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: transparent;
  min-width: 0;
}
.scan-img.keyface {
  aspect-ratio: 638 / 468;
}
.scan-img.phone {
  aspect-ratio: 9 / 16;
}
/* キーホルダーのラッパー（ここがサイズを支配） */
.keyface-wrap {
  position: relative;
  aspect-ratio: 638 / 468;
  width: 100%;
  height: auto;
  min-width: 0;
}
.keyface-wrap > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* ★ aspect-ratio 非対応/不安定環境向けフォールバック */
@supports not (aspect-ratio: 1 / 1) {
  .keyface-wrap::before {
    content: "";
    display: block;
    padding-top: calc(100% * (468 / 638)); /* ≒73.35% */
  }
}
/* === キーホルダーのQRガイド（638×468 向けに再調整） === */
/* figure 既定マージンを無効化（ズレ防止） */
.keyface-wrap {
  position: relative;
  aspect-ratio: 638 / 468;
  width: 100%;
  height: auto;
  margin: 0; /* ← 重要：figure既定marginを打消し */
  /* ▼ 本番アセット向けの座標（W638×H468基準） */
  --qr-x: 10.3%; /* ← 15.8% から -0.9%：少し左へ */
  --qr-y: 50.4%; /* ← 41.0% から +1.4%：少し下へ */
  --qr-size: 25%; /* 大きさはそのまま（問題なし） */
  /* 最終微調整用（必要時のみ px で上書き） */
  --qr-nudge-x: 0px; /* +右 / -左 */
  --qr-nudge-y: 0px; /* +下  / -上  */
  --qr-nudge-s: 0px; /* +拡 / -縮  */
}
/* 画像は常に容器いっぱい＝オーバーレイ座標と一致させる */
.keyface-wrap > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* QR読取ガイド（角括弧＋高コントラストのリング＆グロー：強めのチカチカ） */
.qr-glow {
  position: absolute;
  left: calc(var(--qr-x) + var(--qr-nudge-x));
  top: calc(var(--qr-y) + var(--qr-nudge-y));
  aspect-ratio: 1 / 1; /* 常に正方形 */
  width: calc(var(--qr-size) + var(--qr-nudge-s));
  pointer-events: none;
  /* 角括弧（4隅だけ描画） */
  --r: 10px;
  --c: #0ea5e9;
  background:
    conic-gradient(from 90deg at var(--r) var(--r), var(--c) 90deg, transparent 0) top left, conic-gradient(from 0deg at calc(100% - var(--r)) var(--r), var(--c) 90deg, transparent 0) top right, conic-gradient(from 180deg at var(--r) calc(100% - var(--r)), var(--c) 90deg, transparent 0) bottom left, conic-gradient(from -90deg at calc(100% - var(--r)) calc(100% - var(--r)), var(--c) 90deg, transparent 0) bottom right;
  background-size: 22% 22%;
  background-repeat: no-repeat;
  /* コントラスト強化：白リング + 外側グロー（少し太く＆強く） */
  border-radius: 12px;
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, .98), /* 内側の白リング 2px→3px */ 0 0 0 3px rgba(2, 132, 199, .92), /* 外周のシアンリング 2px→3px */ 0 0 18px 8px rgba(56, 189, 248, .40); /* 外側グロー強め */
  /* チカチカ感：速いパルス + ステップ点滅を合成 */
  animation:
    qrPulse .9s ease-in-out infinite, /* 心臓鼓動っぽい明滅（速め） */ qrFlash 1.1s steps(2, end) infinite; /* ステップ点滅（カクッと切替） */
}
/* パルスの強弱幅を大きめに（発光がハッキリ） */
@keyframes qrPulse {
  0% {
    box-shadow:
      inset 0 0 0 3px rgba(255, 255, 255, .95), 0 0 0 3px rgba(2, 132, 199, .86), 0 0 8px 4px rgba(56, 189, 248, .25);
    transform: scale(1);
    opacity: .92;
  }
  50% {
    box-shadow:
      inset 0 0 0 3px rgba(255, 255, 255, 1), 0 0 0 3px rgba(2, 132, 199, 1), 0 0 22px 12px rgba(56, 189, 248, .50);
    transform: scale(1.015); /* ごく僅かに膨らむ（位置ズレは出ない） */
    opacity: 1;
  }
  100% {
    box-shadow:
      inset 0 0 0 3px rgba(255, 255, 255, .95), 0 0 0 3px rgba(2, 132, 199, .86), 0 0 8px 4px rgba(56, 189, 248, .25);
    transform: scale(1);
    opacity: .92;
  }
}
/* ステップ点滅：パッと光る→少し落ちる を交互に */
@keyframes qrFlash {
  0%, 49% {
    filter: brightness(1) saturate(1);
  }
  50%, 100% {
    filter: brightness(1.18) saturate(1.25);
  }
}
/* 動きを抑える環境ではアニメ弱化（ちらつき配慮） */
@media (prefers-reduced-motion: reduce) {
  .qr-glow {
    animation: qrPulse 1.8s ease-in-out infinite;
  } /* ステップ点滅は無効化 */
}
/* 矢印：中央カラムに固定 */
.scan-arrow {
  width: var(--arrow-col);
  height: var(--arrow-col);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  overflow: hidden;
}
.scan-arrow svg {
  width: 100%;
  height: 100%;
  animation: nudge 1.2s ease-in-out infinite;
}
@keyframes nudge {
  0%, 100% {
    transform: translateX(0)
  }
  50% {
    transform: translateX(2px)
  }
}
/* ------- ブレイクポイント ------- */
/* スマホ：現状の見え方をキープ */
@media (max-width: 599.98px) {
  .scan-row {
    --arrow-col: 26px;
    --spacer-col: 12px;
    grid-template-columns:
      minmax(0, 0.88fr) var(--spacer-col) var(--arrow-col) var(--spacer-col) minmax(0, 1.12fr);
  }
  .scan-img.keyface {
    max-height: 28vh;
  }
  .scan-img.phone {
    max-height: 36vh;
  }
}
/* タブレット：少し広げる */
@media (min-width: 600px) and (max-width: 959.98px) {
  .features {
	display: flex;
    justify-content: center;
	flex-direction: column;
  }
  .scan-row {
    --arrow-col: 50px;
    --spacer-col: 16px;
    grid-template-columns:
      minmax(0, 0.95fr) var(--spacer-col) var(--arrow-col) var(--spacer-col) minmax(0, 1.25fr);
  }
  .scan-img.keyface {
    max-height: 30vw;
  }
  .scan-img.phone {
	display: block; 
	max-width: 200px; 
	width: 100%; 
	height: auto;
	margin: 0 auto;
	box-sizing: border-box;
  }
}
/* PC：高さ基準で実寸比を固定（スマホ420px / キー210px = 1/2） */
@media (min-width: 960px) {
  .scan-row {
    --arrow-col: 50px;
    --spacer-col: 24px;
    /* 列幅は内容サイズに合わせつつ中央に寄せる */
    grid-template-columns: max-content var(--spacer-col) var(--arrow-col) var(--spacer-col) max-content;
    max-width: 980px;
    margin-inline: auto;
    /* ▼高さを一元管理：スマホ高 → キー高(=1/2) を導出 */
    --phone-h: clamp(360px, 38vh, 420px); /* 上限420px・下限360px、画面高に連動 */
    --key-h: calc(var(--phone-h) / 3); /* 常にスマホの半分 */
	display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
  }
  /* PC：過度な拡大を防ぐため上限つきの固定比率に */
  .keyface-wrap {
    height: var(--key-h);
    width: calc(var(--key-h) * 638 / 468); /* 638×468 の実比率を維持 */
  }
  .scan-img.phone {
    width: auto; /* 列幅に引っ張られない */
    height: var(--phone-h);
  }
  .scan-img {
    width: auto;
  } /* 過拡大抑止 */
}
/* 仕様セクションまわりだけ少しタイトに */
#specs {
  padding: var(--space-1) 0;
} /* 仕様セクション自体を少し薄く */
#lineup {
  padding-bottom: var(--space-4);
} /* ラインナップの下だけ軽く調整 */
#about-cp {
  padding-top: var(--space-4);
} /* 入手方法の上だけ軽く調整 */
/* === QRモーダル === */
.qr-modal-open {
  overflow: hidden;
}
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
}
.qr-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}
.qr-modal__panel {
  position: relative;
  margin: 0;
  /* 画面幅の約1/3。最小260px〜最大420pxで制御 */
  width: clamp(260px, 33vw, 420px);
  max-height: 80vh;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #fff;
}
.qr-modal__panel img {
  display: block;
  width: 100%;
  height: auto;
}
.qr-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.qr-modal__close:focus {
  outline: var(--focus);
}

/* ------- FAQ矢印 ------- */
details summary::before {
  content: "\25B6";
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.2s ease;
}

details[open] summary::before {
  transform: rotate(90deg);
}