:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --accent-color: #007aff;
    /* Apple-like Blue */
    --gray-light: #f5f5f7;
    --gray-medium: #86868b;
    --font-main: 'Noto Sans JP', sans-serif;
    --font-jp: 'Noto Sans JP', sans-serif;
    --font-impact: 'Noto Sans JP', sans-serif;
    --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    /* Removed mix-blend-mode to allow correct color display */
    color: var(--text-color);
    transition: background 0.3s;
}

/* .site-header.menu-open removed */

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-main);
    font-weight: 400;
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.logo-image {
    height: 56px;
    width: auto;
    object-fit: contain;
    /* Removed filter invert to keep original color */
}

.site-header nav ul {
    display: flex;
    gap: 30px;
}

.site-header nav a {
    font-family: var(--font-main);
    font-size: 0.9rem;
    position: relative;
}

.site-header nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: #2342b1;
    transition: width 0.3s var(--transition-smooth);
}

.site-header nav a:hover::after {
    width: 100%;
}

/* Hamburger Menu & Responsive Nav */
.hamburger-menu {
    display: none;
    /* Default hidden on desktop */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 200;
    padding: 0;
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    /* Dark for light bg */
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Mobile Nav Overlay defaults */
@media (max-width: 900px) {

    /* Show hamburger */
    .hamburger-menu {
        display: flex;
    }

    /* Hide default nav list or style as overlay */
    .site-header nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.8);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s ease;
        z-index: 150;
    }

    .site-header nav.nav-active {
        opacity: 1;
        visibility: visible;
    }

    .site-header nav ul {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }

    .site-header nav a {
        font-size: 1.5rem;
        color: #fff;
    }

    /* Hamburger Animation when active */
    .hamburger-menu.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger-menu.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* Ensure hamburger is white when menu is active (dark overlay) */
    .hamburger-menu.active span {
        background-color: #fff;
    }
}

@media (max-width: 600px) {
    .site-header {
        padding: 15px 5vw;
    }

    .logo {
        font-size: 1.1rem;
        gap: 6px;
        letter-spacing: 0;
    }

    .logo-image {
        height: 32px;
    }
}

/* Hero Section */
.hero-wrapper {
    overflow: hidden;
    /* Ensure background blobs don't cause scroll */
}

.hero-section {
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 0 20px;
    z-index: 1;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Background Aurora Animation REMOVED */



.hero-content {
    text-align: center;
    z-index: 10;
    /* Correctly above z-index 0 */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0; /* マージンを均一に制御するためgapを0に */
}

.hero-main-title {
    font-family: var(--font-main);
    color: #222;
    line-height: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;
    margin: 0 auto;
}

.block-text {
    display: block;
    opacity: 0;
    animation: fadeUp 1s ease forwards;
}

/* Main copy */
.hero-main-copy {
    font-family: var(--font-jp);
    font-size: clamp(1.6rem, 7.8vw, 5.4rem); /* スマホサイズでも余計な改行を防ぐサイズに最小値を調整 */
    font-weight: 900;
    letter-spacing: 0.05em;
    color: #111;
    line-height: 1.45;
    text-align: center;
    margin-bottom: 16px; /* メインコピーとタグラインの距離を一貫させる */
    animation-delay: 0.2s;
    width: 100%;
}

.hero-tagline {
    font-family: var(--font-main);
    font-size: clamp(1.3rem, 3vw, 2.3rem); /* サイズを大きくし、PCからスマホまで完璧にスケールするclampに変更 */
    font-weight: 600; /* 文字の太さをセミボールドにして、視認性と高級感を向上 */
    letter-spacing: 0.18em; /* 文字間を広げ、ゆったりとしたモダンなブランド感を演出 */
    color: #2342b1; /* ブランドカラーの青色を適用 */
    margin-top: 0; /* タイトル側のmargin-bottomのみで距離を制御 */
    opacity: 0;
    animation: fadeUp 1s ease forwards 0.6s;
}

.hero-cta-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px; /* タグラインからの距離を一貫した幅に調整 */
    opacity: 0;
    animation: fadeUp 1s ease forwards 0.8s;
    width: 100%;
}

.hero-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 36px;
    border-radius: 50px;
    min-width: 220px;
    font-family: var(--font-main);
    transition: all 0.4s var(--transition-smooth);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.hero-btn-primary {
    background: #2342b1;
    color: #ffffff;
    border: 1px solid #2342b1;
}

.hero-btn-primary:hover {
    background: #19318a;
    border-color: #19318a;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(35, 66, 177, 0.3);
}

.hero-btn-secondary {
    background: transparent;
    color: #2342b1;
    border: 1px solid #2342b1;
}

.hero-btn-secondary:hover {
    background: rgba(35, 66, 177, 0.05);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(35, 66, 177, 0.1);
}

/* ボタン内のテキストスタイル */
.hero-btn .btn-en {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.2;
}

.hero-btn .btn-jp {
    font-family: var(--font-jp);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    opacity: 0.8;
    margin-top: 2px;
    line-height: 1.2;
}

