/* コースの違い（/courses/）専用。配色・ヘッダ・フッタは style.css を使う。
   コースの切り替えは main 直下のラジオボタン（.cx-radio）の :checked と兄弟セレクタで行い、JS に依存しない。 */

.cx {
  --c-success-light: #E4F5F2;
  --c-text-tertiary: #9A9A9A;
  --accent: var(--c-primary);
  --accent-light: var(--c-primary-light);
  padding-bottom: 1rem;
}

/* ---------- コースの選択状態 ---------- */

.cx-radio {
  /* fixed にしておくと、ラベル押下でラジオにフォーカスが移ってもページがスクロールしない */
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#course-free:checked ~ * { --accent: #8A8A8A; --accent-light: #F1F1F1; }
#course-basic:checked ~ * { --accent: var(--c-primary); --accent-light: var(--c-primary-light); }
#course-pro:checked ~ * { --accent: var(--c-success); --accent-light: var(--c-success-light); }

#course-free:checked ~ * :is(.only-basic, .only-pro, .only-paid) { display: none; }
#course-basic:checked ~ * :is(.only-free, .only-pro) { display: none; }
#course-pro:checked ~ * :is(.only-free, .only-basic) { display: none; }

#course-free:focus-visible ~ * [for="course-free"],
#course-basic:focus-visible ~ * [for="course-basic"],
#course-pro:focus-visible ~ * [for="course-pro"] {
  outline: 3px solid var(--c-text);
  outline-offset: 3px;
}

/* ---------- ヒーロー：PONO を選ぶ ---------- */

.cx-hero {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
}

.cx-hero__title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.cx-hero__lead {
  margin-top: 0.5rem;
  color: var(--c-text-secondary);
  font-size: 0.9375rem;
}

.cx-pick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  max-width: 760px;
  margin: 1.75rem auto 0;
}

.cx-pick__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0.5rem 1.125rem;
  background: var(--c-surface);
  border: 2px solid var(--c-divider);
  border-radius: 20px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cx-pick__pono {
  width: 112px;
  height: 104px;
  object-fit: contain;
  filter: grayscale(0.6);
  opacity: 0.7;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s, opacity 0.2s;
}

.cx-pick__name {
  margin-top: 0.5rem;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.3;
}

.cx-pick__price {
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.3;
}

.cx-pick__unit {
  font-size: 0.75rem;
  color: var(--c-text-secondary);
}

.cx-pick__via {
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--c-text-secondary);
}

.cx-pick__via span {
  display: inline-block;
}

.cx-pick__fit {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--c-text-secondary);
}

.cx-pick__badge {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.125rem 0.75rem;
  border-radius: 999px;
  background: var(--c-primary);
  color: var(--c-text-on-primary);
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
}

#course-free:checked ~ * .cx-pick__item[data-course="free"],
#course-basic:checked ~ * .cx-pick__item[data-course="basic"],
#course-pro:checked ~ * .cx-pick__item[data-course="pro"] {
  border-color: var(--accent);
  box-shadow: 0 8px 28px rgba(74, 74, 74, 0.1);
}

#course-free:checked ~ * [data-course="free"] .cx-pick__pono,
#course-basic:checked ~ * [data-course="basic"] .cx-pick__pono,
#course-pro:checked ~ * [data-course="pro"] .cx-pick__pono {
  filter: none;
  opacity: 1;
  transform: scale(1.12) translateY(-4px);
}

#course-free:checked ~ * [data-course="free"] .cx-pick__price,
#course-basic:checked ~ * [data-course="basic"] .cx-pick__price,
#course-pro:checked ~ * [data-course="pro"] .cx-pick__price {
  color: var(--accent);
}

.cx-hero__hat {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--c-text-secondary);
}

/* ---------- スクロール中も切り替えられるタブ ---------- */

.cx-switch {
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  padding: 0.5rem 0;
  background: rgba(255, 250, 248, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-divider);
}

.cx-switch__inner {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
}

.cx-switch__tab {
  flex: 0 1 9rem;
  padding: 0.375rem 0.5rem;
  border-radius: 999px;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--c-text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#course-free:checked ~ * .cx-switch__tab[data-course="free"],
#course-basic:checked ~ * .cx-switch__tab[data-course="basic"],
#course-pro:checked ~ * .cx-switch__tab[data-course="pro"] {
  background: var(--accent);
  color: var(--c-text-on-primary);
}

/* ---------- 各場面の共通 ---------- */

.cx-scene {
  padding: 3.5rem 0;
}

.cx-scene--tint {
  background: var(--c-surface);
}

.cx-scene__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 2.5rem;
  align-items: center;
}

.cx-scene__grid--flip {
  grid-template-columns: minmax(0, 6fr) minmax(0, 4fr);
}

