/* カスタム設定 - ライトモード */
:root {
    --primary: #ffffff;
    --secondary-bg: #f8fafc;
    /* slate-50 */
    --accent: #0ea5e9;
    --text-main: #0f172a;
    /* slate-900 */
    --text-sub: #64748b;
    /* slate-500 */
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--primary);
    color: var(--text-main);
    overflow-x: hidden;
}

.font-eng {
    font-family: 'Outfit', sans-serif;
}

/* スクロールバーのカスタマイズ (ライト版) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

@media (hover: hover) {
    ::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }
}

/* ヒーローセクションのCanvas背景 */
#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.8;
}

/* ワープエフェクト用オーバーレイCanvas */
#warp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    /* 最前面 */
    pointer-events: none;
    /* クリックを透過 */
    opacity: 0;
    transition: opacity 0.8s ease;
    mix-blend-mode: normal;
}

/* ヘッダーのスタイル制御（初期状態とスクロール時） */
#header {
    background: rgba(255, 255, 255, 0);
    /* 初期は透明 */
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    border-bottom: 1px solid rgba(0, 0, 0, 0);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* スクロール時のLiquid Glassエフェクト (ホワイトフロスト) */
#header.scrolled {
    background: rgba(255, 255, 255, 0.85);
    /* 半透明の白 */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

/* グリッド背景装飾 (ライト版) - ベース */
.bg-grid {
    background-size: 40px 40px;
    /* 線の色を少し濃くして視認性を向上 (0.03 -> 0.08) */
    background-image: linear-gradient(to right, rgba(15, 23, 42, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15, 23, 42, 0.08) 1px, transparent 1px);
    z-index: 1;
}

/* インタラクティブなハイライトグリッド */
.interactive-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    /* テーマカラー（Sky Blue）のグリッド */
    background-size: 40px 40px;
    background-image: linear-gradient(to right, rgba(14, 165, 233, 0.4) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(14, 165, 233, 0.4) 1px, transparent 1px);
    /* マウス周辺だけを表示するためのマスク（初期値は中心） */
    -webkit-mask-image: radial-gradient(circle 250px at var(--grid-x, 50%) var(--grid-y, 50%), black 0%, transparent 100%);
    mask-image: radial-gradient(circle 250px at var(--grid-x, 50%) var(--grid-y, 50%), black 0%, transparent 100%);
    opacity: 0;
    /* JSロード前は非表示、JSで制御 */
    transition: opacity 0.5s ease;
}

/* スクロールアニメーション用クラス */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* カードのホバーエフェクト (ライト版) */
.service-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
    /* slate-200 */
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

@media (hover: hover) {
    .service-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 25px -5px rgba(14, 165, 233, 0.15), 0 8px 10px -6px rgba(14, 165, 233, 0.1);
        border-color: #38bdf8;
        /* sky-400 */
    }
}

/* ボタンアニメーション */
.btn-glow {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
}

@media (hover: hover) {
    .btn-glow:hover::after {
        left: 100%;
    }
}

/* スポットライトテキストエフェクト */
.spotlight-text {
    /* ベースの色（暗いグレー）から光の色（スカイブルー）へのグラデーション */
    /* 変数はJSで制御 */
    background-image: radial-gradient(circle 450px at var(--mouse-x, 50%) var(--mouse-y, 50%),
            #0ea5e9 0%,
            /* 光の中心: Sky Blue */
            #0284c7 25%,
            /* 少し濃い青 */
            #1e293b 65%
            /* 周囲: Slate 800 */
        );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* フォールバック用 */
    text-shadow: 0 0 30px rgba(14, 165, 233, 0);
    transition: text-shadow 0.3s;
    will-change: background-image;
}

/* テキストの視認性を確保するための調整 */
@media (hover: hover) {
    .spotlight-text:hover {
        text-shadow: 0 0 20px rgba(14, 165, 233, 0.2);
    }
}

/* 3Dカード効果 */
.perspective-container {
    perspective: 1000px;
}

.preserve-3d {
    transform-style: preserve-3d;
}

/* Floating Blob Animation */
@keyframes blob {
    0% {
        transform: translate(0px, 0px) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

/* Virtual Cursor Click Animation */
@keyframes cursor-click {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.8);
    }

    100% {
        transform: scale(1);
    }
}

.cursor-clicking {
    animation: cursor-click 0.2s ease-in-out;
}

