﻿/* Base reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    line-height: 1.7;
    background: var(--bg);
    color: var(--text);
    transition: background-color .2s ease, color .2s ease;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* Theme variables */
body[data-theme='light'] {
    --bg: #f8fafc;
    --bg-soft: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --card: #ffffff;
    --shadow: 0 8px 24px rgba(0,0,0,.08);
    --primary: #2563eb;
    --primary-contrast: #ffffff;
    --accent-tertiary: #2c5f7c;
}
body[data-theme='dark'] {
    --bg: #0b1220;
    --bg-soft: #0f172a;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --border: #243144;
    --card: #111827;
    --shadow: 0 12px 32px rgba(0,0,0,.5);
    --primary: #60a5fa;
    --primary-contrast: #0b1220;
    --accent-tertiary: #2c5f7c;
}

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.content-wrapper { padding: 60px 0; }
.content-section { margin: 0 auto; }
.section-title { text-align: center; letter-spacing: .2em; font-weight: 800; margin-bottom: 40px; }
.content-block { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 16px; padding: 30px; margin: 30px 0; box-shadow: var(--shadow); }

/* Hero */
.hero {
    display: grid;
    place-items: center;
    text-align: center;
    padding: 80px 20px 40px;
    background: linear-gradient(180deg, rgba(99,102,241,0.10), rgba(99,102,241,0) 50%);
}
.site-title { font-size: clamp(36px, 6vw, 56px); margin: 0 0 12px; font-weight: 900; letter-spacing: .08em; }
.tagline { color: var(--muted); margin: 0 0 18px; }
.scroll-indicator { font-size: 12px; letter-spacing: .4em; color: var(--muted); }

/* Theme toggle */
.theme-toggle { position: fixed; top: 16px; right: 16px; z-index: 50; display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.theme-toggle .theme-toggle-icon { font-size: 14px; }
.theme-toggle .theme-toggle-slider { width: 48px; height: 24px; background: var(--border); border-radius: 999px; position: relative; }
.theme-toggle .theme-toggle-slider::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: var(--card); border-radius: 999px; transition: transform .2s ease; box-shadow: var(--shadow); }
body[data-theme='dark'] .theme-toggle .theme-toggle-slider::after { transform: translateX(24px); }

/* Cards grid (navigation) */
.nav-section { padding: 30px 0; }
.nav-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.nav-card { display: flex; flex-direction: column; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); transition: transform .15s ease; }
.nav-card:hover { transform: translateY(-2px); }
.nav-card .icon { font-size: 28px; }
.nav-card-heading { display: flex; align-items: baseline; gap: 8px; font-weight: 800; }
.nav-card-heading .brand { letter-spacing: .08em; }
.nav-card-heading .branch { color: var(--muted); font-weight: 700; }
.nav-card .subtitle { font-size: 12px; letter-spacing: .3em; color: var(--muted); margin: 0; }
.nav-card-actions { margin-top: auto; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 10px; font-weight: 700; border: 1px solid transparent; text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--primary-contrast); }
.btn-primary:hover { filter: brightness(1.05); text-decoration: none; }
.btn-disabled[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }

/* Departments */
.department-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.department-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.department-card h4 { margin: 0 0 10px; font-size: 18px; }
.department-card ul { margin: 10px 0 16px 18px; }
.department-card li { margin: 6px 0; }

/* Highlight */
.highlight-text { background: linear-gradient(180deg, rgba(255,237,213,.9), rgba(255,237,213,0)); padding: 0 .2em; border-radius: 4px; }

