/* import fonts from fonts.css.file */
@import url(./fonts.css);

/* css variables */
@import url(./variables.css);


/*--------------------------------------------------------------
# base
--------------------------------------------------------------*/

html {
    scroll-behavior: smooth;
}

section {
    padding: 9rem 0 11rem 0;
    overflow: hidden;
}

.site_main .section_title {
    padding-bottom: 2rem;
}

/* 自己紹介文：幅が狭いときも最終行に1語だけ残らないよう行をそろえる */
.intro-box .body-lg {
    margin-bottom: 0.5rem;
    text-wrap: balance;
}

/* メニューの portfolio からジャンプしたとき、固定ナビの下にタイトルが来るようにする */
#portfolio-title {
    scroll-margin-top: 180px;
}


h1 {

    font: 900 80px var(--poppins);
    color: var(--primary-color);
    letter-spacing: 4px;
}

h2 {
    font: normal 700 40px/60px var(--barlow);
    color: var(--title-color);
    letter-spacing: 2px;
}

h3 {
    font-size: 32px;

}

h4,
h3.card-title,
#about .icon h2 {
    font: 900 24px var(--poppins);
    letter-spacing: 2px;
}

/* About の紹介文。見出しではなく本文なので div にし、見た目は以前の h2 のまま */
.about-lead {
    font: normal 700 40px/60px var(--barlow);
    color: var(--title-color);
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

/* ヒーローの挨拶（h2）。字間を文字サイズに比例させる */
h2.hero_text {
    letter-spacing: 0.04em;
}

h5,
.body-lg {
    font: normal 400 21px/40px var(--poppins);
    color: var(--title-color);
}




/* Buttons */
button:focus,
button:active button:hover .btn:active,
.btn.active {
    outline: 0px !important;
    box-shadow: none !important;
}

/*--------------------------------------------------------------
# navigation
--------------------------------------------------------------*/

.header_area .main_menu .navbar .navbar-brand {
    padding: 0 2rem 0 5rem;
    display: flex;
    align-items: center;
}

/* ロゴは画像（マーク）と文字に分け、文字は Barlow Bold の実テキストにする。
   ダークモードでは --title-color に追従して読みやすくなる */
.navbar-brand .brand-mark {
    height: 54px;
    width: auto;
}

.navbar-brand .brand-text {
    margin-left: 18px;
    font: normal 700 24px/1 var(--barlow);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--title-color);
    white-space: nowrap;
}

.navbar-brand:hover {
    text-decoration: none;
}

.header_area .main_menu .navbar-nav .nav-item {
    font: normal 700 16px var(--barlow);
    color: var(--title-color);
    padding: 1rem;
    letter-spacing: 2px;
}

.header_area .main_menu .navbar-nav a:hover {
    color: var(--primary-color);
}

.navbar-light {
    background-color: var(--bg-color);
}

.swap img:last-child {
    display: none
}

.swap:hover img:first-child {
    display: none
}

.swap:hover img:last-child {
    display: inline-block
}

.navbar-toggler:focus,
.navbar-toggler:active,
.navbar-toggler-icon:focus {
    outline: none;
    box-shadow: none;
}

/*--------------------------------------------------------------
# return to top 
--------------------------------------------------------------*/

#return-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgb(0, 0, 0);
    background: rgba(0, 0, 0, 0.7);
    width: 50px;
    height: 50px;
    display: block;
    text-decoration: none;
    -webkit-border-radius: 35px;
    -moz-border-radius: 35px;
    border-radius: 35px;
    display: none;
    -webkit-transition: all 0.3s linear;
    -moz-transition: all 0.3s ease;
    -ms-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

#return-to-top i {
    color: #fff;
    margin: 0;
    position: relative;
    left: 16px;
    top: 13px;
    font-size: 19px;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -ms-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

#return-to-top:hover {
    background: rgba(0, 0, 0, 0.9);
}

#return-to-top:hover i {
    color: #fff;
    top: 5px;
}

