/* --- Base Styles & Variables --- */
:root {
    --bg-color: #58B2DC; /* SORA (#58B2DC) */
    --surface-color: #ffffff;
    --accent-color: #0d0d0d;
    --text-primary: #0d0d0d;
    --text-secondary: #333333;
    --font-en: 'Syne', sans-serif;
    --font-jp: 'Noto Sans JP', sans-serif;
    --transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --section-padding: 120px;
}

@media (max-width: 768px) {
    :root {
        --section-padding: 60px;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-jp);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* --- Components --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-title {
    font-family: var(--font-en);
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 48px;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1), 
                transform 1s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 画像用の特別なアニメーション */
.reveal-img {
    opacity: 0;
    transform: scale(1.05) translateY(20px);
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), 
                transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-img.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* 時間差（スタッガー）アニメーション用の遅延設定 */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-item:nth-child(1) { transition-delay: 0.1s; }
.stagger-item:nth-child(2) { transition-delay: 0.2s; }
.stagger-item:nth-child(3) { transition-delay: 0.3s; }
.stagger-item:nth-child(4) { transition-delay: 0.4s; }

.btn {
    display: inline-flex;
    align-items: center;
    padding: 16px 32px;
    background-color: var(--accent-color);
    color: var(--bg-color);
    font-weight: 700;
    border-radius: 100px;
    transition: var(--transition);
    border: 2px solid var(--accent-color);
}

.btn:hover {
    background-color: transparent;
    color: var(--accent-color);
    transform: scale(1.05);
}

.btn-outline {
    background-color: transparent;
    color: var(--accent-color);
}

.btn-outline:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

.placeholder-img {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #333;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(88, 178, 220, 0.1);
}
.placeholder-img::after {
    content: "IMAGE";
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    opacity: 0.2;
}

/* --- Navigation & Sticky --- */
header {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 3000; /* メニュー画面(1500)より上に配置 */
    padding: 24px 0;
    transition: var(--transition);
}

.header-scrolled {
    background: rgba(88, 178, 220, 0.8);
    backdrop-filter: blur(10px);
}

.logo {
    font-family: var(--font-en);
    font-size: 2rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--accent-color);
    position: relative;
    z-index: 3001;
}

.desktop-nav {
    display: flex;
    gap: 32px;
    font-family: var(--font-en);
    font-weight: 700;
    font-size: 0.9rem;
}

/* Hamburger Button */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    z-index: 3001; /* ボタンを最前面に */
}

.hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--accent-color);
    margin: 5px 0;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Navigation Overlay */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-100%);
    transition: var(--transition);
}

.mobile-nav.active {
    transform: translateY(0);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 40px;
    text-align: center;
}

.mobile-link {
    font-family: var(--font-en);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-color);
    text-decoration: none;
}

.no-scroll {
    overflow: hidden;
}

@media (max-width: 768px) {
    .desktop-nav { display: none; }
    .hamburger { display: block; }
    
    /* モバイル時にロゴを中央に */
    header .container {
        justify-content: center;
        position: relative;
    }
    
    header .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    
    header .hamburger {
        position: absolute;
        right: 20px;
    }
}

/* --- Side Navigation (Dynamic Dot to Label) --- */
.side-nav {
    position: fixed;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}

.side-nav-inner {
    display: flex;
    flex-direction: column;
    gap: 60px;
    align-items: flex-start;
}

.side-nav-item {
    text-decoration: none;
    position: relative;
    padding: 10px 0;
}

/* セクション名ラベル (縦書き) */
.nav-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-family: var(--font-en);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    color: var(--accent-color);
    text-transform: uppercase;
    opacity: 0.15; /* 非アクティブ時は薄く表示 */
    transition: var(--transition);
    white-space: nowrap;
}

.side-nav-item.active .nav-label {
    opacity: 1;
    transform: rotate(180deg) scale(1.1);
    color: var(--accent-color);
}

.side-nav-item:hover .nav-label {
    opacity: 0.6;
}

@media (max-width: 1024px) {
    .side-nav {
        display: none;
    }
}