.target-active {
    color: #0ea5e9 !important;
    /* sky-500 */
    /* text-shadow: 0 0 10px rgba(14, 165, 233, 0.3); */
}

/* Loading Screen - Digital Data Burst */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

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

.loading-text-container {
    position: relative;
    z-index: 2;
    text-align: center;
}

.loading-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 3rem;
    letter-spacing: 0.2em;
    color: #0f172a;
    /* slate-900 */
    position: relative;
}

/* Glitch Effect */
.loading-text::before,
.loading-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
}

.loading-text::before {
    left: 2px;
    text-shadow: -1px 0 #0ea5e9;
    /* sky-500 */
    clip-path: inset(44% 0 61% 0);
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

.loading-text::after {
    left: -2px;
    text-shadow: -1px 0 #6366f1;
    /* indigo-500 */
    clip-path: inset(20% 0 10% 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% {
        clip-path: inset(20% 0 80% 0);
    }

    20% {
        clip-path: inset(60% 0 10% 0);
    }

    40% {
        clip-path: inset(40% 0 50% 0);
    }

    60% {
        clip-path: inset(80% 0 5% 0);
    }

    80% {
        clip-path: inset(10% 0 70% 0);
    }

    100% {
        clip-path: inset(30% 0 20% 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip-path: inset(10% 0 60% 0);
    }

    20% {
        clip-path: inset(80% 0 5% 0);
    }

    40% {
        clip-path: inset(30% 0 10% 0);
    }

    60% {
        clip-path: inset(10% 0 80% 0);
    }

    80% {
        clip-path: inset(70% 0 20% 0);
    }

    100% {
        clip-path: inset(50% 0 30% 0);
    }
}

.loading-subtext {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #64748b;
    /* slate-500 */
    letter-spacing: 0.5em;
    text-transform: uppercase;
    animation: pulse-sub 1.5s ease-in-out infinite;
}

@keyframes pulse-sub {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* Hero Entrance Animations - Cyber/Tech Edition */
.hero-hidden {
    opacity: 0;
    visibility: hidden;
}

/* 1. Header: Smooth Slide Down (Keep simple elegant) */
@keyframes slideDownFade {
    0% {
        opacity: 0;
        transform: translateY(-40px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-animate-header {
    animation: slideDownFade 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    visibility: visible;
}

/* 2. Badge: Scanline Reveal */
.hero-badge-container {
    position: relative;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}

.hero-animate-scan {
    opacity: 1 !important;
    visibility: visible !important;
}

.hero-animate-scan::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #0ea5e9;
    /* sky-500 */
    box-shadow: 0 0 15px #0ea5e9;
    animation: scanline 0.8s cubic-bezier(0.45, 0, 0.55, 1) forwards;
}

.hero-animate-scan-content {
    animation: revealContent 0.8s steps(1, end) forwards;
    opacity: 0;
}

@keyframes scanline {
    0% {
        left: 0;
        width: 4px;
        opacity: 1;
    }

    50% {
        width: 40px;
    }

    /* 少し伸びる */
    100% {
        left: 100%;
        width: 0px;
        opacity: 0;
    }
}

@keyframes revealContent {
    0% {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
    }

    50% {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }

    /* スキャン通過に合わせて表示 */
    100% {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}

/* 3. Headline: 3D Rotate Reveal (配合 Text Scramble) */
.hero-headline-wrapper {
    perspective: 1000px;
}

@keyframes rotateUp3D {
    0% {
        opacity: 0;
        transform: rotateX(80deg) translateY(40px) scale(0.9);
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        transform: rotateX(0deg) translateY(0) scale(1);
        filter: blur(0);
    }
}

.hero-animate-3d-text {
    animation: rotateUp3D 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: center bottom;
    visibility: visible;
}

/* 4. Subtext: Cyber Fade Up */
@keyframes cyberFadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
        letter-spacing: 0.1em;
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        letter-spacing: normal;
    }
}

.hero-animate-subtext {
    animation: cyberFadeUp 1s ease-out forwards;
    visibility: visible;
}

/* 5. Buttons: Tech Assemble */
@keyframes assembleBorder {
    0% {
        clip-path: inset(50% 50% 50% 50%);
        opacity: 0;
        background: transparent;
        box-shadow: none;
    }

    40% {
        opacity: 1;
        clip-path: inset(50% 0 50% 0);
        /* 横に広がる */
        background: rgba(14, 165, 233, 0.1);
    }

    100% {
        clip-path: inset(0 0 0 0);
        /* 縦に広がる */
        opacity: 1;
    }
}

.hero-animate-assemble {
    visibility: visible !important;
    animation: assembleBorder 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ボタン出現時のフラッシュ効果 */
.hero-animate-assemble::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    opacity: 0;
    animation: flashBtn 0.8s ease-out forwards;
}

@keyframes flashBtn {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
    }
}

/* Flashcard Styles */
.flashcard-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.flashcard-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 1rem;
    transition: all 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    will-change: transform, opacity;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.flashcard-slide-out {
    transform: translateX(100%) rotate(10deg) !important;
    opacity: 0 !important;
}

.flashcard-no-transition {
    transition: none !important;
}

/* WHO WE ARE Section Ripple Reveal Overlay */
#about-dark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    mix-blend-mode: difference;
    pointer-events: none;
    z-index: 10;
    /* Above text (auto), Below card (20) */

    /* Default: No mask (Fully opaque = Full Inversion) */
    -webkit-mask-image: none;
    mask-image: none;

    will-change: mask-image, -webkit-mask-image;
}

/* Ensure content that shouldn't be inverted stays above */
/* Images/Cards */
#about-card {
    position: relative;
    z-index: 20;
    /* Above the overlay */
}

/* Target Active State (Blue) */
.target-active {
    color: #0ea5e9 !important;
    /* sky-500 */
    position: relative;
    z-index: 20;
    /* Also bring the target text above overlay when active so it pops */
    transition: none !important;
    /* Snap color change instantly */
}

/*
   Dark Mode Artifact Suppression & Color Correction
*/
#about.is-dark-mode .interactive-grid {
    opacity: 0 !important;
    visibility: hidden;
}

/* Strictly remove ALL shadows/borders that might cause white blur */
#about.is-dark-mode #about-card,
#about.is-dark-mode .about-card-inner,
#about.is-dark-mode .service-card,
#about.is-dark-mode .about-card-inner img {
    box-shadow: none !important;
    filter: none !important;
    border-color: transparent !important;
}