/*--------------------------------------------------------------
# about
--------------------------------------------------------------*/

.site_main .section-bg {
    background-color: var(--bg-color);
}

.hand {
    animation-name: hand-animation;
    animation-duration: 3.0s;
    animation-iteration-count: infinite;
    transform-origin: 70% 70%;

    display: inline-block;
}

@keyframes hand-animation {
    0% {
        transform: rotate(0.0deg)
    }

    10% {
        transform: rotate(14.0deg)
    }

    20% {
        transform: rotate(-8.0deg)
    }

    30% {
        transform: rotate(14.0deg)
    }

    40% {
        transform: rotate(-4.0deg)
    }

    50% {
        transform: rotate(10.0deg)
    }

    60% {
        transform: rotate(0.0deg)
    }

    100% {
        transform: rotate(0.0deg)
    }
}


/*--------------------------------------------------------------
# skills
--------------------------------------------------------------*/

.tool .icon-box {
    padding: 70px 20px 80px 20px;
}

.iconbox-mint {
    background-color: var(--accent-mint);
}

.iconbox-blue {
    background-color: var(--primary-color);
}

.iconbox-yellow {
    background-color: var(--accent-yellow);
}

.h4-1 {
    color: var(--primary-color);
}

.h4-2 {
    color: var(--accent-yellow);
}

.h4-3 {
    color: var(--accent-orange);
}

#about table {
    padding-inline-start: 0;
}

#about td {
    font: normal 700 16px/22px var(--barlow);
    color: var(--title-color);
    letter-spacing: 1px;

}

.flip-card {
    perspective: 1000px;
    background-color: transparent;
    width: 400px;
    max-width: calc(100% - 30px);
    height: 320px;
    /* 1列になる小さい画面で、カードを中央に寄せる */
    margin-left: auto;
    margin-right: auto;
}

.flip-card .card-front .icon {
    text-align: center;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}

.flip-card-inner .card-back {
    padding: 5% 27% 5% 27%;

}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    text-align: center;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.card-back {
    background-color: var(--bg-color);
    transform: rotateY(180deg);
}

/* About Meカードの裏は常に白背景 */
#about .card-back {
    background-color: #f9f9f9;
}

#about .card-back small {
    color: var(--primary-color);
}

/* 星を削除したので、残った1列を水平方向に中央揃え */
#about .card-back table {
    display: table;
    width: auto;
    margin: 0 auto;
}

#about .card-back td {
    text-align: center;
}

/*--------------------------------------------------------------
# Portfolio
--------------------------------------------------------------*/

.site_main #portfolio .grid .project>.title h2 {
    font: 700 24px/12px var(--poppins);

}

.site_main #portfolio .grid .project>.title a {
    color: var(--title-color);
}

.site_main #portfolio .grid .project>.title a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

/* Portfolio thumbnail - griflan style zoom */
.site_main #portfolio .grid .project .img {
    overflow: hidden;
    border-radius: 4px;
}

.site_main #portfolio .grid .project .img img {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.site_main #portfolio .grid .project .img a:hover img {
    transform: scale(1.06);
    filter: none;
}

a .site_main #portfolio .button_group button {
    background: transparent;
    border: none;
    font: normal 400 16px/130px var(--poppins);
    text-transform: uppercase;
    letter-spacing: 2px;
}

#portfolio .row .thumbnail {
    margin-bottom: 4rem;
}

/*--------------------------------------------------------------
# Contact
--------------------------------------------------------------*/

#contact .flow_text span {
    font: 700 32px var(--barlow);
    color: var(--title-color);
    letter-spacing: 1px;
}

#contact a {
    color: var(--title-color);
}

#contact a:hover {
    color: var(--primary-color);
    text-decoration: none;

}

.mailto-link {
    position: relative;
    padding: 8px 0;
}