/* モバイル対応の調整 */
@media (max-width: 600px) {
    .hero-cta-group {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin-top: 20px;
    }
    
    .hero-btn {
        width: 100%;
        max-width: 260px;
        padding: 12px 30px;
        min-width: unset;
    }

    .scroll-indicator {
        bottom: 20px !important;
    }

    .scroll-indicator .line {
        height: 30px; /* モバイルでは線を短くしてボタンとの重なりを防ぐ */
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 40px; /* ボタンとの距離をあけるため20pxから40pxに引き上げ */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0;
    animation: fadeIn 1s ease 1.5s forwards;
}

.scroll-indicator span {
    font-family: var(--font-main);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.scroll-indicator .line {
    width: 1px;
    height: 60px;
    background: rgba(35, 66, 177, 0.3);
    position: relative;
    overflow: hidden;
}

.scroll-indicator .line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #2342b1;
    animation: scrollLine 2s infinite;
}

/* Philosophy Section - Dynamic Flex Accordion */
.philosophy-section {
    position: relative;
    padding: 10vh 5vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    background: #000;
    /* Fallback */
}

/* Background Wrapper */
.philosophy-bg-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.ph-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.ph-bg.active {
    opacity: 1;
}

/* Background Images */
.ph-bg-conversion {
    background-image: url('img/ph_conversion.png');
}

.ph-bg-consistency {
    background-image: url('img/ph_consistency.png');
}

.ph-bg-trust {
    background-image: url('img/ph_trust.png');
}

/* Overlay for legibility if needed */
.philosophy-bg-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

/* Content Layer */
.philosophy-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.about-title {
    font-family: var(--font-main);
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 4rem;
    font-weight: 700;
    /* Reverted */
    letter-spacing: 0.02em;
    /* Tightened */
    text-align: left;
    /* Changed from center to left */
    color: #111;
}

.section-title {
    color: #111;
    /* Default black for Contact etc */
    margin-bottom: 3rem;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    /* Reverted */
    letter-spacing: 0.02em;
    /* Tightened */
    font-family: var(--font-main);
    text-align: center;
    /* Ensure centered */
}

/* Philosophy Section White Title Override */
.philosophy-section .section-title {
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Flex Accordion Container */
.philosophy-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    /* Center the group */
    align-items: center;
    height: 500px;
    /* Allocated enough height for the expanded card */
    gap: 30px;
    /* Reduced from 60px */
    width: 100%;
    margin-top: 2rem;
}

/* Card Styles */
.philosophy-card {
    flex: 0 0 300px;
    /* Smaller base size */
    width: 300px;
    height: 300px;
    /* Enforce square */

    position: relative;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    /* Transition width/height/flex for physical push effect */
    transition: flex-basis 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        width 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        height 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.4s ease,
        box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center content vertically */
    padding: 30px;
}

.philosophy-card:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 5;
}

.philosophy-card.active {
    flex: 0 0 400px;
    /* Reduced from 450px */
    width: 400px;
    height: 400px;
    /* Keep square */
    background: #ffffff;
    cursor: default;
    border-color: #fff;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
    z-index: 10;
    /* No transform scale, actual resize */
}

.card-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center vertically */
    align-items: center;
    /* Center horizontally */
    height: 100%;
    width: 100%;
}

