body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background-color: #ffffff;
    color: #1e293b;
    overflow-x: hidden;
    margin: 0;
}

/* Three.js Canvas Container */
#webgl-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Behind all content */
    pointer-events: none;
    opacity: 1; /* Full opacity for better visibility */
}

/* Custom Cursor Logic */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transform: translate3d(0, 0, 0);
    transition: transform 0.1s ease-out;
}
.cursor-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #1e293b;
    border-radius: 50%;
    transition: all 0.2s ease-out;
    width: 8px;
    height: 8px;
    opacity: 1;
}
body.hovering .cursor-dot {
    width: 64px;
    height: 64px;
    opacity: 0.3;
}
body:not(.hovering) .cursor-dot {
    width: 8px;
    height: 8px;
    opacity: 1;
}

/* 3D Reveal Animation 
   要素が奥(-200px)から手前(0px)へ、少し回転しながら現れる演出
*/
.reveal {
    opacity: 0;
    /* 3D Transform Defaults */
    transform: perspective(1000px) translate3d(0, 50px, -200px) rotateX(20deg);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

/* アニメーション完了後の状態：元のレイアウトに完全に戻る */
.reveal.active {
    opacity: 1;
    transform: perspective(1000px) translate3d(0, 0, 0) rotateX(0deg);
}

/* タイトルなどの大きなテキスト用の遅延演出 */
.stagger-char {
    display: inline-block;
    opacity: 0;
    transform: perspective(1000px) translate3d(0, 20px, -50px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.stagger-char.active {
    opacity: 1;
    transform: perspective(1000px) translate3d(0, 0, 0);
}

/* Hide scrollbar for clean look */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f8fafc;
}
::-webkit-scrollbar-thumb {
    background: #22d3ee;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #06b6d4;
}

/* Background Grid Pattern (Overlay on top of Three.js for texture) */
.bg-grid-pattern {
    background-image: linear-gradient(to right, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Ensure content sits above canvas */
section, header, footer {
    position: relative;
    z-index: 10;
}

/* --- Subpage Specific Styles --- */
.page-header-line {
    width: 0;
    height: 1px;
    background-color: #22d3ee;
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.page-header-line.active {
    width: 100px;
}

/* Table Styles */
.dark-table th {
    background-color: rgba(34, 211, 238, 0.08);
    color: #0891b2;
}
.dark-table tr {
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.dark-table td {
    color: #475569;
}

/* Rotating Word Animation - Digital Decode Effect */
#rotating-word {
    display: inline;
    white-space: nowrap;
}

/* モバイル時のキャッチコピー改行制御 */
@media (max-width: 767px) {
    h1 .whitespace-nowrap {
        white-space: normal;
    }
    #rotating-word {
        display: block;
    }
    .hero-crafted {
        display: block;
    }
}

#rotating-word .word-inner {
    display: inline-block;
    font-family: inherit;
}

#rotating-word .decode-char {
    display: inline-block;
    transition: color 0.15s ease, text-shadow 0.15s ease;
    color: inherit;
}

#rotating-word .decode-char:not(.decoded) {
    color: #06b6d4;
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
}

#rotating-word .decode-char.decoded {
    color: inherit;
    text-shadow: none;
}
