/* ==========================================================================
    CSS Variables & Theming
    ========================================================================== */
:root {
    /* Dark Mode (Default) Colors */
    --main-color: #872327; /* ディープレッド */
    --accent1: #9e3d4f;    /* ビビットレッド */
    --accent2: #b8860b;    /* ダークゴールド */
    --bg-color: #000000;   /* ブラック */
    --text-color: #e9ccd1; /* ペールレッド */
    --footer-text: #ffe4e1; /* ミスティローズ */
    
    --bg-layer: rgba(0, 0, 0, 0.7);
    --card-bg: rgba(135, 35, 39, 0.15); 
    --card-solid-bg: rgba(0, 0, 0, 0.6);
    --card-bg-70: rgba(0, 0, 0, 0.7);
    --card-bg-86: rgba(0, 0, 0, 0.86); /* カード用の不透明度86%背景を追加 */
    --border-color: rgba(233, 204, 209, 0.3);

    /* Typography */
    --font-header: 'Bradley Hand ITC', 'Caveat', cursive, sans-serif;
    --font-title: 'DNP Shuei Nijimi Mincho Std L', 'Shippori Mincho', serif;
    --font-subtitle: 'Kinuta Shin StdN', 'Noto Sans JP', sans-serif;
    --font-price: 'Iroha Kaku Classic', 'Klee One', serif;
    --font-body: 'Noto Sans JP', sans-serif;
}

[data-theme="light"] {
    /* Light Mode Colors */
    --main-color: #9e3d4f;
    --accent1: #872327;
    --accent2: #b8860b;
    --bg-color: #fcfbfb;
    --text-color: #3a2b28;
    --footer-text: #ffe4e1;
    
    --bg-layer: rgba(252, 251, 251, 0.85);
    --card-bg: rgba(158, 61, 79, 0.05);
    --card-solid-bg: rgba(252, 251, 251, 0.8);
    --card-bg-70: rgba(252, 251, 251, 0.7);
    --card-bg-86: rgba(252, 251, 251, 0.86); /* ライトモード用の不透明度86%背景を追加 */
    --border-color: rgba(158, 61, 79, 0.2);
}

/* ==========================================================================
    Reset & Base
    ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    background-image: url('../images/backimage.png');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    color: var(--text-color);
    line-height: 1.8;
    transition: color 0.5s ease;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-layer);
    z-index: -1;
    transition: background-color 0.5s ease;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent2);
}

/* Accessibility: Keyboard Focus Styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--accent2);
    outline-offset: 3px;
    border-radius: 4px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

section {
    padding: 100px 0;
}

/* --------------------------------------------------------------------------
   セクションとカードの透過・不透明度設定 
----------------------------------------------------------------------------- */
/* セクション全体の背景色を完全に透過 */
#about,
#skill,
#price,
#products {
    background-color: transparent !important;
}

/* 各セクション内のカード要素の背景色を不透明度86%に変更（固定背景がうっすら見える状態） */
.skill-category,
.price-col,
.product-card,
.no-products-msg,
.about-image img {
    background-color: var(--card-bg-86) !important;
    backdrop-filter: blur(2px);
}

.section-title {
    font-family: var(--font-title);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    color: var(--accent2);
    letter-spacing: 0.1em;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background-color: var(--main-color);
    margin: 15px auto 0;
}

/* ==========================================================================
    Header
    ========================================================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 1000;
    background: transparent;
    transition: background 0.4s ease, padding 0.4s ease;
}

header.scrolled {
    background: var(--card-solid-bg);
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    border-bottom: 1px solid var(--border-color);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo img {
    height: 40px;
    width: auto;
}

.header-logo span {
    font-family: var(--font-title);
    font-size: 1.5rem;
    color: var(--accent2);
    font-weight: bold;
}

nav ul {
    display: flex;
    gap: 30px;
}

nav a {
    font-family: var(--font-header);
    font-size: 1.2rem;
    letter-spacing: 0.05em;
}

.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-toggle-btn {
    background: transparent;
    border: 2px solid var(--accent2);
    color: var(--accent2);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    background: var(--accent2);
    color: var(--bg-color);
}

[data-theme="dark"] .light-icon { display: none; }
[data-theme="dark"] .dark-icon { display: block; }
[data-theme="light"] .dark-icon { display: none; }
[data-theme="light"] .light-icon { display: block; }

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    background: none;
    border: none;
    padding: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background-color: var(--text-color);
    transition: 0.3s;
}

/* ==========================================================================
    Hero Section
    ========================================================================== */