.ph-num {
    font-family: var(--font-main);
    font-size: 3.5rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.05em;
    line-height: 1;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.philosophy-card.active .ph-num {
    color: #2342b1;
    font-size: 2.6rem; /* 大きく調整 */
    margin-bottom: 25px; /* マージンを十分に確保して窮屈さを解消 */
}

.ph-label {
    font-family: var(--font-jp);
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.1em;
    margin-top: 12px; /* 15pxから12pxに調整し、PC非選択時の間隔を引き締める */
    transition: all 0.4s ease;
    white-space: nowrap; /* 一貫した1行表示を保証 */
}

.philosophy-card.active .ph-label {
    opacity: 0;
    height: 0;
    margin: 0;
    overflow: hidden;
    pointer-events: none;
}

.card-details {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    /* Center details */
    text-align: center;
    /* Center text */
    width: 100%;
}

.philosophy-card.active .card-details {
    opacity: 1;
    max-height: 300px;
    overflow: visible;
    transform: translateY(0);
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s, max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.ph-jp {
    font-family: var(--font-jp);
    color: #111;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.5;
}

.ph-desc {
    font-family: var(--font-jp);
    color: #555;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
    max-width: 320px;
    text-align: left;
}

/* Mobile/Tablet Responsive - Switch to stacked view earlier to avoid overflow */
@media (max-width: 1200px) {
    .philosophy-section {
        padding: 80px 20px;
        min-height: auto;
    }

    .philosophy-container {
        flex-direction: column;
        height: auto;
        gap: 24px;
        align-items: center;
        margin-top: 1rem;
    }

    .philosophy-card {
        width: 100%;
        max-width: 600px;
        /* Limit width on tablets for better aesthetics */
        height: auto;
        min-height: auto;
        flex: none;

        /* Semi-transparent Initial State */
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);

        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        padding: 20px 24px;

        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: flex-start;
        text-align: left;

        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .philosophy-card:active {
        transform: scale(0.98);
    }

    /* Active State (Touched) - Becomes White & Opaque */
    .philosophy-card.active {
        width: 100%;
        height: auto;
        flex: none;
        transform: none;
        /* Disable shift */
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
        background: #ffffff;
        border-color: transparent;
    }

    .card-inner {
        width: 100%;
        display: flex;
        flex-wrap: nowrap; /* 非選択時は絶対に折り返さず、1行での完璧な横並び・垂直中央揃えをキープ */
        flex-direction: row;
        align-items: center; /* 非アクティブ時は縦方向の中央にピタッと配置 */
        justify-content: flex-start;
        transition: all 0.5s cubic-bezier(0.25, 1, 0.3, 1);
    }

    .philosophy-card.active .card-inner {
        flex-wrap: wrap; /* アクティブ時のみ、詳細を下に回り込ませるために折り返しを許可 */
    }

    .ph-num {
        display: block; /* inline-blockからblockに変更し、フレックス配置を最適化 */
        font-size: 1.8rem;
        font-weight: 800;
        color: rgba(255, 255, 255, 0.6);
        line-height: 1;
        margin: 0;
        transition: all 0.5s cubic-bezier(0.25, 1, 0.3, 1);
    }

    .philosophy-card.active .ph-num {
        color: #2342b1;
        margin-bottom: 16px; /* アクティブ時に下の詳細との適度な距離感を確保 */
    }

    .ph-label {
        display: block; /* 同様にblockに変更 */
        font-size: 1.05rem;
        font-weight: 700;
        color: #ffffff;
        margin: 0 0 0 15px; /* マージンを左だけにし、余計な上下の干渉をなくす */
        line-height: 1; /* 垂直方向の中央揃えを完璧にするために1にする */
        opacity: 1;
        max-width: 300px;
        white-space: nowrap;
        transform: translateY(-1px); /* 完璧な中間値である-1pxに微調整し、高さをジャストフィットさせる */
        transition: all 0.5s cubic-bezier(0.25, 1, 0.3, 1);
    }

    .philosophy-card.active .ph-label {
        opacity: 0;
        max-width: 0;
        margin-left: 0;
        margin-bottom: 16px; /* 余白を均等にするために数字とマージンを合わせる */
        overflow: hidden;
        transform: translateY(-1px) scale(0.9);
    }

    /* Details (Japanese) - Hidden by default */
    .card-details {
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        transform: translateY(10px);
        width: 100%; /* これによりflexアイテムとして100%幅になり、自動的に下の行に回り込む */
        text-align: left;
        display: block;
        transition: opacity 0.5s cubic-bezier(0.25, 1, 0.3, 1),
                    max-height 0.6s cubic-bezier(0.25, 1, 0.3, 1),
                    transform 0.5s cubic-bezier(0.25, 1, 0.3, 1);
    }

    /* Active Details - Visible */
    .philosophy-card.active .card-details {
        opacity: 1;
        max-height: 350px; /* 実際のテキストサイズに合わせ遅延を解消 */
        transform: translateY(0);
    }

    .ph-jp {
        color: #111;
        font-size: 1.15rem;
        font-weight: 800;
        line-height: 1.4;
        white-space: normal;
        margin: 0 0 12px 0; /* 本文との距離感を美しく整える */
    }

    .ph-jp br {
        display: block;
    }

    .ph-desc {
        color: #555;
        font-size: 0.88rem;
        line-height: 1.6;
        margin: 0;
        white-space: normal;
        max-width: 100%;
        text-align: left;
    }
}

/* Works Section (Horizontal Scroll Logic) */
.works-section {
    position: relative;
    padding: 10vh 0;
    background: #f9f9fb;
}

.works-sticky-container {
    position: relative;
    /* Changed from sticky to relative for native scroll */
    top: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.works-title {
    font-family: var(--font-main);
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-left: 5vw;
    margin-bottom: 2rem;
    color: var(--text-color);
    font-weight: 700;
    /* Reverted */
    letter-spacing: 0.02em;
    /* Tightened from 0.05em */
}

.works-scroll-indicator {
    position: absolute;
    right: 5vw;
    top: 2rem;
    display: flex;
    align-items: center;
    gap: 20px;
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #2342b1;
    animation: scrollHintBounce 2.5s ease-in-out infinite;
}

@keyframes scrollHintBounce {

    0%,
    100% {
        transform: translateX(0);
    }

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

.works-scroll-indicator .line {
    width: 80px;
    height: 2px;
    background: rgba(35, 66, 177, 0.2);
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.works-scroll-indicator .line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #2342b1;
    animation: scrollLineHoriz 2s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}

@keyframes scrollLineHoriz {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Mobile Scroll Indicator Adjustment */
@media (max-width: 768px) {
    .works-scroll-indicator {
        position: relative;
        top: auto;
        right: auto;
        justify-content: flex-end;
        margin-right: 0;
        margin-bottom: 20px;
        margin-top: 5px;
        /* Adjust spacing related to title margin */
        pointer-events: none;
        /* Ensure it doesn't block interactions */
    }
}

/* Works Section Redesign */
.client-works-container {
    padding: 20px 0 60px;
}

.project-samples-container {
    padding-bottom: 40px;
}

.subsection-title {
    font-family: var(--font-main);
    font-size: 1.1rem;
    /* Enlarged from 0.9rem */
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #666;
    /* Slightly darker */
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 20px;

    /* Animation Base States */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.subsection-title.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.subsection-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg,
            rgba(0, 0, 0, 0.05) 0%,
            rgba(35, 66, 177, 0.8) 50%,
            rgba(0, 0, 0, 0.05) 100%);
    background-size: 200% 100%;
    background-position: -100% 0;
    /* Highlight starts off to the left */
    max-width: 0;
    transition: max-width 1.2s cubic-bezier(0.25, 1, 0.5, 1) 0.4s;
}

.subsection-title.is-visible::after {
    max-width: 100%;
    animation: kirattoSweep 1.8s ease-out 0.4s forwards;
}

@keyframes kirattoSweep {
    0% {
        background-position: -100% 0;
        filter: drop-shadow(0 0 2px rgba(35, 66, 177, 0));
    }

    40% {
        filter: drop-shadow(0 0 12px rgba(35, 66, 177, 1));
    }

    100% {
        background-position: 200% 0;
        /* Highlight sweeps past the right edge */
        filter: drop-shadow(0 0 0 rgba(35, 66, 177, 0));
    }
}



.client-works-carousel .featured-work-card {
    /* 横スクロールがあることを直感的に伝えるため、次に続くカードが常に見切れる幅に調整 */
    flex: 0 0 calc(85vw - 60px);
    max-width: 1050px;
    /* Expanded to contain the more spacious padding */
    scroll-snap-align: center;
}

.featured-work-card {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 70px;
    /* Increased gap to add more breathing room between image and text */
    align-items: center;
    background: #fff;
    padding: 80px 100px;
    /* Significantly increased padding for a wider, more spacious background */
    border-radius: 40px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.04);
}

.featured-work-visual {
    width: 430px;
    padding: 0 20px;
    box-sizing: border-box;
    /* Or content-box depending on original layout, usually border-box is safer if width is total */
    margin: 0 auto;
    display: flex;
    justify-content: center;
    position: relative;
    /* Anchor physical side buttons */
}


.featured-work-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.work-tag {
    font-family: var(--font-main);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #2342b1;
    background: rgba(35, 66, 177, 0.08);
    padding: 6px 14px;
    border-radius: 20px;
    width: fit-content;
}

.featured-work-info h3 {
    font-family: var(--font-jp);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    line-height: 1.3;
    color: #111;
}

.work-brief {
    font-family: var(--font-jp);
    font-size: 1.05rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 5px;
    text-align: left;
}

.work-client-info {
    font-family: var(--font-jp);
    font-size: 1rem;
    color: #2342b1;
    font-weight: 600;
    margin-bottom: 15px;
    display: inline-flex;
    flex-direction: column;
    text-align: left;
    gap: 4px;
}

.work-testimonial {
    background: #fcfcfc;
    border-left: 3px solid #eee;
    padding: 20px;
    margin: 10px 0 20px;
    position: relative;
}

.work-testimonial p {
    font-family: var(--font-jp);
    font-size: 0.95rem;
    line-height: 1.7;
    color: #555;
    font-style: italic;
    text-align: left;
}

.work-testimonial::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 3rem;
    color: rgba(0, 0, 0, 0.05);
    font-family: serif;
}

/* Coming Soon Card Styles */
.coming-soon-card {
    background: #fdfdfd;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.02);
}

.coming-soon-card:hover {
    transform: none;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.02);
}

.placeholder-frame {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.02);
}