/* Fade-in animation */
.fade-in { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* Force departments vertical layout */
.department-grid { grid-template-columns: 1fr; }

/* Footer */
footer { text-align: center; background: var(--accent-tertiary); color: rgba(255,255,255,0.9); padding: 40px 0 60px; }
footer a { color: rgba(255,255,255,0.9); text-decoration: underline; text-underline-offset: 2px; }
footer a:hover { opacity: .9; }

/* ===== Rebuild: Styles from provided HTML design ===== */
/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Color system */
:root {
    --bg-primary: #fafaf8;
    --bg-secondary: #ffffff;
    --text-primary: #333333;
    --text-secondary: #555555;
    --text-muted: #666666;
    --accent-primary: #db4d6d;
    --accent-secondary: #3a8fb7;
    --accent-tertiary: #2c5f7c;
    --accent-green: #8fbc8b;
    --border-color: rgba(58, 143, 183, 0.15);
    --shadow-color: rgba(0,0,0,0.08);
    --gradient-1: rgba(219, 77, 109, 0.08);
    --gradient-2: rgba(58, 143, 183, 0.06);
    --gradient-3: rgba(143, 188, 139, 0.05);
}

[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: rgba(255,255,255,0.02);
    --text-primary: #ffffff;
    --text-secondary: rgba(255,255,255,0.8);
    --text-muted: rgba(255,255,255,0.6);
    --accent-primary: #c9a063;
    --accent-secondary: #e8c89f;
    --accent-tertiary: #2c5f7c; /* 固定色（フッター背景） */
    --accent-green: #c9a063;
    --border-color: rgba(201, 160, 99, 0.2);
    --shadow-color: rgba(0,0,0,0.5);
    --gradient-1: rgba(201, 160, 99, 0.15);
    --gradient-2: rgba(232, 200, 159, 0.1);
    --gradient-3: rgba(201, 160, 99, 0.08);
}

body {
    font-family: 'Noto Serif JP', 'Yu Mincho', serif;
    line-height: 1.8;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    transition: background .3s ease, color .3s ease;
}

/* Theme Toggle */
.theme-toggle { position: fixed; top: 30px; right: 30px; z-index: 1000; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 50px; padding: 10px; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: all .3s ease; box-shadow: 0 4px 20px var(--shadow-color); }
.theme-toggle:hover { transform: scale(1.05); box-shadow: 0 6px 25px var(--shadow-color); }
.theme-toggle-icon { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.theme-toggle-slider { width: 50px; height: 26px; background: var(--accent-primary); border-radius: 13px; position: relative; transition: background .3s ease; }
.theme-toggle-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform .3s ease; }
body[data-theme='dark'] .theme-toggle-slider::after { transform: translateX(24px); }

/* Background Animation */
body::before { content: ""; position: fixed; inset: 0; background:
    radial-gradient(circle at 20% 50%, var(--gradient-1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, var(--gradient-2) 0%, transparent 50%),
    radial-gradient(circle at 50% 100%, var(--gradient-3) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite; z-index: -1; }
/* 上層にクリック遮断が来ないようイベント透過 */
body::before { pointer-events: none; }
@keyframes float { 0%,100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.1) rotate(5deg); } }

.container { max-width: 1400px; margin: 0 auto; padding: 0 40px; }

/* Hero */
.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; position: relative; }
[data-theme="light"] .hero { background: linear-gradient(180deg, rgba(255,255,255,0.5) 0%, transparent 50%, rgba(255,255,255,0.3) 100%); }
[data-theme="dark"] .hero { background: linear-gradient(180deg, #0a0a0a 0%, rgba(10,10,10,0.8) 50%, #0a0a0a 100%); }
.hero::after { content: ""; position: absolute; bottom: 50px; left: 50%; transform: translateX(-50%); width: 1px; height: 80px; background: linear-gradient(180deg, transparent, var(--accent-primary), transparent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
.site-title { font-size: clamp(4rem, 10vw, 8rem); font-weight: 200; letter-spacing: .5em; margin-right: -.5em; position: relative; animation: glow 3s ease-in-out infinite; }
[data-theme="light"] .site-title { background: linear-gradient(135deg, #2c5f7c 0%, #db4d6d 50%, #3a8fb7 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
[data-theme="dark"] .site-title { background: linear-gradient(135deg, #fff 0%, #c9a063 50%, #fff 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
@keyframes glow { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.2); } }
.tagline { font-size: 1.2rem; color: var(--text-muted); letter-spacing: .3em; margin-top: 20px; font-weight: 300; }
.scroll-indicator { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); font-size: .8rem; color: var(--text-muted); letter-spacing: .2em; animation: bounce 2s infinite; }
@keyframes bounce { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(10px); } }

/* Navigation Cards */
.nav-section { padding: 100px 0; background: transparent; position: relative; }
[data-theme="dark"] .nav-section { background: #0a0a0a; }
.nav-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; max-width: 1200px; margin: 0 auto; }
.nav-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 0; padding: 60px 30px; text-align: center; text-decoration: none; color: var(--text-primary); position: relative; overflow: hidden; transition: all .5s cubic-bezier(.4,0,.2,1); box-shadow: 0 4px 20px var(--shadow-color); }
[data-theme="dark"] .nav-card { background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%); }
.nav-card::before { content: ""; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; opacity: 0; transition: opacity .5s ease; }
/* ホバー用オーバーレイもイベント透過でクリック阻害を回避 */
.nav-card::before { pointer-events: none; }
[data-theme="light"] .nav-card::before { background: radial-gradient(circle, rgba(219,77,109,0.05) 0%, transparent 70%); }
[data-theme="dark"] .nav-card::before { background: radial-gradient(circle, rgba(201,160,99,0.1) 0%, transparent 70%); }
.nav-card:hover::before { opacity: 1; }
.nav-card:hover { transform: translateY(-10px); }
[data-theme="light"] .nav-card:hover { border-color: rgba(219,77,109,0.3); box-shadow: 0 10px 40px rgba(219,77,109,0.15); }
[data-theme="dark"] .nav-card:hover { border-color: rgba(201,160,99,0.6); background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%); }
.nav-card .icon { font-size: 3rem; margin-bottom: 20px; transition: all .5s ease; }
[data-theme="light"] .nav-card .icon { filter: saturate(.8); }
[data-theme="dark"] .nav-card .icon { filter: grayscale(.5); }
.nav-card:hover .icon { transform: scale(1.1); }
[data-theme="light"] .nav-card:hover .icon { filter: saturate(1.2); }
[data-theme="dark"] .nav-card:hover .icon { filter: grayscale(0); }
.nav-card h3 { font-size: 1.8rem; margin-bottom: 10px; font-weight: 300; letter-spacing: .2em; line-height: 1.4; }
.nav-card h3 .main-title { display: block; font-size: 1.2rem; margin-bottom: 5px; opacity: .8; }
.nav-card h3 .sub-title { display: block; font-size: 2.2rem; font-weight: 400; }
[data-theme="light"] .nav-card h3 { color: var(--accent-tertiary); }
.nav-card .subtitle { font-size: .9rem; color: var(--accent-primary); margin-bottom: 20px; letter-spacing: .3em; }
[data-theme="dark"] .nav-card .subtitle { color: var(--accent-secondary); }
.nav-card p { font-size: .95rem; color: var(--text-muted); letter-spacing: .1em; }
.nav-card .action-link { display: inline-block; margin-top: 20px; padding: 10px 25px; border: 1px solid var(--accent-primary); color: var(--accent-primary); text-decoration: none; font-size: .9rem; letter-spacing: .1em; transition: all .3s ease; }
.nav-card .action-link:hover { background: var(--accent-primary); color: #fff; }
.nav-card .action-link.disabled { opacity: .5; cursor: not-allowed; }
.nav-card .action-link.disabled:hover { background: transparent; color: var(--accent-primary); }

/* Related Links */
.related-section { padding: 80px 0; background: var(--bg-secondary); border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
.related-title { text-align: center; font-size: 2rem; color: var(--text-primary); margin-bottom: 50px; font-weight: 200; letter-spacing: .3em; position: relative; }
.related-title::after { content: ""; position: absolute; bottom: -15px; left: 50%; transform: translateX(-50%); width: 80px; height: 1px; background: var(--accent-primary); }
.related-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; max-width: 1200px; margin: 0 auto; }
.related-card { text-align: center; padding: 30px 20px; background: var(--bg-primary); border: 1px solid var(--border-color); color: var(--text-primary); transition: all .3s ease; position: relative; overflow: hidden; }
.related-card::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--accent-primary); transform: scaleX(0); transition: transform .3s ease; }
.related-card:hover::before { transform: scaleX(1); }
.related-card:hover { transform: translateY(-5px); box-shadow: 0 5px 20px var(--shadow-color); }
.related-card h4 { font-size: 1.3rem; margin-bottom: 10px; color: var(--accent-tertiary); font-weight: 400; }
.related-card .url { font-size: .9rem; color: var(--text-muted); font-family: monospace; }
.related-card .url a { color: var(--accent-primary); text-decoration: underline; text-underline-offset: 2px; }
.related-card .url a:hover { opacity: .9; }

