:root {
    --bg-color: #FFFFFF;
    --text-color: #333333;
    --accent-color: #888888;
    --light-gray: #F5F5F5;
    --border-color: #E0E0E0;
    --font-main: 'Inter', sans-serif;
    --spacing-unit: 1rem;
    --container-width: 1200px;
    --header-height: 80px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.7;
}

ul {
    list-style: none;
}

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

/* Header */
.header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.header.scrolled {
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-color);
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.logo.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav {
    position: relative;
    display: flex;
    align-items: center;
}

.mobile-menu-btn {
    display: flex;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    z-index: 1001;
    padding: 10px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-color);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Navigation List (Dropdown style for Desktop) */
.nav-list {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    min-width: 150px;
    text-align: right;
}

/* Hover Interaction */
.nav:hover .nav-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-list a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent-color);
    display: block;
}

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

/* Hero */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* padding-top removed for better vertical centering */
}

.hero-container {
    width: min-content;
    /* Shrink to fit the widest word (UNFRAMES) */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-title {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    white-space: nowrap;
}

#hero-title-clickable {
    cursor: default;
    /* 隠し機能なのでポインターにしない */
    user-select: none;
}

#u-letter {
    display: inline-block;
    transition: color 1.2s ease;
    /* デフォルト：文字が現れる時は1.1秒遅れて現れる（画像が消えた後） */
    transition-delay: 1.1s;
    position: relative;
}

#u-letter.image-mode {
    color: transparent;
    /* image-mode時はすぐに消える (delay 0s) */
    transition-delay: 0s;
}

#u-letter img {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 1.4em;
    width: auto;
    opacity: 0;
    transition: opacity 1.2s ease;
    /* デフォルト：画像が消える時はすぐに消える (delay 0s) */
    transition-delay: 0s;
    pointer-events: none;
}

#u-letter.image-mode img {
    opacity: 1;
    /* image-mode時は1.1秒遅れて現れる（文字が消えた後） */
    transition-delay: 1.1s;
}

.hero-subtitle {
    font-size: clamp(0.7rem, 1vw, 1.2rem);
    /* Increased size for better readability */
    color: var(--accent-color);
    font-weight: 400;
    /* Increased weight slightly for readability at small size */
    letter-spacing: 0.02em;
    width: 100%;
    /* Fill the container width */
    max-width: none;
    /* Remove previous constraint */
    margin: 0 auto;
    line-height: 1.4;
    /* Tighter line height */
    text-align: left;
    /* Align text to the left */
    word-spacing: normal;
    /* Keep normal spacing between words */
}

/* Sections */
.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
    /* Remove padding as we use flex centering */
}

.section .container {
    width: 100%;
    /* Ensure container takes full width for alignment */
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 4rem;
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--text-color);
}

