:root {
    --bg-color: #f8f7f2;
    --text-color: #111111;
    --accent-color: #b8b6ad;
    --muted-color: #62615b;
    --panel-color: rgba(255, 255, 255, 0.68);
    --panel-border: rgba(17, 17, 17, 0.12);
}

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    cursor: auto;
}

.has-custom-cursor {
    cursor: none;
}

/* カスタムスクロールバー */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

/* 3D Canvas Container */
#webgl-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none; /* コンテンツへのクリックを透過 */
}

/* Content Layer */
#content-layer {
    position: relative;
    z-index: 10;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem clamp(1.5rem, 4vw, 3.5rem);
    background: transparent;
}

.brand {
    color: var(--text-color);
    text-decoration: none;
    font-size: clamp(1rem, 2vw, 1.3rem);
    letter-spacing: 0.28em;
    font-weight: 900;
}

.site-nav {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.site-nav a {
    display: inline-flex;
    min-height: 2.4rem;
    align-items: center;
    padding: 0.56rem 0.88rem;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 800;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.site-nav a:hover {
    border-color: var(--text-color);
    background: rgba(255, 255, 255, 0.36);
}

/* ノイズテクスチャ (Awwwardsテイスト) */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 50;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* カスタムカーソル */
.cursor-dot, .cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}
.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--text-color);
}
.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(17, 17, 17, 0.45);
}

/* タイポグラフィ・ユーティリティ */
.text-gradient {
    background: linear-gradient(135deg, #111111 0%, #6e6c64 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.clip-text {
    overflow: hidden;
}
.clip-text span {
    display: inline-block;
    transform: translateY(100%);
}

/* グラスモーフィズムパネル */
.glass-panel {
    background: var(--panel-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    box-shadow: 0 24px 80px rgba(17, 17, 17, 0.08);
}

/* ローディング画面 */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease-in-out;
}
.loading-text {
    font-size: 2rem;
    font-weight: 200;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    animation: pulse 2s infinite;
}
.loading-text.has-error {
    animation: none;
    letter-spacing: 0.3em;
}
@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* 画像ホバーエフェクト */
.img-container {
    overflow: hidden;
}
.img-container img {
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), filter 0.8s ease;
    filter: grayscale(100%) brightness(0.8);
}
.img-container:hover img {
    transform: scale(1.05);
    filter: grayscale(0%) brightness(1);
}

/* Light theme overrides for CDN Tailwind utility classes used below. */
.theme-light .text-white { color: #111111; }
.theme-light .text-black { color: #ffffff; }
.theme-light .text-gray-300,
.theme-light .text-gray-400 { color: #4f4e49; }
.theme-light .text-gray-500 { color: #77756d; }
.theme-light .text-gray-600 { color: #8d8a82; }
.theme-light .text-gray-800 { color: #d6d3c8; }
.theme-light .bg-white { background-color: #111111; }
.theme-light .bg-black,
.theme-light .bg-\[\#050505\] { background-color: #ffffff; }
.theme-light .bg-gray-900 { background-color: #ece9df; }
.theme-light .bg-gray-800 { background-color: #d8d5ca; }
.theme-light .border-white { border-color: #111111; }
.theme-light .border-gray-600,
.theme-light .border-gray-700,
.theme-light .border-gray-800 { border-color: #c9c5b9; }
.theme-light .hover\:bg-white:hover { background-color: #111111; }
.theme-light .hover\:text-black:hover { color: #ffffff; }
.theme-light .hover\:bg-gray-300:hover { background-color: #363636; }
.theme-light .hover\:text-gray-400:hover,
.theme-light .hover\:text-white:hover { color: #55534d; }
.theme-light .mix-blend-difference { mix-blend-mode: normal; }
.theme-light .from-white {
    --tw-gradient-from: #111111 var(--tw-gradient-from-position);
    --tw-gradient-to: rgba(17, 17, 17, 0) var(--tw-gradient-to-position);
}
.theme-light .from-gray-900 {
    --tw-gradient-from: #ece9df var(--tw-gradient-from-position);
    --tw-gradient-to: rgba(236, 233, 223, 0) var(--tw-gradient-to-position);
}
.theme-light .to-black,
.theme-light .to-\[\#0a0a0a\] {
    --tw-gradient-to: #ffffff var(--tw-gradient-to-position);
}
.theme-light .via-gray-500 {
    --tw-gradient-to: rgba(119, 117, 109, 0) var(--tw-gradient-to-position);
    --tw-gradient-stops: var(--tw-gradient-from), #77756d var(--tw-gradient-via-position), var(--tw-gradient-to);
}

.theme-light .scene-surface {
    background-color: rgba(248, 247, 242, 0.74);
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
}

.hero-title {
    font-size: clamp(2.8rem, 14vw, 5.5rem);
    letter-spacing: -0.03em;
}

.hero-scroll-hint {
    font-size: 0.72rem;
}

@media (max-width: 900px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-nav {
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .hero-scroll-hint {
        bottom: 2.5rem;
    }

    .hero-contact-list {
        font-size: 1rem;
    }

    .hero-contact-list svg {
        width: 1.1rem;
        height: 1.1rem;
    }
}

@media (max-width: 520px) {
    .site-header {
        padding: 1.35rem 1.35rem 0;
    }

    .site-nav {
        gap: 0.35rem;
    }

    .site-nav a {
        min-height: 2rem;
        padding: 0.42rem 0.58rem;
        font-size: 0.62rem;
        letter-spacing: 0.12em;
    }
}

@media (hover: none), (pointer: coarse) {
    .cursor-dot,
    .cursor-outline {
        display: none;
    }
}