.placeholder-frame:hover {
    transform: none;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.02);
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: #9aa5b1;
}

.placeholder-icon {
    font-size: 2.5rem;
    opacity: 0.6;
}

.placeholder-text {
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.coming-soon-tag {
    background: rgba(0, 0, 0, 0.04);
    color: #666;
}

.work-meta-mini {
    display: flex;
    gap: 20px;
    font-family: var(--font-main);
    font-size: 0.85rem;
    color: #999;
    font-weight: 500;
}

.samples-header {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 0 5vw;
    margin-bottom: 1.5rem;
}

.samples-header .subsection-title {
    width: 100%;
    margin-bottom: 1rem;
}

.samples-header .works-scroll-indicator {
    position: relative;
    top: auto;
    right: auto;
}

@media (max-width: 1024px) {
    .featured-work-card {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 40px;
        margin-left: 0;
        /* Reset desktop layout alignment hack for proper mobile flow */
    }

    .featured-work-visual {
        order: -1;
        margin: 0 auto;
        /* Width is naturally inherited from base 430px */
    }
}

@media (max-width: 600px) {
    .client-works-container {
        padding: 20px 0 0;
        /* カードを画面端まで広げるためコンテナの左右余白を削除。下の余白も詰め寄り */
    }

    .featured-work-card {
        padding: 40px 20px 20px;
        /* Adjust bottom padding to pull things tighter */
        border-radius: 0;
        /* 画面フル幅のため角丸をやめる */
        gap: 30px;
        display: flex;
        flex-direction: column;
        align-items: center;
        /* 中身を確実に中央寄せ */
        text-align: center;
        margin-bottom: 0;
    }

    .featured-work-info {
        align-items: center;
        /* 文字やボタンも中央寄せに */
    }

    .featured-work-visual {
        margin: 0 auto;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .featured-work-info h3 {
        font-size: 1.5rem;
    }

    .work-brief {
        font-size: 0.95rem;
        text-align: left;
    }
}

.works-horizontal-wrapper {
    display: flex;
    gap: 40px;
    padding: 20px 5vw 40px calc(5vw + 60px);
    /* Align with padded featured work card */
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    width: 100%;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.works-horizontal-wrapper::-webkit-scrollbar {
    display: none;
}

/* Mobile overrides for works horizontal wrapper alignment */
@media (max-width: 1024px) {
    .works-horizontal-wrapper {
        padding-left: calc(5vw + 40px);
        gap: 30px;
    }
}

@media (max-width: 600px) {
    .works-horizontal-wrapper {
        padding-left: 5vw;
        /* 白カードがフル幅になったためpadding合わせ */
        padding-right: 5vw;
        gap: 20px;
    }

    .client-works-carousel .featured-work-card {
        /* 横スクロール内での白カードの幅（画面幅いっぱい） */
        flex: 0 0 100vw;
        width: 100vw;
        max-width: 100vw;
    }
}

/* iPhone Styling - Realistic */
/* iPhone Styling - Realistic Titanium */
/* iPhone Styling - Realistic Titanium */
.work-item {
    width: 430px;
    /* Increased for standard 375px viewport support */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    scroll-snap-align: center;
    padding: 20px 20px;
    /* Added horizontal space for buttons */
}

/* Side Buttons (Volume/Power) */
/* Apply to both the regular carousel items AND the featured visual container */
.work-item::before,
.featured-work-visual::before {
    /* Volume Buttons (Left) */
    content: '';
    position: absolute;
    top: 140px;
    left: 14px;
    /* Positioned to touch the frame */
    width: 4px;
    height: 65px;
    background: #2a2a2a;
    border-radius: 4px 0 0 4px;
    box-shadow: inset -1px 0 1px rgba(255, 255, 255, 0.2);
    z-index: 1;
}

.work-item::after,
.featured-work-visual::after {
    /* Power Button (Right) */
    content: '';
    position: absolute;
    top: 170px;
    right: 14px;
    /* Positioned to touch the frame */
    width: 4px;
    height: 45px;
    background: #2a2a2a;
    border-radius: 0 4px 4px 0;
    box-shadow: inset 1px 0 1px rgba(255, 255, 255, 0.2);
    z-index: 1;
}

.work-frame-container {
    width: 100%;
    aspect-ratio: 9/19.5;
    /* iPhone Aspect Ratio */
    background: #000;
    border-radius: 54px;
    position: relative;
    z-index: 10;
    overflow: hidden;

    /* Realistic Frame Composition */
    box-shadow:
        /* 1. Screen Bezel (Inner Black) */
        inset 0 0 0 2px #000,
        /* 2. Antenna Details / Inner Frame Edge */
        inset 0 0 0 3px #555,
        /* 3. Main Frame Body (Titanium Grey) */
        0 0 0 4px #4a4a4a,
        /* 4. Outer Frame curvature/highlight */
        0 0 0 5px #2a2a2a,
        /* 5. Deep Shadow */
        0 25px 50px -12px rgba(0, 0, 0, 0.6);

    transition: transform 0.4s var(--transition-smooth);
    /* Home Indicator (simulated with gradient on container) */
    background-image: radial-gradient(circle at bottom center, rgba(255, 255, 255, 0.4) 0, transparent 60%);
    background-size: 100% 10px;
    background-repeat: no-repeat;
    background-position: bottom center;

    /* Bezel Thickness - Narrower */
    padding: 8px;
    box-sizing: border-box;
}

.work-frame-container:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow:
        inset 0 0 0 2px #000,
        inset 0 0 0 3px #666,
        0 0 0 4px #5a5a5a,
        0 0 0 5px #333,
        0 40px 80px -20px rgba(0, 0, 0, 0.7);
}

/* Dynamic Island */
.work-frame-container::before,
.featured-frame::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 96px;
    height: 28px;
    background: #000;
    border-radius: 20px;
    z-index: 20;
}



/* Screen reflection gloss/shine */
.work-frame-container::after,
.featured-frame::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 54px;
    pointer-events: none;
    background: linear-gradient(125deg,
            rgba(255, 255, 255, 0.25) 0%,
            rgba(255, 255, 255, 0.05) 25%,
            transparent 45%,
            transparent 100%);
    z-index: 20;
    mix-blend-mode: overlay;
}