/* Content Section */
.content-wrapper { padding: 100px 0; }
[data-theme="light"] .content-wrapper { background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.8) 50%, transparent 100%); }
[data-theme="dark"] .content-wrapper { background: linear-gradient(180deg, #0a0a0a 0%, #1a1614 50%, #0a0a0a 100%); }
.content-section { max-width: 900px; margin: 0 auto; text-align: center; }
.section-title { font-size: 3rem; margin-bottom: 60px; font-weight: 200; letter-spacing: .3em; position: relative; display: inline-block; }
[data-theme="light"] .section-title { color: var(--accent-tertiary); }
[data-theme="dark"] .section-title { color: #fff; }
.section-title::after { content: ""; position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); width: 100px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-primary), transparent); }
.content-block { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 20px; padding: 60px; margin-bottom: 60px; box-shadow: 0 10px 40px var(--shadow-color); text-align: left; }
[data-theme="dark"] .content-block { backdrop-filter: blur(10px); }
.content-block h2 { font-size: 2.5rem; color: var(--accent-primary); margin-bottom: 40px; text-align: center; font-weight: 200; letter-spacing: .2em; }
.content-block h3 { font-size: 1.6rem; color: var(--accent-secondary); margin: 40px 0 20px; font-weight: 300; text-align: center; }
.content-block p { color: var(--text-secondary); line-height: 2.2; margin-bottom: 25px; font-size: 1.05rem; }
.content-block ul { list-style: none; padding: 0; margin: 30px 0; }
.content-block ul li { color: var(--text-secondary); padding: 15px 0; padding-left: 40px; position: relative; font-size: 1.05rem; border-bottom: 1px solid var(--border-color); }
.content-block ul li::before { content: '◆'; position: absolute; left: 10px; color: var(--accent-primary); }
.content-block strong { color: var(--accent-tertiary); font-weight: 500; }
[data-theme="dark"] .content-block strong { color: #fff; }
.highlight-text { background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 500; }

.department-grid { display: grid; gap: 30px; margin-top: 50px; }
.department-card { padding: 40px; position: relative; overflow: hidden; transition: all .3s ease; border-left: 3px solid var(--accent-green); }
[data-theme="light"] .department-card { background: linear-gradient(135deg, rgba(143,188,139,.05) 0%, rgba(255,255,255,.8) 100%); }
[data-theme="dark"] .department-card { background: rgba(201,160,99,.05); }
.department-card::before { content: ""; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; transition: left .5s ease; }
[data-theme="light"] .department-card::before { background: linear-gradient(90deg, transparent, rgba(143,188,139,.1), transparent); }
[data-theme="dark"] .department-card::before { background: linear-gradient(90deg, transparent, rgba(201,160,99,.1), transparent); }
.department-card:hover::before { left: 100%; }
.department-card h4 { color: var(--accent-tertiary); font-size: 1.4rem; margin-bottom: 20px; font-weight: 400; }
[data-theme="dark"] .department-card h4 { color: var(--accent-secondary); }
.department-card p { color: var(--text-secondary); }

/* Responsive */
@media (max-width: 768px) {
    .theme-toggle { top: 15px; right: 15px; }
    .nav-cards { grid-template-columns: 1fr; gap: 30px; }
    .related-links { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .content-block { padding: 40px 20px; }
    .site-title { letter-spacing: .2em; margin-right: -.2em; }
}
@media (max-width: 480px) {
    .related-links { grid-template-columns: 1fr; }
}

/* Scroll animations */
.fade-in { opacity: 0; transform: translateY(30px); transition: all .8s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* Related orgs (existing) */
.related-orgs-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.related-org-card {
    display: block;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    background: var(--card);
    color: inherit;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: var(--shadow);
}
.related-org-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}
.related-org-name {
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 6px;
}
.related-org-url {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: .9rem;
    opacity: .8;
}

/* Responsive */
@media (max-width: 1024px) {
    .nav-cards { grid-template-columns: repeat(2, 1fr); }
    .department-grid { grid-template-columns: repeat(2, 1fr); }
    .related-orgs-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .nav-cards { grid-template-columns: 1fr; }
    .department-grid { grid-template-columns: 1fr; }
    .related-orgs-grid { grid-template-columns: 1fr; }
    .content-block { padding: 20px; border-radius: 12px; }
}

.related-orgs-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.related-org-card {
    display: block;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 12px;
    text-decoration: none;
    background: #fff;
    color: inherit;
    transition: transform .2s ease, box-shadow .2s ease;
}
.related-org-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.related-org-name {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 6px;
}
.related-org-url {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: .9rem;
    opacity: .8;
}

@media (max-width: 1024px) {
    .related-orgs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .related-orgs-grid {
        grid-template-columns: 1fr;
    }
}