#hero {
    height: 100vh;
    padding: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    background-color: var(--bg-color);
    mix-blend-mode: luminosity;
}

.hero-slide.active {
    opacity: 0.85;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 40%, rgba(0,0,0,0.6) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 50px 80px;
    border: 1px solid rgba(135, 35, 39, 0.3);
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(2px);
    animation: fadeInUP 1.5s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

[data-theme="light"] .hero-content {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(158, 61, 79, 0.3);
}

.hero-title {
    font-family: var(--font-title);
    color: var(--accent2);
    margin-bottom: 20px;
    line-height: 1.4;
}

.hero-title .line1 {
    display: block;
    font-size: 2rem;
    font-weight: 500;
}

.hero-title .line2 {
    display: block;
    font-size: 2.4rem; 
    font-weight: 700;
    letter-spacing: 0.05em;
}

.hero-subtitle {
    font-family: var(--font-subtitle);
    font-size: 1.2rem;
    color: var(--text-color);
    letter-spacing: 0.2em;
}

/* ==========================================================================
    About Section
    ========================================================================== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 50px;
    align-items: center;
}

.about-image {
    text-align: center;
}

.about-image img {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 5px 5px 20px rgba(0,0,0,0.5);
    border: 2px solid var(--main-color);
    /* 不透明度86%は上のセレクタで適用済み */
}

.about-text {
    font-size: 1.05rem;
}

.about-text p {
    margin-bottom: 1.5em;
}

.highlight-text {
    color: var(--accent1);
    font-weight: bold;
}

/* ==========================================================================
    Skill Section
    ========================================================================== */
.skill-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.skill-category {
    /* 不透明度86%は上のセレクタで適用済み */
    border: 1px solid var(--border-color);
    padding: 40px 30px;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(110, 71, 74, 0.2);
    border-color: var(--accent2);
}

.skill-category h3 {
    font-family: var(--font-title);
    font-size: 1.8rem;
    color: var(--accent2);
    margin-bottom: 25px;
    border-bottom: 1px dashed var(--main-color);
    padding-bottom: 15px;
    text-align: center;
}

.skill-list li {
    position: relative;
    padding-left: 35px;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 500;
}

.skill-list li.check-item::before {
    content: '✓';
    position: absolute;
    left: 5px;
    top: 0;
    color: var(--accent2);
    font-weight: bold;
    font-size: 1.2rem;
}

.skill-list li.sub-item {
    padding-left: 35px;
    margin-bottom: 25px;
    font-size: 0.95rem;
    font-weight: normal;
    color: var(--text-color);
}

/* ==========================================================================
    Price Section
    ========================================================================== */
.price-category {
    margin-bottom: 80px;
}

.price-category h3 {
    font-family: var(--font-title);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-color);
}

.price-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.price-col {
    /* 不透明度86%は上のセレクタで適用済み */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    font-family: var(--font-price);
    transition: transform 0.3s ease;
    position: relative;
}