.work-frame-container .home-indicator {
    position: absolute;
    bottom: 12px;
    /* Consistent bottom spacing */
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 100px;
    z-index: 25;
    pointer-events: none;
}

.work-frame-container .home-indicator::before {
    content: 'SCROLL';
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-family: var(--font-main);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    white-space: nowrap;
    text-shadow: none;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    padding: 4px 10px;
    border-radius: 12px;
    opacity: 1;
    animation: scrollHintFloat 2s ease-in-out infinite;
    z-index: 30;
}

@keyframes scrollHintFloat {

    0%,
    100% {
        transform: translate(-50%, 0);
        opacity: 0.5;
    }

    50% {
        transform: translate(-50%, -5px);
        opacity: 1;
    }
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #fff;
    /* Device Radius (54) - Padding (8) = 46px */
    border-radius: 46px;

    /* Ensure content starts below notch */
    padding-top: 50px;
    box-sizing: border-box;
    /* Clip content to rounds */
    clip-path: inset(0 round 46px);
}

/* Scoped Scrollbar hiding */
.work-frame-container iframe::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* Prevent scroll hijacking by iframe ONLY on mobile/touch sizes */
@media (max-width: 900px) {

    /* Scale down the mockup container to fit mobile screens better */
    .work-item {
        width: 360px;
        /* Adjusted footprint to perfectly align side-buttons and maintain gaps */
        margin-right: 0px;
    }

    .work-frame-container {
        /* Maintain original layout width to preserve text rendering */
        width: 430px;

        /* Scale down visually */
        transform: scale(0.744);
        /* 320 / 430 */
        transform-origin: top left;

        /* Pull up content below because scale doesn't affect flow */
        margin-bottom: -230px;
    }

    /* Ensure ALL iframes are interactive (scrolling enabled) */
    .work-frame-container iframe {
        pointer-events: auto;
    }

    /* Override hover effect on mobile: Prevent scaling up, just lift slightly */
    .work-frame-container:hover {
        transform: scale(0.744) translateY(-15px);
        /* Keep the same scale as non-hover, just add lift */
    }

    /* FEATURED MOCKUP MOBILE ADJUSTMENT */
    .featured-work-visual {
        width: 360px;
        padding: 20px 20px;
        box-sizing: border-box;
        margin: 0 auto;
        height: 733px; /* 693px (scaled height) + 40px (padding) */
        position: relative;
    }

    .featured-frame {
        width: 430px !important;
        max-width: none !important;
        height: auto !important;
        /* Let height adapt mathematically to the aspect ratio */
        aspect-ratio: 9/19.5 !important;
        /* Maintain original layout width to preserve text rendering, scale visually */
        transform: scale(0.744) !important;
        transform-origin: top left !important;
        margin: 0 !important;
        position: absolute !important;
        top: 20px;
        left: 20px;
    }

    .featured-frame:hover {
        transform: scale(0.744) translateY(-10px) !important;
        box-shadow:
            inset 0 0 0 2px #000,
            inset 0 0 0 3px #666,
            0 0 0 4px #5a5a5a,
            0 0 0 5px #333,
            0 20px 40px -10px rgba(0, 0, 0, 0.7) !important;
    }
}