/*
   Force Text/Decorations to Black in Dark Mode
   (Because 'Difference' Invert of Black is White)
   This solves the "Warm Color" issue and makes text Pure White.
*/
#about.is-dark-mode h2,
#about.is-dark-mode h3,
#about.is-dark-mode p,
#about.is-dark-mode li,
#about.is-dark-mode a {
    color: #000000 !important;
}

/* Force Sky Blue accents (bullets, underlines) to Black (Invert to White) */
/* Only apply background-color to spans (bullets/lines), NOT text elements like h2 */
#about.is-dark-mode span.bg-sky-500 {
    background-color: #000000 !important;
}

#about.is-dark-mode span.text-sky-600,
#about.is-dark-mode h2.text-sky-600 {
    color: #000000 !important;
    /* Do NOT set background-color here, it creates a block */
}

/* Ensure target text is also black initially (white), then turns blue on active */
#about.is-dark-mode #auto-click-target:not(.target-active) {
    color: #000000 !important;
}

/* ========================================
   MOBILE OPTIMIZATIONS
   ======================================== */

/* Mobile Device Styles - Apply to touchscreen devices and small screens */
@media (max-width: 768px) {

    /* --- Text Handling --- */
    body {
        word-break: keep-all;
        overflow-wrap: break-word;
        line-break: strict;
        font-size: 16px;
        /* Remove tap highlight completely */
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }

    /* Remove all unwanted tap/touch effects */
    * {
        -webkit-tap-highlight-color: transparent !important;
        -webkit-touch-callout: none !important;
        /* Prevent text selection color change */
        user-select: none;
        -webkit-user-select: none;
    }

    /* Allow text selection only in specific elements */
    p,
    li,
    span:not(.mobile-link) {
        user-select: text;
        -webkit-user-select: text;
    }

    /* Fix for WHO WE ARE section tap issues - Disable selection to prevent color change */
    #about *,
    #about h2,
    #about h3,
    #about p,
    #about ul,
    #about li,
    #about img {
        -webkit-tap-highlight-color: transparent !important;
        user-select: none !important;
        -webkit-user-select: none !important;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p,
    li {
        /* Better Japanese text rendering */
        word-break: keep-all;
        overflow-wrap: anywhere;
    }

    /* --- Hero Section Mobile Optimization --- */
    #hero-section {
        min-height: 100vh;
        padding: 80px 16px 60px;
    }

    #hero-section .max-w-5xl {
        padding-left: 0;
        padding-right: 0;
    }

    /* Hero Badge - Smaller on mobile, no interaction, no overflow animation */
    #hero-section .hero-badge-container {
        overflow: hidden;
    }

    #hero-section .hero-badge-container span {
        font-size: 0.625rem;
        padding: 0.5rem 0.75rem;
        letter-spacing: 0.15em;
        border: none !important;
        pointer-events: none !important;
        cursor: default !important;
        display: inline-block;
    }

    #hero-badge {
        pointer-events: none !important;
    }

    #hero-badge::before,
    #hero-badge::after {
        display: none !important;
    }

    /* Hero Headline - Much smaller on mobile */
    #hero-headline {
        font-size: 2rem !important;
        /* 32px instead of 40px */
        line-height: 1.2 !important;
        margin-bottom: 1.5rem !important;
    }

    /* Hero Subtext - Smaller and tighter */
    #hero-subtext {
        font-size: 0.875rem !important;
        /* 14px */
        line-height: 1.6 !important;
        margin-bottom: 2rem !important;
        padding: 0 8px;
    }

    /* Hero Buttons - Fit content width, centered */
    #hero-buttons {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    #hero-buttons a {
        width: auto;
        min-width: 200px;
        text-align: center;
        padding: 1rem 2rem;
        font-size: 0.875rem;
        display: inline-flex;
        justify-content: center;
        align-items: center;
    }

    /* Remove sticky active state */
    #hero-buttons a:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    #hero-buttons a:not(:active) {
        transform: scale(1);
        transition: transform 0.2s ease 0.1s;
    }

    /* Disable spotlight effect on mobile (use static color) */
    .spotlight-text {
        background-image: none !important;
        color: #1e293b !important;
        /* Slate 800 */
        background-clip: unset !important;
        -webkit-background-clip: unset !important;
        -webkit-text-fill-color: #1e293b !important;
    }

    /* --- Navigation Fixes --- */
    #header {
        z-index: 10000;
        height: 70px;
        padding: 0 16px !important;
        border-bottom: 1px solid transparent !important;
    }

    /* Remove tap border effect */
    #header:active,
    #header:focus {
        border-bottom-color: transparent !important;
    }

    #header .max-w-7xl {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    #header a.text-2xl {
        font-size: 1.5rem;
    }

    /* Full-screen mobile menu overlay - White background with cyan accents */
    #mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: #ffffff;
        z-index: 9999;

        /* Cyan grid pattern */
        background-image:
            linear-gradient(to right, rgba(6, 182, 212, 0.1) 1px, transparent 1px),
            linear-gradient(to bottom, rgba(6, 182, 212, 0.1) 1px, transparent 1px);
        background-size: 50px 50px;

        /* Center content */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2.5rem;

        /* Transform for slide in */
        transform: translateX(100%);
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);

        overflow: hidden;
    }

    /* Active state */
    #mobile-menu:not(.translate-x-full) {
        transform: translateX(0);
    }

    /* Fluid cyan blur orbs */
    #mobile-menu::before {
        content: '';
        position: absolute;
        width: 400px;
        height: 400px;
        border-radius: 50%;
        background: radial-gradient(circle,
                rgba(6, 182, 212, 0.3),
                rgba(6, 182, 212, 0.1) 40%,
                transparent 70%);
        filter: blur(40px);
        top: 10%;
        left: -10%;
        animation: cyanBlurMove1 8s ease-in-out infinite;
        pointer-events: none;
    }

    @keyframes cyanBlurMove1 {

        0%,
        100% {
            transform: translate(0, 0) scale(1);
        }

        33% {
            transform: translate(30vw, 20vh) scale(1.2);
        }

        66% {
            transform: translate(-10vw, 40vh) scale(0.9);
        }
    }

    /* Second fluid blur orb */
    #mobile-menu::after {
        content: '';
        position: absolute;
        width: 350px;
        height: 350px;
        border-radius: 50%;
        background: radial-gradient(circle,
                rgba(14, 165, 233, 0.25),
                rgba(14, 165, 233, 0.1) 40%,
                transparent 70%);
        filter: blur(50px);
        bottom: 15%;
        right: -5%;
        animation: cyanBlurMove2 10s ease-in-out infinite;
        pointer-events: none;
    }

    @keyframes cyanBlurMove2 {

        0%,
        100% {
            transform: translate(0, 0) scale(1);
        }

        40% {
            transform: translate(-40vw, -15vh) scale(1.15);
        }

        80% {
            transform: translate(20vw, 30vh) scale(0.85);
        }
    }

    #mobile-menu-btn {
        z-index: 10001;
        /* Above menu */
        position: relative;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.3s ease;
    }

    /* Mobile menu links with slide-in animation - Dark text on white */
    .mobile-link {
        position: relative;
        padding: 1rem 2rem !important;
        font-size: 2rem !important;
        font-weight: 700 !important;
        color: #0f172a !important;
        text-decoration: none;
        letter-spacing: 0.05em;
        opacity: 0;
        transform: translateY(30px) scale(0.9);
        transition: all 0.3s ease;
    }

    /* Animate links when menu is open */
    #mobile-menu:not(.translate-x-full) .mobile-link {
        animation: menuLinkFade 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    #mobile-menu:not(.translate-x-full) .mobile-link:nth-child(1) {
        animation-delay: 0.1s;
    }

    #mobile-menu:not(.translate-x-full) .mobile-link:nth-child(2) {
        animation-delay: 0.2s;
    }

    #mobile-menu:not(.translate-x-full) .mobile-link:nth-child(3) {
        animation-delay: 0.3s;
    }

    #mobile-menu:not(.translate-x-full) .mobile-link:nth-child(4) {
        animation-delay: 0.4s;
    }

    @keyframes menuLinkFade {
        0% {
            opacity: 0;
            transform: translateY(30px) scale(0.9);
        }

        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    /* Cyan underline on tap - no shimmer */
    .mobile-link::before {
        content: '';
        position: absolute;
        left: 0;
        bottom: -4px;
        width: 0;
        height: 3px;
        background: linear-gradient(90deg, #06b6d4, #0ea5e9);
        transition: width 0.3s ease;
    }

    .mobile-link:active::before {
        width: 100%;
    }

    /* --- Unified Padding for All Sections (16px) --- */
    #hero-section {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    #about,
    #services,
    #news {
        padding: 3rem 16px !important;
    }

    footer {
        min-height: 450px !important;
        padding: 3rem 16px 2rem !important;
    }

    /* Ensure containers don't override */
    .max-w-7xl,
    .max-w-5xl {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Fix for double padding in sections - Override .px-6 utility */
    #about .max-w-7xl,
    #services .max-w-7xl,
    #news .max-w-7xl,
    footer .max-w-5xl {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* --- About Section Mobile Optimization --- */
    #about {
        padding: 3rem 16px !important;
    }

    #about h2 {
        font-size: 0.875rem !important;
        /* Smaller section label */
        margin-bottom: 0.5rem !important;
    }

    #about h3 {
        font-size: 1.5rem !important;
        /* 24px instead of 36px */
        line-height: 1.3 !important;
        margin-bottom: 1rem !important;
    }

    #about p {
        font-size: 0.875rem !important;
        /* 14px */
        line-height: 1.7 !important;
        margin-bottom: 1rem !important;
    }

    #about ul {
        margin-top: 1rem;
    }

    #about li {
        font-size: 0.875rem !important;
        margin-bottom: 0.75rem;
    }

    #about-card {
        height: 250px !important;
        /* Shorter card on mobile */
        margin-top: 2rem;
    }

    /* --- Services Section Mobile Optimization --- */
    /* Padding already unified above */

    #services h3 {
        font-size: 1.75rem !important;
        /* 28px */
        margin-bottom: 1.5rem !important;
    }

    .service-card {
        padding: 1.5rem !important;
        margin-bottom: 1rem;
    }

    .service-card h4 {
        font-size: 1.125rem !important;
        /* 18px */
        margin-bottom: 0.75rem !important;
        line-height: 1.4 !important;
    }

    .service-card p {
        font-size: 0.8125rem !important;
        /* 13px */
        line-height: 1.6 !important;
        margin-bottom: 1rem !important;
    }

    .service-card .w-14.h-14 {
        width: 3rem !important;
        height: 3rem !important;
        margin-bottom: 1rem !important;
    }

    .service-card svg {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }

    .service-card .text-sm {
        font-size: 0.8125rem !important;
    }

    .service-card ul {
        margin-top: 0.5rem;
    }

    .service-card li {
        margin-bottom: 0.5rem;
        font-size: 0.8125rem !important;
    }

    /* --- News Section Mobile Optimization --- */
    /* Padding already unified above */

    #news .md\:w-32 {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    #news .text-sm {
        font-size: 0.75rem !important;
    }

    #news .text-xs {
        font-size: 0.6875rem !important;
    }

    /* --- Footer Mobile Optimization --- */
    /* Padding already unified above */

    /* Add spacing between catchphrase and copyright */
    footer h1.text-5xl {
        margin-bottom: 3rem !important;
    }

    footer p.text-slate-400 {
        font-size: 0.75rem !important;
        margin-bottom: 2rem !important;
    }

    footer .absolute.bottom-6 p {
        font-size: 0.5625rem !important;
        position: static !important;
        margin-top: 2rem;
    }


    /* Remove tap color changes on footer - REMOVED (Breaks gradient text) */
    /* footer *:active,
    footer *:focus {
        color: inherit !important;
        background-color: inherit !important;
    } */

    /* --- Tap Target Optimization --- */
    a,
    button,
    .mobile-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .mobile-link {
        padding: 12px 24px;
        font-size: 1.25rem !important;
    }

    /* --- Remove ALL hover effects on mobile --- */
    .service-card:hover,
    .service-card:active,
    .service-card:focus {
        transform: none !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
        border-color: #e2e8f0 !important;
    }

    .btn-glow:hover,
    .btn-glow:active {
        transform: none !important;
    }

    a:hover,
    a:active {
        transform: none !important;
    }

    /* Ensure no transform on any element */
    * {
        -webkit-tap-highlight-color: rgba(14, 165, 233, 0.1);
    }

    /* --- Performance Optimizations --- */
    /* Reduce backdrop blur for better performance */
    #header.scrolled {
        backdrop-filter: blur(8px) saturate(140%);
        -webkit-backdrop-filter: blur(8px) saturate(140%);
    }

    /* Simplify animations for better performance */
    .reveal {
        transition: opacity 0.4s ease, transform 0.4s ease;
        transform: translateY(15px);
    }

    .reveal.active {
        opacity: 1;
        transform: translateY(0);
    }

    /* --- Scroll indicator --- */
    .animate-bounce {
        animation-duration: 2s;
    }

    /* --- Loading Screen Mobile --- */
    .loading-text {
        font-size: 1.75rem !important;
        /* 28px */
        letter-spacing: 0.15em;
    }

    .loading-subtext {
        font-size: 0.625rem !important;
        /* 10px */
        letter-spacing: 0.3em;
    }

    /* --- Spacing Utilities Override for Mobile --- */
    .px-6 {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .py-24 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .mb-6 {
        margin-bottom: 1rem !important;
    }

    .mb-10 {
        margin-bottom: 2rem !important;
    }

    .mb-20 {
        margin-bottom: 2rem !important;
    }

    /* --- Grid adjustments --- */
    .grid-cols-1 {
        gap: 1.5rem;
    }

    /* --- Remove parallax transforms on mobile --- */
    #hero-section {
        transform: none !important;
    }

    /* --- Mobile Menu Fixes --- */
    #mobile-menu {
        /* Enforce background color and backdrop filter */
        background-color: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(24px) !important;
        -webkit-backdrop-filter: blur(24px) !important;
        /* Promote to compositing layer to fix rendering glitches */
        transform: translate3d(100%, 0, 0);
        /* Default hidden state */
        will-change: transform;
        /* Prevent tap highlight on the container itself */
        -webkit-tap-highlight-color: transparent;
    }

    /* 当クラスが外れて表示される時のスタイルを補強 */
    #mobile-menu:not(.translate-x-full) {
        transform: translate3d(0, 0, 0) !important;
    }
}

/* Extra small devices (iPhone SE, etc) */
@media (max-width: 375px) {
    #hero-headline {
        font-size: 1.75rem !important;
        /* 28px */
    }

    #hero-subtext {
        font-size: 0.8125rem !important;
        /* 13px */
    }

    .service-card {
        padding: 1.25rem !important;
    }

    footer h1.text-5xl {
        font-size: 2rem !important;
        /* 32px */
    }
}

/* Tablet-specific adjustments (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .service-card {
        padding: 1.5rem;
    }

    #hero-headline {
        font-size: 3rem !important;
    }

    #about h3 {
        font-size: 2rem !important;
    }
}

/* Mobile-safe Hover Effects (Footer) */
@media (hover: hover) {
    .footer-orb-glow:hover {
        background-color: rgba(14, 165, 233, 0.4);
        /* sky-500/40 */
    }
}