/* Homepage "Codex研修でできること" (.cx): four feature cards with product mocks, per the supplied design.
   Desktop: header with cloud art + one row of four cards + gradient CTA band (fits one screen).
   Phone: same cards behind a radio-tab switcher. */

.cx {
  --ink: #0f1a4d;
  --text: #3a4468;
  --muted: #7a82a3;
  --accent: #3b5bf6;
  --card: rgba(255, 255, 255, 0.82);
  --line: rgba(160, 175, 240, 0.35);
  --dark: #151b3d;
  --green: #22c55e;
  position: relative;
  overflow: hidden;
  padding: 40px 32px 32px;
  background: #eef1ff;
  color: var(--ink);
  font-family: "Noto Sans JP", system-ui, sans-serif;
  line-height: 1.6;
  text-align: left;
  isolation: isolate;
}

:where(.cx) *, :where(.cx) *::before, :where(.cx) *::after {
  box-sizing: border-box;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: normal;
}

:where(.cx) :is(h2, h3, p, ul, ol, pre) { margin: 0; padding: 0; }
:where(.cx) :is(ul, ol) { list-style: none; }
:where(.cx) a { text-decoration: none; }

:where(.cx) svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cx__bg { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; }
.cx__inner { max-width: 1440px; margin: 0 auto; }

/* ---------- header ---------- */
.cx-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; padding: 0 16px; }