.cx-scene__title {
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.4;
}

.cx-scene__head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.cx-scene__pono {
  width: 112px;
  height: 104px;
  object-fit: contain;
  flex: 0 0 auto;
}

.cx-scene__line {
  font-weight: 700;
  font-size: 1rem;
}

.cx-scene__note {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--c-text-secondary);
}

.cx-big {
  margin: 0.25rem 0 0.5rem;
  font-size: clamp(3.5rem, 12vw, 5rem);
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.cx-big small {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text-secondary);
  letter-spacing: 0;
}

.cx-big--sm {
  font-size: clamp(2.25rem, 8vw, 3rem);
  margin-top: 0.75rem;
}

/* ---------- スマホ画面の枠 ---------- */

.cx-phones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  list-style: none;
}

.cx-phone__screen {
  position: relative;
  aspect-ratio: 9 / 19.5;
  overflow: hidden;
  border: 4px solid var(--c-text);
  border-radius: 20px;
  background: var(--c-text);
}

.cx-phone__screen > img,
.cx-phone__screen > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cx-phone__cap {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 700;
}

.cx-phone__cap::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.375rem;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.1em;
}

.cx-phone__skip {
  position: absolute;
  inset: 50% 0 auto;
  transform: translateY(-50%);
  margin: 0 auto;
  width: max-content;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--c-surface);
  font-size: 0.75rem;
  font-weight: 700;
}

#course-free:checked ~ * :is(.cx-phone--takeback, .cx-phone--follow) .cx-phase {
  opacity: 0.2;
}

#course-free:checked ~ * :is(.cx-phone--takeback, .cx-phone--follow) .cx-phone__cap {
  color: var(--c-text-tertiary);
}

#course-free:checked ~ * :is(.cx-phone--takeback, .cx-phone--follow) .cx-phone__cap::before {
  background: var(--c-divider);
}

.cx-phone--solo {
  max-width: 260px;
  margin: 0 auto;
  width: 100%;
}

/* フェーズ解析の画面（上下の黒帯を切り落としたキャプチャ）の縦横比に合わせる */
.cx-phones .cx-phone__screen {
  aspect-ratio: 720 / 1405;
}

/* ふりかえりへの PONO のコメント（アプリのホーム画面を模す。吹き出しは chat-mock.css） */
.cx-phone--solo .cx-phone__screen {
  aspect-ratio: auto;
  background: var(--c-bg);
}

.cx-phone__note {
  margin-top: 0.5rem;
  color: var(--c-text-tertiary);
  font-size: 0.6875rem;
  line-height: 1.6;
}

.cx-chat {
  font-size: 0.6875rem;
  line-height: 1.65;
}

.cx-chat__head {
  flex: none;
  padding: 0.5rem 0 0.375rem;
  background: var(--c-surface);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.cx-chat__thread {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem 1rem;
}

.cx-chat .chat-mock__avatar { width: 22px; height: 22px; }

.cx-chat .chat-mock__body { max-width: 82%; }

/* ---------- 技術 ---------- */

.cx-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.cx-chips__label {
  font-size: 0.875rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.cx-chips ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cx-chip {
  padding: 0.3125rem 0.75rem;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-light);
  font-size: 0.8125rem;
  line-height: 1.5;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

#course-free:checked ~ * .cx-chip--paid {
  border-style: dashed;
  border-color: var(--c-divider);
  background: transparent;
  color: var(--c-text-tertiary);
}

/* ---------- ふりかえり ---------- */

.cx-talk {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.cx-talk__pono {
  width: 72px;
  height: 64px;
  object-fit: contain;
  flex: 0 0 auto;
}

.cx-talk__bubble {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 360px;
  padding: 1rem 1.125rem;
  background: var(--c-surface);
  border: 1px solid var(--c-divider);
  border-radius: 4px 18px 18px 18px;
}

.cx-talk__bar {
  display: block;
  height: 0.625rem;
  border-radius: 999px;
  background: var(--accent-light);
}

.cx-talk__bar--short { width: 60%; }

.cx-facts {
  margin-top: 1.25rem;
  display: grid;
  gap: 1rem;
}

.cx-facts dt {
  font-size: 0.75rem;
  color: var(--c-text-secondary);
}

.cx-facts dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  font-weight: 700;
  font-size: 0.9375rem;
}

.cx-days {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.cx-days i {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: var(--accent);
}

.cx-days b {
  margin-left: 0.25rem;
  padding: 0 0.5rem;
  border-radius: 4px;
  background: var(--accent);
  color: var(--c-text-on-primary);
  font-size: 0.6875rem;
  line-height: 1.6;
}

.cx-meter {
  display: inline-block;
  width: 140px;
  height: 0.625rem;
  border-radius: 999px;
  background: var(--c-divider);
  overflow: hidden;
}

.cx-meter__fill {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transition: width 0.3s;
}

/* 140 / 500 文字、3 / 90 日の比率 */
#course-free:checked ~ * .cx-meter .cx-meter__fill { width: 28%; }
#course-free:checked ~ * .cx-meter--days .cx-meter__fill { width: 4%; }

/* ---------- 回数 ---------- */

.cx-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.cx-count {
  padding: 1.25rem 1rem;
  border: 1px solid var(--c-divider);
  border-radius: 16px;
  background: var(--c-bg);
}

.cx-count__label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--c-text-secondary);
}

