/* ベース設定: シンプルモダン・モノトーン（黒背景） */
:root {
    --bg-color: #111111; /* 基本は黒 */
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --accent-color: #ffffff; /* アクセントは白 */
    --border-color: #333333;
    --card-bg: #1a1a1a;
    --font-base: 'Noto Sans JP', 'Inter', sans-serif;
    --max-width: 1000px;
}

/* 白背景テーマ */
body.light-theme {
    --bg-color: #ffffff;
    --text-main: #111111;
    --text-muted: #666666;
    --accent-color: #000000;
    --border-color: #e0e0e0;
    --card-bg: #f9f9f9;
}

/* ライトテーマ時のロゴ色修正 */
body.light-theme .logo {
    color: #ffffff; /* 白に修正 */
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-base);
    line-height: 1.8;
    letter-spacing: 0.04em;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

a {
    color: var(--text-main);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.7;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* ヘッダー - 究極にシンプルに */
header {
    padding: 2rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(17, 17, 17, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

/* スクロール時のヘッダー変化 */
header.scrolled {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.logo {
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

@media (max-width: 600px) {
    nav ul {
        gap: 1rem;
        font-size: 0.8rem;
    }
    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }
}

nav a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

nav a:hover {
    color: var(--text-main);
}

/* メイン */
main {
    padding-top: 100px;
}

/* ヒーローエリア - 楽しく、笑顔に */
.hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-desc {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 3rem;
}

.hero-icons {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    font-size: 2rem;
    color: var(--text-main);
}

.nfc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid var(--text-main);
    border-radius: 50px;
    font-weight: bold;
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* セクション共通 */
section {
    padding: 6rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

/* About - シンプルなグリッド */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    .hero-desc { font-size: 1rem; padding: 0 1rem; }
    .about-content { grid-template-columns: 1fr; }
    section { padding: 4rem 0; }
    .work-item, .work-item.reverse { grid-template-columns: 1fr; gap: 1.5rem; }
    .work-item.reverse .work-image { order: 0; } /* モバイルでは画像が上 */
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

/* UI/UX Philosophy - カード */
.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.philosophy-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px; /* 丸みを帯びさせて親しみやすく */
    text-align: center;
    transition: transform 0.3s ease;
}

.philosophy-card:hover {
    transform: translateY(-5px);
}

.philosophy-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.philosophy-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.philosophy-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Works - シンプルなリスト */
.work-list {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.work-item {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    align-items: center;
}

.work-item.reverse {
    grid-template-columns: 1fr 1.5fr;
}

.work-item.reverse .work-image {
    order: 1;
}

.work-image {
    background: #222;
    border-radius: 16px;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #444;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.work-image:hover {
    transform: scale(1.02);
}

.work-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.work-info p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tech-tag {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    background: var(--text-main);
    color: var(--bg-color);
    border-radius: 4px;
}

/* Contact */
.contact {
    text-align: center;
    padding: 8rem 0;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.contact.in-view {
    opacity: 1;
    transform: translateY(0);
}

.contact h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.contact p {
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.btn-contact {
    display: inline-block;
    padding: 1rem 3rem;
    background: var(--text-main);
    color: var(--bg-color);
    border-radius: 50px;
    font-weight: bold;
    transition: transform 0.2s;
}

.btn-contact:hover {
    transform: scale(1.05);
    opacity: 1;
}

/* Footer */
footer {
    padding: 3rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
}

/* 汎用アニメーションクラス (Aboutセクションなどで使用) */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

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

[data-scroll] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

[data-scroll].in-view {
    opacity: 1;
    transform: translateY(0);
}

/* アクセシビリティ: アニメーションを無効化する設定に対応 */
@media (prefers-reduced-motion: reduce) {
    .fade-in-up,
    [data-scroll] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* 笑顔エフェクト用アニメーション */
@keyframes fall {
    0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* コマンドプロンプト風モーダル */
.terminal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.terminal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.terminal-window {
    width: 800px;
    height: 500px;
    background: #0c0c0c;
    border: 1px solid #444;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    font-family: 'Consolas', 'Courier New', monospace;
    overflow: hidden;
}

@media (max-width: 820px) {
    .terminal-window {
        width: 90vw;
        height: 60vh;
    }
}

.terminal-header {
    background: #ffffff;
    padding: 0; /* パディング削除してボタン配置を正確に */
    border-bottom: 1px solid #999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 32px;
    user-select: none;
}

.terminal-controls {
    display: flex;
    height: 100%;
}

.win-btn {
    width: 46px; /* Windows 10/11標準サイズに近づける */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px; /* アイコンサイズ */
    color: #000;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
}

.win-btn:hover {
    background: #e5e5e5;
}

.win-btn.close:hover {
    background: #e81123;
    color: white;
}

.terminal-title {
    margin-left: 10px;
    color: #333;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    letter-spacing: 0.5px;
}

.terminal-icon {
    width: 14px;
    height: 14px;
    background: #000;
    display: inline-block;
}

.terminal-body {
    flex: 1;
    padding: 8px 12px;
    background-color: #0c0c0c;
    color: #cccccc;
    overflow-y: auto;
    font-size: 16px; /* 読みやすいサイズ */
    line-height: 1.4;
    cursor: text; /* テキスト入力エリアであることを示す */
}

/* スクロールバー - ダークテーマに馴染ませる */
.terminal-body::-webkit-scrollbar {
    width: 10px;
}
.terminal-body::-webkit-scrollbar-track {
    background: #1e1e1e;
}
.terminal-body::-webkit-scrollbar-thumb {
    background-color: #4d4d4d;
    border: 2px solid #1e1e1e; /* 隙間を作って浮かせる */
}
.terminal-body::-webkit-scrollbar-thumb:hover {
    background-color: #666666;
}

.prompt {
    color: #cccccc; /* プロンプト色も合わせる */
    margin-right: 0;
}

#terminal-input {
    background: transparent;
    border: none;
    color: #cccccc; /* 入力文字色も合わせる */
    font-family: inherit;
    font-size: inherit;
    flex: 1;
    outline: none;
}
