/* ==========================================================================
   Dr.WataWata Laboratory - Stable Integrated Style
   ========================================================================== */

:root {
    --main-blue: #0074BE;
    --soft-blue: #f4f7f9;
    --bg-white: #ffffff;
    --text-dark: #333;
    --text-gray: #777;
    --transition: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --side-padding: 8%; /* ロゴの開始位置に合わせるための基準値 */
}

/* --- 基本リセット --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Roboto', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-white);
    color: var(--text-dark);
    line-height: 1.8;
    overflow-x: hidden;
}

/* ==========================================================================
   ナビゲーション (メニューボタン & フルメニュー)
   ========================================================================== */

.menu-btn {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 30px;
    height: 24px;
    z-index: 3000;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--main-blue);
    transition: var(--transition);
}

/* メニュー展開時のボタンアニメーション */
.menu-btn.active span:nth-child(1) { transform: translateY(11px) rotate(45deg); }
.menu-btn.active span:nth-child(2) { opacity: 0; }
.menu-btn.active span:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }

.full-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 2500;
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: var(--transition);

/* ★この1行を必ず追加してください★ */
    overflow-y: auto;
}

.full-menu.active {
    visibility: visible;
    opacity: 1;
}

.full-menu ul { list-style: none; text-align: center; }
.full-menu li { margin: 10px 0; }
.full-menu a {
    font-size: 2rem;
    text-decoration: none;
    color: var(--main-blue);
    font-weight: 300;
}

.lang-switch {
    position: fixed;
    top: 32px;
    right: 90px;
    z-index: 2000;
    font-size: 14px;
}

/* ==========================================================================
   メインレイアウト (Hero / Container)
   ========================================================================== */

/* 全てのメインコンテンツの開始位置を左端8%に揃えるための基本設定 */
.container, 
.archive-wrapper, 
.hero {
    padding-left: var(--side-padding) !important;
    padding-right: var(--side-padding) !important;
}

/* ヒーローエリア */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    background-color: var(--bg-white);
    overflow: hidden;
}

/* 帯状パーティクル (杉浦研究室スタイル) */
#particles-js {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 400px;
    transform: translateY(-50%);
    z-index: 1;
    mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
}

.logo-area { position: relative; z-index: 10; }
.logo-area h1 { font-size: clamp(2.5rem, 8vw, 4.5rem); color: var(--main-blue); font-weight: 300; line-height: 1.1; }

/* コンテンツセクション */
.content-section {
    padding: 100px 0;
    border-bottom: 1px solid #e1e8ed;
}
.content-section:nth-of-type(odd) { background-color: var(--soft-blue); }

.flex-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 80px;
}
.reverse { flex-direction: row-reverse; }

.text-block { flex: 1.5; text-align: left; }
.text-block h2 { font-size: 2.2rem; color: var(--main-blue); margin-bottom: 30px; font-weight: 300; position: relative; }
.text-block h2::after { content: ""; position: absolute; bottom: -10px; left: 0; width: 40px; height: 3px; background-color: var(--main-blue); }

.image-block { flex: 1; display: flex; justify-content: center; }
.image-block img { width: 100%; max-width: 550px; height: auto; border-radius: 4px; box-shadow: 0 12px 30px rgba(0,0,0,0.06); }

/* ==========================================================================
   サブページ (Equations / Methods / About / Books)
   ========================================================================== */

.archive-wrapper {
    padding-top: 160px; /* ヘッダーとの重なり回避 */
    padding-bottom: 100px;
}

.archive-header h1 {
    font-size: 3rem;
    font-weight: 300;
    color: var(--main-blue);
    margin-bottom: 60px;
}

/* グリッドカード */
.eq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.eq-card {
    display: block;
    background: #fff;
    border: 1px solid #e1e8ed;
    padding: 40px;
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition);
}
.eq-card:hover { border-color: var(--main-blue); transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0,0,0,0.05); }

.eq-number { display: block; font-size: 0.8rem; color: var(--main-blue); margin-bottom: 15px; font-weight: 500; letter-spacing: 2px; }
.eq-card h3 { font-size: 1.4rem; margin-bottom: 15px; color: var(--main-blue); font-weight: 500; }

/* 個別解説ページ用 */
.formula-box {
    background: var(--soft-blue);
    border-left: 4px solid var(--main-blue);
    padding: 30px;
    margin: 40px 0;
    max-width: 800px;
    overflow-x: auto;
}

.back-nav { margin-top: 60px; border-top: 1px solid #eee; padding-top: 30px; }
.back-nav a { color: var(--main-blue); text-decoration: none; font-weight: 500; }

/* ==========================================================================
   レスポンシブ
   ========================================================================== */
@media (max-width: 768px) {
    :root { --side-padding: 5%; }
    .flex-container, .reverse { flex-direction: column !important; align-items: flex-start; }
    .image-block { margin-top: 40px; width: 100%; }
}

footer {
    padding: 60px var(--side-padding);
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: #999;
}




/* Booksページのリンクの色をわかりやすくする */
.eq-card h3 a {
    color: #333; /* 文字色（黒系） */
    text-decoration: underline; /* 下線をつける */
    transition: color 0.3s;
}

.eq-card h3 a:hover {
    color: #007bff; /* マウスを乗せたときの色（青系） */
}


/* Date Style for Cards */
    .eq-card {
        position: relative;
    }
    .eq-date {
        position: absolute;
        top: 15px;
        right: 15px;
        font-size: 0.75rem;
        color: #999;
        font-family: 'Roboto', sans-serif;
        letter-spacing: 0.05em;
    }
    @media (max-width: 480px) {
        .eq-date {
            top: 10px;
            right: 10px;
            font-size: 0.7rem;
        }