/* --- Geometric Background Animations --- */
.bg-geometry {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    background-color: var(--bg-color);
}

.shape {
    position: absolute;
    opacity: 0.1;
    border: 1px solid var(--surface-color);
    animation: float 20s infinite linear;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    right: -50px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    background: rgba(255, 255, 255, 0.05);
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: 10%;
    left: -20px;
    transform: rotate(45deg);
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 40%;
    left: 20%;
    border-radius: 50%;
    border-style: dashed;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, 50px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

/* --- Floating Social Bar --- */
.social-sticky {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.social-sticky.visible {
    opacity: 1;
    pointer-events: auto;
}

.social-sticky-item {
    width: 48px;
    height: 48px;
    background: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-size: 1.2rem;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.social-sticky-item:hover {
    transform: scale(1.1) translateX(-5px);
    background: var(--accent-color);
    color: var(--bg-color);
}

@media (max-width: 768px) {
    .social-sticky {
        right: 12px;
        gap: 12px;
    }
    .social-sticky-item {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* --- Section: Hero --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    position: relative;
    background-image: url('../../assets/img/profile.JPG');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

/* 背景画像の上に空色のオーバーレイを重ねて統一感を出す */
#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        var(--bg-color) 20%, 
        rgba(88, 178, 220, 0.7) 50%, 
        rgba(88, 178, 220, 0.3) 100%
    );
    z-index: 1;
}

#hero .container {
    position: relative;
    z-index: 2;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 80px;
    align-items: center;
}

@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }
}

.hero-left {
    padding: 40px 0;
    min-height: 400px; /* 十分な高さを確保してガタつきを防止 */
    display: flex;
    align-items: center;
    position: relative; /* 子要素の基準点 */
}

.hero-intro-content {
    position: absolute; /* 全てを同じ位置に重ねる */
    top: 50%;
    left: 0;
    transform: translateY(-40%); /* 中央寄せの微調整 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), 
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                visibility 0.6s;
    width: 100%;
}

.hero-intro-content.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%); /* アクティブ時にスッと上がる */
}