.cx-eyebrow { color: #4a5a9c; font-size: 20px; font-weight: 500; line-height: 1.3; }
.cx-eyebrow small { display: block; color: #7a8ac0; font-family: "Inter", sans-serif; font-size: 13px; font-weight: 500; letter-spacing: 0.08em; }

.cx-title {
  margin-top: 18px;
  color: var(--ink);
  font-size: clamp(30px, 2.9vw, 44px);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.cx-title .nb { display: inline-block; }
.cx-title em { color: var(--accent); font-style: normal; }
.cx-lead { margin-top: 18px; color: var(--text); font-size: 15px; line-height: 1.8; }

.cx-head__art { position: relative; flex: none; width: 340px; height: 230px; }
.cx-head__art img { position: absolute; top: 0; left: 20px; width: 170px; height: auto; filter: drop-shadow(0 16px 30px rgba(80, 80, 240, 0.35)); }

.cx-script {
  position: absolute;
  top: 18px;
  right: 0;
  color: #7c86d8;
  font-family: "Caveat", cursive;
  font-size: 34px;
  line-height: 1.05;
  transform: rotate(-12deg);
}

.cx-pill {
  position: absolute;
  bottom: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #2f45c9;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(60, 80, 200, 0.12);
  transition: background 0.2s;
}

.cx-pill:hover { background: #fff; }

/* ---------- card ---------- */
.cx-card {
  display: flex;
  flex-direction: column;
  padding: 22px 26px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 16px 40px rgba(70, 90, 200, 0.08);
  backdrop-filter: blur(10px);
}

.cx-card__top { display: flex; align-items: center; gap: 16px; }
.cx-card__num { color: #7f8fd8; font-family: "Inter", sans-serif; font-size: 22px; font-weight: 600; }

.cx-card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(145deg, #a7b4ff, #6f84f6);
  color: #fff;
  box-shadow: 0 8px 18px rgba(90, 110, 240, 0.3);
}

.cx-card__icon svg { width: 26px; height: 26px; }
.cx-card__tag { margin-left: auto; color: #8a93b8; font-family: "Inter", sans-serif; font-size: 12px; font-weight: 500; letter-spacing: 0.12em; }

.cx-card__title { margin-top: 18px; color: var(--ink); font-size: clamp(20px, 1.65vw, 25px); font-weight: 800; line-height: 1.35; }
.cx-card__body { margin-top: 10px; min-height: 5.4em; color: #5d6689; font-size: 13.5px; line-height: 1.75; }

.cx-card__checks { display: grid; gap: 7px; margin-top: 16px; }

.cx-card__checks li {
  position: relative;
  padding-left: 28px;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
}

.cx-card__checks li::before {
  content: "";
  position: absolute;
  top: 0.3em;
  left: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-8.5'/%3E%3C/svg%3E") center / 11px no-repeat,
    var(--accent);
}

/* ---------- card mocks ---------- */
.cx-m { height: 150px; margin-top: 14px; overflow: hidden; border-radius: 12px; font-size: 12px; }

/* 01 terminal */
.cx-m--term { display: flex; flex-direction: column; padding: 10px 12px 12px; background: var(--dark); color: #fff; }
.cx-m__bar { display: flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, 0.8); font-size: 12px; }
.cx-m__bar svg { width: 14px; height: 14px; }
.cx-m__prompt { position: relative; flex: 1; margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.07); }
.cx-m__prompt p { font-size: 12.5px; line-height: 1.6; }

.cx-m__send {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  border-radius: 8px;
  background: #3b82f6;
  font-weight: 700;
}

/* 02 dashboard */
.cx-m--dash { display: flex; border: 1px solid var(--line); background: #fff; }
.cx-m__side { display: flex; flex-direction: column; gap: 9px; width: 38px; padding: 10px 8px; background: #1e2a5c; }
.cx-m__side i { height: 14px; border-radius: 4px; background: rgba(255, 255, 255, 0.25); }
.cx-m__side i.is-on { background: #3b82f6; }
.cx-m__main { flex: 1; padding: 10px 12px; }
.cx-m__head { display: flex; justify-content: space-between; color: var(--ink); font-size: 12px; font-weight: 700; }
.cx-m__head span { color: var(--muted); font-weight: 500; }
.cx-m__kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.cx-m__kpis div { padding: 6px 8px; border-radius: 6px; box-shadow: 0 1px 4px rgba(20, 30, 80, 0.08); }
.cx-m__kpis small { display: block; color: var(--muted); font-size: 9px; }
.cx-m__kpis b { display: block; color: var(--ink); font-family: "Inter", sans-serif; font-size: 13px; }
.cx-m__kpis em { color: var(--green); font-size: 9.5px; font-style: normal; font-weight: 700; }
.cx-m__chart { display: block; width: 100%; height: 52px; margin-top: 6px; }

/* 03 working */
.cx-m--work { padding: 10px 14px; border: 1px solid var(--line); background: #fff; }
.cx-m__title { display: flex; justify-content: space-between; color: var(--ink); font-size: 13px; font-weight: 700; }
.cx-m__title span { color: var(--muted); font-size: 10.5px; font-weight: 500; }
.cx-m--work ul { display: grid; gap: 5px; margin-top: 8px; }
.cx-m--work li { position: relative; display: flex; align-items: center; gap: 10px; padding-left: 22px; color: var(--text); font-size: 12px; }
.cx-m--work li::before { content: ""; position: absolute; left: 0; width: 14px; height: 14px; border: 1.5px solid #cfd5ee; border-radius: 50%; }
.cx-m--work li.is-done::before {
  border-color: var(--green);
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-8.5'/%3E%3C/svg%3E") center / 9px no-repeat;
}
.cx-m--work li.is-run::before { border: 3.5px solid var(--accent); }
.cx-m--work li:not(.is-done):not(.is-run) { color: var(--muted); }
.cx-m__prog { flex: 1; height: 4px; margin-left: 10px; border-radius: 999px; background: #e6e9f7; overflow: hidden; }
.cx-m__prog i { display: block; width: 42%; height: 100%; background: var(--accent); animation: cx-prog 2.4s ease-in-out infinite alternate; }

/* 04 review */
.cx-m--rev { padding: 8px 12px; border: 1px solid var(--line); background: #fff; }
.cx-m__tabs { display: flex; gap: 14px; padding-bottom: 6px; border-bottom: 1px solid #eceff8; color: var(--text); font-size: 11.5px; }
.cx-m__tabs span.is-on { color: var(--ink); font-weight: 700; }
.cx-m__tabs b { margin-left: 4px; padding: 0 5px; border-radius: 4px; background: #e8ecff; color: var(--accent); font-size: 10px; }
.cx-m__tabs span:nth-child(2) b,
.cx-m__tabs span:nth-child(3) b { background: #ffe8e8; color: #e0453a; }

.cx-m__code {
  margin-top: 6px;
  color: #3a4468;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 10.5px;
  line-height: 1.55;
  white-space: pre;
  overflow: hidden;
}

.cx-m__code .ln { display: inline-block; width: 2em; color: #a8afc9; }
.cx-m__code .ln.is-hl { color: #e0453a; }
.cx-m__code .k { color: #7c3aed; }
.cx-m__code .add { color: #16a34a; }

.cx-m__issue {
  position: relative;
  margin: -42px 0 0 30px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #fff1f1;
  color: #c2362c;
  font-size: 11.5px;
  line-height: 1.6;
}

.cx-m__issue i {
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  margin-right: 6px;
  border-radius: 50%;
  background: #e0453a;
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  vertical-align: -1px;
}

/* ---------- desktop grid ---------- */
.cx-sp { display: none; }
.cx-pc { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }

/* ---------- CTA band ---------- */
.cx-band {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 18px;
  padding: 20px 32px;
  border-radius: 16px;
  background: linear-gradient(90deg, #2b44d6 0%, #3f5ee8 55%, #6e8cf7 100%);
  color: #fff;
  box-shadow: 0 16px 40px rgba(50, 70, 210, 0.25);
}

.cx-band__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: linear-gradient(145deg, #b8c2ff, #8a9cf8);
  color: #fff;
}

.cx-band__icon svg { width: 30px; height: 30px; fill: currentColor; stroke: none; }
.cx-band__text { flex: 1; padding-right: 24px; border-right: 1px solid rgba(255, 255, 255, 0.25); }
.cx-band__text h3 { font-size: 20px; font-weight: 800; line-height: 1.4; }
.cx-band__text p { margin-top: 2px; color: rgba(255, 255, 255, 0.82); font-size: 13px; }

.cx-band__btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 54px;
  padding: 0 40px;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.2s;
}

.cx-band__btn:hover { transform: translateY(-1px); }
.cx-band__btn svg { width: 20px; height: 20px; }
.cx-band__btn--ghost { border: 1px solid rgba(255, 255, 255, 0.7); background: transparent; color: #fff; }

/* ---------- tablet ---------- */
@media (max-width: 1100px) and (min-width: 768px) {
  .cx { padding: 64px 28px 56px; }
  .cx-head__art { display: none; }
  .cx-pc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-band { flex-wrap: wrap; }
  .cx-band__text { flex-basis: calc(100% - 80px); padding-right: 0; border-right: 0; }
  .cx-band__btn { flex: 1; }
}

/* ---------- phone ---------- */
@media (max-width: 767px) {
  .cx { padding: 56px 16px 48px; }
  .cx .cx-pc { display: none; }
  .cx .cx-sp { display: block; margin-top: 22px; }

  .cx-head { display: block; padding: 0; }
  .cx-eyebrow { font-size: 15px; }
  .cx-eyebrow small { font-size: 11px; }
  .cx-title { margin-top: 12px; font-size: clamp(22px, 6.3vw, 28px); line-height: 1.45; }
  .cx-lead { margin-top: 12px; font-size: 13px; line-height: 1.8; }
  .cx-lead br { display: none; }

  .cx-head__art { width: 100%; height: auto; margin-top: 16px; }
  .cx-head__art img, .cx-script { display: none; }
  .cx-pill { position: static; padding: 10px 18px; font-size: 13px; }

  .cx-sp__radio { position: absolute; opacity: 0; pointer-events: none; }
  .cx-sp__tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }

  .cx-sp__tabs label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 2px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
    color: #5d6689;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
  }

  .cx-sp__tabs label span { font-family: "Inter", sans-serif; font-size: 10.5px; opacity: 0.8; }

  #cx-tab-auto:checked ~ .cx-sp__tabs label[for="cx-tab-auto"],
  #cx-tab-build:checked ~ .cx-sp__tabs label[for="cx-tab-build"],
  #cx-tab-accel:checked ~ .cx-sp__tabs label[for="cx-tab-accel"],
  #cx-tab-improve:checked ~ .cx-sp__tabs label[for="cx-tab-improve"] {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
  }

  .cx-sp__radio:focus-visible ~ .cx-sp__tabs { outline: 2px solid var(--accent); outline-offset: 2px; }

  .cx-sp__panels { margin-top: 10px; }
  .cx-sp__panels .cx-card { display: none; padding: 20px 18px; }

  #cx-tab-auto:checked ~ .cx-sp__panels .cx-card--auto,
  #cx-tab-build:checked ~ .cx-sp__panels .cx-card--build,
  #cx-tab-accel:checked ~ .cx-sp__panels .cx-card--accel,
  #cx-tab-improve:checked ~ .cx-sp__panels .cx-card--improve { display: flex; }

  .cx-card__title { font-size: 21px; }
  .cx-card__body { min-height: 0; font-size: 13px; }
  .cx-card__body br { display: none; }
  .cx-card__checks li { font-size: 13.5px; }

  .cx-band { flex-direction: column; align-items: stretch; gap: 14px; padding: 20px 18px; }
  .cx-band__icon { display: none; }
  .cx-band__text { padding: 0; border: 0; }
  .cx-band__text h3 { font-size: 18px; }
  .cx-band__btn { height: 50px; padding: 0 16px; font-size: 14px; }
}

@keyframes cx-prog { from { width: 30%; } to { width: 62%; } }

@media (prefers-reduced-motion: reduce) {
  .cx * { animation: none !important; transition: none !important; }
}

/* ---------- desktop: tighten to one screen, match reference proportions ---------- */
@media (min-width: 1101px) {
  .cx { padding: 30px 32px 24px; }
  .cx-eyebrow { font-size: 18px; }
  .cx-title { margin-top: 10px; font-size: clamp(28px, 2.6vw, 42px); line-height: 1.28; }
  .cx-lead { margin-top: 10px; font-size: 14px; line-height: 1.7; }
  .cx-head__art { height: 200px; }
  .cx-head__art img { width: 150px; }

  .cx-pc { margin-top: 12px; }
  .cx-card { padding: 18px 22px 18px; }
  .cx-card__icon { width: 44px; height: 44px; }
  .cx-card__title { margin-top: 12px; font-size: clamp(19px, 1.55vw, 24px); }
  .cx-card__body { margin-top: 6px; min-height: 5.25em; font-size: 13px; line-height: 1.7; }
  .cx-card__checks { gap: 4px; margin-top: 12px; }
  .cx-card__checks li { font-size: 14px; }

  .cx-m { height: 142px; margin-top: 10px; }
  .cx-m__main { padding: 8px 10px; }
  .cx-m__kpis { margin-top: 6px; }
  .cx-m__kpis div { padding: 4px 8px; }
  .cx-m__chart { height: 44px; margin-top: 4px; }
  .cx-m--work { padding: 8px 12px; }
  .cx-m--work ul { gap: 3px; margin-top: 6px; }
  .cx-m--work li { font-size: 11.5px; }

  .cx-band { margin-top: 14px; padding: 14px 28px; }
  .cx-band__icon { width: 48px; height: 48px; }
  .cx-band__btn { height: 50px; padding: 0 34px; }
}

@media (min-width: 1101px) {
  .cx { padding-top: 26px; }
  .cx-m__kpis b { line-height: 1.3; }
  .cx-m__kpis small, .cx-m__kpis em { line-height: 1.35; }
  .cx-m__chart { height: 40px; }
  .cx-m--work li { line-height: 1.45; }
  .cx-m__code { line-height: 1.45; }
  .cx-m__issue { margin-top: -34px; padding: 4px 10px; line-height: 1.5; }
  .cx-band { margin-top: 12px; }
}

@media (min-width: 1101px) and (max-width: 1400px) {
  .cx-m__tabs { gap: 10px; font-size: 10.5px; }
  .cx-m__code { font-size: 9.5px; line-height: 1.35; }
  .cx-m__issue { font-size: 10.5px; }
}
.cx-band__text .nb { display: inline-block; }
