:root {
  --body-color: #FFFDF2;
  --ribbon-color: #FD2621;
  --button-color: #C45A55;
  --text-color: #3B352F;
  --font-body: "Noto Serif JP", "Yu Mincho", serif;
  --font-display: "Shippori Mincho", "Yu Mincho", serif; /* FV用 */
  --fontsize-button: 16px;
  --thread-space: 100px;
  --thread-left: 40px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

h1, h2, h3, h4 {
    font-weight: 500;
}

body {
    color: var(--text-color);
    margin:0 auto;
    font-family: var(--font-body);
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.05em;
    background-color: var(--body-color);
}

a {
    text-decoration: none;
    color: var(--text-color);
}

a:hover,
.button-design:hover { /* inputの送信ボタンはaではないので併記 */
    opacity: 0.5;
}

.section-title {
    font-size: 48px;
    text-align: left;
    margin-top: 100px;
    margin-bottom: 40px;
    padding: 0 0 10px 20px;
    border-bottom: solid 3px var(--ribbon-color);
}

.ribbon-pc {
    position: absolute;
    left: 0px;
    top: -20px;
    width: 80px;
    height: 50px;
    z-index: 5;
    opacity: 0;
    transition: opacity 1s ease;
}

.ribbon-pc.scroll {
    opacity: 1;
}

.ribbon-sp {
    display: none;
}

/* .ribbon-pc(position: absolute)の基準にするため、
   セクション共通で position: relative を持たせる */
.thread-sections {
    position: relative;
    scroll-margin-top: 40px;
}

/* 糸のレーン分、左側を空ける共通クラス。
   各セクションの中身をまとめて1つのdivで囲み、そのdivにだけ付ける。
   margin-leftなのは、中の要素が別途 padding-left を持っていても競合しないようにするため */
.thread-content {
    margin-left: var(--thread-space);
}

/* 糸含む全体 */
.page-wrapper {
    position: relative;
    max-width: 1080px;
    margin: 0 auto;
}

/* 糸 */

/* メインセクションの糸 */
.thread-line-top {
    position: absolute;
    top: 80px;
    left: var(--thread-left);
    width: 1px;
    height: calc(100% + 20px);
    background-color: var(--ribbon-color);
    z-index: 5;
    /* 糸の動き */
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 1.5s ease 0.5s;
}

.thread-line-top.scroll {
    transform: scaleY(1);
}

/* 他セクションの糸 */
.thread-line {
    position: absolute;
    left: var(--thread-left);
    width: 1px;
    height: calc(100% + 100px);
    background-color: var(--ribbon-color);
    z-index: 5;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 2.5s ease 0.5s;
}

.thread-line.scroll {
    transform: scaleY(1);
}

/* 最後のセクションのみ糸を短く */
.thread-line--short {
    height: 100%;
}

/* ナビゲーション */
.hamburger {
    display: none;
}

.header{
    max-width: 1700px;
    margin: 50px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 100px;
}

.header-logo {
    width: 200px;
}

.header-logo-img {
    width: 100%;
}

.global-nav ul {
    font-size: 20px;
    display: flex;
    padding-left: 0;
    column-gap: 60px;
}

.global-nav li {
    list-style: none;
}

/* Main Visual */
.main-visual {
    position: relative;
    height: clamp(600px, 80vh, 750px);
}

.main-message {
    width: 60%;
}

.main-text {
    position: relative;
    font-size: 48px;
    z-index: 12;
    margin: 0;
    padding: 130px 0 0 0;
    font-family: var(--font-display);
    font-weight: 400; /* Shippori Minchoは400が最細 */
}

.main-text > span {
    color: var(--ribbon-color);
}

.sub-text{
    position: relative;
    padding: 24px 0 0 5px;
    z-index: 11;
    font-size: 24px;
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.8;
}

.my-photo {
    /* ヒーローエリアの画像は、pagewrapper=1080pxより左右200pxずつ大きめに表示する */
    position: absolute;
    left: -200px;
    width: calc(100% + 400px);
    height: 100%;
    object-fit: cover;
    object-position: right center;
    z-index: 1;
}

/* Message */
.message-area {
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-areas:
        "photo contents"
        "photo name";
    align-items: start; /* 中央揃えだと文章量で写真の上端がずれるため上揃え */
    gap: 24px;
}

.message-photo {
    grid-area: photo;
    width: 300px;
}

.message-photo img {
    width: 100%;
    border-radius: 10px;
}

.message-contents {
    grid-area: contents;
}

.message-title {
    font-size: 28px;
    margin-top: 0; /* h3標準の上余白を消し、赤線下の余白をセクション間でそろえる */
}

.my-name {
    text-align: right;
    font-size: 24px;
}

.my-name-s {
    font-size: 16px;
}

/* Works */

.works-title{
    font-size: 24px;
    text-align: center;
}

.card-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 50px 50px;
    margin-bottom: 40px;
}