.price-col:hover {
    transform: scale(1.02);
    z-index: 10;
    border-color: var(--accent2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.price-col.recommended {
    border: 2px solid var(--main-color);
    transform: scale(1.05);
    z-index: 5;
}

.price-col.recommended:hover {
    transform: scale(1.07);
}

.price-header {
    background: transparent;
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.price-plan-name {
    font-size: 1.2rem;
    color: var(--accent2);
    margin-bottom: 10px;
    font-weight: bold;
}

.price-amount {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-color);
}

.price-body {
    padding: 30px 20px;
}

.price-body ul {
    text-align: center;
}

.price-body li {
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 0.95rem;
}

.price-body li:last-child {
    border-bottom: none;
}

/* ==========================================================================
    Products Section & Category Filter
    ========================================================================== */
.product-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--accent2);
    color: var(--text-color);
    padding: 8px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent2);
    color: var(--bg-color);
    box-shadow: 0 4px 10px rgba(184, 134, 11, 0.3);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.no-products-msg {
    grid-column: 1 / -1; 
    text-align: center;
    padding: 50px 0;
    font-size: 1.1rem;
    color: var(--text-color);
    /* 不透明度86%は上のセレクタで適用済み */
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.product-card {
    /* 不透明度86%は上のセレクタで適用済み */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.4s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
    opacity: 1;
}

.product-card.hidden {
    display: none;
    opacity: 0;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    border-color: var(--accent2);
}

/* パフォーマンスとSEO向上のために背景画像からimgタグに変更したスタイル */
.product-img-wrapper {
    width: 100%;
    height: 220px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    background-color: transparent;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 画像の縦横比を維持しながら枠を埋める */
    filter: grayscale(100%);
    transition: filter 0.5s ease, transform 0.5s ease;
}

.product-card:hover .product-img {
    filter: grayscale(0%);
    transform: scale(1.05); /* ホバー時の微小ズームアニメーションを追加 */
}

.product-content {
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-category {
    display: inline-block;
    font-size: 0.8rem;
    background: var(--main-color);
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    align-self: flex-start;
}

.product-title {
    font-family: var(--font-title);
    font-size: 1.3rem;
    color: var(--accent2);
    margin-bottom: 15px;
}

.product-desc {
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 15px;
    flex-grow: 1;
}

.product-feature {
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.4;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
}

/* ==========================================================================
    Contact Section
    ========================================================================== */
#contact {
    background-color: transparent !important;
    width: 50%; /* コンタクトセクションの幅を半分にする */
    margin: 0 auto;
}

.contact-text {
    text-align: center;
    margin-bottom: 30px;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-bg-70);
    backdrop-filter: blur(2px); 
    padding: 50px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-family: var(--font-title);
    color: var(--accent2);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    background: var(--card-solid-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-family: var(--font-body);
    border-radius: 4px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent2);
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

.submit-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background: var(--main-color);
    color: #fff;
    border: none;
    font-family: var(--font-title);
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s, transform 0.3s;
    letter-spacing: 0.1em;
}

.submit-btn:hover {
    background: var(--accent2);
    transform: translateY(-2px);
}

/* ==========================================================================
    Footer
    ========================================================================== */
footer {
    background: #000;
    color: var(--footer-text);
    text-align: center;
    padding: 30px 0;
    font-size: 0.9rem;
    border-top: 1px solid var(--main-color);
}

/* ==========================================================================
    Back to Top Button
    ========================================================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--main-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--accent2);
    transform: translateY(-3px);
    color: var(--bg-color);
}

/* ==========================================================================
    Animations & Utilities
    ========================================================================== */
@keyframes fadeInUP {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
    Responsive Design
    ========================================================================== */

@media screen and (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .hero-title .line1 { font-size: 1.5rem; }
    .hero-title .line2 { font-size: 1.5rem; } 
    .hero-content { padding: 30px 20px; width: 90%; }
    
    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-color);
        padding: 20px 0;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }

    nav ul.active {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .skill-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .price-grid {
        grid-template-columns: 1fr;
    }

    .price-col.recommended {
        transform: scale(1);
    }
    .price-col.recommended:hover {
        transform: scale(1.02);
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    /* モバイル画面では幅の半分を解除し、元の表示幅(90%)に戻す調整 */
    #contact {
        width: 90%;
    }

    .contact-form {
        padding: 30px 20px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}