/* Page-scoped styles with native CSS nesting. Shared contact/footer use theme styles. */
.hajimete-page {
  margin: 0;
  background: #fff;

  #contents {
    margin: 0;
  }
}

.hj-skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);

  &:focus {
    position: fixed;
    inset: 12px auto auto 12px;
    z-index: 9999;
    width: auto;
    height: auto;
    padding: 12px 20px;
    clip-path: none;
    background: white;
    color: #102e80;
  }
}

.hj-page {
  --hj-blue: #102e80;
  --hj-middle: #426ef5;
  --hj-sky: #38a8e8;
  --hj-light: #eaf0ff;
  color: #111;
  font:
    400 18px/1.8 "Noto Sans JP",
    "Hiragino Kaku Gothic ProN",
    Meiryo,
    sans-serif;
  letter-spacing: 0.03em;

  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  :is(h1, h2, h3, h4, p, dl, dd, ol) {
    margin: 0;
    padding: 0;
  }
  :is(p, dl, dt, dd, ol, li) {
    font-size: inherit;
  }
  :is(h1, h2, h3, h4, strong) {
    font-weight: 700;
  }
  span {
    font-weight: inherit;
    font-style: normal;
  }
  img {
    display: block;
    max-width: 100%;
    height: auto;
  }
  a:focus-visible {
    outline: 3px solid var(--hj-blue);
    outline-offset: 5px;
  }
  .hj-container {
    width: min(1000px, calc(100% - 48px));
    margin-inline: auto;
  }
  .hj-section {
    padding-block: 72px;
  }
  .hj-heading {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 46px;
    color: var(--hj-blue);
    font-size: clamp(23px, 2.4vw, 32px);
    line-height: 1.5;

    &::before {
      content: "⚙";
      flex: 0 0 auto;
      color: var(--hj-sky);
      font-size: 0.95em;
    }
  }
  .hj-intro,
  .hj-scope,
  .hj-preparation,
  .hj-faq {
    background: var(--hj-light);
  }
  #header.hj-intro {
    padding-block: 60px 110px;
    background: var(--hj-light);
  }
  .hj-hero {
    display: flex;
    justify-content: space-around;
    align-items: end;
    gap: 20px;
    padding: 36px 48px 0;
    margin-bottom: 48px;
    background: #fff;
    color: var(--hj-blue);

    > div {
      padding-bottom: 36px;
    }
    p {
      margin-bottom: 20px;
      font-weight: 700;
      font-size: 21px;
    }
    h1 {
      font-size: clamp(26px, 3.2vw, 43px);
      line-height: 1.5;
      letter-spacing: 0;
    }
    .hj-person {
      flex: 0 0 140px;
      width: 140px;
      height: 140px;
    }
  }
  .hj-beginner {
    margin-right: 10px;
    font-size: 30px;
    vertical-align: middle;
  }
  .hj-person {
    position: relative;
    display: inline-block;
    width:  140px;
    overflow: hidden;

    img {
      position: absolute;
      width: 100%;
      max-width: none;
      right: 0;
      bottom: -50px;
    }
    &.hj-person-man img {
      right: auto;
      left: 0;
    }
  }
  .hj-intro-lead {
    margin: -22px 0 32px;
    text-align: center;
    font-size: 20px;
  }
  .hj-stages {
    --hj-stage-width: 250px;
    list-style: none;
    margin: 0 28px 52px;

    li {
      --stage-color: var(--hj-blue);
      display: grid;
      grid-template-columns: var(--hj-stage-width) 1fr;
      align-items: center;
      gap: 20px;
      margin-bottom: 16px;

      &:nth-child(2) {
        --stage-color: var(--hj-middle);
      }
      &:nth-child(3) {
        --stage-color: var(--hj-sky);
      }
      > div {
        padding: 12px 16px;
        background: #fff;
      }
      h3 {
        color: var(--stage-color);
        font-size: 23px;
        letter-spacing: 0.12em;
      }
      small {
        margin-left: 14px;
        font-size: 14px;
        letter-spacing: 0.04em;
      }
      p {
        font-size: 16px;
        line-height: 1.6;
      }
    }
  }
  .hj-diamond {
    display: grid;
    place-items: center;
    min-height: 135px;
    padding: 25px;
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    background: var(--stage-color);
    color: white;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: 0.12em;
  }
  @media (width > 540px) {
    .hj-stages {
      position: relative;

      li {
        min-height: 135px;

        > div {
          grid-column: 2;
        }
        &:nth-child(2) .hj-diamond {
          top: 150px;
          z-index: 2;
        }
        &:nth-child(3) .hj-diamond {
          top: 255px;
          z-index: 1;
        }
      }
      /* A 108px step overlaps each 135px diamond by 20%. */
      .hj-diamond {
        position: absolute;
        top: 40px;
        left: 0;
        z-index: 3;
        width: var(--hj-stage-width);
        height: 135px;
      }
    }
  }
  .hj-newsletter {
    padding: 42px 30px 34px;
    background: #fff;
    text-align: center;

    h2 {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 22px;
      margin-bottom: 12px;
      color: var(--hj-blue);
      font-size: clamp(22px, 2.5vw, 32px);
      line-height: 1.6;
    }
    .hj-person {
      flex: 0 0 78px;
      height: 100px;
	  &.hj-person-man img{
		width: 100%;
		height: auto;
		bottom: 0;
	  }
    }
    > p:not(.hj-fineprint) {
      font-size: 21px;
      line-height: 1.9;
    }
  }
  .hj-skyline {
    display: block;
    width: 330px;
    max-width: 80%;
    height: auto;
    margin: 12px auto 0;
    color: #d7e2ff;
  }
  .wpcf7-form-control.wpcf7-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: min(580px, 100%);
    height: 3em;
    margin: 0 auto;
    padding: 8px 20px;
    border: 3px solid white;
    border-radius: 6px;
    background: linear-gradient(#ff7515, #ed2304);
    box-shadow:
      0 2px 2px #0006,
      inset 0 0 0 1px #ca4d0a;
    color: #fff;
    font-size: inherit;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.4;

    &:hover {
      background: linear-gradient(#ef6409, #d81c00);
    }
  }

  .wpcf7-form.init {
    padding-top: 2em;
    p {
      margin: 1em auto;
      label{
        display: grid;
        grid-template-columns: 0.7fr 1fr;
        width: 40em;
        margin: auto;
        align-items: center;
        @media (width <= 540px) {
          display: flex;
          flex-direction: column;
          align-items: flex-start;
          width: 100%;
        }
        input{
          padding: 18px 25px;
        }
      }
      &:nth-of-type(4){
        margin: 0 auto;
      }
      &:nth-of-type(5){
        position: relative;
        margin: 0 auto;
        font-size: 1.1em;
        @media (width <= 540px) {
          font-size: 0.9em;
        }
        &::before {
          content: '';
          position: absolute;
          left: calc(50% - 10em);
          top: calc(1.5em - 20px);
          width: 40px;
          height: 40px;
          background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 40 40' fill='none'%3E%3Cpath d='M4.375 9.375H35.625V33.125H4.375V9.375Z' stroke-width='4' stroke-linecap='round' stroke-linejoin='round' stroke='white'/%3E%3Cpath d='M5.625 10.625L20 23.125L34.375 10.625' stroke-width='4' stroke-linecap='round' stroke-linejoin='round' stroke='white'/%3E%3C/svg%3E");
          background-repeat: no-repeat;
          background-size: contain;
          background-position: center;
        }
      }
    }
  }

  .hj-fineprint {
    margin-top: 28px;
    font-size: 14px;
    line-height: 1.7;
  }
  .hj-inset {
    width: min(780px, 100%);
    margin-inline: auto;
  }
  .hj-example {
    --example-color: var(--hj-blue);
    margin-bottom: 38px;

    &:nth-child(2) {
      --example-color: var(--hj-middle);
    }
    &:nth-child(3) {
      --example-color: var(--hj-sky);
      margin-bottom: 0;
    }
    h3 {
      display: inline-block;
      padding: 4px 22px;
      margin-bottom: 24px;
      border-radius: 5px;
      background: var(--example-color);
      color: white;
      font-size: 23px;
    }
  }
  .hj-label-list {
    display: grid;
    gap: 12px;

    > div {
      display: grid;
      grid-template-columns: 126px 1fr;
      align-items: baseline;
      gap: 18px;
    }
    dt {
      padding: 1px 6px;
      border: 1px solid #647bbc;
      border-radius: 5px;
      color: var(--hj-blue);
      text-align: center;
      letter-spacing: 0.12em;
      font-size: 17px;
      white-space: nowrap;
    }
    dd {
      font-size: 16px;
      line-height: 1.7;
    }
  }
  .hj-welcome {
    width: min(820px, 100%);
    padding: 32px 36px;
    margin: 0 auto 44px;
    background: #fff;

    h3 {
      margin-bottom: 30px;
      color: var(--hj-blue);
      font-size: 25px;
    }
    h3 > svg {
		margin-bottom: -5px;
    }
  }
  .hj-limit {
    width: min(740px, 100%);
    margin-inline: auto;
    padding: 26px 40px 30px;
    background: #d9d9d9;
    text-align: center;

    h3 {
      margin-bottom: 20px;
      color: #555;
      font-size: 25px;
	  svg {
		margin-bottom: -10px;
	  }
    }
    h3 span {
      font-size: 35px;
      margin-right: 10px;
    }
    .hj-limit-label {
      width: fit-content;
      padding: 0 15px;
      margin-bottom: 16px;
      margin-left: 10%;
      border: 1px solid #999;
      border-radius: 6px;
      background: #eee;
      color: #555;
      font-size: 24px;
    }
    p {
      font-size: 17px;
      line-height: 1.5;
    }
    small {
      display: block;
      text-align: right;
      font-size: 14px;
    }
    .hj-limit-note {
      margin-top: 24px;
      font-size: 16px;
    }
  }
  .hj-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 36px;
    padding-top: 26px;
    list-style: none;

    li {
      --step-color: var(--hj-blue);
      position: relative;
      padding: 24px 10px 18px;
      border: 3px solid #c2d2ff;
      border-radius: 22px;
      text-align: center;

      &:nth-child(2) {
        --step-color: var(--hj-middle);
      }
      &:nth-child(3) {
        --step-color: var(--hj-sky);
      }
      &:nth-child(4) {
        --step-color: #65cce2;
      }
      &:not(:last-child)::after {
        content: "";
        position: absolute;
        left: calc(100% + 17px);
        top: 45%;
        border: 9px solid transparent;
        border-left-color: var(--step-color);
      }
	  img{
		  height: 60px;
		  margin: 10px auto;
	  }
      h3 {
        font-size: 18px;
        font-weight: 400;
        white-space: nowrap;
      }
      p {
        margin-top: 24px;
        font-size: 14px;
        line-height: 1.5;
      }
    }
  }
  .hj-step-number {
    position: absolute;
    top: -16px;
    left: calc(50% - 16px);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--step-color);
    color: #fff;
    font-size: 18px;
  }
  .hj-step-owner {
    display: inline-block;
    padding: 0 13px;
    margin-top: 5px;
    background: #c6d6ff;
    color: var(--hj-blue);
    font-size: 14px;
  }
  .hj-flow-note {
    margin-top: 60px;
    text-align: center;
    font-size: 16px;
  }
  .hj-preparation-inner {
    width: min(680px, 100%);
    margin-inline: auto;

    h3 {
      font-size: 28px;
    }
    h3 span {
      color: #e00000;
    }
    > p:not(.hj-fineprint) {
      font-size: 21px;
    }
    .hj-optional-title {
      margin: 40px 0 10px;
      font-size: 24px;
    }
  }
  .hj-need {
    width: min(550px, 100%);
    margin-top: 16px;
    overflow: hidden;
    border: 2px solid var(--hj-blue);
    border-radius: 6px;
    background: #fff;

    h4 {
      padding: 3px 16px;
      background: var(--hj-blue);
      color: #fff200;
      text-align: center;
      font-size: 32px;
    }
    p {
      padding: 28px 32px;
      font-size: 21px;
      line-height: 1.6;
    }
  }
  .hj-newsletter-section {
    padding-block: 24px 50px;
  }
  .hj-questions {
    width: min(900px, 100%);
    margin-inline: auto;

    > div + div {
      margin-top: 38px;
    }
    dt,
    dd {
      display: flex;
      align-items: baseline;
      gap: 24px;
    }
    dt {
      color: var(--hj-blue);
      font-size: 21px;
      font-weight: 700;
      line-height: 1.6;
    }
    dd {
      margin-top: 22px;
    }
    dd p {
      font-size: 16px;
      line-height: 2;
    }
    :is(dt, dd) > span {
      flex: 0 0 34px;
      height: 34px;
      border-radius: 50%;
      background: var(--hj-blue);
      color: #fff;
      text-align: center;
      font-size: 24px;
      font-weight: 700;
      line-height: 34px;
    }
    dd > span {
      background: var(--hj-middle);
    }
  }
  .hj-final {
    text-align: center;

    h2 {
      color: var(--hj-blue);
      font-size: clamp(24px, 2.6vw, 32px);
    }
    .hj-team {
      width: 160px;
      margin: 30px auto;
    }
    p {
      margin-bottom: 36px;
      font-size: 22px;
      line-height: 1.9;
    }
  }

  @media (width <= 800px) {
    .hj-hero {
      padding: 28px 24px 0;
      gap: 10px;
      p {
        font-size: 17px;
      }
      .hj-person {
        flex-basis: 90px;
        height: 110px;
      }
    }
    .hj-stages {
      --hj-stage-width: 180px;
      margin-inline: 0;
      li {
        gap: 12px;
      }
    }
    .hj-diamond {
      font-size: 19px;
    }
    .hj-stages li small {
      display: block;
      margin-left: 0;
    }
    .hj-newsletter {
      padding-inline: 20px;
      > p:not(.hj-fineprint) {
        font-size: 18px;
      }
    }
    .hj-steps {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 40px;
      li:nth-child(2)::after {
        display: none;
      }
    }
    .hj-welcome {
      padding-inline: 24px;
    }
  }
  @media (width <= 540px) {
    font-size: 16px;
    .hj-container {
      width: calc(100% - 36px);
    }
    .hj-section {
      padding-block: 46px;
    }
    #header.hj-intro {
	  padding: 24px 12px;
    }
    .hj-heading {
      gap: 10px;
      margin-bottom: 28px;
      font-size: 23px;
    }
    .hj-hero {
      position: relative;
      margin-bottom: 32px;
      padding: 22px 15px 0;
      > div {
        padding-bottom: 65px;
      }
      p {
        padding-right: 32px;
        font-size: 14px;
      }
      h1 {
        position: relative;
        z-index: 1;
        padding-right: 24px;
        font-size: 30px;
		padding-right: 0;
      }
      .hj-person {
        position: absolute;
        right: 0;
        bottom: 0;
        width: 75px;
        height: 85px;
        opacity: 0.5;
		img{
			width: 100%;
			height: auto;
			bottom: -15px;
		}
      }
    }
    .hj-beginner {
      margin-right: 4px;
      font-size: 22px;
    }
    .hj-intro-lead {
      margin-top: 0;
      text-align: left;
      font-size: 16px;
    }
    .hj-stages {
      margin-bottom: 32px;
      li {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 24px;
        h3 {
          font-size: 21px;
        }
        small {
          display: inline;
          margin-left: 8px;
          font-size: 12px;
        }
      }
    }
    .hj-diamond {
      min-height: auto;
      padding: 10px;
      clip-path: none;
      font-size: 18px;
    }
    .hj-newsletter {
      padding: 24px 16px;
      h2 {
        gap: 10px;
        font-size: 22px;
        text-align: left;
      }
      .hj-person {
        flex-basis: 45px;
        height: 72px;
      }
      > p:not(.hj-fineprint) {
        font-size: 16px;
      }
    }
    .hj-button {
      gap: 8px;
      padding-inline: 8px;
      font-size: 16px;
    }
    .hj-fineprint {
      margin-top: 20px;
      font-size: 12px;
    }
    .hj-example h3 {
      margin-bottom: 18px;
      padding-inline: 15px;
      font-size: 20px;
    }
    .hj-label-list {
      gap: 16px;
      > div {
        grid-template-columns: 96px 1fr;
        gap: 12px;
      }
      dt {
        font-size: 14px;
        letter-spacing: 0.02em;
      }
      dd {
        font-size: 14px;
      }
    }
    .hj-welcome {
      padding: 22px 16px;
      h3 {
        font-size: 21px;
      }
    }
    .hj-limit {
      padding: 22px 18px;
      h3 {
        font-size: 20px;
      }
      .hj-limit-label {
        margin-inline: auto;
        font-size: 20px;
      }
      p {
        font-size: 15px;
      }
    }
    .hj-steps {
      gap: 30px 24px;
      li {
        border-width: 2px;
        border-radius: 16px;
        padding-inline: 8px;
        h3 {
          font-size: 15px;
          white-space: normal;
        }
        p {
          font-size: 12px;
        }
        &:not(:last-child)::after {
          left: calc(100% + 9px);
          border-width: 7px;
        }
      }
    }
    .hj-flow-note {
      margin-top: 32px;
      text-align: left;
      font-size: 14px;
    }
    .hj-preparation-inner {
      h3 {
        font-size: 24px;
      }
      > p:not(.hj-fineprint) {
        font-size: 17px;
      }
    }
    .hj-need {
      h4 {
        font-size: 25px;
      }
      p {
        padding: 20px 14px;
        font-size: 16px;
      }
    }
    .hj-questions {
      dt,
      dd {
        gap: 12px;
      }
      dt {
        font-size: 18px;
      }
      dd {
        margin-top: 16px;
      }
      dd p {
        font-size: 14px;
      }
      :is(dt, dd) > span {
        flex-basis: 28px;
        height: 28px;
        font-size: 20px;
        line-height: 28px;
      }
    }
    .hj-final p {
      font-size: 17px;
    }
  }
}