.work-info {
    text-align: center;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.work-item:hover .work-info {
    opacity: 1;
}

.work-info h3 {
    font-family: var(--font-main);
    font-size: 1.2rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.visit-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #2342b1;
    font-weight: 500;
    padding: 8px 24px;
    border-radius: 50px;
    background: transparent;
    border: 1px solid #2342b1;
    transition: all 0.3s var(--transition-smooth);
}

.visit-link:hover {
    gap: 12px;
    background: #2342b1;
    color: #fff;
    transform: translateY(-2px);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(35, 66, 177, 0.3);
}
/* Workflow Section */
.workflow-section {
    padding: 10vh 5vw;
    background: #f9f9fb;
}

.workflow-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-top: 60px;
}

.workflow-step {
    position: relative;
    background: #ffffff;
    border: 1px solid rgba(35, 66, 177, 0.1);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: visible; /* 矢印が表示されるように */
    z-index: 1;
}



.workflow-step:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(35, 66, 177, 0.08);    
}

.step-bg-number {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 6rem;
    font-weight: 800;
    color: rgba(35, 66, 177, 0.04);
    line-height: 1;
    z-index: -1;
    font-family: var(--font-main);
    user-select: none;
    pointer-events: none;
}

.step-content {
    position: relative;
    z-index: 2;
}

.step-title-en {
    font-family: var(--font-main);
    font-size: 1.4rem;
    font-weight: 900;
    color: #2342b1;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.step-title-jp {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.step-desc {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
}

@media (min-width: 769px) {
    .workflow-step:not(:nth-child(3n))::after {
        content: '';
        position: absolute;
        right: -25px;
        top: 50%;
        transform: translateY(-50%) rotate(45deg);
        width: 12px;
        height: 12px;
        border-top: 3px solid #2342b1;
        border-right: 3px solid #2342b1;
    }
}

@media (max-width: 768px) {
    .workflow-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .workflow-step:not(:last-child)::after {
        content: '';
        position: absolute;
        bottom: -22px;
        left: 50%;
        transform: translateX(-50%) rotate(135deg);
        width: 12px;
        height: 12px;
        border-top: 3px solid #2342b1;
        border-right: 3px solid #2342b1;
    }
}

/* Pricing Section */
.pricing-section {
    position: relative;
    padding: 10vh 5vw;
    background: #ffffff;
    overflow: hidden;
    z-index: 10;
}

.pricing-bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(35, 66, 177, 0.08) 0%, rgba(0, 122, 255, 0.03) 40%, rgba(255,255,255,0) 70%);
    z-index: 0;
    pointer-events: none;
    animation: slowPulse 8s infinite alternate ease-in-out;
}

@keyframes slowPulse {
    0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

.pricing-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
}

.pricing-header {
    text-align: center;
    margin-bottom: 4rem;
}

.pricing-subtitle {
    font-family: var(--font-main);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #2342b1;
    line-height: 1.4;
    letter-spacing: 0.02em;
}

.pricing-subtitle .jp-subtitle {
    font-family: var(--font-jp);
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 400;
    color: #555;
    display: block;
    margin-top: 10px;
    letter-spacing: 0.05em;
}

.pricing-cards-wrapper {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: stretch;
}

.pricing-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(35, 66, 177, 0.1);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(35, 66, 177, 0.08);
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    flex: 1;
    min-width: 320px;
    max-width: 500px;
    position: relative;
}

.premium-card {
    border: 2px solid #2342b1;
    box-shadow: 0 30px 60px rgba(35, 66, 177, 0.15);
}

@media (min-width: 769px) {
    .premium-card {
        transform: scale(1.03);
        z-index: 2;
    }
    .pricing-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 30px 60px rgba(35, 66, 177, 0.12);
    }
    .premium-card:hover {
        transform: scale(1.03) translateY(-5px);
        box-shadow: 0 40px 70px rgba(35, 66, 177, 0.2);
    }
}

.recommended-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #2342b1;
    color: #fff;
    padding: 6px 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    border-radius: 0 0 12px 12px;
    z-index: 10;
}

.plan-name {
    font-family: var(--font-jp);
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
}

.pricing-badge {
    display: inline-block;
    align-self: center;
    background: linear-gradient(135deg, #2342b1 0%, #4a7aff 100%);
    color: #fff;
    font-family: var(--font-jp);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 8px 24px;
    border-radius: 100px;
    margin-bottom: 20px;
    letter-spacing: 0.08em;
    box-shadow: 0 4px 15px rgba(35, 66, 177, 0.3);
    animation: badgeGlow 3s infinite ease-in-out;
}

@keyframes badgeGlow {
    0%, 100% { box-shadow: 0 4px 15px rgba(35, 66, 177, 0.3); }
    50% { box-shadow: 0 4px 25px rgba(35, 66, 177, 0.5); }
}

.pricing-card-inner {
    padding: 60px 40px;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.pricing-amount {
    display: flex;
    justify-content: center;
    align-items: baseline;
    color: #111;
    margin-bottom: 20px;
}

.pricing-amount .currency {
    font-size: 2.5rem;
    font-weight: 600;
    margin-right: 4px;
}

.pricing-amount .price-number {
    font-size: clamp(3.5rem, 6vw, 5rem);
    font-weight: 800;
    font-family: 'Oswald', sans-serif;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #111 0%, #2342b1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.pricing-amount .tax-text {
    font-size: 0.9rem;
    color: #888;
    margin-left: 8px;
    font-family: var(--font-jp);
}

.pricing-desc {
    font-size: 1.05rem;
    color: #444;
    line-height: 1.8;
    margin-bottom: 30px;
    flex-grow: 1;
}

.pricing-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
    background: rgba(249, 249, 251, 0.7);
    padding: 30px;
    border-radius: 16px;
    margin: 0 auto;
    max-width: 500px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.feature-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    background-color: rgba(35, 66, 177, 0.1);
    color: #2342b1;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px;
}

.feature-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.feature-text {
    font-size: 1.05rem;
    color: #333;
}

.feature-text strong {
    color: #2342b1;
    font-weight: 700;
}

@media (max-width: 768px) {
    .pricing-bg-glow {
        width: 100%;
        height: 500px;
    }

    .pricing-card-inner {
        padding: 40px 20px;
    }
    
    .pricing-features {
        padding: 20px;
    }
    
    .feature-text {
        font-size: 0.85rem;
    }
}

/* About Section */
.about-section {
    padding: 10vh 5vw;
    /* Match sides logic */
    background: var(--bg-color);
}

.about-title {
    font-family: var(--font-main);
    font-size: clamp(2rem, 5vw, 4rem);
    /* Match Works title size */
    margin-bottom: 4rem;
    color: var(--text-color);
}

.about-container {
    display: flex;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: flex-start;
}

.about-image-placeholder {
    width: 350px;
    max-width: 100%;
    /* Responsive constraint */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Align to top */
    color: var(--gray-medium);
    font-family: var(--font-main);
    border-radius: 8px;
    flex-shrink: 0;
}

.about-profile-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Use contain to avoid cropping if aspect differs */
    border-radius: inherit;
    display: block;
}