.cx-count__value {
  margin: 0.25rem 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
}

.cx-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3125rem;
}

.cx-dots i {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: var(--accent);
}

.cx-dots--ticket i {
  width: 1.125rem;
  border-radius: 3px;
}

.cx-coin {
  display: inline-block;
  padding: 0.125rem 0.625rem;
  border: 2px solid var(--c-warning);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--c-text);
}

.cx-meter--days {
  width: 100%;
}

.cx-map {
  height: 140px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--c-divider);
}

.cx-map img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 48%;
  transition: filter 0.2s, opacity 0.2s;
}

#course-free:checked ~ * .cx-map img {
  filter: blur(3px) grayscale(1);
  opacity: 0.5;
}

/* ---------- 一覧表 ---------- */

.cx-table {
  border: 1px solid var(--c-divider);
  border-radius: 16px;
  background: var(--c-surface);
}

.cx-table summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  font-weight: 700;
  cursor: pointer;
}

.cx-table summary img {
  width: 48px;
  height: 42px;
  object-fit: contain;
}

.cx-table__wrap {
  overflow-x: auto;
  padding: 0 1.25rem 1.25rem;
}

.cx-table table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.cx-table th,
.cx-table td {
  padding: 0.625rem 0.5rem;
  border-bottom: 1px solid var(--c-divider);
  text-align: center;
  vertical-align: middle;
}

.cx-table tbody th {
  text-align: left;
  font-weight: 700;
}

.cx-table thead th span {
  display: block;
  font-size: 0.75rem;
  color: var(--c-text-secondary);
}

.cx-table__sub {
  display: block;
  font-size: 0.6875rem;
  color: var(--c-text-secondary);
}

.courses-table__yes { color: var(--c-success); font-weight: 800; }
.courses-table__no  { color: var(--c-text-secondary); }

.cx-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- お申し込み ---------- */

.cx-apply {
  padding: 1rem 0 3rem;
}

.cx-apply__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 760px;
}

.cx-apply__pono {
  width: 128px;
  height: auto;
  flex: 0 0 auto;
}

.cx-apply__lead {
  font-weight: 700;
}

.cx-apply__cta {
  display: inline-block;
  margin: 0.75rem 0;
  padding: 0.75rem 2rem;
  border-radius: 999px;
  background: var(--c-primary);
  color: var(--c-text-on-primary);
  font-weight: 800;
}

.cx-apply__cta:hover {
  background: #F26060;
}

.cx-apply__note {
  font-size: 0.75rem;
  color: var(--c-text-secondary);
  margin-top: 0.375rem;
}

/* ---------- 画面幅 ---------- */

@media (max-width: 860px) {
  .cx-scene__grid,
  .cx-scene__grid--flip {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .cx-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .cx-hero { padding-top: 1.75rem; }

  .cx-pick { gap: 0.5rem; }

  .cx-pick__item { padding: 0.75rem 0.25rem 0.875rem; border-radius: 16px; }

  .cx-pick__pono { width: 72px; height: 66px; }

  .cx-pick__name { font-size: 0.6875rem; white-space: nowrap; letter-spacing: -0.02em; }

  .cx-pick__price { font-size: 1.125rem; }

  .cx-pick__fit { font-size: 0.6875rem; }

  .cx-pick__via { font-size: 0.625rem; }

  .cx-scene { padding: 2.5rem 0; }

  .cx-scene__pono { width: 80px; height: 74px; }

  .cx-phones { gap: 0.5rem; }

  .cx-phone__screen { border-width: 3px; border-radius: 14px; }

  .cx-phone__skip { font-size: 0.625rem; }

  .cx-chips { grid-template-columns: minmax(0, 1fr); }

  .cx-counts { gap: 0.625rem; }

  .cx-count { padding: 1rem 0.75rem; }

  .cx-count__value { font-size: 1.0625rem; }

  .cx-apply__inner { flex-direction: column; text-align: center; }

  .cx-apply__pono { width: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  .cx-pick__item,
  .cx-pick__pono,
  .cx-switch__tab,
  .cx-chip,
  .cx-meter__fill,
  .cx-map img {
    transition: none;
  }
}