.card-text {
    width: fit-content;
    margin-inline: auto;
    margin-top: 8px;
}

.card-title {
    margin-bottom: 4px;
}

.cards-lp{
    width: 500px;
}

.cards-banner{
    width: 300px;
}

.cards-lp > img {
    width: 100%;
}

.cards-banner > img {
    display: block;
    margin-inline: auto;
    width: 90%;
}

.card-tool {
    margin-bottom: 32px;
    font-size: 14px;
}

.source {
    display: inline-block;
    width: 80px;
}

.card-visit {
    text-align: center;
    margin-bottom: 32px;
}

.card-visit-button {
    font-size: var(--fontsize-button);
    padding: 8px 24px;
    border: 1px solid var(--button-color);
    border-radius: 30px;
    /*
        border-top: 1px solid var(--button-color);
    border-bottom: 1px solid var(--button-color);
    */

}

/* About */

.about-container {
    display: flex;
    gap: 0 5%;
    padding: 0 20px;
}

.about-img {
    width: 40%;
}

.about-photo {
    width: 100%;
    border-radius: 5%;
}

.about-text {
    width: 60%;
}

.about-text > h2 {
    margin: 0;
}

.about-text-content {
    margin-bottom: 32px;
}

.skill-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    row-gap: 10px;
}

/* Contact */

.contact-table {
    width: 60%;
    max-width: 600px;
    margin: 40px auto 0;
}

.form-row {
    display: flex;
    flex-direction: column;
}

.table-title {
    padding: 20px 0 10px 0;
}

.table-input {
    padding: 10px 0;
}

.form-input {
    width: 100%;
    height: 48px;
}

.form-textarea {
    width: 100%;
    height: 220px;
}

.button-design {
    display: block;
    width: fit-content; /* input(置換要素)以外(a, buttonなど)でも幅を中身に合わせて中央揃えを効かせる */
    margin: 16px auto 0;
    border: 2px solid var(--button-color);
    color: var(--text-color);
    background-color: transparent;
    padding: 10px 60px;
    border-radius: 30px;
    cursor: pointer;
    font-size: var(--fontsize-button);
    font-family: inherit; /* inputは親のフォントを継承しないので明示する */
    text-decoration: none;
}

.error-message {
    color: var(--ribbon-color);
}

/* Footer */
.copyright {
    text-align: center;
    margin: 0 0 50px 0;
}

.pagetop {
    display: flex;
    align-items: center;
    height: 80px;
    width: 110px;
    margin: 100px auto 50px auto;
}

.arrow {
    height: 100%;
}

/* Privacy Policy */
.policy-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 40px 100px;
}

.policy-title {
    font-size: 40px;
    margin: 0 0 40px;
    padding-bottom: 16px;
    border-bottom: solid 3px var(--ribbon-color);
}

.policy-lead {
    line-height: 1.9;
    margin-bottom: 60px;
}

.policy-section {
    margin-bottom: 50px;
}

.policy-heading {
    font-size: 22px;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: solid 2px var(--ribbon-color);
}

.policy-subheading {
    font-size: 18px;
    margin: 24px 0 12px;
}

.policy-section p,
.policy-section ul,
.policy-section ol {
    line-height: 1.9;
    margin: 0 0 12px;
}

.policy-section ul,
.policy-section ol {
    padding-left: 1.4em;
}

.policy-end {
    text-align: right;
    margin: 0 0 80px;
}

/* Thank You */
.thankyou {
    width: 50%;
    margin: 200px auto 0 auto;
    text-align: center;
}

.thankyou .contents {
    margin: 10px 0 50px 0;
}