.mailto-message {
    top: 1px;
    left: 50%;
    margin-bottom: -5px;
    transform: translate(-50%, -100%);
    position: absolute;
    display: none;
    width: auto;
    white-space: nowrap;
    font-size: 16px;
    background-color: var(--primary-color);
    color: white;
    padding: 1px 6px;

    /* &:after {
        content: '';
    } */
}

.mailto-link:hover .mailto-message,
.mailto-link:focus .mailto-message,
.mailto-link:focus-within .mailto-message {
    display: block;
}




/*--------------------------------------------------------------
# Project 
--------------------------------------------------------------*/
.project_intro .card-text {
    padding: inherit;
}

/* チップ（Branding など）が小さい画面で2段に折り返したとき、段の間に隙間をあける */
div:has(> .badge-pill) {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.5rem;
}


#next_project .outer {
    overflow: hidden;
}

#next_project .inner {
    background-size: cover;
    background-position: center;
    transition: all 0.5s ease;
}

#next_project .inner:hover {
    transform: scale(1.2);
}

#next_project a {
    color: var(--primary-color);
    letter-spacing: 2px;
}

.downArrow {
    color: var(--title-color);
    ;
}

.garally .bg_blue {
    background-color: #eaecfa;
}

#next_project .card-body h4 a,
#next_project .card-body h3 a {
    color: var(--title-color);
    letter-spacing: 2px;
}

#next_project .card-body h4 a:hover,
#next_project .card-body h3 a:hover {
    color: var(--primary-color);
    text-decoration: none;

}


/*--------------------------------------------------------------
# Responsive
--------------------------------------------------------------*/

@media only screen and (max-width: 450px) {

    .header_area .main_menu .navbar {
        padding: 2%;
        margin: 0%;
    }

    .navbar .navbar-brand {
        width: auto;
    }

    .navbar-brand .brand-mark {
        height: 36px;
    }

    .navbar-brand .brand-text {
        margin-left: 10px;
        font-size: 17px;
    }

    #portfolio h2.hero_text {
        padding: 6% 2%;
    }

    #portfolio .hero-text {
        padding-top: 20%
    }

    .site_main h1 {
        font-size: 36px;
    }

    .site_main h2,
    .about-lead {
        font: normal 700 24px/35px var(--barlow);
    }

   section{
    padding:10% 2%;

    }

    .site_main .section-bg {

        padding: 3rem 0 4rem 0;

    }

    .site_main .tool {

        padding: 6rem 0 2rem 0;

    }

    #portfolio .row .thumbnail {
        margin-bottom: 2rem;
    }

    #contact .flow_text span {
        font: 400 16px var(--poppins);
        letter-spacing: 0.05em;
    }

    .wrap-hero img {
        padding-top: 10%;
    }

    #about .card-back {
        padding: 5% 5% 5% 8%;
    }


}


@media only screen and (max-width: 1112px) {


    #about .card-back {
        padding: 5% 20% 5% 20%;
    }

}




@media only screen and (max-width: 792px) {

    .header_area .main_menu .navbar .navbar-brand {
        padding: 2%;
        margin: 0%;

    }

    .wrap-hero {
        padding-top: 10%;
    }


}


/*--------------------------------------------------------------
# Dark Mode Toggle Button
--------------------------------------------------------------*/

.dark-mode-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 20px;
    margin-left: 1rem;
    position: relative;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.dark-mode-btn:hover {
    transform: scale(1.15);
    background: transparent !important;
}