.about-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.detail-group h3 {
    font-family: var(--font-main);
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    margin-bottom: 15px;
    padding-left: 15px;
    border-left: 3px solid #2342b1;
    line-height: 1;
    text-transform: uppercase;
}

.detail-group p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 1.2rem;
}

.detail-group p:last-child {
    margin-bottom: 0;
}

.profile-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.profile-name .name-en {
    font-weight: 400;
    font-size: 1.1rem;
}

.profile-name .name-sep {
    margin: 0 30px;
    /* Increased spacing */
    color: var(--gray-medium);
    font-weight: 300;
}

.profile-name .name-jp {
    font-weight: 500;
    font-feature-settings: "palt";
}

.bio-list li {
    font-size: 1rem;
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
}

.bio-list .year {
    font-weight: 600;
    font-family: var(--font-main);
}

.skills-list {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.skills-list li {
    font-family: var(--font-main);
    font-size: 0.9rem;
    padding: 10px 24px;
    border: 1px solid #ddd;
    border-radius: 50px;
    color: var(--text-color);
    background: #fff;
    transition: border-color 0.3s;
}

.skills-list li:hover {
    border-color: #000;
}

@media (max-width: 768px) {
    .about-container {
        flex-direction: column;
        gap: 40px;
    }

    .about-image-placeholder {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
}

/* Contact Section */
.contact-section {
    padding: 20vh 20px 10vh;
    text-align: center;
    background: #f9f9fb;
}

.contact-text {
    margin-bottom: 40px;
}
.contact-form {
    max-width: 600px;
    margin: 0 auto 40px;
    text-align: left;
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: var(--font-jp);
    font-size: 1rem;
    color: #111;
    background: #f9f9fb;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2342b1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(35, 66, 177, 0.1);
}

.contact-submit-btn {
    display: block;
    width: 100%;
    padding: 15px 40px;
    background: transparent;
    border: 1px solid #2342b1;
    color: #2342b1;
    border-radius: 50px;
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    text-align: center;
}

.contact-submit-btn:hover {
    transform: translateY(-3px);
    background: #2342b1;
    color: #fff;
    box-shadow: 0 4px 12px rgba(35, 66, 177, 0.3);
}

.site-footer {
    margin-top: 100px;
    color: var(--gray-medium);
    font-size: 0.8rem;
    text-align: center;
    padding: 0 20px 40px;
}

@media (max-width: 768px) {
    .contact-form {
        padding: 30px 20px;
        margin-bottom: 20px;
    }
    .site-footer {
        margin-top: 40px;
    }
}

/* Animations Keyframes */
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Scroll Animation Classes */
.scroll-reveal {
    opacity: 0;
    transform: translateY(60px) scale(0.9);
    filter: blur(12px);
    transition: all 1s cubic-bezier(0.2, 0.6, 0.35, 1);
}

.scroll-reveal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

@keyframes scrollLine {
    0% {
        transform: translateY(-100%);
    }

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

/* Clickable Overlay for Work Items */
.work-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    /* Above everything inside the frame */
    cursor: pointer;
    background: transparent;
}

/* Work Detail Page Styles */
.detail-page-body {
    background: #fff;
    padding-top: 100px;
    /* Space for fixed header */
}

.detail-main {
    min-height: 80vh;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.detail-container {
    max-width: 1300px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 60px;
    animation: fadeIn 0.8s ease;
}

/* MacBook Mockup Styling */
.detail-hero {
    width: 100%;
    /* Allow height to be determined by content/aspect ratio */
    height: auto;
    min-height: 60vh;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

/* MacBook Pro High-Fidelity Mockup */
.macbook-mockup {
    width: 98%;
    max-width: 1000px;
    position: relative;
    perspective: 2000px;
    margin: 40px auto 60px;
    transform-style: preserve-3d;
}

.macbook-lid {
    background: #000;
    /* Deep Black Bezel */
    border-radius: 20px 20px 0 0;
    padding: 2.2% 2.2% 3% 2.2%;
    /* Thin modern bezels */
    position: relative;
    z-index: 20;
    /* Layered Box Shadows for Bezel Depth */
    box-shadow:
        /* Inner screen edge definition */
        inset 0 0 0 1px rgba(255, 255, 255, 0.1),
        /* Outer Rim Light */
        inset 0 0 0 2px rgba(60, 60, 60, 0.6),
        /* Ambient Occlusion */
        0 20px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.5s ease;
}

/* Metallic Rim Highlight on Lid */
.macbook-lid::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: 0;
    border-radius: 20px 20px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    pointer-events: none;
    z-index: 21;
}

/* MacBook Pro Notch */
.macbook-lid::before {
    content: '';
    position: absolute;
    top: 2.2%;
    left: 50%;
    transform: translateX(-50%);
    width: 12%;
    height: 3.8%;
    background: #000;
    border-radius: 0 0 8px 8px;
    z-index: 25;
}

.macbook-screen {
    width: 100%;
    aspect-ratio: 16/10;
    background: #1a1a1a;
    position: relative;
    overflow: hidden;
    border-radius: 4px 4px 0 0;
    /* Soft corner screen */
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8);
}

.macbook-iframe-wrapper {
    width: 1440px;
    /* Logical desktop width */
    height: 900px;
    /* 16:10 aspect ratio */
    transform-origin: top left;
    position: absolute;
    top: 0;
    left: 0;
}

.macbook-iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    border-radius: 0;
    padding-top: 0;
    mask-image: none;
    -webkit-mask-image: none;
    clip-path: none;
    opacity: 0.99;
    /* Fix for some rendering bugs */
}

.macbook-screen::before {
    content: 'SCROLL';
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-family: var(--font-main);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    white-space: nowrap;
    text-shadow: none;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    padding: 6px 14px;
    border-radius: 12px;
    opacity: 1;
    animation: scrollHintFloat 2s ease-in-out infinite;
    z-index: 30;
    pointer-events: none;
}

/* Screen Gloss / Reflection (Subtle & Real) */
.macbook-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(-135deg,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(255, 255, 255, 0.02) 20%,
            transparent 50%);
    pointer-events: none;
    z-index: 22;
    mix-blend-mode: overlay;
}