/* About */
.about-list {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.about-item h3 {
    font-size: 0.9rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.about-item p {
    font-size: 1.2rem;
    font-weight: 400;
}

.about-item .highlight {
    font-weight: 600;
}

/* Services */
.services {
    background-color: var(--light-gray);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card {
    background-color: var(--bg-color);
    padding: 3rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.service-number {
    display: block;
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    font-family: monospace;
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.service-card p {
    font-size: 0.95rem;
    color: var(--accent-color);
    line-height: 1.7;
}

/* Footer */
.footer {
    border-top: none;
    background-color: var(--bg-color);
    position: relative;
    /* Removed justify-content: flex-end and padding-bottom to allow centering */
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Left align */
    justify-content: center;
    /* Vertical center */
    width: 100%;
    min-height: 100vh;
    /* Ensure it takes full viewport height */
    position: relative;
    text-align: left;
}

.logo-footer {
    font-weight: 700;
    font-size: 2rem;
    /* Make it larger like a section title */
    display: block;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.footer-lead {
    font-size: clamp(3rem, 7vw, 5rem);
    /* Larger size */
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 2rem;
    line-height: 1.2;
}

.footer-brand a {
    display: block;
    margin-bottom: 3rem;
}

.footer-brand a::before {
    content: "";
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    margin-right: 0.5rem;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/><polyline points="22,6 12,13 2,6"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
}

.footer-brand p {
    font-size: 0.9rem;
    color: var(--accent-color);
}

.footer-brand p:last-child {
    position: absolute;
    bottom: 3rem;
    /* Moved up */
    left: 2rem;
    right: auto;
    width: auto;
    text-align: left;
    margin-top: 0;
    padding-bottom: 0;
}

.footer-links a {
    font-size: 1.2rem;
    /* Make link larger */
    font-weight: 500;
    text-decoration: underline;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-container {
        padding: 0 1.5rem;
    }

    .mobile-menu-btn {
        display: flex;
        z-index: 1001;
    }

    /* Reset .nav positioning for mobile, move sliding logic to .nav-list */
    .nav {
        position: static;
        transform: none;
        width: auto;
        height: auto;
        background: transparent;
        display: block;
    }

    .nav-list {
        position: fixed;
        top: 0;
        right: 0;
        width: 200px;
        /* Narrower width */
        max-width: 80%;
        /* Ensure it fits on small screens */
        height: 100vh;
        background-color: var(--bg-color);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 2rem;
        z-index: 1000;
        opacity: 1;
        visibility: visible;
        text-align: left;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.05);
        padding-left: 2rem;
        /* Add shadow for depth */
    }

    .nav.active .nav-list {
        transform: translateX(0);
    }

    .nav-list a {
        font-size: 1.5rem;
    }

    .hero-title {
        font-size: 15vw;
    }

    .section {
        padding: 0;
        /* Ensure no padding interferes with centering */
    }

    .footer-container {
        align-items: flex-start;
        text-align: left;
    }

    .footer-brand p:last-child {
        left: 1.5rem;
        bottom: 3rem;
        /* Match desktop spacing */
        text-align: left;
    }
}

/* Menu Button Animation */
@keyframes rotateLine {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.mobile-menu-btn.rotating span {
    animation: rotateLine 0.6s ease-in-out;
}

/* Hidden Easter Egg: Walking Characters */
#hero-subtitle-clickable {
    cursor: default;
    user-select: none;
    position: relative;
    z-index: 10;
}

/* Container for the runner */
.walking-character {
    position: fixed;
    left: -150px;
    z-index: 9999;
    height: 40px;
    /* デフォルトサイズ */
    width: auto;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* 足の位置合わせ */
}

.walking-character.small {
    height: 24px;
}

/* キャラクター画像 */
.walking-character img {
    height: 100%;
    /* 親の高さに合わせる */
    width: auto;
    position: relative;
    z-index: 2;
    /* 足より手前 */
}

/* 足 (pseudo-elements) */
.walking-character::before,
.walking-character::after {
    content: '';
    position: absolute;
    bottom: -2px;
    /* 画像の下から少し出す */
    width: 4px;
    height: 15px;
    background-color: var(--leg-color, #333333);
    /* キャラクターごとの色 */
    border-radius: 2px;
    transform-origin: top center;
    z-index: 1;
}

.walking-character::before {
    left: 40%;
    animation: runLegs 0.2s infinite alternate ease-in-out;
}

.walking-character::after {
    right: 40%;
    animation: runLegs 0.2s infinite alternate-reverse ease-in-out;
}

/* 足のアニメーション */
@keyframes runLegs {
    from {
        transform: rotate(-45deg);
    }

    to {
        transform: rotate(45deg);
    }
}

/* 横移動アニメーション */
@keyframes walkAcross {
    0% {
        left: -150px;
        transform: scaleX(1);
        /* 右向き */
    }

    100% {
        left: 100vw;
        transform: scaleX(1);
    }
}

/* 歩いているような上下の揺れ + 前後の動き + 回転 */
@keyframes wildRun {
    0% {
        transform: translateY(0) rotate(0deg) translateX(0);
    }

    25% {
        transform: translateY(-8px) rotate(5deg) translateX(3px);
    }

    50% {
        transform: translateY(0) rotate(0deg) translateX(0);
    }

    75% {
        transform: translateY(-4px) rotate(-5deg) translateX(-3px);
    }

    100% {
        transform: translateY(0) rotate(0deg) translateX(0);
    }
}