.dark-mode-btn:focus,
.dark-mode-btn:active {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* ツールチップ */
.dark-mode-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: #fff;
    font-size: 11px;
    font-family: var(--poppins);
    letter-spacing: 1px;
    white-space: nowrap;
    padding: 2px 8px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.dark-mode-btn:hover::after {
    opacity: 1;
}

/* ライトモード時：月アイコンのみ表示 */
.dark-mode-btn .icon-sun {
    display: none;
}

.dark-mode-btn .icon-moon {
    display: inline;
}

/* ダークモード時：太陽アイコンのみ表示 */
html.dark-mode .dark-mode-btn .icon-sun {
    display: inline;
}

html.dark-mode .dark-mode-btn .icon-moon {
    display: none;
}


/*--------------------------------------------------------------
# Dark Mode Colors
--------------------------------------------------------------*/

html.dark-mode body {
    background-color: var(--bg-color);
    color: var(--title-color);
}

html.dark-mode .navbar-light {
    background-color: #16213e !important;
}

/* ハンバーガーメニュー：Bootstrap の既定は黒なので、ダークモードでは文字と同じ色にする */
html.dark-mode .navbar-light .navbar-toggler {
    color: #e0e0e0;
    border-color: rgba(224, 224, 224, 0.4);
}

html.dark-mode .navbar-light .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='%23e0e0e0' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

html.dark-mode h1,
html.dark-mode h2,
html.dark-mode h3,
html.dark-mode h5,
html.dark-mode .body-lg,
html.dark-mode .about-lead {
    color: #e0e0e0;
}

/* セクションタイトル（PORTFOLIO, ABOUT ME, CONTACT）はダークモードでも青を維持 */
html.dark-mode h1.section_title {
    color: var(--primary-color) !important;
}

/* h4は通常白にするが、アクセントカラーのh4は元の色を保持 */
html.dark-mode h4 {
    color: #e0e0e0;
}

html.dark-mode .h4-1 {
    color: var(--primary-color) !important;
}

html.dark-mode .h4-2 {
    color: var(--accent-yellow) !important;
}

html.dark-mode .h4-3 {
    color: var(--accent-orange) !important;
}

html.dark-mode .section-bg {
    background-color: #16213e;
}

/* About Meフリップカードの裏側はダークモードでも変更しない */
html.dark-mode #about .card-back {
    background-color: #f9f9f9 !important;
    color: #707070 !important;
}

html.dark-mode #about .card-back td,
html.dark-mode #about .card-back small,
html.dark-mode #about .card-back h4,
html.dark-mode #about .card-back p {
    color: #707070 !important;
}

/* Next Project エリア：白背景を削除、テキストを白に */
html.dark-mode #next_project .card {
    background-color: transparent !important;
}

html.dark-mode #next_project .card-body {
    background-color: transparent !important;
}

html.dark-mode #next_project .card-body h4 a,
html.dark-mode #next_project .card-body h3 a {
    color: #e0e0e0;
}

html.dark-mode #next_project .card-body h4 a:hover,
html.dark-mode #next_project .card-body h3 a:hover {
    color: var(--primary-color) !important;
}

html.dark-mode #next_project h2 {
    color: #e0e0e0 !important;
}

html.dark-mode #next_project .downArrow {
    color: #e0e0e0 !important;
}
html.dark-mode footer {
    background-color: #1a1a2e;
    color: #e0e0e0;
}

html.dark-mode #contact a,
html.dark-mode #contact .flow_text span {
    color: #e0e0e0;
}

html.dark-mode .site_main #portfolio .grid .project>.title a {
    color: #e0e0e0;
}

html.dark-mode .site_main #portfolio .grid .project>.title a:hover {
    color: var(--primary-color) !important;
}

html.dark-mode .text-secondary {
    color: #a0a0b0 !important;
}

html.dark-mode .garally .bg_blue {
    background-color: #1e2a4a;
}

/*--------------------------------------------------------------
# YouTube Thumbnail Link
--------------------------------------------------------------*/
.youtube-thumb-wrap {
    position: relative;
    cursor: pointer;
}

.youtube-thumb-link {
    display: block;
    position: relative;
}

.youtube-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.youtube-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(255, 0, 0, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    transition: background 0.3s ease, transform 0.3s ease;
    padding-left: 5px;
}

.youtube-thumb-link:hover .youtube-play-btn {
    background: rgba(255, 0, 0, 1);
    transform: translate(-50%, -50%) scale(1.1);
}