.dynamic-title {
    font-family: var(--font-en);
    font-size: clamp(3rem, 8vw, 5.5rem); /* サイズを抑えてバランスを調整 */
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

.dynamic-text {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 580px;
    font-weight: 500;
    word-break: break-word;
}

.hero-right {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.nav-card {
    background: var(--surface-color);
    padding: 32px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.nav-card:hover {
    transform: translateX(10px);
    background: #f8f8f8;
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.nav-card .label {
    font-family: var(--font-en);
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 最大2行に制限 */
    line-clamp: 2; /* 標準プロパティ */
    -webkit-box-orient: vertical;
}

.nav-card:hover .card-description {
    max-height: 80px; /* 説明文の高さに合わせて調整 */
    opacity: 1;
    margin-top: 12px;
}

.nav-card .arrow {
    opacity: 0;
    transform: translateX(-20px);
    transition: var(--transition);
    font-size: 1.5rem;
}

.nav-card:hover .arrow {
    opacity: 1;
    transform: translateX(0);
}

/* --- Section: About (Redesigned) --- */
#about {
    padding: var(--section-padding) 0;
    color: var(--text-primary);
    overflow: hidden;
    position: relative;
}

/* 尾道イラスト装飾 */
.about-bg-decoration {
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: clamp(300px, 40vw, 600px);
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
}

.about-bg-decoration img {
    width: 100%;
    height: auto;
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    position: relative;
    z-index: 1;
}

.about-side-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-family: var(--font-en);
    font-size: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: 0.5em;
    opacity: 0.9;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.about-main-content {
    flex: 1;
}

.about-name-jp {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.1em;
}

.about-name-en {
    font-family: var(--font-en);
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 0.05em;
    margin-bottom: 60px;
    text-transform: uppercase;
    font-weight: 400;
    line-height: 1;
    opacity: 0.9;
}

.about-info-group {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.about-info-item {
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    opacity: 0.8;
    font-weight: 400;
}

.about-social-links {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.about-social-icon {
    color: var(--text-primary);
    opacity: 0.6;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-social-icon:hover {
    opacity: 1;
    color: var(--accent-color);
    transform: translateY(-3px);
}

.about-image-box {
    width: 40%;
    max-width: 450px;
    aspect-ratio: 3/4;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 4px;
}

/* About画像へのグラデーションオーバーレイ */
.about-image-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        var(--bg-color) 0%, 
        rgba(88, 178, 220, 0) 60%
    );
    pointer-events: none;
}

.about-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.section-title {
    font-family: var(--font-en);
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 0.1em;
    margin-bottom: 48px;
    text-transform: uppercase;
    font-weight: 800;
}

.section-title.centered {
    text-align: center;
    width: 100%;
}

@media (max-width: 992px) {
    .about-container {
        flex-direction: column;
        padding: 40px 24px;
        text-align: left; /* テキスト自体は左揃えでも全体を中央寄せに */
        gap: 40px;
        align-items: center;
    }
    .about-side-label {
        display: none; /* 参考画像に合わせて非表示に */
    }
    .about-main-content {
        order: 2;
        width: 100%;
        max-width: 500px;
    }
    .about-image-box {
        width: 100%;
        max-width: 400px;
        order: 1; /* 画像を上に */
    }
    .about-name-en {
        margin-bottom: 40px;
        text-align: center;
    }
    .about-info-group {
        text-align: left;
    }
}

/* --- Section: Note --- */
#note {
    padding: var(--section-padding) 0;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.note-bg-texture {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    opacity: 0.05; /* かなり薄く敷く */
    pointer-events: none;
    z-index: 0;
}

.note-bg-texture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
}

.section-header-with-icon {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 48px;
}

.coffee-icon {
    width: 40px;
    height: auto;
    opacity: 0.8;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 48px;
}

@media (max-width: 992px) {
    .article-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .article-grid {
        grid-template-columns: 1fr;
    }
}

.article-card {
    background: var(--bg-color);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.article-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-color: rgba(0,0,0,0.1);
}

.article-thumb {
    width: 100%;
    aspect-ratio: 16/9;
}

.article-body {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.75rem;
    margin-bottom: 16px;
    width: fit-content;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-link {
    margin-top: auto;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-link::after {
    content: "→";
    transition: var(--transition);
}

.article-link:hover::after {
    transform: translateX(5px);
}

/* --- Section: Products --- */
#products {
    padding: var(--section-padding) 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 48px;
}

@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

.product-card {
    background: var(--surface-color);
    border-radius: 20px;
    padding: 32px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.product-card:hover {
    transform: scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tag {
    font-size: 0.7rem;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.product-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.product-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.product-img {
    width: 100%;
    aspect-ratio: 4/3;
    margin-bottom: 24px;
}

/* --- Page Header (note-list.html, products.html) --- */
#page-header {
    padding: 180px 0 60px;
    text-align: center;
}

/* --- Note List Page --- */
.note-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px;
    margin-bottom: 120px;
}

/* --- Product List Page --- */
.product-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 60px;
    margin-bottom: 120px;
}

.product-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    background: var(--surface-color);
    padding: 60px;
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

@media (max-width: 992px) {
    .product-item {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 40px;
    }
}

.product-item:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.01);
}

.product-info h2 {
    font-size: 2.5rem;
    margin-bottom: 24px;
    font-family: var(--font-en);
}

.product-info .product-tags {
    margin-bottom: 24px;
}

.product-info .product-desc {
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.product-visual {
    width: 100%;
    aspect-ratio: 16/10;
}

/* --- Footer --- */
footer {
    padding: 120px 0 80px;
    position: relative;
    background-image: url('../../assets/img/IMG_1183.jpeg');
    background-size: cover;
    background-position: center;
    color: var(--bg-color); /* 文字を空色にして浮かせる */
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 13, 13, 0.6); /* 暗めのフィルターで高級感を出す */
    z-index: 1;
}

footer .container {
    position: relative;
    z-index: 2;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }
}

.footer-sns {
    display: flex;
    gap: 24px;
}

.footer-sns a:hover {
    opacity: 0.6;
}

.footer-bottom {
    margin-top: 60px;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}