/* Hinge Mechanism */
.macbook-lid .hinge {
    position: absolute;
    bottom: -14px;
    left: 10%;
    width: 80%;
    height: 14px;
    background: linear-gradient(to bottom, #1a1a1a, #0d0d0d);
    z-index: 15;
    border-radius: 0 0 4px 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Base Unit */
.macbook-base {
    width: 100%;
    /* Match lid width exactly for modern look, base creates perspective via shadow/groove */
    margin: -4px auto 0;
    height: 18px;
    position: relative;
    z-index: 10;
    background: #e2e4e6;
    /* Silver Aluminum */
    border-radius: 0 0 14px 14px;

    /* Complex metallic gradient */
    background: linear-gradient(to bottom,
            #d4d7dc 0%,
            #b8bbc1 100%);

    box-shadow:
        /* Top Edge Highlight */
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        /* Bottom Edge Shade */
        inset 0 -1px 0 rgba(0, 0, 0, 0.15),
        /* Realistic Drop Shadow */
        0 40px 80px -20px rgba(0, 0, 0, 0.5);
}

/* Main Base Body (Perspective Trick) */
.macbook-base::before {
    content: '';
    position: absolute;
    top: 0;
    left: -5%;
    width: 110%;
    height: 100%;
    background: inherit;
    border-radius: 0 0 24px 24px;
    z-index: -1;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 20px 50px rgba(0, 0, 0, 0.3);
}

/* Groove / Opener */
.macbook-base::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 15%;
    height: 8px;
    background: #aab0b6;
    border-radius: 0 0 8px 8px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Revert special iPhone masking for the simple rectangular detail view */

.detail-header {
    text-align: left;
    border-bottom: 1px solid #eee;
    padding-bottom: 40px;
}

.detail-title {
    font-family: var(--font-main);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 20px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    color: var(--gray-medium);
    font-family: var(--font-main);
}

.meta-item h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    color: #000;
}

.meta-item p {
    font-size: 1rem;
}

.detail-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    max-width: 800px;
}

.detail-content h3 {
    font-size: 1.5rem;
    margin: 40px 0 20px;
    font-family: var(--font-main);
}

.detail-action {
    display: flex;
    justify-content: flex-start;
    padding-top: 20px;
}

.detail-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: transparent;
    color: #2342b1;
    border: 1px solid #2342b1;
    border-radius: 50px;
    font-weight: 500;
    font-family: var(--font-main);
    transition: all 0.3s var(--transition-smooth);
}

.detail-btn:hover {
    background: #2342b1;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(35, 66, 177, 0.3);
}

.loading-state {
    text-align: center;
    font-size: 1.2rem;
    color: var(--gray-medium);
    margin-top: 100px;
}

/* Mobile Responsiveness for Hero */
@media (max-width: 768px) {
    .hero-section {
        padding: 0 15px;
        /* Reduce padding to give more text space */
    }

    /* Normalize section padding for mobile */
    .philosophy-section,
    .works-section,
    .workflow-section,
    .pricing-section,
    .about-section,
    .contact-section {
        padding: 40px 15px !important;
    }

    /* Remove extra internal padding between Works and Workflow */
    .client-works-container,
    .project-samples-container {
        padding-bottom: 0 !important;
    }
    .workflow-grid {
        margin-top: 20px !important;
    }

    /* Detail Page Mobile Adjustments */
    .detail-container {
        gap: 30px;
    }
    .detail-header {
        padding-bottom: 20px;
    }
    .detail-content h3 {
        margin-top: 20px;
    }
}

/* Contact Button Re-declaration (To override scroll-reveal conflicts) */
.contact-btn {
    display: inline-block;
    padding: 15px 40px;
    background: transparent;
    border: 1px solid #2342b1;
    color: #2342b1;
    border-radius: 50px;
    font-family: var(--font-main);
    font-weight: 500;
    transition: all 0.3s var(--transition-smooth);
    /* Ensure this transition wins over scroll-reveal's 1s */
}

.contact-btn:hover {
    transform: translateY(-3px);
    background: #2342b1;
    color: #fff;
    border-color: #2342b1;
    box-shadow: 0 5px 15px rgba(35, 66, 177, 0.3);
}