/* General Styles */
:root {
    --background-color: #0a0a0a;
    --text-color: #5a5a5a;
    --accent-color: #ffffff;
    --diamond-window-color: rgba(255, 255, 255, 0.5);
    /* Semi-transparent white */
    --parallax-bg-color-start: #1a1a1a;
    --parallax-bg-color-end: #000000;
}

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

html {
    /* スムーズなスクロール挙動を有効に */
    scroll-behavior: smooth ;
}

body {
    font-family: 'Helvetica Neue', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    position: relative;
    /* Added for absolute positioning context */
}

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

a:hover {
    color: var(--accent-color);
}

/* Background Container for Parallax */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    perspective: 1000px;
    /* For 3D transforms */
    transform: scale(1.1);
}

.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: linear-gradient(135deg, var(--parallax-bg-color-start), var(--parallax-bg-color-end)); */
    transform: translateZ(-500px);
    /* Place far back for parallax effect */
    will-change: transform;
    /* Optimize for animation */
}

.diamond-windows {
    position: absolute;
    top: 0;
    left: -16.66vw;
    /* Move left to center the grid */
    top: -16.66vh;
    /* Move up to center the grid */
    width: 133.33vw;
    height: 133.33vh;
    display: grid;
    grid-template-columns: repeat(4, 33.33vw);
    /* Use vw for consistent sizing */
    grid-template-rows: repeat(4, 33.33vw);
    /* Use vw for consistent sizing */
    overflow: hidden;
    pointer-events: none;
    /* Allow interaction with content below */
    z-index: 0;
    /* Ensure visibility */
}

.diamond {
    width: 100%;
    height: 100%;
    background-color: var(--diamond-window-color);
    transform: rotate(45deg) scale(5.0);
    /* Make it a diamond shape and slightly smaller */
    opacity: 0.375;
    /* Clearly visible opacity */
    will-change: transform, opacity;
    transition: transform 0.5s ease, opacity 0.5s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: diamond-rotate 5s linear forwards;
    /* Run animation once */
}

.diamond:hover {
    opacity: 0.5;
    transform: rotate(45deg) scale(0.9);
}


/* Content */
.content-container {
    text-align: center;
    position: relative;
    z-index: 1;
    height: 100dvh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
}

.hero-section {
    animation: fade-in 1s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.button-container {
    opacity: 0;
    animation: fade-in 1s ease-out 3s forwards;
    margin-top: 30px;
    display: flex;
    gap: 20px;
    /* Space between buttons */
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 8px;
    /* Radius */
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    /* Drop shadow */
}

.btn-primary {
    background-color: rgba(255, 255, 255, 0.6);
    /* Semi-transparent gray background */
    color: #5a5a5a;
    /* White text */
    border: 1px solid rgba(68, 68, 68, 0.3);
}

.btn-primary:hover {
    background-color: rgba(102, 102, 102, 0.7);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.hero-logo {
    opacity: 0;
    animation: fade-in 0.5s ease-out 0.5s forwards, float 1s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: auto;
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    transform-style: preserve-3d;
}

#welcome-text {
    font-size: 3rem;
    font-weight: bold;
    color: var(--accent-color);
    white-space: nowrap;
    overflow: hidden;
    border-right: 3px solid var(--accent-color);
    display: inline-block;
    animation: blink-caret 0.75s step-end infinite;
    letter-spacing: 2px;
    padding-left: 5px;
    padding-right: 5px;
    transition: border-right-color 0.5s ease, text-shadow 0.5s ease;
    height: 1.2em;
}

/* Hide the caret when typing is done */
#welcome-text.typing-done {
    border-right-color: transparent;
    animation: none;
    text-shadow: 0 0 10px rgba(36, 36, 36, 0.5), 0 0 20px rgba(255, 255, 255, 0.3);
}

.page-section {
    /* 各セクションが画面いっぱいに広がるようにします */
    height: 100dvh;
    width: 100%;
    /* スクロールスナップの揃える位置をセクションの開始点に設定 */
    scroll-snap-align: start;
    /* コンテンツを中央に配置するためのFlexbox設定 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    position: relative;
    padding-top: calc(2rem + env(safe-area-inset-top));
    padding-right: calc(2rem + env(safe-area-inset-right));
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    padding-left: calc(2rem + env(safe-area-inset-left));
}

.page-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: -1;
}

#home::before {
    background-color: transparent;
}

/* ヒーローセクションのボタンコンテナをコンテンツの一部として扱う */
#home .button-container {
    margin-top: 2rem;
}

/* Aboutセクションのテキストスタイル */
#about {
    text-align: center;
}

#about h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

#about p {
    font-size: 1.2rem;
    line-height: 1.6;
}



@keyframes blink {
    50% {
        opacity: 0;
    }
}


.subtitle {
    font-size: 1.2rem;
    margin-top: 15px;
    opacity: 0.8;
}

/* Animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: var(--accent-color);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes diamond-rotate {
    from {
        transform: rotate(50deg) scale(5.0) rotate(0deg);
    }

    to {
        transform: rotate(50deg) scale(5.0) rotate(10deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    #welcome-text {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .hero-logo {
        width: 80px;
        height: 80px;
    }

    .diamond-window {
        width: 100px;
        height: 100px;
    }
}