html, body {
    margin: 0;
    padding: 0;
    height: 100%;  /* 明示的に高さを設定 */
}

body {
    background-color: transparent;
    color: #333;
    font-family: 'Courier New', Courier, monospace;
    padding: 2rem;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;  /* スクロール防止はbodyだけに */
    display: flex;  /* Flexboxを使用 */
    align-items: center;  /* 垂直方向の中央揃え */
    justify-content: center;  /* 水平方向の中央揃え */
}

/* 背景要素を画面いっぱいに */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #f8f8f8;
    z-index: -1;
}

.container {
    position: relative;  /* 子要素の絶対配置の基準点 */
    text-align: center;
    max-width: 800px;
    width: 100%;
    padding: 0 2rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
}

#profile-image {
    position: absolute;
    width: 100%;
    top: -4rem;  /* コンテナの上部から4rem上に配置 */
    left: 0;
    font-size: 1.2rem;
    color: #666;
}

/* メインコンテンツをフレックスアイテムとして配置 */
.main-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h1 {
    font-size: 2.5rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

/* スマートフォン向けのスタイル調整 */
@media (max-width: 480px) {
    body {
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.8rem;
    }
    
    .container {
        padding: 0 1.5rem;
        width: calc(100% - 2rem);
        max-width: calc(100% - 2rem);
    }
    
    #profile-image {
        top: -3rem;  /* スマホでは少し近づける */
    }
}

/* さらに小さい画面向け */
@media (max-width: 320px) {
    h1 {
        font-size: 1.5rem;  /* より小さい画面ではさらに小さく */
    }
}

.section {
    margin-top: 2rem;
}

.typing-text {
    margin: 1rem 0;
    min-height: 1.2em;
    position: relative;
    visibility: hidden;
}

.typing-active {
    visibility: visible;
}

/* Only show cursor for active element */
.active-cursor::after {
    content: '▋';
    position: absolute;
    margin-left: 2px;
    color: #333;
    z-index: 2;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

#noise-canvas {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.15;
    z-index: 1;  /* -2から1に変更 */
}
