/*
 * Responsive stage
 * PC: Figma 1500px canvas / SP: Figma 750px canvas rendered at 375px.
 * Individual sections retain their Figma-matched baseline geometry; the stage
 * scales fonts, spacing, images and borders together to preserve proportions.
 */
:root {
  --design-width: 1500px;
  --design-scale: 1;
  --sp-readable-min: 10px;
}

html,
body {
  width: 100%;
  overflow-x: clip;
}

.design-viewport {
  width: 100%;
  overflow: hidden;
}

.design-stage {
  width: var(--design-width);
  transform-origin: top left;
  zoom: var(--design-scale);
}

@supports not (zoom: 1) {
  .design-viewport {
    height: var(--design-height, auto);
  }

  .design-stage {
    zoom: 1;
    transform: scale(var(--design-scale));
  }
}

@media (min-width: 900px) {
  :root {
    --design-width: 1500px;
  }
}

@media (max-width: 899px) {
  :root {
    --design-width: 375px;
  }

  /* Figma上で10px未満の補助文字だけ、縮小後も10pxを下回らない。 */
  .brand__sub,
  .cases__note,
  .income__note,
  .course-note,
  .course-card__total small,
  .course-card__lessons span,
  .roadmap__payment,
  .skill-group--tool li:nth-child(2)::after,
  .comparison-table__head > div:last-child,
  .comparison-table__row span,
  .comparison-table__row:nth-child(3) > div:last-child span,
  .comparison-table__row:nth-child(4) > div:nth-child(2) span,
  .discount-card__note,
  .flow-step > span small,
  .final-cta__note {
    font-size: max(10px, var(--sp-readable-min));
  }

  /* 講師本文が増えても、次カードの丸バッジと接触させない。 */
  .instructor-grid {
    row-gap: max(60px, calc(var(--sp-readable-min) * 6));
  }

  .instructor-card {
    min-width: 0;
  }

  /* 支払い方法はFigmaの細い1行ピルを維持する。 */
  .roadmap__payment {
    grid-template-columns: 65px minmax(0, 1fr);
    height: 26px;
    min-height: 0;
    overflow: hidden;
    border-radius: 999px;
    font-size: 8px;
    line-height: 1;
  }

  .roadmap__payment strong,
  .roadmap__payment span {
    min-width: 0;
    padding: 0 5px;
    font-size: 8px;
    line-height: 1;
    white-space: nowrap;
  }

  .roadmap__payment strong {
    justify-content: center;
    border-radius: 999px 0 0 999px;
    letter-spacing: 0;
  }

  .roadmap__payment span {
    justify-content: flex-start;
    letter-spacing: 0;
    overflow-wrap: normal;
  }

  /* 料金注釈の行数に合わせ、ロードマップ以降を通常フローで押し下げる。 */
  .courses {
    height: auto;
    overflow: visible;
  }

  .courses .layout-container--medium {
    height: auto;
    padding-top: 1018px;
    padding-bottom: 28px;
  }

  .course-note {
    position: relative;
    top: auto;
    left: auto;
    margin: 0 auto;
    transform: none;
  }

  .roadmap {
    position: relative;
    top: auto;
    left: auto;
    margin: 28px auto 0;
    transform: none;
  }

  /* 比較表は固定高を外し、文字の行数に合わせて表とセクションを伸ばす。 */
  .comparison {
    height: auto;
    min-height: 0;
    padding: 50px 0;
  }

  .comparison .layout-container--medium {
    height: auto;
  }

  .comparison .content-title {
    position: static;
    width: 100%;
    max-width: 335px;
    margin-inline: auto;
    transform: none;
    text-align: center;
  }

  .comparison-table {
    position: relative;
    top: auto;
    left: auto;
    height: auto;
    margin: 28px auto 0;
    overflow: visible;
    transform: none;
  }

  .comparison-table__row {
    height: auto;
    min-height: max(74px, calc(var(--sp-readable-min) * 7.4));
  }

  .comparison-table__row:nth-child(3),
  .comparison-table__row:nth-child(4) {
    min-height: max(92px, calc(var(--sp-readable-min) * 9.2));
  }

  .comparison-table__head {
    height: auto;
    min-height: 42px;
  }

  .comparison-table__row > div,
  .comparison-table__head > div {
    height: auto;
    min-height: 0;
    padding-block: 7px;
  }

  /* Creator Lab紹介: Figma SP（750px）の座標を375pxへ換算。 */
  .intro {
    position: relative;
    height: 914.5px;
    padding: 0;
    overflow: hidden;
  }

  /* FV人物写真: Figma SPの画像ボックス（750px基準）を1/2換算。 */
  .hero__background {
    inset: auto;
    top: 69.5px;
    left: -248.75px;
    width: 747.2px;
    height: 427.4px;
    max-width: none;
    object-fit: fill;
    object-position: center;
    clip-path: inset(6px 0 0);
  }

  .hero__lead {
    width: 68.67%;
  }

  .intro .layout-container {
    position: relative;
    width: 100%;
    max-width: none;
    height: 100%;
  }

  .intro .section-label {
    position: absolute;
    top: 30px;
    left: 50%;
    margin: 0;
    transform: translateX(-50%);
  }

  .intro__title {
    position: absolute;
    top: 87.5px;
    left: 16px;
    width: 343px;
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
  }

  .intro__title strong {
    font-size: 18px;
    white-space: nowrap;
  }

  .point-panel {
    position: absolute;
    top: 189px;
    left: 20px;
    display: block;
    width: 335px;
    height: 683px;
    padding: 0;
  }

  .point-panel .point-card {
    position: absolute;
    left: 32px;
    width: 273px;
  }

  .point-panel .point-card:first-child {
    top: 28.5px;
  }

  .point-panel .point-card:nth-child(2) {
    top: 357.8px;
  }

  .point-panel .point-card__number {
    margin-bottom: 10px;
  }

  .point-panel .point-card__title {
    margin-bottom: 0;
    line-height: 1.3;
  }

  .point-panel .point-card:nth-child(2) .point-card__number {
    margin-bottom: 12px;
  }

  .point-panel .point-card:nth-child(2) .point-card__title {
    margin-bottom: 12px;
    line-height: 1;
  }

  .point-panel .point-card__image {
    display: block;
    width: 273px;
    height: 163.8px;
  }

  .point-panel .point-card__text {
    margin: 15px 19px 0;
    line-height: 1.4;
  }

  /* 伴走サポート: SPでもFigmaの左右2列カードを維持する。 */
  .support {
    position: relative;
    height: 544.5px;
    padding: 0;
    overflow: hidden;
  }

  .support .layout-container--wide {
    position: relative;
    width: 100%;
    max-width: none;
    height: 100%;
  }

  .support .section-title {
    position: absolute;
    top: 50px;
    left: 22.5px;
    width: 330px;
    margin: 0;
    transform: none;
    font-size: 25px;
    line-height: 1.1;
  }

  .support-list {
    position: absolute;
    top: 125px;
    left: 15px;
    display: block;
    width: 345px;
    height: 370px;
    transform: none;
  }

  .support-item {
    position: absolute;
    left: 0;
    display: grid;
    width: 345px;
    height: 70px;
    min-height: 0;
    grid-template-columns: 138.5px 206.5px;
    border: 1px solid var(--color-text);
    border-radius: 4px;
  }

  .support-item:nth-of-type(1) { top: 0; }
  .support-item:nth-of-type(2) { top: 100px; }
  .support-item:nth-of-type(3) { top: 200px; }
  .support-item:nth-of-type(4) { top: 300px; }

  .support-item > div {
    min-height: 0;
    padding: 8px 10px;
  }

  .support-item strong {
    display: flex;
    align-items: baseline;
    gap: 1px;
    font-size: 10.5px;
    line-height: 1.2;
    letter-spacing: 0.2px;
    white-space: nowrap;
  }

  .support-item small {
    margin-top: 2px;
    font-size: 8px;
    line-height: 1.25;
    letter-spacing: 0;
    white-space: normal;
  }

  .support-item p {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 0;
    border-radius: 0;
    font-size: 14px;
    line-height: 1.3;
    letter-spacing: 0.7px;
    white-space: normal;
  }

  .support-item__arrow {
    position: absolute;
    left: 50%;
    margin: 0;
    border-top-width: 14px;
    border-right-width: 16px;
    border-left-width: 16px;
    transform: translateX(-50%);
  }

  .support-item__arrow:nth-of-type(1) { top: 77px; }
  .support-item__arrow:nth-of-type(2) { top: 177px; }
  .support-item__arrow:nth-of-type(3) { top: 277px; }

  /* 実績画像はlazy-load前からFigmaと同じ領域を確保する。 */
  .achievements {
    position: relative;
    height: 1820.5px;
    padding: 0;
    overflow: hidden;
  }

  .achievements .layout-container--medium {
    position: relative;
    width: 100%;
    max-width: none;
    height: 100%;
  }

  .achievements .content-title {
    position: absolute;
    top: 50px;
    left: 20px;
    width: 335px;
    margin: 0;
    transform: none;
    color: var(--color-text);
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 2.25px;
  }

  .achievement-grid {
    position: absolute;
    top: 87.5px;
    left: 30px;
    display: grid;
    width: 315px;
    height: 1733px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(4, 407px);
    gap: 15px;
    padding: 30px;
    transform: none;
    border-radius: 0;
  }

  .achievement-grid article {
    width: 100%;
    min-width: 0;
    height: 407px;
    padding: 0 28.5px 15px;
    border: 3px solid var(--color-main);
    border-radius: 20.5px;
    box-shadow: none;
  }

  .achievement-grid h3 {
    width: 220px;
    height: 37.5px;
    margin: 0 0 21px -13.5px;
    color: #fff;
    font-size: 21.5px;
    line-height: 1;
    letter-spacing: 1.72px;
  }

  .achievement-grid article:nth-child(n + 3) h3 {
    margin-bottom: 21px;
    font-size: 16px;
    letter-spacing: 0.96px;
  }

  .achievement-grid article:nth-child(2) h3 {
    margin-bottom: 21px;
  }

  .achievement-grid img,
  .achievement-grid article:nth-child(2) img,
  .achievement-grid article:nth-child(3) img,
  .achievement-grid article:nth-child(4) img {
    display: block;
    width: 195px;
    height: 330px;
    max-width: 100%;
    max-height: none;
    margin-inline: auto;
    object-fit: contain;
  }

  /* 可読下限で増えた本文行数と、30px張り出す次カードのバッジを離す。 */
  .instructor-grid {
    row-gap: 60px;
  }

  .instructors {
    height: 1894.3px;
    overflow: hidden;
  }

  /* FAQ: gridのgapと隣接marginの重複を除き、Figmaの40px行へ戻す。 */
  .faq {
    height: auto;
    min-height: 677.5px;
    padding: 50px 0;
    overflow: visible;
  }

  .faq .section-title {
    margin-bottom: 17.5px;
    line-height: 1;
  }

  .faq-list {
    gap: 15px;
  }

  .faq-item + .faq-item {
    margin-top: 0;
  }

  .faq-item summary {
    display: flex;
    min-height: 40px;
    align-items: center;
    padding: 10px 44px 10px 15px;
    font-size: 12.5px;
    letter-spacing: -0.04em;
    line-height: 1.2;
    white-space: nowrap;
  }

  .faq-item summary span {
    min-width: 0;
    overflow-wrap: normal;
    white-space: nowrap;
  }

  .faq-item summary::after {
    right: 15px;
    width: 18px;
    text-align: center;
  }

  /* 最終CTA: SPもFigma通り3バッジを横並びにする。 */
  .final-cta {
    position: relative;
    height: 332px;
    padding: 0;
    overflow: hidden;
  }

  .final-cta .layout-container--medium {
    position: relative;
    width: 100%;
    max-width: none;
    height: 100%;
  }

  .final-cta h2 {
    position: absolute;
    top: 50px;
    left: 63px;
    width: 249px;
    margin: 0;
    transform: none;
    color: var(--color-text);
    font-size: 25px;
    line-height: 30px;
    letter-spacing: 3.5px;
    white-space: nowrap;
  }

  .final-cta__badges {
    position: absolute;
    top: 155px;
    left: 21px;
    display: grid;
    width: 333px;
    height: 37px;
    grid-template-columns: 80px 116.5px 116.5px;
    margin: 0;
    gap: 10px;
    transform: none;
  }

  .final-cta__badges p {
    display: grid;
    height: 37px;
    place-content: center;
    padding: 1px 3px;
    border-width: 1px;
    border-radius: 19px;
    background: transparent;
    font-size: 10px;
    line-height: 1.1;
  }

  .final-cta__badges strong {
    font-size: 12px;
    line-height: 1.05;
  }

  .final-cta__badges p:first-child strong {
    font-size: 17px;
  }

  .final-cta__button {
    position: absolute;
    top: 207px;
    left: 20px;
    width: 335px;
    margin: 0;
    transform: none;
  }

  .final-cta__note {
    position: absolute;
    top: 275px;
    left: 0;
    width: 100%;
    margin: 0;
    transform: none;
    line-height: 17px;
    white-space: nowrap;
  }

  /* Footer: 横圧縮せず、自然な字形のままFigmaの横一列を維持する。 */
  .site-footer {
    position: relative;
    height: 201.5px;
    padding: 0;
    overflow: hidden;
  }

  .site-footer__brand {
    position: absolute;
    top: 60px;
    left: 50%;
    width: 177.5px;
    height: 36.5px;
    margin: 0;
    transform: translateX(-50%);
  }

  .site-footer .brand__image {
    width: 177.5px;
    height: 36.5px;
  }

  .site-footer nav {
    position: absolute;
    top: 136.5px;
    left: 50%;
    width: 345px;
    flex-direction: row;
    justify-content: space-between;
    gap: 0;
    font-size: 8px;
    line-height: 17px;
    letter-spacing: 0;
    white-space: nowrap;
    transform: translateX(-50%);
  }
}