/* スパム対策 */
.honeypot {
  position: absolute;
  left: -9999px;
}

@media (max-width: 767px) {
    /* メニュー開いている間はスクロール禁止 */
    body.menu-open {
        overflow: hidden;
    }

    /* SPでは糸のレーンを使わないので、共通の左空けをリセット。
       代わりに全セクション共通で左右にpaddingを効かせる */
    .thread-content {
        margin-left: 0;
        padding: 0 40px;
    }

    /* ヘッダ */
    .header {
        margin: 20px auto;
        position: relative;
        padding: 0 20px;
    }

    .header-logo {
        width: 140px;
    }

    .global-nav {
        display: none; /* 閉じている間は要素そのものを消し、クリック/フォーカスとも当たらないようにする */
        position: fixed;
    }

    .global-nav.is-opened {
        display: block;
        width: 100vw;
        height: 100vh;
        top: 0px;
        background-color: rgb(100, 100, 100, 0.8) ;
        z-index: 20;
    }

    .global-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 50px;
        width: 80vw;
        height: 100vh;
        margin: 0;
        padding-top: 100px;
        border-radius: 0 10px 10px 0;
        background-color: var(--body-color);
        transform: translateX(-80vw);
        transition: 0.5s;
    }

    .global-nav.is-opened ul {
        transform: translateX(0);
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 10px;
        color: var(--ribbon-color);
        border: none;
        background-color: transparent;
        cursor: pointer;
        margin-right: 20px;
        z-index: 30;
    }

    .hamburger span {
        width: 30px;
        height: 2px;
        background-color: var(--ribbon-color);
        transition: 0.3s;
    }

    .hamburger.is-opened span:nth-of-type(1){
        transform: translateY(12px) rotate(45deg);
    }

    .hamburger.is-opened span:nth-of-type(2){
        opacity: 0;
    }

    .hamburger.is-opened span:nth-of-type(3){
        transform: translateY(-12px) rotate(-45deg);
    }

    /* 各セクションのタイトル */
    .section-title-wrapper {
        position: relative;
    }

    .section-title {
        font-size: 24px;
        margin: 50px 0 20px 0; /* 左右の余白は共通の.thread-contentのpaddingに任せる */
        padding: 0 0 6px 0;
        text-align: center;
        border-bottom: solid 1px var(--ribbon-color);
    }

    .ribbon-sp {
        display: block;
        position: absolute;
        left: -20px;
        top: 30px;
        width: 40px;
        height: 25px;
        z-index: 5;
    }

    /* Main Visual */
    .main-message {
        width: 100%;
        padding-left: 60px;
    }

    .main-text {
        font-size: 32px;
    }

    .sub-text {
        font-size: 14px;
    }

    .my-photo {
        left: 0;
        width: 100%;
    }

    /* 糸 */
    .thread-line {
        display: none;
    }

    .thread-line-top {
        height: 350px;
    }

    /* SP側のリボンは、Section titleを親とする*/
    .ribbon-pc {
        display: none;
    }

    /* Message */
    .message-area {
        grid-template-columns: 1fr;
        grid-template-areas:
            "contents"
            "photo"
            "name";
    }

    .message-photo {
        width: 80%;
        margin: 0 auto;
    }

    /* Works */
    .works-title {
        font-size: 16px;
    }

    .cards-lp,
    .cards-banner{
        width: 80%;
        min-width: 300px;
    }

    .cards-lp a {
        font-size: 12px;
    }

    .cards-lp > img,
    .cards-banner > img {
        width: 100%;
    }

    .source {
        font-size: 12px;
        width: 60px;
    }

    .tool-tag {
        font-size: 12px;
    }

    /* About */
    .about-container {
        display: block;
        margin: 0;
        padding: 0; /* 左右の余白は共通の.thread-contentのpaddingに任せる */
        font-size: 14px;
    }

    .about-img {
        width: 80%;
        margin: 30px auto 0;
    }

    .about-text {
        width: 100%;
    }

    /* Contact */
    /* 左右の余白は共通の.thread-contentのpaddingに任せる */

    .contact-table {
        width: 80%;
    }

    /* プライバシーポリシー */
    .policy-content {
        padding: 40px 20px 80px;
    }

    .policy-title {
        font-size: 28px;
    }

    .policy-heading {
        font-size: 20px;
    }
}